@anvia/studio 0.7.10 → 0.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/ui/assets/{evals-page-BJKMS1fR.js → evals-page-eIWZ_vsI.js} +2 -2
- package/dist/ui/assets/{evals-page-BJKMS1fR.js.map → evals-page-eIWZ_vsI.js.map} +1 -1
- package/dist/ui/assets/index-CC5mjRie.js +154 -0
- package/dist/ui/assets/index-CC5mjRie.js.map +1 -0
- package/dist/ui/assets/{knowledge-page-COXaxj3j.js → knowledge-page-C6WkzIFh.js} +2 -2
- package/dist/ui/assets/{knowledge-page-COXaxj3j.js.map → knowledge-page-C6WkzIFh.js.map} +1 -1
- package/dist/ui/assets/{mcps-page-D1e6dvNE.js → mcps-page-BJ4m_GoP.js} +2 -2
- package/dist/ui/assets/{mcps-page-D1e6dvNE.js.map → mcps-page-BJ4m_GoP.js.map} +1 -1
- package/dist/ui/assets/{memory-page-Dy11ocsi.js → memory-page-BuerJ-04.js} +2 -2
- package/dist/ui/assets/{memory-page-Dy11ocsi.js.map → memory-page-BuerJ-04.js.map} +1 -1
- package/dist/ui/assets/{pipelines-page-1epSSZ5H.js → pipelines-page-Dx0uB0Dm.js} +2 -2
- package/dist/ui/assets/{pipelines-page-1epSSZ5H.js.map → pipelines-page-Dx0uB0Dm.js.map} +1 -1
- package/dist/ui/assets/{sessions-page-BH7t2H-M.js → sessions-page-UdXui_Zk.js} +2 -2
- package/dist/ui/assets/{sessions-page-BH7t2H-M.js.map → sessions-page-UdXui_Zk.js.map} +1 -1
- package/dist/ui/assets/{status-page-Dlb6Q1aP.js → status-page-DC5pVW4o.js} +2 -2
- package/dist/ui/assets/{status-page-Dlb6Q1aP.js.map → status-page-DC5pVW4o.js.map} +1 -1
- package/dist/ui/assets/{tools-page-BCTZ2glH.js → tools-page-ByKfOqk3.js} +2 -2
- package/dist/ui/assets/{tools-page-BCTZ2glH.js.map → tools-page-ByKfOqk3.js.map} +1 -1
- package/dist/ui/assets/{trace-browser-CkzLOQ8P.js → trace-browser-Dk7nD7KO.js} +2 -2
- package/dist/ui/assets/{trace-browser-CkzLOQ8P.js.map → trace-browser-Dk7nD7KO.js.map} +1 -1
- package/dist/ui/assets/{transcript-item-2OjC7_oe.js → transcript-item-DbtXMj-E.js} +2 -2
- package/dist/ui/assets/{transcript-item-2OjC7_oe.js.map → transcript-item-DbtXMj-E.js.map} +1 -1
- package/dist/ui/index.html +1 -1
- package/package.json +4 -4
- package/dist/ui/assets/index-DMEhoZEd.js +0 -154
- package/dist/ui/assets/index-DMEhoZEd.js.map +0 -1
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agents-page-B8Tw2e11.js","assets/utils-BN2yP0LH.js","assets/badge-BH7gz3tB.js","assets/evals-page-eIWZ_vsI.js","assets/PlayIcon-Culan3xL.js","assets/knowledge-page-C6WkzIFh.js","assets/RefreshIcon-B3w42HZJ.js","assets/renderers-CIC1VVRv.js","assets/format-C9HPGfkW.js","assets/mcps-page-BJ4m_GoP.js","assets/memory-page-BuerJ-04.js","assets/pipelines-page-Dx0uB0Dm.js","assets/pipelines-page-DtxX27Jz.css","assets/sessions-page-UdXui_Zk.js","assets/status-page-DC5pVW4o.js","assets/tools-page-ByKfOqk3.js","assets/trace-browser-Dk7nD7KO.js","assets/PathIcon-DX1w_Nk9.js","assets/transcript-item-DbtXMj-E.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,n,r,s as i,t as a}from"./utils-BN2yP0LH.js";import{f as o,i as s,m as c,o as l,s as u}from"./format-C9HPGfkW.js";(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 d=e((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,O());else{var t=n(l);t!==null&&ee(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){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&&ee(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function ee(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,ee(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),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}}}})),f=e(((e,t)=>{t.exports=d()})),p=e((e=>{var n=t();function r(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 i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(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=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.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,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,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=l(t.as,t.crossOrigin);a.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??a.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=l(n,t.crossOrigin);a.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=l(t.as,t.crossOrigin);a.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 a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),m=e(((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=p()})),h=e((e=>{var n=f(),r=t(),i=m();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(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 c(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 l(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 u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=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`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||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 k: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 D:return t=e.displayName||null,t===null?ne(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ne(e(t))}catch{}}return null}var M=Array.isArray,N=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=i.__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 I(e,t){ae++,ie[ae]=e.current,e.current=t}var se=oe(null),ce=oe(null),le=oe(null),L=oe(null);function ue(e,t){switch(I(le,t),I(ce,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(se),I(se,e)}function de(){F(se),F(ce),F(le)}function fe(e){e.memoizedState!==null&&I(L,e);var t=se.current,n=Hd(t,e.type);t!==n&&(I(ce,e),I(se,n))}function pe(e){ce.current===e&&(F(se),F(ce)),L.current===e&&(F(L),Qf._currentValue=re)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!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(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);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=`
|
|
7
|
+
`+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{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ge(n):``}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(`Lazy`);case 13:return e.child!==t&&t!==null?ge(`Suspense Fallback`):ge(`Suspense`);case 19:return ge(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(`Activity`);default:return``}}function be(e){try{var t=``,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=n.unstable_scheduleCallback,Ce=n.unstable_cancelCallback,we=n.unstable_shouldYield,Te=n.unstable_requestPaint,Ee=n.unstable_now,De=n.unstable_getCurrentPriorityLevel,Oe=n.unstable_ImmediatePriority,ke=n.unstable_UserBlockingPriority,Ae=n.unstable_NormalPriority,je=n.unstable_LowPriority,Me=n.unstable_IdlePriority,Ne=n.log,Pe=n.unstable_setDisableYieldValue,Fe=null,Ie=null;function Le(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,We=4194304;function Ge(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 Ke(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=Ge(n))):i=Ge(o):i=Ge(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ge(n))):i=Ge(o)):i=Ge(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 qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(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 Ye(){var e=We;return We<<=1,!(We&62914560)&&(We=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(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-Re(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&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(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 rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=P.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function at(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var ot=Math.random().toString(36).slice(2),st=`__reactFiber$`+ot,ct=`__reactProps$`+ot,lt=`__reactContainer$`+ot,ut=`__reactEvents$`+ot,dt=`__reactListeners$`+ot,ft=`__reactHandles$`+ot,pt=`__reactResources$`+ot,mt=`__reactMarker$`+ot;function ht(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[st])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function yt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=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]*$`),Et={},Dt={};function Ot(e){return xe.call(Dt,e)?!0:xe.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(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 At(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 jt(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 Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(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 Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Lt(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 Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(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=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Mt(n)):Ht(e,o,Mt(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=``+Mt(s):e.removeAttribute(`name`)}function Vt(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)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(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),Ft(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(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=``+Mt(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 Wt(e,t,n){if(t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(M(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=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 Jt(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||qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(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 i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Jt(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Xt(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 Zt=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`]]),Qt=/^[\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 $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(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="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ct]||null;if(!i)throw Error(a(90));Bt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&It(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(bu(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ct]||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(a(231,t,typeof n));return n}var un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,`passive`,{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function R(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.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 hn=i.slice(e,1<r?1-r:void 0)}function gn(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 _n(){return!0}function vn(){return!1}function yn(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)?_n:vn,this.isPropagationStopped=vn,this}return h(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=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),Sn=h({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,z,En=h({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ln,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!==z&&(z&&e.type===`mousemove`?(wn=e.screenX-z.screenX,Tn=e.screenY-z.screenY):Tn=wn=0,z=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),Dn=yn(En),On=yn(h({},En,{dataTransfer:0})),kn=yn(h({},Sn,{relatedTarget:0})),An=yn(h({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),jn=yn(h({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Mn=yn(h({},bn,{data:0})),Nn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Pn={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`},Fn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function In(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fn[e])?!!t[e]:!1}function Ln(){return In}var Rn=yn(h({},Sn,{key:function(e){if(e.key){var t=Nn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Pn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ln,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),zn=yn(h({},En,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Bn=yn(h({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ln})),Vn=yn(h({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Hn=yn(h({},En,{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})),Un=yn(h({},bn,{newState:0,oldState:0})),Wn=[9,13,27,32],Gn=un&&`CompositionEvent`in window,Kn=null;un&&`documentMode`in document&&(Kn=document.documentMode);var qn=un&&`TextEvent`in window&&!Kn,Jn=un&&(!Gn||Kn&&8<Kn&&11>=Kn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Gn&&Zn(e,t)?(e=R(),hn=mn=pn=null,$n=!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 Jn&&t.locale!==`ko`?null:t.data;default:return null}}var nr={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 rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!nr[e.type]:t===`textarea`}function ir(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=Ed(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ar=null,or=null;function sr(e){yd(e,0)}function cr(e){if(It(vt(e)))return e}function lr(e,t){if(e===`change`)return t}var ur=!1;if(un){var dr;if(un){var fr=`oninput`in document;if(!fr){var pr=document.createElement(`div`);pr.setAttribute(`oninput`,`return;`),fr=typeof pr.oninput==`function`}dr=fr}else dr=!1;ur=dr&&(!document.documentMode||9<document.documentMode)}function mr(){ar&&(ar.detachEvent(`onpropertychange`,hr),or=ar=null)}function hr(e){if(e.propertyName===`value`&&cr(or)){var t=[];ir(t,or,e,nn(e)),cn(sr,t)}}function gr(e,t,n){e===`focusin`?(mr(),ar=t,or=n,ar.attachEvent(`onpropertychange`,hr)):e===`focusout`&&mr()}function _r(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return cr(or)}function vr(e,t){if(e===`click`)return cr(t)}function yr(e,t){if(e===`input`||e===`change`)return cr(t)}function br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var xr=typeof Object.is==`function`?Object.is:br;function Sr(e,t){if(xr(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(!xe.call(t,i)||!xr(e[i],t[i]))return!1}return!0}function Cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wr(e,t){var n=Cr(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=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(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=Lt(e.document)}return t}function Dr(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 Or=un&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==Lt(r)||(r=kr,`selectionStart`in r&&Dr(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}),jr&&Sr(jr,r)||(jr=r,r=Ed(Ar,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Fr={animationend:Pr(`Animation`,`AnimationEnd`),animationiteration:Pr(`Animation`,`AnimationIteration`),animationstart:Pr(`Animation`,`AnimationStart`),transitionrun:Pr(`Transition`,`TransitionRun`),transitionstart:Pr(`Transition`,`TransitionStart`),transitioncancel:Pr(`Transition`,`TransitionCancel`),transitionend:Pr(`Transition`,`TransitionEnd`)},Ir={},Lr={};un&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),`TransitionEvent`in window||delete Fr.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!Fr[e])return e;var t=Fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`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(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),Ct(t,[e])}var Yr=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)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[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&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(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-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<fu)throw fu=0,pu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(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 si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(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 ui(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 di(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=si(31,n,t,i),e.elementType=k,e.lanes=o,e;case y:return fi(n.children,i,o,t);case b:s=8,i|=24;break;case x:return e=si(12,n,t,i|2),e.elementType=x,e.lanes=o,e;case T:return e=si(13,n,t,i),e.elementType=T,e.lanes=o,e;case E:return e=si(19,n,t,i),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 D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function B(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hi=new WeakMap;function gi(e,t){if(typeof e==`object`&&e){var n=hi.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},hi.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var _i=[],vi=0,yi=null,bi=0,xi=[],Si=0,Ci=null,wi=1,V=``;function Ti(e,t){_i[vi++]=bi,_i[vi++]=yi,yi=e,bi=t}function Ei(e,t,n){xi[Si++]=wi,xi[Si++]=V,xi[Si++]=Ci,Ci=e;var r=wi;e=V;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,wi=1<<32-Re(t)+i|n<<i|r,V=a+e}else wi=1<<a|n<<i|r,V=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===yi;)yi=_i[--vi],_i[vi]=null,bi=_i[--vi],_i[vi]=null;for(;e===Ci;)Ci=xi[--Si],xi[Si]=null,V=xi[--Si],xi[Si]=null,wi=xi[--Si],xi[Si]=null}function ki(e,t){xi[Si++]=wi,xi[Si++]=V,xi[Si++]=Ci,wi=t.id,V=t.overflow,Ci=e}var Ai=null,ji=null,H=!1,Mi=null,Ni=!1,Pi=Error(a(519));function Fi(e){throw Bi(gi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Pi}function U(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[st]=e,t[ct]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Gt(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||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||Fi(e,!0)}function Ii(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Ni=!1;return;case 27:case 3:Ni=!0;return;default:Ai=Ai.return}}function Li(e){if(e!==Ai)return!1;if(!H)return Ii(e),H=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&ji&&Fi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));ji=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));ji=uf(e)}else t===27?(t=ji,Zd(e.type)?(e=lf,lf=null,ji=e):ji=t):ji=Ai?cf(e.stateNode.nextSibling):null;return!0}function Ri(){ji=Ai=null,H=!1}function zi(){var e=Mi;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),Mi=null),e}function Bi(e){Mi===null?Mi=[e]:Mi.push(e)}var Vi=oe(null),Hi=null,Ui=null;function Wi(e,t,n){I(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,F(Vi)}function Ki(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 qi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Ji(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;xr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===L.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(a(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=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()})}},ta=n.unstable_scheduleCallback,na=n.unstable_NormalPriority,ra={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=dd(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(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 pa=N.S;N.S=function(e,t){tu=Ee(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=oe(null);function ha(){var e=ma.current;return e===null?zl.pooledCache:e}function ga(e,t){t===null?I(ma,ma.current):I(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(a(460)),ya=Error(a(474)),ba=Error(a(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=zl,e!==null&&100<e.shellSuspendCounter)throw Error(a(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,Da(e),e}throw Ta=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ta=e,va):e}}var Ta=null;function Ea(){if(Ta===null)throw Error(a(459));var e=Ta;return Ta=null,e}function Da(e){if(e===va||e===ba)throw Error(a(483))}var Oa=null,ka=0;function Aa(e){var t=ka;return ka+=1,Oa===null&&(Oa=[]),Ca(Oa,e,t)}function ja(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ma(e,t){throw t.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Na(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 i(e,t){return e=li(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=pi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===O&&wa(a)===t.type)?(t=i(t,n.props),ja(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),ja(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=B(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=fi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=di(t.type,t.key,t.props,null,e.mode,n),ja(n,t),n.return=e,n;case v:return t=B(t,e.mode,n),t.return=e,t;case O:return t=wa(t),f(e,t,n)}if(M(t)||j(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Aa(t),n);if(t.$$typeof===C)return f(e,Qi(e,t),n);Ma(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 O:return n=wa(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,Aa(n),r);if(n.$$typeof===C)return p(e,t,Qi(e,n),r);Ma(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 O:return r=wa(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,Aa(r),i);if(r.$$typeof===C)return m(e,t,n,Qi(t,r),i);Ma(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),H&&Ti(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 H&&Ti(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)}),H&&Ti(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(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(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),H&&Ti(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return H&&Ti(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,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(i,e)}),H&&Ti(i,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=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&wa(l)===r.type){n(e,r.sibling),c=i(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),ja(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=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=B(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=wa(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(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===C)return b(e,r,Qi(e,o),c);Ma(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=i(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(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 za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(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=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Va(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,et(e,n)}}function Ha(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 Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!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===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ia=!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),Kl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ka(n[e],t)}var Ja=oe(null),Ya=oe(0);function Xa(e,t){e=Wl,I(Ya,e),I(Ja,t),Wl=e|t.baseLanes}function Za(){I(Ya,Wl),I(Ja,Ja.current)}function Qa(){Wl=Ya.current,F(Ja),F(Ya)}var $a=oe(null),eo=null;function to(e){var t=e.alternate;I(W,W.current&1),I($a,e),eo===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){I(W,W.current),I($a,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(I(W,W.current),I($a,e),eo===null&&(eo=e)):io(e)}function io(){I(W,W.current),I($a,$a.current)}function ao(e){F($a),eo===e&&(eo=null),F(W)}var W=oe(0);function oo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(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 so=0,G=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(a(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return so=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Ls:Rs,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){N.H=Is;var t=co!==null&&co.next!==null;if(so=0,lo=co=G=null,uo=!1,ho=0,go=null,t)throw Error(a(300));e===null||tc||(e=e.dependencies,e!==null&&Yi(e)&&(tc=!0))}function So(e,t,n,r){G=e;var i=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=i)throw Error(a(301));if(i+=1,lo=co=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=zs,o=t(n,r)}while(fo);return o}function Co(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(G.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}so=0,lo=co=G=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?G.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(co===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?G.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw G.alternate===null?Error(a(467)):Error(a(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?G.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Ca(go,e,t),t=G,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Ls:Rs),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===C)return Zi(e)}throw Error(a(438,String(e)))}function Mo(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.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=ko(),G.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]=A;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),co,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(so&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===ca&&(d=!0);else if((so&p)===p){u=u.next,p===ca&&(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,G.lanes|=p,Kl|=p;f=u.action,po&&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,G.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!xr(o,e.memoizedState)&&(tc=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);xr(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=G,i=Oo(),o=H;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!xr((co||i).memoizedState,n);if(s&&(i.memoizedState=n,tc=!0),i=i.queue,cs(Bo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,i,n,t),null),zl===null)throw Error(a(349));o||so&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=ko(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function Ho(e){var t=ni(e,2);t!==null&&X(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function Wo(e,t,n,r){return e.baseState=n,Fo(e,co,typeof r==`function`?r:No)}function Go(e,t,n,r,i){if(Ns(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,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,Ko(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ko(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),qo(e,t,s)}catch(n){Yo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),qo(e,t,a)}catch(n){Yo(e,t,n)}}function qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Jo(e,t,n)},function(n){return Yo(e,t,n)}):Jo(e,t,n)}function Jo(e,t,n){t.status=`fulfilled`,t.value=n,Xo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ko(e,n)))}function Yo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Xo(t),t=t.next;while(t!==r)}e.action=null}function Xo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zo(e,t){return t}function Qo(e,t){if(H){var n=zl.formState;if(n!==null){a:{var r=G;if(H){if(ji){b:{for(var i=ji,a=Ni;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=cf(i.nextSibling),r=i.data===`F!`;break a}}Fi(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zo,lastRenderedState:t},n.queue=r,n=As.bind(null,G,r),r.dispatch=n,r=Uo(!1),a=Ms.bind(null,G,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Go.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function $o(e){return es(Oo(),co,e)}function es(e,t,n){if(t=Fo(e,t,Zo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===va?ba:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,rs(9,{destroy:void 0},ts.bind(null,i,n),null)),[r,a,e]}function ts(e,t){e.action=t}function ns(e){var t=Oo(),n=co;if(n!==null)return es(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=ko(),G.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 is(){return Oo().memoizedState}function as(e,t,n,r){var i=Do();G.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(G.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=ko(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=Oo().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(K&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(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 ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||so&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),G.lanes|=e,Kl|=e,n)}function ys(e,t,n,r){return xr(n,t)?n:Ja.current===null?!(so&42)||so&1073741824&&!(J&261930)?(tc=!0,e.memoizedState=n):(e=hu(),G.lanes|=e,Kl|=e,t):(e=vs(e,n,r),xr(e,t)||(tc=!0),e)}function bs(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,Ms(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,fa(c,r),mu(e)):js(e,t,r,mu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Cs(e).queue;bs(e,i,t,re,n===null?xs:function(){return ws(e),n(r)})}function Cs(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:No,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},mu())}function Ts(){return Zi(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=za(n);var r=Ba(t,e,n);r!==null&&(X(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=ti(e,t,n,r),n!==null&&(X(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,mu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(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,xr(s,o))return ei(e,t,i,0),zl===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return X(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(a(479))}else t=ti(e,n,r,2),t!==null&&X(t,e,2)}function Ns(e){var t=e.alternate;return e===G||t!==null&&t===G}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Is={readContext:Zi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Zi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Le(!0);try{n(t)}finally{Le(!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=ks.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,G,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,i=Do();if(H){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),zl===null)throw Error(a(349));J&127||Ro(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=zl.identifierPrefix;if(H){var n=V,r=wi;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:Qo,useActionState:Qo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Os.bind(null,G)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Po,useRef:is,useState:function(){return Po(No)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(Oo(),co.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e,t){return Wo(Oo(),co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:Zi,use:jo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Io,useRef:is,useState:function(){return Io(No)},useDebugValue:hs,useDeferredValue:function(e,t){var n=Oo();return co===null?vs(n,e,t):ys(n,co.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Es,useHostTransitionStatus:Ts,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){var n=Oo();return co===null?(n.baseState=e,[e,n.queue.dispatch]):Wo(n,co,e,t)},useMemoCache:Mo,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=za(r);i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(X(t,e,r),Va(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(X(t,e,r),Va(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=za(n);r.tag=2,t!=null&&(r.callback=t),t=Ba(e,r,n),t!==null&&(X(t,e,n),Va(t,e,n))}};function Hs(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?!Sr(n,r)||!Sr(i,a):!0}function Us(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&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(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=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Yr(e)}function Ks(e){console.error(e)}function qs(e){Yr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(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 Xs(e,t,n){return n=za(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=za(e),e.tag=3,e}function Qs(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(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(iu===null?iu=new Set([this]):iu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,i,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Du():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Gu(e,r,i)),!1;case 22:return n.flags|=65536,r===xa?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)),Gu(e,r,i)),!1}throw Error(a(435,n.tag))}return Gu(e,r,i),Du(),!1}if(H)return t=$a.current,t===null?(r!==Pi&&(t=Error(a(423),{cause:r}),Bi(gi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=gi(r,n),i=Xs(e.stateNode,r,i),Ha(e,i),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Pi&&(e=Error(a(422),{cause:r}),Bi(gi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=gi(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Xs(n.stateNode,r,e),Ha(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`&&(iu===null||!iu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Zs(i),Qs(i,e,n,r),Ha(n,i),!1}n=n.return}while(n!==null);return!1}var ec=Error(a(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function rc(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 Xi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(H&&s&&Di(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Sr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sr(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(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 cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),ro(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Za(),io(t)):(ga(t,a.cachePool),Xa(t,a),io(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Za(),ro(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Pa(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(H){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(no(t),(e=ji)?(e=rf(e,Ni),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ci===null?null:{id:wi,overflow:V},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),i)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(tc||Ji(e,t,n,!1),i=(n&e.childLanes)!==0,tc||i){if(r=zl,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),X(r,e,s),ec;Du(),t=uc(e,t,n)}else e=o.treeContext,ji=cf(s.nextSibling),Ai=t,H=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=lc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(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(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return Xi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!tc?(To(e,t,i),Dc(e,t,i)):(H&&r&&Di(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!tc?(To(e,t,a),Dc(e,t,a)):(H&&r&&Di(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},La(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(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&&Vs.enqueueReplaceState(a,a.state,null),Ga(t,r,a,i),Wa(),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=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=Zi(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)&&Us(t,a,r,o),Ia=!1;var f=t.memoizedState;a.state=f,Ga(t,r,a,i),Wa(),l=t.memoizedState,s||f!==l||Ia?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Ia||Hs(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,Ra(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=Zi(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)&&Us(t,a,r,c),Ia=!1,f=t.memoizedState,a.state=f,Ga(t,r,a,i),Wa();var p=t.memoizedState;o!==d||f!==p||Ia||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Ia||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(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,fc(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=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Ri(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:_a()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function bc(e,t,n){var r=t.pendingProps,i=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(W.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(H){if(i?to(t):io(t),(e=ji)?(e=rf(e,Ni),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ci===null?null:{id:wi,overflow:V},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Fi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(io(t),i=t.mode,c=Sc({mode:`hidden`,children:c},i),r=fi(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(to(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,i=t.mode,r=Sc({mode:`visible`,children:r.children},i),c=fi(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Pa(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=zl,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),X(s,e,r),ec;af(c)||Du(),t=Cc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=cf(c.nextSibling),Ai=t,H=!0,Mi=null,Ni=!1,e!==null&&ki(t,e),t=xc(t,r.children),t.flags|=4096);return t}return i?(io(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,i,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(i=c.cachePool,i===null?i=_a():(l=ra._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=li(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 xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=si(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Pa(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Tc(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 Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=W.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,I(W,o),nc(e,t,r,n),r=H?bi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(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&&oo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(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&&oo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Yi(e))):!0}function kc(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:fe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),I(W,W.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,H&&t.flags&1048576&&Ei(t,bi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===w){t.tag=11,t=rc(null,t,e,r,n);break a}else if(i===D){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=ne(e)||e,Error(a(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Ws(r,t.pendingProps),hc(e,t,r,i,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Ra(e,t),Ga(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Wa(),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=gc(e,t,r,n);break a}else if(r!==i){i=gi(Error(a(424)),t),Bi(i),t=gc(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(ji=cf(e.firstChild),Ai=t,H=!0,Mi=null,Ni=!0,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===i){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:H||(n=t.type,e=t.pendingProps,r=Bd(le.current).createElement(n),r[st]=t,r[ct]=e,Pd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&H&&(r=t.stateNode=ff(t.type,t.pendingProps,le.current),Ai=t,Ni=!0,i=ji,Zd(t.type)?(lf=i,ji=cf(r.firstChild)):ji=i),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&H&&((i=r=ji)&&(r=tf(r,t.type,t.pendingProps,Ni),r===null?i=!1:(t.stateNode=r,Ai=t,ji=cf(r.firstChild),Ni=!1,i=!0)),i||Fi(t)),fe(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(i,o)?r=null:s!==null&&Ud(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=bo(e,t,Co,null,null,n),Qf._currentValue=i),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&H&&((e=n=ji)&&(n=nf(n,t.pendingProps,Ni),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Fi(t)),null;case 13:return bc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Xi(t),i=Zi(i),r=r(i),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(i=ha(),i===null&&(i=zl,o=ia(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},La(t),Wi(t,ra,i)):((e.lanes&n)!==0&&(Ra(e,t),Ga(t,null,null,n),Wa()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Wi(t,ra,r),r!==i.cache&&qi(t,[ra],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Wi(t,ra,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function jc(e){e.flags|=4}function Mc(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(wu())e.flags|=8192;else throw Ta=xa,ya}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(wu())e.flags|=8192;else throw Ta=xa,ya}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ye(),e.lanes|=t,Xl|=t)}function Fc(e,t){if(!H)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 Ic(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 Lc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Ic(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,i,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,i,e,r,n)),null;case 27:if(pe(t),n=le.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Ic(t),null}e=se.current,Li(t)?U(t,e):(e=ff(i,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(pe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Ic(t),null}if(o=se.current,Li(t))U(t,o);else{var s=Bd(le.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);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(i,{is:r.is}):s.createElement(i)}}o[st]=t,o[ct]=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(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=le.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Ai,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Fi(t,!0)}else e=Bd(e).createTextNode(r),e[st]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[st]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(a(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[st]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),i=!1}else i=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return de(),e===null&&Sd(t.stateNode.containerInfo),Ic(t),null;case 10:return Gi(t.type),Ic(t),null;case 19:if(F(W),r=t.memoizedState,r===null)return Ic(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Fc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=oo(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return I(W,W.current&1|2),H&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>nu&&(t.flags|=128,i=!0,Fc(r,!1),t.lanes=4194304)}else{if(!i)if(e=oo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!H)return Ic(t),null}else 2*Ee()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,i=!0,Fc(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?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=W.current,I(W,i?n&1|2:n&1),H&&Ti(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(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(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Ic(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Rc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(a(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(W),null;case 4:return de(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&F(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function zc(e,t){switch(Oi(t),t.tag){case 3:Gi(ra),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:F(W);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&F(ma);break;case 24:Gi(ra)}}function Bc(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){Z(t,t.return,e)}}function Vc(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){Z(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Z(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Z(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Z(e,t,n)}}function Wc(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){Z(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Z(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){Z(e,t,n)}else n.current=null}function Kc(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){Z(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ct]=t}catch(t){Z(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(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&&Zd(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 Xc(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=en));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(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&&Zd(e.type)&&(n=e.stateNode),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){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[st]=e,t[ct]=n}catch(t){Z(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=Er(e),Dr(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 i=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||i!==0&&f.nodeType!==3||(c=s+i),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===i&&(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(zd={focusedElem:e,selectionRange:n},sp=!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++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Z(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(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(a(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&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Z(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Z(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(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{qa(e,t)}catch(e){Z(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(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=Ju.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=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&&ht(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(Ie&&typeof Ie.onCommitFiberUnmount==`function`)try{Ie.onCommitFiberUnmount(Fe,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;Zd(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),pf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(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){Z(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Z(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(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:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=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{Np(e)}catch(e){Z(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{Np(e)}catch(e){Z(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(a(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Yu.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 i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(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(a(160));ul(o,s,i),sl=null,cl=!1,o=i.alternate,o!==null&&(o.return=null),i.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&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(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 i=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(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,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[mt]||o[st]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Pd(o,r,n),o[st]=e,bt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).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=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,i).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=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[st]=e,bt(o),r=o}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){i=e.stateNode;try{Kt(i,``)}catch(t){Z(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,qc(e,i,n===null?i:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Z(e,e.return,t)}}break;case 3:if(Bf=null,i=gl,gl=gf(t.containerInfo),hl(t,e),gl=i,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Z(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=gf(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)&&(eu=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||i,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)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){Z(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Z(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Z(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(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;Zc(e,Yc(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(a(161))}}catch(t){Z(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:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:pf(t.stateNode);case 26:case 5:Gc(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),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Z(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++)Ka(c[i],s)}catch(e){Z(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(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),Wc(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&&aa(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&&aa(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&&Bc(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&&aa(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){Z(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),Bc(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&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=gf(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&&Vc(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:Vc(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:Vc(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:aa(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=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,zl=null,q=null,J=0,Y=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,iu=null,au=0,ou=null,su=null,cu=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return K&2&&J!==0?J&-J:N.T===null?it():dd()}function hu(){if(Yl===0)if(!(J&536870912)||H){var e=Ue;Ue<<=1,!(Ue&3932160)&&(Ue=262144),Yl=e}else Yl=536870912;return e=$a.current,e!==null&&(e.flags|=32),Yl}function X(e,t,n){(e===zl&&(Y===2||Y===9)||e.cancelPendingCommit!==null)&&(Su(e,0),yu(e,J,Yl,!1)),Ze(e,n),(!(K&2)||e!==zl)&&(e===zl&&(!(K&2)&&(ql|=n),Gl===4&&yu(e,J,Yl,!1)),rd(e))}function gu(e,t,n){if(K&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||qe(e,t),i=r?Au(e,t):Ou(e,t,!0),o=r;do{if(i===0){Hl&&!r&&yu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!vu(n)){i=Ou(e,t,!1),o=!1;continue}if(i===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;i=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Su(c,s).flags|=256),s=Ou(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,i=4;break a}o=Ql,Ql=i,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Su(e,0),yu(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:yu(r,t,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=eu+300-Ee(),10<i)){if(yu(r,t,Yl,!Vl),Ke(r,0,!0)!==0)break a;cu=t,r.timeoutHandle=Kd(_u.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),i);break a}_u(r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,null,-0,0)}}break}while(1);rd(e)}function _u(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:en},jl(t,a,d);var m=(a&62914560)===a?eu-Ee():(a&4194048)===a?tu-Ee():0;if(m=qf(d,m),m!==null){cu=a,e.cancelPendingCommit=m(Lu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),yu(e,a,o,!l);return}}Lu(e,t,a,n,r,i,o,s,c)}function vu(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(!xr(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 yu(e,t,n,r){t&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&$e(e,n,t)}function bu(){return K&6?!0:(id(0,!1),!1)}function xu(){if(q!==null){if(Y===0)var e=q.return;else e=q,Ui=Hi=null,Eo(e),Oa=null,ka=0,e=q;for(;e!==null;)zc(e.alternate,e),e=e.return;q=null}}function Su(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cu=0,xu(),zl=e,q=n=li(e.current,null),J=t,Y=0,Bl=null,Vl=!1,Hl=qe(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,$r(),n}function Cu(e,t){G=null,N.H=Is,t===va||t===ba?(t=Ea(),Y=3):t===ya?(t=Ea(),Y=4):Y=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,q===null&&(Gl=1,Js(e,gi(t,e.current)))}function wu(){var e=$a.current;return e===null?!0:(J&4194048)===J?eo===null:(J&62914560)===J||J&536870912?e===eo:!1}function Tu(){var e=N.H;return N.H=Is,e===null?Is:e}function Eu(){var e=N.A;return N.A=Ll,e}function Du(){Gl=4,Vl||(J&4194048)!==J&&$a.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||zl===null||yu(zl,J,Yl,!1)}function Ou(e,t,n){var r=K;K|=2;var i=Tu(),a=Eu();(zl!==e||J!==t)&&(ru=null,Su(e,t)),t=!1;var o=Gl;a:do try{if(Y!==0&&q!==null){var s=q,c=Bl;switch(Y){case 8:xu(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=Y;if(Y=0,Bl=null,Pu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=Y,Y=0,Bl=null,Pu(e,s,c,l)}}ku(),o=Gl;break}catch(t){Cu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,K=r,N.H=i,N.A=a,q===null&&(zl=null,J=0,$r()),o}function ku(){for(;q!==null;)Mu(q)}function Au(e,t){var n=K;K|=2;var r=Tu(),i=Eu();zl!==e||J!==t?(ru=null,nu=Ee()+500,Su(e,t)):Hl=qe(e,t);a:do try{if(Y!==0&&q!==null){t=q;var o=Bl;b:switch(Y){case 1:Y=0,Bl=null,Pu(e,t,o,1);break;case 2:case 9:if(Sa(o)){Y=0,Bl=null,Nu(t);break}t=function(){Y!==2&&Y!==9||zl!==e||(Y=7),rd(e)},o.then(t,t);break a;case 3:Y=7;break a;case 4:Y=5;break a;case 7:Sa(o)?(Y=0,Bl=null,Nu(t)):(Y=0,Bl=null,Pu(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?Wf(s):c.stateNode.complete){Y=0,Bl=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,Fu(u))}break b}}Y=0,Bl=null,Pu(e,t,o,5);break;case 6:Y=0,Bl=null,Pu(e,t,o,6);break;case 8:xu(),Gl=6;break a;default:throw Error(a(462))}}ju();break}catch(t){Cu(e,t)}while(1);return Ui=Hi=null,N.H=r,N.A=i,K=n,q===null?(zl=null,J=0,$r(),Gl):0}function ju(){for(;q!==null&&!we();)Mu(q)}function Mu(e){var t=Ac(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Fu(e):q=t}function Nu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:Eo(t);default:zc(n,t),t=q=ui(t,Wl),t=Ac(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Fu(e):q=t}function Pu(e,t,n,r){Ui=Hi=null,Eo(t),Oa=null,ka=0;var i=t.return;try{if($s(e,i,t,n,J)){Gl=1,Js(e,gi(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;Gl=1,Js(e,gi(n,e.current)),q=null;return}t.flags&32768?(H||r===1?e=!0:Hl||J&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Iu(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Iu(t,Vl);return}e=t.return;var n=Lc(t.alternate,t,Wl);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);Gl===0&&(Gl=5)}function Iu(e,t){do{var n=Rc(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);Gl=6,q=null}function Lu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do Hu();while(au!==0);if(K&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=Qr,Qe(e,n,o,s,c,l),e===zl&&(q=zl=null,J=0),su=t,ou=e,cu=n,lu=o,uu=i,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Xu(Ae,function(){return Uu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,i=P.p,P.p=2,s=K,K|=4;try{il(e,t,n)}finally{K=s,P.p=i,N.T=r}}au=1,Ru(),zu(),Bu()}}function Ru(){if(au===1){au=0;var e=ou,t=su,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=zd,o=Er(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Tr(s.ownerDocument.documentElement,s)){if(c!==null&&Dr(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 _=wr(s,h),v=wr(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}}sp=!!Rd,zd=Rd=null}finally{K=i,P.p=r,N.T=n}}e.current=t,au=2}}function zu(){if(au===2){au=0;var e=ou,t=su,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}}au=3}}function Bu(){if(au===4||au===3){au=0,Te();var e=ou,t=su,n=cu,r=du;t.subtreeFlags&10256||t.flags&10256?au=5:(au=0,su=ou=null,Vu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(iu=null),rt(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==`function`)try{Ie.onCommitFiberRoot(Fe,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}}cu&3&&Hu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===pu?fu++:(fu=0,pu=e):fu=0,id(0,!1)}}function Vu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Hu(){return Ru(),zu(),Bu(),Uu()}function Uu(){if(au!==5)return!1;var e=ou,t=lu;lu=0;var n=rt(cu),r=N.T,i=P.p;try{P.p=32>n?32:n,N.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,K&6)throw Error(a(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{P.p=i,N.T=r,Vu(e,t)}}function Wu(e,t,n){t=gi(n,t),t=Xs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(Ze(e,2),rd(e))}function Z(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(iu===null||!iu.has(r))){e=gi(n,e),n=Zs(2),r=Ba(t,n,2),r!==null&&(Qs(n,r,t,e),Ze(r,2),rd(r));break}}t=t.return}}function Gu(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)||(Ul=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(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&&(Gl===4||Gl===3&&(J&62914560)===J&&300>Ee()-eu?!(K&2)&&Su(e,0):Jl|=n,Xl===J&&(Xl=0)),rd(e)}function qu(e,t){t===0&&(t=Ye()),e=ni(e,t),e!==null&&(Ze(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Se(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;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-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=J,a=Ke(r,r===zl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qe(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Gd()&&(e=nd);for(var t=Ee(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}au!==0&&au!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Je(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=zl,n=J,n=Ke(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Y===2||Y===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),rt(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=Me;break;default:n=Ae}return r=cd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(au!==0&&au!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Hu()&&e.callbackNode!==n)return null;var r=J;return r=Ke(e,e===zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(gu(e,r,t),sd(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Hu())return null;gu(e,t,!0)}function ud(){Yd(function(){K&6?Se(Oe,ad):od()})}function dd(){if(nd===0){var e=ca;e===0&&(e=He,He<<=1,!(He&261888)&&(He=256)),nd=e}return nd}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function pd(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 md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[ct]||null).action),o=r.submitter;o&&(t=(t=o[ct]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(nd!==0){var e=o?pd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<qr.length;hd++){var gd=qr[hd];Jr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),wt(`onMouseEnter`,[`mouseout`,`mouseover`]),wt(`onMouseLeave`,[`mouseout`,`mouseover`]),wt(`onPointerEnter`,[`pointerout`,`pointerover`]),wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(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){Yr(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){Yr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,xt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!dn||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 wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=gt(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}cn(function(){var r=a,i=nn(n),o=[];a:{var c=Kr.get(e);if(c!==void 0){var l=xn,u=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:l=Rn;break;case`focusin`:u=`focus`,l=kn;break;case`focusout`:u=`blur`,l=kn;break;case`beforeblur`:case`afterblur`:l=kn;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=Dn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=On;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Bn;break;case zr:case Br:case Vr:l=An;break;case Gr:l=Vn;break;case`scroll`:case`scrollend`:l=Cn;break;case`wheel`:l=Hn;break;case`copy`:case`cut`:case`paste`:l=jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=zn;break;case`toggle`:case`beforetoggle`:l=Un}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=ln(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[lt]))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?gt(u):null,u!==null&&(f=s(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Dn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=zn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:vt(l),h=u==null?c:vt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,gt(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=Dd,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&&Od(o,c,l,d,!1),u!==null&&f!==null&&Od(o,f,u,d,!0)}}a:{if(c=r?vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=lr;else if(rr(c))if(ur)v=yr;else{v=_r;var y=gr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Xt(r.elementType)&&(v=lr):v=vr;if(v&&=v(e,r)){ir(o,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ht(c,`number`,c.value)}switch(y=r?vt(r):window,e){case`focusin`:(rr(y)||y.contentEditable===`true`)&&(kr=y,Ar=r,jr=null);break;case`focusout`:jr=Ar=kr=null;break;case`mousedown`:Mr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Mr=!1,Nr(o,n,i);break;case`selectionchange`:if(Or)break;case`keydown`:case`keyup`:Nr(o,n,i)}var b;if(Gn)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 $n?Zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Jn&&n.locale!==`ko`&&($n||x!==`onCompositionStart`?x===`onCompositionEnd`&&$n&&(b=R()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,$n=!0)),y=Ed(r,x),0<y.length&&(x=new Mn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Qn(n),b!==null&&(x.data=b)))),(b=qn?er(e,n):tr(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Mn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),md(o,e,r,n,i)}yd(o,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(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=ln(e,n),i!=null&&r.unshift(Td(e,i,a)),i=ln(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(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=ln(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
|
|
10
|
+
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(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=$t(``+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`&&$(e,t,`name`,i.name,i,null),$(e,t,`formEncType`,i.formEncType,i,null),$(e,t,`formMethod`,i.formMethod,i,null),$(e,t,`formTarget`,i.formTarget,i,null)):($(e,t,`encType`,i.encType,i,null),$(e,t,`method`,i.method,i,null),$(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(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=$t(``+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`:Q(`beforetoggle`,e),Q(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(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=Zt.get(n)||n,kt(e,n,r))}}function Nd(e,t,n,r,i,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[ct]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,i=!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`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:$(e,t,o,s,n,null)}}i&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=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(a(137,t));break;default:$(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:$(e,t,s,c,n,null)}Gt(e,r,i,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:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`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(a(137,t));default:$(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(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 i=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)||$(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`:i=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(a(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,i);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)||$(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&$(e,t,s,i,r,o)}Wt(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:$(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:$(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)&&$(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(a(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(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||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(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||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){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&&Id(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&&Id(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 Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(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 ef(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`:ef(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(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[mt])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=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(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 cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=P.d;P.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=yt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);bt(c),Pd(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,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=yt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),bt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=yt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),bt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=le.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=yt(i).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=Af(n.href);var o=yt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.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},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=yt(i).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(a(444,e))}}function Af(e){return`href="`+zt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(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}),Pd(t,`link`,n),bt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+zt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,bt(i),i):(r=n,(i=mf.get(o))&&(r=h({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),bt(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(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 Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,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[mt]||a[st]||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 Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(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=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(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=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.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=Jf.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 Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function $f(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=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(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 ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function tp(e){return e?(e=ai,e):ai}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(X(n,e,t),Va(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&X(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=mu();t=nt(t);var n=ni(e,t);n!==null&&X(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,up(e,t,n,r)}finally{P.p=a,N.T=i}}function lp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,up(e,t,n,r)}finally{P.p=a,N.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ge(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}rd(a),!(K&6)&&(nu=Ee()+500,id(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&X(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=nn(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=gt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(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 fp=e,null}function mp(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(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case Me:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=_t(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=gt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,at(e.priority,function(){op(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,at(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=_t(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,t){e.blockedOn===t&&(e.blockedOn=null,hp||(hp=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){jp===e&&(jp=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(pp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.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[ct]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ct]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){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 Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;np(n,mu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[lt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=r.version;if(Lp!==`19.2.7`)throw Error(a(527,Lp,`19.2.7`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Fe=zp.inject(Rp),Ie=zp}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,s,c,Pp),e[lt]=t.current,Sd(e),new Fp(t)}})),g=e(((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=h()})),_=i(t(),1),v=typeof window<`u`?_.useLayoutEffect:_.useEffect;function y(e){let t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function b(e,t,n={},r={}){_.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function x(e){let t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function S(e){return e[e.length-1]}function C(e){return typeof e==`function`}function w(e,t){return C(e)?e(t):e}var T=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;function D(e){for(let t in e)if(T.call(e,t))return!0;return!1}var O=()=>Object.create(null),k=(e,t)=>A(e,t,O);function A(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=ne(e)&&ne(i);if(!a&&!(j(e)&&j(i)))return i;let o=a?e:ee(e);if(!o)return i;let s=a?i:ee(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:T.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=A(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function ee(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!E.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!E.call(e,t))return!1;r.push(t)}return r}function j(e){if(!te(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!te(n)||!n.hasOwnProperty(`isPrototypeOf`))}function te(e){return Object.prototype.toString.call(e)===`[object Object]`}function ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function M(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!M(e[r],t[r],n))return!1;return!0}if(j(e)&&j(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!M(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!M(e[o],t[o],n)))return!1;return i===a}return!1}function N(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function P(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function re(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function ie(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return re(t)}var ae=[`http:`,`https:`,`mailto:`,`tel:`];function oe(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function F(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=ie(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ie(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function I(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function se(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ce(){throw Error(`Invariant failed`)}function le(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var L=4,ue=5;function de(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function fe(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=de(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function pe(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=fe(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=ge(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=ge(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=_e(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=_e(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=_e(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=ge(n.fullPath??n.from);e.kind=ue,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=ge(n.fullPath??n.from);e.kind=L,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)pe(e,t,r,s,i,a,o)}function me(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function he(e){if(e.pathless)for(let t of e.pathless)he(t);if(e.static)for(let t of e.static.values())he(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())he(t);if(e.dynamic?.length){e.dynamic.sort(me);for(let t of e.dynamic)he(t)}if(e.optional?.length){e.optional.sort(me);for(let t of e.optional)he(t)}if(e.wildcard?.length){e.wildcard.sort(me);for(let t of e.wildcard)he(t)}}function ge(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function _e(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function ve(e,t){let n=ge(`/`),r=new Uint16Array(6);for(let t of e)pe(!1,r,t,1,n,0);he(n),t.masksTree=n,t.flatCache=le(1e3)}function ye(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=we(e,t.masksTree);return t.flatCache.set(e,r),r}function be(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=ge(`/`),pe(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),we(r,o,n)}function xe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=we(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Ee(a.route)),t.matchCache.set(r,a),a}function Se(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Ce(e,t=!1,n){let r=ge(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return pe(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&ce(),a[e.id]=e,s!==0&&e.path){let t=Se(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),he(r),{processedTree:{segmentTree:r,singleCache:le(1e3),matchCache:le(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function we(e,t,n=!1){let r=e.split(`/`),i=Oe(e,r,t,n);if(!i)return null;let[a]=Te(e,r,i);return{route:i.node.route,rawParams:a}}function Te(e,t,n){let r=De(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===L)break;if(u.kind===ue){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Ee(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function De(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Oe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!S(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!Me(l,n))continue;if(i.parse){if(!je(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==L&&Me(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===L||i.kind===2)&&Me(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(je(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&Ae(p,o))return n;Me(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+ke(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+ke(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+ke(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+ke(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function ke(e,t){return 2**(e-t-1)}function Ae(e,t){return e===2**(t-1)-1}function je(e,t,n){let r,i;try{[r,i]=Te(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Me(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===L)>(e.node.kind===L)||t.node.kind===L==(e.node.kind===L)&&t.depth>e.depth))):!0}function Ne(e){return Pe(e.filter(e=>e!==void 0).join(`/`))}function Pe(e){return e.replace(/\/{2,}/g,`/`)}function Fe(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Ie(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Le(e){return Ie(Fe(e))}function Re(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ze(e,t,n){return Re(e,n)===Re(t,n)}function Be({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&S(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(S(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Pe(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Ve(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function He(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>We(e,n)).join(`/`):We(r,n):r}function Ue({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=fe(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=He(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=He(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=He(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function We(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function Ge(e){return e?.isNotFound===!0}function Ke(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function qe(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Je(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=qe(r):Array.isArray(t)?t.push(qe(r)):n[e]=[t,qe(r)]}return n}var Ye=Ze(JSON.parse),Xe=Qe(JSON.stringify,JSON.parse);function Ze(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Je(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Qe(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Ke(e,r);return t?`?${t}`:``}}var $e=`__root__`;function et(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function tt(e){return e instanceof Response&&!!e.options}var nt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},rt=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),it=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),at=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},ot=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},st=(e,t,n)=>{if(!(!tt(n)&&!Ge(n)))throw tt(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:tt(n)?`redirected`:Ge(n)?`notFound`:r.status===`pending`?`success`:r.status,context:at(e,t.index),isFetching:!1,error:n})),Ge(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),tt(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},ct=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},lt=(e,t,n)=>{let r=at(e,n);e.updateMatch(t,e=>({...e,context:r}))},ut=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,st(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,st(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!tt(n)&&!Ge(n)&&(e.serialError??=n)},dt=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!it(e,t)&&(n.options.loader||n.options.beforeLoad||St(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{nt(e)},i);r._nonReactive.pendingTimeout=t}},ft=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;dt(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&st(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},pt=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=N(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&ut(e,n,o),s&&ut(e,n,s),dt(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=N();let f={...at(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=it(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(tt(r)||Ge(r))&&(u(),ut(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),P(y))return u(),y.catch(t=>{ut(e,n,t)}).then(v)}catch(t){u(),ut(e,n,t)}v(y)},mt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>pt(e,n,t,i),s=()=>{if(ct(e,n))return;let t=ft(e,n,i);return P(t)?t.then(o):o()};return a()},ht=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},gt=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=at(e,r),d=it(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},_t=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{xt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(gt(e,t,n,r,i)),l=!!s&&P(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;st(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:at(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:at(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,Ge(t)&&await i.options.notFoundComponent?.preload?.(),st(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,st(e,e.router.getMatch(n),t)}!tt(o)&&!Ge(o)&&await xt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:at(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),st(e,r,t)}},vt=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(gt(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await _t(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){tt(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await _t(e,t,i,n,d):lt(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(ct(e,i)){if(!e.router.getMatch(i))return e.matches[n];lt(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=it(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&st(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=N(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function yt(e){let t=e,n=[];rt(t.router)&&nt(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=mt(t,e);P(n)&&await n}catch(e){if(tt(e))throw e;if(Ge(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?ot(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(vt(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(tt(e))throw e;Ge(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=ot(t,l);e===void 0&&ce();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await xt(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await xt(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=ht(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=nt(t);if(P(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function bt(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function xt(e,t=Ct){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Ct?(()=>{if(e._componentsPromise===void 0){let t=bt(e,Ct);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():bt(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function St(e){for(let t of Ct)if(e.options[t]?.preload)return!0;return!1}var Ct=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function wt(e){return{input:({url:t})=>{for(let n of e)t=Et(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Dt(e[n],t);return t}}}function Tt(e){let t=Le(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Ne([`/`,t,e.pathname]),e)}}function Et(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Dt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Ot(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>kt(o,_.get())),x=r(()=>kt(s,v.get())),S=r(()=>kt(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=le(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:ee,setCached:j};A(e.matches),a?.(k);function A(e){At(e,o,_,n,i)}function ee(e){At(e,s,v,n,i)}function j(e){At(e,c,y,n,i)}return k}function kt(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function At(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}se(n.get(),a)||n.set(a)})}var jt=`__TSR_index`,Mt=`popstate`,Nt=`beforeunload`;function Pt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Rt(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[jt];i=Ft(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[jt];i=Ft(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[jt]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ft(e,t){t||={};let n=zt();return{...t,key:n,__TSR_key:n,[jt]:e}}function It(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Rt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=zt();t.history.replaceState({[jt]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=Rt(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[jt]-l.state[jt],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Pt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Nt,S,{capture:!0}),t.removeEventListener(Mt,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Nt,S,{capture:!0}),t.addEventListener(Mt,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Lt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Rt(e,t){let n=Lt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=zt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[jt]:0,key:a,__TSR_key:a}}}function zt(){return(Math.random()+1).toString(36).substring(7)}function Bt(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var Vt=new WeakMap,Ht=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ve(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=It()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=le(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Ot(Gt(this.latestLocation),e),fn(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=Le(o);t&&t!==`/`&&e.push(Tt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:wt(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ce(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&ve(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:F(e).path,external:!1,searchStr:o,search:k(t?.search,i),hash:F(r.slice(1)).path,state:A(t?.state,a)}}let o=new URL(i,this.origin),s=Et(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:F(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:k(t?.search,c),hash:F(s.hash.slice(1)).path,state:A(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>Be({base:e,to:t.includes(`//`)?Pe(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>qt({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,w(t.params,s)),d=this.routesByPath[Ie(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&D(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:F(Ue({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Kt(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=Jt({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=k(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?w(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?w(t.state,n.state):{};v=A(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=Dt(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=I(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=ye(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,w(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=M(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Ie(this.latestLocation.href)===Ie(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=N(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=Rt(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Et(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(oe(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t?Vt.set(this.latestLocation,t):Vt.delete(this.latestLocation);let n=this.latestLocation,r=Bt(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await yt({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){tt(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Ge(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Bt(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&oe(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=xt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await yt({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(tt(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});Ge(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=be(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!M(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?M(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Xe,parseSearch:e.parseSearch??Ye,protocolAllowlist:e.protocolAllowlist??ae}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Ee(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:Ie(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Xt(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Kt(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof Ut||(r=new Ut(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=Ue({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,x;if(!v)try{Zt(r,b)}catch(e){if(x=Ge(e)||tt(e)?e:new Wt(e.message,{cause:e}),t?.throwOnError)throw x}Object.assign(i,b);let S=y?`stay`:`enter`,C;if(v)C={...v,cause:S,params:y?.params??i,_strictParams:b,search:k(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||St(r)?`pending`:`success`;C={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?k(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:N()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?A(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(C.globalNotFound=s===r.id),C.searchError=f;let w=this.getParentContext(o);C.context={...w,...C.__routeContext,...C.__beforeLoadContext},c[n]=C}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?k(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=S(t),i={...e.search};for(let e of t)try{Object.assign(i,Kt(e.options.validateSearch,i))}catch{}let a=S(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{Zt(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},Ut=class extends Error{},Wt=class extends Error{};function Gt(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Kt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Ut(`Async validation not supported`);if(n.issues)throw new Ut(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function qt({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Ie(e),a,o=xe(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Jt({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Yt(n)(e,t,r??!1)}function Yt(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=Kt(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=w(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function Xt(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return $e}function Zt(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}function Qt(){try{return sessionStorage}catch{return}}var $t=`tsr-scroll-restoration-v1_3`,en=Qt();function tn(){try{return JSON.parse(en?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function nn(){try{en?.setItem($t,JSON.stringify(rn))}catch{}}var rn=tn(),an=`data-scroll-restoration-id`,on=e=>e.state.__TSR_key||e.href;function sn(e){let t=e.getAttribute(an);if(t)return`[${an}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var cn=!1,ln=`window`;function un(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function dn(e){let t=[];for(let n of e){if(n===ln)continue;let e=un(n);e&&t.push(e)}return t}function fn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||on,a=new Map,o=(e,t,n)=>{let r=a.get(e)||{};r.scrollX=t,r.scrollY=n,a.set(e,r)},s=e=>{if(!(cn||!r.restoring))if(e.target===document)o(ln,scrollX,scrollY);else{let t=e.target;o(t,t.scrollLeft,t.scrollTop)}},c=e=>{if(!r.restoring)return;let t=rn[e]||={};for(let[e,n]of a)e===ln?t[ln]=n:e.isConnected&&(t[sn(e)]=n)};n&&!r.restoration&&(r.restoration=!0,cn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,s,!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&c(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{c(i(e.stores.resolvedLocation.get()??e.stores.location.get())),nn()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c;if(a.clear(),s||(r.next=!0),typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let l=i(t.toLocation),u=t.fromLocation&&i(t.fromLocation);if(r.restoring&&u&&u!==l){let e=rn[u];if(e){let t=rn[l];for(let n in e){if(n===ln){if(s)continue}else{let e=un(n);if(!e||s&&o&&(c??=dn(o),c.includes(e)))continue}t||=rn[l]={},t[n]??=e[n]}}}cn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){let s=Vt.get(t.toLocation),u=e&&i&&(s===`PUSH`||s===`REPLACE`),d=r.restoring?rn[l]:void 0;if(d)for(let e in d){let{scrollX:t,scrollY:r}=d[e];if(e===ln){if(u)continue;scrollTo({top:r,left:t,behavior:n}),a=!0}else{let n=un(e);n&&(n.scrollLeft=t,n.scrollTop=r)}}if(!a&&!e){let e={top:0,left:0,behavior:n};if(scrollTo(e),o){c??=dn(o);for(let t of c)t.scrollTo(e)}}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{cn=!1}}))}var pn=`Error preloading route! ☝️`,mn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=$e:this.parentRoute||ce();let r=n?$e:t?.path;r&&r!==`/`&&(r=Fe(r));let i=t?.id||r,a=n?$e:Ne([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Ne([`/`,a]));let o=a===`__root__`?`/`:Ne([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Ie(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>et({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},hn=class extends mn{constructor(e){super(e)}},R=r();function gn(e){let t=e.errorComponent??vn;return(0,R.jsx)(_n,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?_.createElement(t,{error:n,reset:r}):e.children})}var _n=class extends _.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function vn({error:e}){let[t,n]=_.useState(!1);return(0,R.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,R.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,R.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,R.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,R.jsx)(`div`,{children:(0,R.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,R.jsx)(`code`,{children:e.message}):null})}):null]})}function yn({children:e,fallback:t=null}){return bn()?(0,R.jsx)(_.Fragment,{children:e}):(0,R.jsx)(_.Fragment,{children:t})}function bn(){return _.useSyncExternalStore(xn,()=>!0,()=>!1)}function xn(){return()=>{}}var Sn=_.createContext(null);function Cn(e){return _.useContext(Sn)}var wn=_.createContext(void 0),Tn=_.createContext(void 0),z=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(z||{});function En({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Dn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var On=[],kn=0,{link:An,unlink:jn,propagate:Mn,checkDirty:Nn,shallowPropagate:Pn}=En({update(e){return e._update()},notify(e){On[In++]=e,e.flags&=~z.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=z.Mutable|z.Dirty,Bn(e))}}),Fn=0,In=0,Ln,Rn=0;function zn(e){try{++Rn,e()}finally{--Rn||Vn()}}function Bn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=jn(n,e)}function Vn(){if(!(Rn>0)){for(;Fn<In;){let e=On[Fn];On[Fn++]=void 0,e.notify()}Fn=0,In=0}}function Hn(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?z.None:z.Mutable,get(){return Ln!==void 0&&An(i,Ln,kn),i._snapshot},subscribe(e){let t=Dn(e),n={current:!1},r=Un(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Ln,o=t?.compare??Object.is;if(n)Ln=i,++kn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=z.Mutable|z.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Ln=a,n&&(i.flags&=~z.RecursedCheck),Bn(i)}}};return n?(i.flags=z.Mutable|z.Dirty,i.get=function(){let e=i.flags;if(e&z.Dirty||e&z.Pending&&Nn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Pn(e)}}else e&z.Pending&&(i.flags=e&~z.Pending);return Ln!==void 0&&An(i,Ln,kn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Mn(e),Pn(e),Vn())}},i}function Un(e){let t=()=>{let t=Ln;Ln=n,++kn,n.depsTail=void 0,n.flags=z.Watching|z.RecursedCheck;try{return e()}finally{Ln=t,n.flags&=~z.RecursedCheck,Bn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:z.Watching|z.RecursedCheck,notify(){let e=this.flags;e&z.Dirty||e&z.Pending&&Nn(this.deps,this)?t():this.flags=z.Watching},stop(){this.flags=z.None,this.depsTail=void 0,Bn(this)}};return t(),n}var Wn=e((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),Gn=e(((e,t)=>{t.exports=Wn()})),Kn=e((e=>{var n=t(),r=Gn();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),qn=e(((e,t)=>{t.exports=Kn()})),Jn=i(qn(),1);function Yn(e,t){return e===t}function Xn(e,t,n=Yn){let r=(0,_.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,_.useCallback)(()=>e?.get(),[e]);return(0,Jn.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Zn={get(){},subscribe(){return{unsubscribe(){}}}};function Qn(e,t){let n=_.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=A(n.current,i):i}}function $n(e){let t=Cn(),n=_.useContext(e.from?Tn:wn),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=Qn(e,t),a=Xn(r??Zn,e=>e?i(e):Zn);if(a!==Zn)return a;(e.shouldThrow??!0)&&ce()}function er(e){return $n({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function tr(e){let{select:t,...n}=e;return $n({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function nr(e){return $n({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function rr(e){return $n({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ir(e){let t=Cn();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function ar(e){let t=Cn(),n=ir(),r=_.useRef(null);return v(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function or(e){return $n({...e,select:t=>e.select?e.select(t.context):t.context})}var sr=i(m(),1);function cr(e,t){let n=Cn(),r=x(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:v,disabled:y,style:S,className:C,onClick:T,onBlur:E,onFocus:D,onMouseEnter:O,onMouseLeave:k,onTouchStart:A,ignoreBlocker:ee,params:j,search:te,hash:ne,state:N,mask:P,reloadDocument:re,unsafeRelative:ie,from:ae,_fromLocation:F,...I}=e,se=bn(),ce=_.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),le=Xn(n.stores.location,e=>e,(e,t)=>e.href===t.href),L=_.useMemo(()=>{let e={_fromLocation:le,...ce};return n.buildLocation(e)},[n,le,ce]),ue=L.maskedLocation?L.maskedLocation.publicHref:L.publicHref,de=L.maskedLocation?L.maskedLocation.external:L.external,fe=_.useMemo(()=>_r(ue,de,n.history,y),[y,de,ue,n.history]),pe=_.useMemo(()=>{if(fe?.external)return oe(fe.href,n.protocolAllowlist)?void 0:fe.href;if(!vr(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),oe(s,n.protocolAllowlist)?void 0:s}catch{}},[s,fe,n.protocolAllowlist]),me=_.useMemo(()=>{if(pe)return!1;if(o?.exact){if(!ze(le.pathname,L.pathname,n.basepath))return!1}else{let e=Re(le.pathname,n.basepath),t=Re(L.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!M(le.search,L.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?se&&le.hash===L.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,le,pe,se,L.hash,L.pathname,L.search,n.basepath]),he=me?w(i,{})??ur:lr,ge=me?lr:w(a,{})??lr,_e=[C,he.className,ge.className].filter(Boolean).join(` `),ve=(S||he.style||ge.style)&&{...S,...he.style,...ge.style},[ye,be]=_.useState(!1),xe=_.useRef(!1),Se=e.reloadDocument||pe?!1:c??n.options.defaultPreload,Ce=l??n.options.defaultPreloadDelay??0,we=_.useCallback(()=>{n.preloadRoute({...ce,_builtLocation:L}).catch(e=>{console.warn(e),console.warn(pn)})},[n,ce,L]);b(r,_.useCallback(e=>{e?.isIntersecting&&we()},[we]),hr,{disabled:!!y||Se!==`viewport`}),_.useEffect(()=>{xe.current||!y&&Se===`render`&&(we(),xe.current=!0)},[y,we,Se]);let Te=e=>{let t=e.currentTarget.getAttribute(`target`),r=v===void 0?t:v;if(!y&&!br(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,sr.flushSync)(()=>{be(!0)});let t=n.subscribe(`onResolved`,()=>{t(),be(!1)});n.navigate({...ce,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:ee})}};if(pe)return{...I,ref:r,href:pe,...g&&{children:g},...v&&{target:v},...y&&{disabled:y},...S&&{style:S},...C&&{className:C},...T&&{onClick:T},...E&&{onBlur:E},...D&&{onFocus:D},...O&&{onMouseEnter:O},...k&&{onMouseLeave:k},...A&&{onTouchStart:A}};let Ee=e=>{if(y||Se!==`intent`)return;if(!Ce){we();return}let t=e.currentTarget;if(mr.has(t))return;let n=setTimeout(()=>{mr.delete(t),we()},Ce);mr.set(t,n)},De=e=>{y||Se!==`intent`||we()},Oe=e=>{if(y||!Se||!Ce)return;let t=e.currentTarget,n=mr.get(t);n&&(clearTimeout(n),mr.delete(t))};return{...I,...he,...ge,href:fe?.href,ref:r,onClick:gr([T,Te]),onBlur:gr([E,Oe]),onFocus:gr([D,Ee]),onMouseEnter:gr([O,Ee]),onMouseLeave:gr([k,Oe]),onTouchStart:gr([A,De]),disabled:!!y,target:v,...ve&&{style:ve},..._e&&{className:_e},...y&&dr,...me&&fr,...se&&ye&&pr}}var lr={},ur={className:`active`},dr={role:`link`,"aria-disabled":!0},fr={"data-status":`active`,"aria-current":`page`},pr={"data-transitioning":`transitioning`},mr=new WeakMap,hr={rootMargin:`100px`},gr=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function _r(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function vr(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var yr=_.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=cr(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return _.createElement(`a`,t,o)}return _.createElement(n,a,o)});function br(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var xr=class extends mn{constructor(e){super(e),this.useMatch=e=>$n({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>or({...e,from:this.id}),this.useSearch=e=>rr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>nr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>tr({...e,from:this.id}),this.useLoaderData=e=>er({...e,from:this.id}),this.useNavigate=()=>ir({from:this.fullPath}),this.Link=_.forwardRef((e,t)=>(0,R.jsx)(yr,{ref:t,from:this.fullPath,...e}))}};function Sr(e){return new xr(e)}var Cr=class extends hn{constructor(e){super(e),this.useMatch=e=>$n({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>or({...e,from:this.id}),this.useSearch=e=>rr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>nr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>tr({...e,from:this.id}),this.useLoaderData=e=>er({...e,from:this.id}),this.useNavigate=()=>ir({from:this.fullPath}),this.Link=_.forwardRef((e,t)=>(0,R.jsx)(yr,{ref:t,from:this.fullPath,...e}))}};function wr(e){return new Cr(e)}function Tr(e){let t=Cn(),n=`not-found-${Xn(t.stores.location,e=>e.pathname)}-${Xn(t.stores.status,e=>e)}`;return(0,R.jsx)(gn,{getResetKey:()=>n,onCatch:(t,n)=>{if(Ge(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Ge(t))return e.fallback?.(t);throw t},children:e.children})}function Er(){return(0,R.jsx)(`p`,{children:`Not Found`})}function Dr(e){return(0,R.jsx)(R.Fragment,{children:e.children})}function Or(e,t,n){return t.options.notFoundComponent?(0,R.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,R.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,R.jsx)(Er,{})}var kr=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,Ar=(e,t)=>e[0]===t[0]&&e[1]===t[1],jr=_.memo(function({matchId:e}){let t=Cn(),n=t.stores.matchStores.get(e);n||ce();let r=Xn(t.stores.loadedAt,e=>e),i=Xn(n,e=>e,kr);return(0,R.jsx)(Mr,{router:t,matchId:e,resetKey:r,matchState:_.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Mr({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,R.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?_.Suspense:Dr,f=s?gn:Dr,p=l?Tr:Dr;return(0,R.jsxs)(i.isRoot?i.options.shellComponent??Dr:Dr,{children:[(0,R.jsx)(wn.Provider,{value:t,children:(0,R.jsx)(d,{fallback:o,children:(0,R.jsx)(f,{getResetKey:()=>n,errorComponent:s||vn,onCatch:(e,t)=>{if(Ge(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,R.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return _.createElement(l,e)},children:u||r._displayPending?(0,R.jsx)(yn,{fallback:o,children:(0,R.jsx)(Pr,{matchId:t})}):(0,R.jsx)(Pr,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Nr,{}),(e.options.scrollRestoration,null)]}):null]})}function Nr(){let e=Cn(),t=_.useRef();return v(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...Bt(e.stores.location.get(),r??n)}),t.current=n},[Xn(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Pr=_.memo(function({matchId:e}){let t=Cn(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||ce();let i=Xn(r,e=>e),a=i.routeId,o=t.routesById[a],s=_.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=_.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,R.jsx)(e,{},s):(0,R.jsx)(Fr,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=N();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return Ge(i.error)||ce(),Or(t,o,i.error);if(i.status===`redirected`)throw tt(i.error)||ce(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),Fr=_.memo(function(){let e=Cn(),t=_.useContext(wn),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=Xn(a,e=>[e?.routeId,e?.globalNotFound??!1],Ar),i=Xn(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,R.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||ce(),Or(e,a,void 0);if(!i)return null;let s=(0,R.jsx)(jr,{matchId:i});return n===`__root__`?(0,R.jsx)(_.Suspense,{fallback:o,children:s}):s});function Ir(){let e=Cn(),t=_.useRef({router:e,mounted:!1}),[n,r]=_.useState(!1),i=Xn(e.stores.isLoading,e=>e),a=Xn(e.stores.hasPending,e=>e),o=y(i),s=i||n||a,c=y(s),l=i||a,u=y(l);return e.startTransition=e=>{r(!0),_.startTransition(()=>{e(),r(!1)})},_.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ie(e.latestLocation.publicHref)!==Ie(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),v(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),v(()=>{o&&!i&&e.emit({type:`onLoad`,...Bt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),v(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Bt(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),v(()=>{if(c&&!s){let t=Bt(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),zn(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function Lr(){let e=Cn(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,R.jsx)(t,{}):null,r=(0,R.jsxs)(typeof document<`u`&&e.ssr?Dr:_.Suspense,{fallback:n,children:[(0,R.jsx)(Ir,{}),(0,R.jsx)(Rr,{})]});return e.options.InnerWrap?(0,R.jsx)(e.options.InnerWrap,{children:r}):r}function Rr(){let e=Cn(),t=Xn(e.stores.firstId,e=>e),n=Xn(e.stores.loadedAt,e=>e),r=t?(0,R.jsx)(jr,{matchId:t}):null;return(0,R.jsx)(wn.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,R.jsx)(gn,{getResetKey:()=>n,errorComponent:vn,onCatch:void 0,children:r})})}var zr=e=>({createMutableStore:Hn,createReadonlyStore:Hn,batch:zn}),Br=e=>new Vr(e),Vr=class extends Ht{constructor(e){super(e,zr)}};function Hr({router:e,children:t,...n}){D(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,R.jsx)(Sn.Provider,{value:e,children:t});return e.options.Wrap?(0,R.jsx)(e.options.Wrap,{children:r}):r}function Ur({router:e,...t}){return(0,R.jsx)(Hr,{router:e,...t,children:(0,R.jsx)(Lr,{})})}var Wr=g(),Gr=`studioModel`,Kr=`.png,.jpg,.jpeg,.webp,.gif,.pdf,.txt,.md,.csv,.json`;function qr(e){return Xr(e)&&e.type===`pipeline_log`&&Xr(e.log)}function Jr(e){return Xr(e)&&e.type===`pipeline_final`&&`output`in e}function Yr(e){return Xr(e)&&e.type===`error`}function Xr(e){return typeof e==`object`&&!!e}function Zr(e,t){let n=[...t].sort((e,t)=>Date.parse(e.startedAt)-Date.parse(t.startedAt)).map(e=>e.id),r=0,i,a=[...e];function o(){if(i===void 0)return;let e=n[r];r+=1;let t=a[i];t?.kind===`message`&&t.role===`assistant`&&t.traceId===void 0&&e!==void 0&&(a[i]={...t,traceId:e}),i=void 0}for(let[e,t]of a.entries()){if(t.kind===`message`&&t.role===`user`){o();continue}t.kind===`message`&&t.role===`assistant`&&(i=e)}return o(),a}function Qr(e){let t=e.metadata?.[Gr];return typeof t==`string`?t:``}function $r(e,t){return t.length>0&&e.some(e=>e.ref===t)}function ei(e){let t=e.providerName??e.providerId,n=e.name??e.id,r=e.modalities?.input.filter(e=>e!==`text`).map(e=>e.slice(0,3)).join(`/`);return r===void 0||r.length===0?`${t} / ${n}`:`${t} / ${n} (${r})`}async function ti(e){let t=e.type||oi(e.name),n=t.startsWith(`image/`)?`image`:`document`;if(!ai(t,e.name))throw Error(`Unsupported attachment type: ${e.name}`);return{id:globalThis.crypto.randomUUID(),name:e.name,mediaType:t,kind:n,data:await ni(e),size:e.size}}function ni(e){return new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`Failed to read ${e.name}`)),r.onload=()=>{let i=r.result;if(typeof i!=`string`){n(Error(`Failed to read ${e.name}`));return}t(i.slice(i.indexOf(`,`)+1))},r.readAsDataURL(e)})}function ri(e,t){let n=[];e.length>0&&n.push({type:`text`,text:e});for(let e of t){if(e.kind===`image`){n.push({type:`image`,source:{type:`base64`,data:e.data,mediaType:e.mediaType}});continue}n.push({type:`document`,source:{type:`base64`,data:e.data,mediaType:e.mediaType,filename:e.name}})}return{role:`user`,content:n}}function ii(e){return e.map(e=>({kind:e.kind,name:e.name,mediaType:e.mediaType,data:e.data}))}function ai(e,t){return e.startsWith(`image/`)||e===`application/pdf`||e.startsWith(`text/`)||[`application/json`,`text/markdown`,`text/csv`].includes(e)||/\.(md|csv|json|txt)$/i.test(t)}function oi(e){return/\.png$/i.test(e)?`image/png`:/\.jpe?g$/i.test(e)?`image/jpeg`:/\.webp$/i.test(e)?`image/webp`:/\.gif$/i.test(e)?`image/gif`:/\.pdf$/i.test(e)?`application/pdf`:/\.md$/i.test(e)?`text/markdown`:/\.csv$/i.test(e)?`text/csv`:/\.json$/i.test(e)?`application/json`:`text/plain`}var si=`anvia-studio-theme`;function ci(){if(typeof window>`u`)return`dark`;try{let e=window.localStorage.getItem(si);return e===`light`||e===`dark`?e:`dark`}catch{return`dark`}}function li(e){typeof document>`u`||(document.documentElement.classList.toggle(`dark`,e===`dark`),document.documentElement.style.colorScheme=e)}function ui(e){try{window.localStorage.setItem(si,e)}catch{}}var di=ci();li(di);function fi(){let[e,t]=(0,_.useState)(()=>di);return(0,_.useEffect)(()=>{li(e),ui(e)},[e]),{theme:e,toggleTheme:()=>t(e=>e===`dark`?`light`:`dark`)}}function pi(e){let{enabled:t,onError:n,selectedAgentId:r}=e,[i,a]=(0,_.useState)(),[o,c]=(0,_.useState)(``);return(0,_.useEffect)(()=>{if(!t||r===void 0){a(void 0),c(``);return}let e=r,i=!1;async function o(){try{let t=await fetch(`/agents/${encodeURIComponent(e)}/models`);if(!t.ok)throw Error(`Agent models failed with HTTP ${t.status}`);let n=await t.json();if(i)return;a(n),c(e=>$r(n.models,e)?e:n.defaultModel??n.models[0]?.ref??``)}catch(e){i||(a(void 0),c(``),n(s(e)))}}return o(),()=>{i=!0}},[t,n,r]),{selectedAgentModels:i!==void 0&&i.agentId===r?i.models:[],selectedModelRef:o,setSelectedModelRef:c}}var mi;function B(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var hi=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},gi=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(mi=globalThis).__zod_globalConfig??(mi.__zod_globalConfig={});var _i=globalThis.__zod_globalConfig;function vi(e){return e&&Object.assign(_i,e),_i}function yi(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function bi(e,t){return typeof t==`bigint`?t.toString():t}function xi(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Si(e){return e==null}function Ci(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var wi=Symbol(`evaluating`);function V(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==wi)return r===void 0&&(r=wi,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ti(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ei(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function Di(e){return JSON.stringify(e)}function Oi(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ki=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Ai(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ji=xi(()=>{if(_i.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function H(e){if(Ai(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Ai(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Mi(e){return H(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Ni=new Set([`string`,`number`,`symbol`]);function Pi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Fi(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function U(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ii(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function Li(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Fi(e,Ei(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Ti(this,`shape`,e),e},checks:[]}))}function Ri(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Fi(e,Ei(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Ti(this,`shape`,r),r},checks:[]}))}function zi(e,t){if(!H(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Fi(e,Ei(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ti(this,`shape`,n),n}}))}function Bi(e,t){if(!H(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Fi(e,Ei(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ti(this,`shape`,n),n}}))}function Vi(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Fi(e,Ei(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ti(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Hi(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return Fi(t,Ei(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Ti(this,`shape`,i),i},checks:[]}))}function Ui(e,t,n){return Fi(t,Ei(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Ti(this,`shape`,i),i}}))}function Wi(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Gi(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ki(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function qi(e){return typeof e==`string`?e:e?.message}function Ji(e,t,n){let r=e.message?e.message:qi(e.inst?._zod.def?.error?.(e))??qi(t?.error?.(e))??qi(n.customError?.(e))??qi(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Yi(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Xi(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Zi=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,bi,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Qi=B(`$ZodError`,Zi),$i=B(`$ZodError`,Zi,{Parent:Error});function ea(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ta(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var na=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new hi;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Ji(e,a,vi())));throw ki(t,i?.callee),t}return o.value},ra=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Ji(e,a,vi())));throw ki(t,i?.callee),t}return o.value},ia=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new hi;return a.issues.length?{success:!1,error:new(e??Qi)(a.issues.map(e=>Ji(e,i,vi())))}:{success:!0,data:a.value}},aa=ia($i),oa=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Ji(e,i,vi())))}:{success:!0,data:a.value}},sa=oa($i),ca=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return na(e)(t,n,i)},la=e=>(t,n,r)=>na(e)(t,n,r),ua=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ra(e)(t,n,i)},da=e=>async(t,n,r)=>ra(e)(t,n,r),fa=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ia(e)(t,n,i)},pa=e=>(t,n,r)=>ia(e)(t,n,r),ma=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return oa(e)(t,n,i)},ha=e=>async(t,n,r)=>oa(e)(t,n,r),ga=/^[cC][0-9a-z]{6,}$/,_a=/^[0-9a-z]+$/,va=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ya=/^[0-9a-vA-V]{20}$/,ba=/^[A-Za-z0-9]{27}$/,xa=/^[a-zA-Z0-9_-]{21}$/,Sa=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ca=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,wa=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ta=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ea=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Da(){return new RegExp(Ea,`u`)}var Oa=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ka=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Aa=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ja=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ma=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Na=/^[A-Za-z0-9_-]*$/,Pa=/^https?$/,Fa=/^\+[1-9]\d{6,14}$/,Ia=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,La=RegExp(`^${Ia}$`);function Ra(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function za(e){return RegExp(`^${Ra(e)}$`)}function Ba(e){let t=Ra({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Ia}T(?:${r})$`)}var Va=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Ha=/^[^A-Z]*$/,Ua=/^[^a-z]*$/,Wa=B(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ga=B(`$ZodCheckMaxLength`,(e,t)=>{var n;Wa.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Si(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Yi(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ka=B(`$ZodCheckMinLength`,(e,t)=>{var n;Wa.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Si(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Yi(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qa=B(`$ZodCheckLengthEquals`,(e,t)=>{var n;Wa.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Si(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Yi(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ja=B(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Wa.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ya=B(`$ZodCheckRegex`,(e,t)=>{Ja.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Xa=B(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ha,Ja.init(e,t)}),Za=B(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ua,Ja.init(e,t)}),Qa=B(`$ZodCheckIncludes`,(e,t)=>{Wa.init(e,t);let n=Pi(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),$a=B(`$ZodCheckStartsWith`,(e,t)=>{Wa.init(e,t);let n=RegExp(`^${Pi(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),eo=B(`$ZodCheckEndsWith`,(e,t)=>{Wa.init(e,t);let n=RegExp(`.*${Pi(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),to=B(`$ZodCheckOverwrite`,(e,t)=>{Wa.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),no=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
11
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
12
|
+
`))}},ro={major:4,minor:4,patch:3},io=B(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ro;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Wi(e),i;for(let a of t){if(a._zod.def.when){if(Gi(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new hi;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Wi(e,t))});else{if(e.issues.length===t)continue;r||=Wi(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Wi(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new hi;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new hi;return o.then(e=>t(e,r,a))}return t(o,r,a)}}V(e,`~standard`,()=>({validate:t=>{try{let n=aa(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return sa(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),ao=B(`$ZodString`,(e,t)=>{io.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Va(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),W=B(`$ZodStringFormat`,(e,t)=>{Ja.init(e,t),ao.init(e,t)}),oo=B(`$ZodGUID`,(e,t)=>{t.pattern??=Ca,W.init(e,t)}),so=B(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=wa(e)}else t.pattern??=wa();W.init(e,t)}),G=B(`$ZodEmail`,(e,t)=>{t.pattern??=Ta,W.init(e,t)}),co=B(`$ZodURL`,(e,t)=>{W.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Pa.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),lo=B(`$ZodEmoji`,(e,t)=>{t.pattern??=Da(),W.init(e,t)}),uo=B(`$ZodNanoID`,(e,t)=>{t.pattern??=xa,W.init(e,t)}),fo=B(`$ZodCUID`,(e,t)=>{t.pattern??=ga,W.init(e,t)}),po=B(`$ZodCUID2`,(e,t)=>{t.pattern??=_a,W.init(e,t)}),mo=B(`$ZodULID`,(e,t)=>{t.pattern??=va,W.init(e,t)}),ho=B(`$ZodXID`,(e,t)=>{t.pattern??=ya,W.init(e,t)}),go=B(`$ZodKSUID`,(e,t)=>{t.pattern??=ba,W.init(e,t)}),_o=B(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ba(t),W.init(e,t)}),vo=B(`$ZodISODate`,(e,t)=>{t.pattern??=La,W.init(e,t)}),yo=B(`$ZodISOTime`,(e,t)=>{t.pattern??=za(t),W.init(e,t)}),bo=B(`$ZodISODuration`,(e,t)=>{t.pattern??=Sa,W.init(e,t)}),xo=B(`$ZodIPv4`,(e,t)=>{t.pattern??=Oa,W.init(e,t),e._zod.bag.format=`ipv4`}),So=B(`$ZodIPv6`,(e,t)=>{t.pattern??=ka,W.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Co=B(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Aa,W.init(e,t)}),wo=B(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ja,W.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function To(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Eo=B(`$ZodBase64`,(e,t)=>{t.pattern??=Ma,W.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{To(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Do(e){if(!Na.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return To(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Oo=B(`$ZodBase64URL`,(e,t)=>{t.pattern??=Na,W.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Do(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ko=B(`$ZodE164`,(e,t)=>{t.pattern??=Fa,W.init(e,t)});function Ao(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var jo=B(`$ZodJWT`,(e,t)=>{W.init(e,t),e._zod.check=n=>{Ao(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Mo=B(`$ZodUnknown`,(e,t)=>{io.init(e,t),e._zod.parse=e=>e}),No=B(`$ZodNever`,(e,t)=>{io.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Po(e,t,n){e.issues.length&&t.issues.push(...Ki(n,e.issues)),t.value[n]=e.value}var Fo=B(`$ZodArray`,(e,t)=>{io.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Po(t,n,e))):Po(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Io(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Ki(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Lo(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Ii(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ro(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Io(e,n,i,t,u,d))):Io(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var zo=B(`$ZodObject`,(e,t)=>{if(io.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=xi(()=>Lo(t));V(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Ai,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Io(n,t,e,s,r,i))):Io(a,t,e,s,r,i)}return i?Ro(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Bo=B(`$ZodObjectJIT`,(e,t)=>{zo.init(e,t);let n=e._zod.parse,r=xi(()=>Lo(t)),i=e=>{let t=new no([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Di(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=Di(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
13
|
+
if (${n}.issues.length) {
|
|
14
|
+
if (${o} in input) {
|
|
15
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
16
|
+
...iss,
|
|
17
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
18
|
+
})));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (${n}.value === undefined) {
|
|
23
|
+
if (${o} in input) {
|
|
24
|
+
newResult[${o}] = undefined;
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
newResult[${o}] = ${n}.value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
`):c?t.write(`
|
|
31
|
+
if (${n}.issues.length) {
|
|
32
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
33
|
+
...iss,
|
|
34
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
35
|
+
})));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (${n}.value === undefined) {
|
|
39
|
+
if (${o} in input) {
|
|
40
|
+
newResult[${o}] = undefined;
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
newResult[${o}] = ${n}.value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
`):t.write(`
|
|
47
|
+
const ${n}_present = ${o} in input;
|
|
48
|
+
if (${n}.issues.length) {
|
|
49
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
50
|
+
...iss,
|
|
51
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
52
|
+
})));
|
|
53
|
+
}
|
|
54
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
55
|
+
payload.issues.push({
|
|
56
|
+
code: "invalid_type",
|
|
57
|
+
expected: "nonoptional",
|
|
58
|
+
input: undefined,
|
|
59
|
+
path: [${o}]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (${n}_present) {
|
|
64
|
+
if (${n}.value === undefined) {
|
|
65
|
+
newResult[${o}] = undefined;
|
|
66
|
+
} else {
|
|
67
|
+
newResult[${o}] = ${n}.value;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Ai,s=!_i.jitless,c=s&&ji.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Ro([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Vo(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Wi(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Ji(e,r,vi())))}),t)}var Ho=B(`$ZodUnion`,(e,t)=>{io.init(e,t),V(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),V(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),V(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),V(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ci(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Vo(t,r,e,i)):Vo(o,r,e,i)}}),Uo=B(`$ZodIntersection`,(e,t)=>{io.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Go(e,t,n)):Go(e,i,a)}});function Wo(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(H(e)&&H(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Wo(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Wo(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Go(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Wi(e))return e;let o=Wo(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Ko=B(`$ZodEnum`,(e,t)=>{io.init(e,t);let n=yi(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Ni.has(typeof e)).map(e=>typeof e==`string`?Pi(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),qo=B(`$ZodTransform`,(e,t)=>{io.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new gi(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new hi;return n.value=i,n.fallback=!0,n}});function Jo(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Yo=B(`$ZodOptional`,(e,t)=>{io.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,V(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ci(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Jo(e,r)):Jo(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Xo=B(`$ZodExactOptional`,(e,t)=>{Yo.init(e,t),V(e._zod,`values`,()=>t.innerType._zod.values),V(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Zo=B(`$ZodNullable`,(e,t)=>{io.init(e,t),V(e._zod,`optin`,()=>t.innerType._zod.optin),V(e._zod,`optout`,()=>t.innerType._zod.optout),V(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ci(e.source)}|null)$`):void 0}),V(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Qo=B(`$ZodDefault`,(e,t)=>{io.init(e,t),e._zod.optin=`optional`,V(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>$o(e,t)):$o(r,t)}});function $o(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var es=B(`$ZodPrefault`,(e,t)=>{io.init(e,t),e._zod.optin=`optional`,V(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ts=B(`$ZodNonOptional`,(e,t)=>{io.init(e,t),V(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ns(t,e)):ns(i,e)}});function ns(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var rs=B(`$ZodCatch`,(e,t)=>{io.init(e,t),e._zod.optin=`optional`,V(e._zod,`optout`,()=>t.innerType._zod.optout),V(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Ji(e,n,vi()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Ji(e,n,vi()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),is=B(`$ZodPipe`,(e,t)=>{io.init(e,t),V(e._zod,`values`,()=>t.in._zod.values),V(e._zod,`optin`,()=>t.in._zod.optin),V(e._zod,`optout`,()=>t.out._zod.optout),V(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>as(e,t.in,n)):as(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>as(e,t.out,n)):as(r,t.out,n)}});function as(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var os=B(`$ZodReadonly`,(e,t)=>{io.init(e,t),V(e._zod,`propValues`,()=>t.innerType._zod.propValues),V(e._zod,`values`,()=>t.innerType._zod.values),V(e._zod,`optin`,()=>t.innerType?._zod?.optin),V(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(ss):ss(r)}});function ss(e){return e.value=Object.freeze(e.value),e}var cs=B(`$ZodCustom`,(e,t)=>{Wa.init(e,t),io.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>ls(t,n,r,e));ls(i,n,r,e)}});function ls(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Xi(e))}}var us,ds=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function fs(){return new ds}(us=globalThis).__zod_globalRegistry??(us.__zod_globalRegistry=fs());var ps=globalThis.__zod_globalRegistry;function ms(e,t){return new e({type:`string`,...U(t)})}function hs(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...U(t)})}function gs(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...U(t)})}function _s(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...U(t)})}function vs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...U(t)})}function ys(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...U(t)})}function bs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...U(t)})}function xs(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...U(t)})}function Ss(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...U(t)})}function Cs(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...U(t)})}function ws(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...U(t)})}function Ts(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...U(t)})}function Es(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...U(t)})}function Ds(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...U(t)})}function Os(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...U(t)})}function ks(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...U(t)})}function As(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...U(t)})}function js(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...U(t)})}function Ms(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...U(t)})}function Ns(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...U(t)})}function Ps(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...U(t)})}function Fs(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...U(t)})}function Is(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...U(t)})}function Ls(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...U(t)})}function Rs(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...U(t)})}function zs(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...U(t)})}function Bs(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...U(t)})}function Vs(e){return new e({type:`unknown`})}function Hs(e,t){return new e({type:`never`,...U(t)})}function Us(e,t){return new Ga({check:`max_length`,...U(t),maximum:e})}function Ws(e,t){return new Ka({check:`min_length`,...U(t),minimum:e})}function Gs(e,t){return new qa({check:`length_equals`,...U(t),length:e})}function Ks(e,t){return new Ya({check:`string_format`,format:`regex`,...U(t),pattern:e})}function qs(e){return new Xa({check:`string_format`,format:`lowercase`,...U(e)})}function Js(e){return new Za({check:`string_format`,format:`uppercase`,...U(e)})}function Ys(e,t){return new Qa({check:`string_format`,format:`includes`,...U(t),includes:e})}function Xs(e,t){return new $a({check:`string_format`,format:`starts_with`,...U(t),prefix:e})}function Zs(e,t){return new eo({check:`string_format`,format:`ends_with`,...U(t),suffix:e})}function Qs(e){return new to({check:`overwrite`,tx:e})}function $s(e){return Qs(t=>t.normalize(e))}function ec(){return Qs(e=>e.trim())}function tc(){return Qs(e=>e.toLowerCase())}function nc(){return Qs(e=>e.toUpperCase())}function rc(){return Qs(e=>Oi(e))}function ic(e,t,n){return new e({type:`array`,element:t,...U(n)})}function ac(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...U(n)})}function oc(e,t){let n=sc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Xi(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Xi(r))}},e(t.value,t)),t);return n}function sc(e,t){let n=new Wa({check:`custom`,...U(t)});return n._zod.check=e,n}function cc(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??ps,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function lc(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,lc(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&fc(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function uc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
72
|
+
|
|
73
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function dc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:mc(t,`input`,e.processors),output:mc(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function fc(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return fc(r.element,n);if(r.type===`set`)return fc(r.valueType,n);if(r.type===`lazy`)return fc(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return fc(r.innerType,n);if(r.type===`intersection`)return fc(r.left,n)||fc(r.right,n);if(r.type===`record`||r.type===`map`)return fc(r.keyType,n)||fc(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:fc(r.in,n)||fc(r.out,n);if(r.type===`object`){for(let e in r.shape)if(fc(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(fc(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(fc(e,n))return!0;return!!(r.rest&&fc(r.rest,n))}return!1}var pc=(e,t={})=>n=>{let r=cc({...n,processors:t});return lc(e,r),uc(r,e),dc(r,e)},mc=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=cc({...i??{},target:a,io:t,processors:n});return lc(e,o),uc(o,e),dc(o,e)},hc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},gc=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=hc[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},_c=(e,t,n,r)=>{n.not={}},vc=(e,t,n,r)=>{let i=e._zod.def,a=yi(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},yc=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},bc=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},xc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=lc(a.element,t,{...r,path:[...r.path,`items`]})},Sc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=lc(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=lc(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Cc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>lc(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},wc=(e,t,n,r)=>{let i=e._zod.def,a=lc(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=lc(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Tc=(e,t,n,r)=>{let i=e._zod.def,a=lc(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ec=(e,t,n,r)=>{let i=e._zod.def;lc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Dc=(e,t,n,r)=>{let i=e._zod.def;lc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Oc=(e,t,n,r)=>{let i=e._zod.def;lc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},kc=(e,t,n,r)=>{let i=e._zod.def;lc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ac=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;lc(o,t,r);let s=t.seen.get(e);s.ref=o},jc=(e,t,n,r)=>{let i=e._zod.def;lc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Mc=(e,t,n,r)=>{let i=e._zod.def;lc(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Nc=B(`ZodISODateTime`,(e,t)=>{_o.init(e,t),ol.init(e,t)});function Pc(e){return Ls(Nc,e)}var Fc=B(`ZodISODate`,(e,t)=>{vo.init(e,t),ol.init(e,t)});function Ic(e){return Rs(Fc,e)}var Lc=B(`ZodISOTime`,(e,t)=>{yo.init(e,t),ol.init(e,t)});function Rc(e){return zs(Lc,e)}var zc=B(`ZodISODuration`,(e,t)=>{bo.init(e,t),ol.init(e,t)});function Bc(e){return Bs(zc,e)}var Vc=B(`ZodError`,(e,t)=>{Qi.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ta(e,t)},flatten:{value:t=>ea(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,bi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,bi,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Hc=na(Vc),Uc=ra(Vc),Wc=ia(Vc),Gc=oa(Vc),Kc=ca(Vc),qc=la(Vc),Jc=ua(Vc),Yc=da(Vc),Xc=fa(Vc),Zc=pa(Vc),Qc=ma(Vc),$c=ha(Vc),el=new WeakMap;function tl(e,t,n){let r=Object.getPrototypeOf(e),i=el.get(r);if(i||(i=new Set,el.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var nl=B(`ZodType`,(e,t)=>(io.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:mc(e,`input`),output:mc(e,`output`)}}),e.toJSONSchema=pc(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>Hc(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Wc(e,t,n),e.parseAsync=async(t,n)=>Uc(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Gc(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Kc(e,t,n),e.decode=(t,n)=>qc(e,t,n),e.encodeAsync=async(t,n)=>Jc(e,t,n),e.decodeAsync=async(t,n)=>Yc(e,t,n),e.safeEncode=(t,n)=>Xc(e,t,n),e.safeDecode=(t,n)=>Zc(e,t,n),e.safeEncodeAsync=async(t,n)=>Qc(e,t,n),e.safeDecodeAsync=async(t,n)=>$c(e,t,n),tl(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Ei(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Fi(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(ru(e,t))},superRefine(e,t){return this.check(iu(e,t))},overwrite(e){return this.check(Qs(e))},optional(){return Y(this)},exactOptional(){return Vl(this)},nullable(){return Ul(this)},nullish(){return Y(Ul(this))},nonoptional(e){return Yl(this,e)},array(){return jl(this)},or(e){return Fl([this,e])},and(e){return Ll(this,e)},transform(e){return $l(this,q(e))},default(e){return Gl(this,e)},prefault(e){return ql(this,e)},catch(e){return Zl(this,e)},pipe(e){return $l(this,e)},readonly(){return tu(this)},describe(e){let t=this.clone();return ps.add(t,{description:e}),t},meta(...e){if(e.length===0)return ps.get(this);let t=this.clone();return ps.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return ps.get(e)?.description},configurable:!0}),e)),rl=B(`_ZodString`,(e,t)=>{ao.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gc(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,tl(e,`_ZodString`,{regex(...e){return this.check(Ks(...e))},includes(...e){return this.check(Ys(...e))},startsWith(...e){return this.check(Xs(...e))},endsWith(...e){return this.check(Zs(...e))},min(...e){return this.check(Ws(...e))},max(...e){return this.check(Us(...e))},length(...e){return this.check(Gs(...e))},nonempty(...e){return this.check(Ws(1,...e))},lowercase(e){return this.check(qs(e))},uppercase(e){return this.check(Js(e))},trim(){return this.check(ec())},normalize(...e){return this.check($s(...e))},toLowerCase(){return this.check(tc())},toUpperCase(){return this.check(nc())},slugify(){return this.check(rc())}})}),il=B(`ZodString`,(e,t)=>{ao.init(e,t),rl.init(e,t),e.email=t=>e.check(hs(sl,t)),e.url=t=>e.check(xs(ul,t)),e.jwt=t=>e.check(Is(Tl,t)),e.emoji=t=>e.check(Ss(dl,t)),e.guid=t=>e.check(gs(cl,t)),e.uuid=t=>e.check(_s(ll,t)),e.uuidv4=t=>e.check(vs(ll,t)),e.uuidv6=t=>e.check(ys(ll,t)),e.uuidv7=t=>e.check(bs(ll,t)),e.nanoid=t=>e.check(Cs(fl,t)),e.guid=t=>e.check(gs(cl,t)),e.cuid=t=>e.check(ws(pl,t)),e.cuid2=t=>e.check(Ts(ml,t)),e.ulid=t=>e.check(Es(hl,t)),e.base64=t=>e.check(Ns(Sl,t)),e.base64url=t=>e.check(Ps(Cl,t)),e.xid=t=>e.check(Ds(gl,t)),e.ksuid=t=>e.check(Os(_l,t)),e.ipv4=t=>e.check(ks(vl,t)),e.ipv6=t=>e.check(As(yl,t)),e.cidrv4=t=>e.check(js(bl,t)),e.cidrv6=t=>e.check(Ms(xl,t)),e.e164=t=>e.check(Fs(wl,t)),e.datetime=t=>e.check(Pc(t)),e.date=t=>e.check(Ic(t)),e.time=t=>e.check(Rc(t)),e.duration=t=>e.check(Bc(t))});function al(e){return ms(il,e)}var ol=B(`ZodStringFormat`,(e,t)=>{W.init(e,t),rl.init(e,t)}),sl=B(`ZodEmail`,(e,t)=>{G.init(e,t),ol.init(e,t)}),cl=B(`ZodGUID`,(e,t)=>{oo.init(e,t),ol.init(e,t)}),ll=B(`ZodUUID`,(e,t)=>{so.init(e,t),ol.init(e,t)}),ul=B(`ZodURL`,(e,t)=>{co.init(e,t),ol.init(e,t)}),dl=B(`ZodEmoji`,(e,t)=>{lo.init(e,t),ol.init(e,t)}),fl=B(`ZodNanoID`,(e,t)=>{uo.init(e,t),ol.init(e,t)}),pl=B(`ZodCUID`,(e,t)=>{fo.init(e,t),ol.init(e,t)}),ml=B(`ZodCUID2`,(e,t)=>{po.init(e,t),ol.init(e,t)}),hl=B(`ZodULID`,(e,t)=>{mo.init(e,t),ol.init(e,t)}),gl=B(`ZodXID`,(e,t)=>{ho.init(e,t),ol.init(e,t)}),_l=B(`ZodKSUID`,(e,t)=>{go.init(e,t),ol.init(e,t)}),vl=B(`ZodIPv4`,(e,t)=>{xo.init(e,t),ol.init(e,t)}),yl=B(`ZodIPv6`,(e,t)=>{So.init(e,t),ol.init(e,t)}),bl=B(`ZodCIDRv4`,(e,t)=>{Co.init(e,t),ol.init(e,t)}),xl=B(`ZodCIDRv6`,(e,t)=>{wo.init(e,t),ol.init(e,t)}),Sl=B(`ZodBase64`,(e,t)=>{Eo.init(e,t),ol.init(e,t)}),Cl=B(`ZodBase64URL`,(e,t)=>{Oo.init(e,t),ol.init(e,t)}),wl=B(`ZodE164`,(e,t)=>{ko.init(e,t),ol.init(e,t)}),Tl=B(`ZodJWT`,(e,t)=>{jo.init(e,t),ol.init(e,t)}),El=B(`ZodUnknown`,(e,t)=>{Mo.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Dl(){return Vs(El)}var Ol=B(`ZodNever`,(e,t)=>{No.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_c(e,t,n,r)});function kl(e){return Hs(Ol,e)}var Al=B(`ZodArray`,(e,t)=>{Fo.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xc(e,t,n,r),e.element=t.element,tl(e,`ZodArray`,{min(e,t){return this.check(Ws(e,t))},nonempty(e){return this.check(Ws(1,e))},max(e,t){return this.check(Us(e,t))},length(e,t){return this.check(Gs(e,t))},unwrap(){return this.element}})});function jl(e,t){return ic(Al,e,t)}var Ml=B(`ZodObject`,(e,t)=>{Bo.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sc(e,t,n,r),V(e,`shape`,()=>t.shape),tl(e,`ZodObject`,{keyof(){return K(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Dl()})},loose(){return this.clone({...this._zod.def,catchall:Dl()})},strict(){return this.clone({...this._zod.def,catchall:kl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return zi(this,e)},safeExtend(e){return Bi(this,e)},merge(e){return Vi(this,e)},pick(e){return Li(this,e)},omit(e){return Ri(this,e)},partial(...e){return Hi(J,this,e[0])},required(...e){return Ui(Jl,this,e[0])}})});function Nl(e,t){return new Ml({type:`object`,shape:e??{},...U(t)})}var Pl=B(`ZodUnion`,(e,t)=>{Ho.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cc(e,t,n,r),e.options=t.options});function Fl(e,t){return new Pl({type:`union`,options:e,...U(t)})}var Il=B(`ZodIntersection`,(e,t)=>{Uo.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wc(e,t,n,r)});function Ll(e,t){return new Il({type:`intersection`,left:e,right:t})}var Rl=B(`ZodEnum`,(e,t)=>{Ko.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vc(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Rl({...t,checks:[],...U(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Rl({...t,checks:[],...U(r),entries:i})}});function K(e,t){return new Rl({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...U(t)})}var zl=B(`ZodTransform`,(e,t)=>{qo.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new gi(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Xi(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Xi(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function q(e){return new zl({type:`transform`,transform:e})}var J=B(`ZodOptional`,(e,t)=>{Yo.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Y(e){return new J({type:`optional`,innerType:e})}var Bl=B(`ZodExactOptional`,(e,t)=>{Xo.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vl(e){return new Bl({type:`optional`,innerType:e})}var Hl=B(`ZodNullable`,(e,t)=>{Zo.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ul(e){return new Hl({type:`nullable`,innerType:e})}var Wl=B(`ZodDefault`,(e,t)=>{Qo.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Gl(e,t){return new Wl({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Mi(t)}})}var Kl=B(`ZodPrefault`,(e,t)=>{es.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ql(e,t){return new Kl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Mi(t)}})}var Jl=B(`ZodNonOptional`,(e,t)=>{ts.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ec(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Yl(e,t){return new Jl({type:`nonoptional`,innerType:e,...U(t)})}var Xl=B(`ZodCatch`,(e,t)=>{rs.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Zl(e,t){return new Xl({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Ql=B(`ZodPipe`,(e,t)=>{is.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ac(e,t,n,r),e.in=t.in,e.out=t.out});function $l(e,t){return new Ql({type:`pipe`,in:e,out:t})}var eu=B(`ZodReadonly`,(e,t)=>{os.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tu(e){return new eu({type:`readonly`,innerType:e})}var nu=B(`ZodCustom`,(e,t)=>{cs.init(e,t),nl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yc(e,t,n,r)});function ru(e,t={}){return ac(nu,e,t)}function iu(e,t){return oc(e,t)}e(((e,t)=>{t.exports={}}))();var au=Symbol.for(`yaml.alias`),ou=Symbol.for(`yaml.document`),su=Symbol.for(`yaml.map`),cu=Symbol.for(`yaml.pair`),lu=Symbol.for(`yaml.scalar`),uu=Symbol.for(`yaml.seq`),du=Symbol.for(`yaml.node.type`),fu=e=>!!e&&typeof e==`object`&&e[du]===au,pu=e=>!!e&&typeof e==`object`&&e[du]===ou,mu=e=>!!e&&typeof e==`object`&&e[du]===su,hu=e=>!!e&&typeof e==`object`&&e[du]===cu,X=e=>!!e&&typeof e==`object`&&e[du]===lu,gu=e=>!!e&&typeof e==`object`&&e[du]===uu;function _u(e){if(e&&typeof e==`object`)switch(e[du]){case su:case uu:return!0}return!1}function vu(e){if(e&&typeof e==`object`)switch(e[du]){case au:case su:case lu:case uu:return!0}return!1}var yu=e=>(X(e)||_u(e))&&!!e.anchor,bu=Symbol(`break visit`),xu=Symbol(`skip children`),Su=Symbol(`remove node`);function Cu(e,t){let n=Du(t);pu(e)?wu(null,e.contents,n,Object.freeze([e]))===Su&&(e.contents=null):wu(null,e,n,Object.freeze([]))}Cu.BREAK=bu,Cu.SKIP=xu,Cu.REMOVE=Su;function wu(e,t,n,r){let i=Ou(e,t,n,r);if(vu(i)||hu(i))return ku(e,r,i),wu(e,i,n,r);if(typeof i!=`symbol`){if(_u(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=wu(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===bu)return bu;else i===Su&&(t.items.splice(e,1),--e)}}else if(hu(t)){r=Object.freeze(r.concat(t));let e=wu(`key`,t.key,n,r);if(e===bu)return bu;e===Su&&(t.key=null);let i=wu(`value`,t.value,n,r);if(i===bu)return bu;i===Su&&(t.value=null)}}return i}async function Tu(e,t){let n=Du(t);pu(e)?await Eu(null,e.contents,n,Object.freeze([e]))===Su&&(e.contents=null):await Eu(null,e,n,Object.freeze([]))}Tu.BREAK=bu,Tu.SKIP=xu,Tu.REMOVE=Su;async function Eu(e,t,n,r){let i=await Ou(e,t,n,r);if(vu(i)||hu(i))return ku(e,r,i),Eu(e,i,n,r);if(typeof i!=`symbol`){if(_u(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await Eu(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===bu)return bu;else i===Su&&(t.items.splice(e,1),--e)}}else if(hu(t)){r=Object.freeze(r.concat(t));let e=await Eu(`key`,t.key,n,r);if(e===bu)return bu;e===Su&&(t.key=null);let i=await Eu(`value`,t.value,n,r);if(i===bu)return bu;i===Su&&(t.value=null)}}return i}function Du(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function Ou(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(mu(t))return n.Map?.(e,t,r);if(gu(t))return n.Seq?.(e,t,r);if(hu(t))return n.Pair?.(e,t,r);if(X(t))return n.Scalar?.(e,t,r);if(fu(t))return n.Alias?.(e,t,r)}function ku(e,t,n){let r=t[t.length-1];if(_u(r))r.items[e]=n;else if(hu(r))e===`key`?r.key=n:r.value=n;else if(pu(r))r.contents=n;else{let e=fu(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Au={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},ju=e=>e.replace(/[!,[\]{}]/g,e=>Au[e]),Mu=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ju(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&vu(e.contents)){let t={};Cu(e.contents,(e,n)=>{vu(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
74
|
+
`)}};Mu.defaultYaml={explicit:!1,version:`1.2`},Mu.defaultTags={"!!":`tag:yaml.org,2002:`};function Nu(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Pu(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Pu(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Pu(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Pu(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Pu(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function Fu(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Fu(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!yu(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Iu=class{constructor(e){Object.defineProperty(this,du,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!pu(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=Fu(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Pu(i,{"":o},``,o):o}},Lu=class extends Iu{constructor(e){super(au),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Cu(e,{Node:(e,t)=>{(fu(t)||yu(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(Fu(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Ru(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Nu(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Ru(e,t,n){if(fu(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(_u(t)){let r=0;for(let i of t.items){let t=Ru(e,i,n);t>r&&(r=t)}return r}else if(hu(t)){let r=Ru(e,t.key,n),i=Ru(e,t.value,n);return Math.max(r,i)}return 1}var zu=e=>!e||typeof e!=`function`&&typeof e!=`object`,Bu=class extends Iu{constructor(e){super(lu),this.value=e}toJSON(e,t){return t?.keep?this.value:Fu(this.value,e,t)}toString(){return String(this.value)}};Bu.BLOCK_FOLDED=`BLOCK_FOLDED`,Bu.BLOCK_LITERAL=`BLOCK_LITERAL`,Bu.PLAIN=`PLAIN`,Bu.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Bu.QUOTE_SINGLE=`QUOTE_SINGLE`;var Vu=`tag:yaml.org,2002:`;function Hu(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function Uu(e,t,n){if(pu(e)&&(e=e.contents),vu(e))return e;if(hu(e)){let t=n.schema[su].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new Lu(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=Vu+t.slice(2));let l=Hu(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new Bu(e);return c&&(c.node=t),t}l=e instanceof Map?o[su]:Symbol.iterator in Object(e)?o[uu]:o[su]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new Bu(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Wu(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Uu(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Z=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Gu=class extends Iu{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>vu(t)||hu(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Z(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(_u(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Wu(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(_u(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&X(i)?i.value:i:_u(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!hu(t))return!1;let n=t.value;return n==null||e&&X(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return _u(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(_u(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Wu(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Ku=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function qu(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Ju=(e,t,n)=>e.endsWith(`
|
|
75
|
+
`)?qu(n,t):n.includes(`
|
|
76
|
+
`)?`
|
|
77
|
+
`+qu(n,t):(e.endsWith(` `)?``:` `)+n,Yu=`flow`,Xu=`block`,Zu=`quoted`;function Qu(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=$u(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
78
|
+
`)n===`block`&&(h=$u(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
79
|
+
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
80
|
+
`&&t!==` `&&(f=h)}if(h>=d)if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function $u(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
81
|
+
`);r=t,i=t+1,a=e[i]}return r}var ed=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),td=e=>/^(%|---|\.\.\.)/m.test(e);function nd(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
82
|
+
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function rd(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(td(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
83
|
+
|
|
84
|
+
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
85
|
+
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:Qu(o,a,Zu,ed(t,!1))}function id(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
86
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return rd(e,t);let n=t.indent||(td(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:Qu(r,n,Yu,ed(t,!1))}function ad(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=rd;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?id:i&&!t?rd:n?id:rd}return r(e,t)}var od;try{od=RegExp(`(^|(?<!
|
|
87
|
+
))
|
|
88
|
+
+(?!
|
|
89
|
+
|$)`,`g`)}catch{od=/\n+(?!\n|$)/g}function sd({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return ad(n,r);let l=r.indent||(r.forceBlockIndent||td(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===Bu.BLOCK_FOLDED?!1:t===Bu.BLOCK_LITERAL?!0:!nd(n,c,l.length);if(!n)return u?`|
|
|
90
|
+
`:`>
|
|
91
|
+
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
92
|
+
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
93
|
+
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
94
|
+
`&&(p=p.slice(0,-1)),p.replace(od,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
95
|
+
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
96
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=ed(r,!0);o!==`folded`&&t!==Bu.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=Qu(`${v}${e}${p}`,l,Xu,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function cd(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
97
|
+
`)||u&&/[[\]{},]/.test(a))return ad(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
98
|
+
`)?ad(a,t):sd(e,t,n,r);if(!s&&!u&&i!==Bu.PLAIN&&a.includes(`
|
|
99
|
+
`))return sd(e,t,n,r);if(td(a)){if(c===``)return t.forceBlockIndent=!0,sd(e,t,n,r);if(s&&c===l)return ad(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return ad(a,t)}return s?d:Qu(d,c,Yu,ed(t,!1))}function ld(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==Bu.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=Bu.QUOTE_DOUBLE);let c=e=>{switch(e){case Bu.BLOCK_FOLDED:case Bu.BLOCK_LITERAL:return i||a?ad(o.value,t):sd(o,t,n,r);case Bu.QUOTE_DOUBLE:return rd(o.value,t);case Bu.QUOTE_SINGLE:return id(o.value,t);case Bu.PLAIN:return cd(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function ud(e,t){let n=Object.assign({blockQuote:!0,commentString:Ku,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function dd(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(X(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function fd(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(X(e)||_u(e))&&e.anchor;a&&Nu(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function pd(e,t,n,r){if(hu(e))return e.toString(t,n,r);if(fu(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=vu(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=dd(t.doc.schema.tags,a);let o=fd(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):X(a)?ld(a,t,n,r):a.toString(t,n,r);return o?X(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function md({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=vu(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(_u(e)||!vu(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||_u(e)||(X(e)?e.type===Bu.BLOCK_FOLDED||e.type===Bu.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=pd(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=Ju(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=Ju(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=Ju(g,n.indent,l(f))));let _,v,y;vu(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&X(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&gu(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=pd(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
|
100
|
+
`:``,v){let e=l(v);S+=`\n${qu(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|
101
|
+
`&&y&&(S=`
|
|
102
|
+
|
|
103
|
+
`):S+=`\n${n.indent}`}else if(!p&&_u(t)){let e=x[0],r=x.indexOf(`
|
|
104
|
+
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else (x===``||x[0]===`
|
|
105
|
+
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=Ju(g,n.indent,l(y)):h&&i&&i(),g}function hd(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var gd=`<<`,_d={identify:e=>e===gd||typeof e==`symbol`&&e.description===gd,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new Bu(Symbol(gd)),{addToJSMap:yd}),stringify:()=>gd},vd=(e,t)=>(_d.identify(t)||X(t)&&(!t.type||t.type===Bu.PLAIN)&&_d.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===_d.tag&&e.default);function yd(e,t,n){let r=bd(e,n);if(gu(r))for(let n of r.items)Q(e,t,n);else if(Array.isArray(r))for(let n of r)Q(e,t,n);else Q(e,t,r)}function Q(e,t,n){let r=bd(e,n);if(!mu(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function bd(e,t){return e&&fu(t)?t.resolve(e.doc,e):t}function xd(e,t,{key:n,value:r}){if(vu(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(vd(e,n))yd(e,t,r);else{let i=Fu(n,``,e);if(t instanceof Map)t.set(i,Fu(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Sd(n,i,e),o=Fu(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Sd(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(vu(e)&&n?.doc){let t=ud(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),hd(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Cd(e,t,n){return new wd(Uu(e,void 0,n),Uu(t,void 0,n))}var wd=class e{constructor(e,t=null){Object.defineProperty(this,du,{value:cu}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return vu(n)&&(n=n.clone(t)),vu(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return xd(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?md(this,e,t,n):JSON.stringify(this)}};function Td(e,t,n){return(t.inFlow??e.flow?Dd:Ed)(e,t,n)}function Ed({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(vu(i))!d&&i.spaceBefore&&f.push(``),Od(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(hu(i)){let e=vu(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Od(n,f,e.commentBefore,d))}d=!1;let s=pd(i,u,()=>o=null,()=>d=!0);o&&(s+=Ju(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
106
|
+
`}}return e?(p+=`
|
|
107
|
+
`+qu(l(e),c),s&&s()):d&&o&&o(),p}function Dd({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(vu(i))i.spaceBefore&&d.push(``),Od(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(hu(i)){let e=vu(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Od(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=vu(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=pd(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
108
|
+
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=Ju(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
109
|
+
`;return`${e}\n${i}${p}`}else return`${f}${o}${d.join(` `)}${o}${p}`}function Od({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=qu(t(r),e);n.push(i.trimStart())}}function kd(e,t){let n=X(t)?t.value:t;for(let r of e)if(hu(r)&&(r.key===t||r.key===n||X(r.key)&&r.key.value===n))return r}var Ad=class extends Gu{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(su,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(Cd(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=hu(e)?e:!e||typeof e!=`object`||!(`key`in e)?new wd(e,e?.value):new wd(e.key,e.value);let r=kd(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);X(r.value)&&zu(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=kd(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=kd(this.items,e)?.value;return(!t&&X(n)?n.value:n)??void 0}has(e){return!!kd(this.items,e)}set(e,t){this.add(new wd(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)xd(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!hu(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Td(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},jd={collection:`map`,default:!0,nodeClass:Ad,tag:`tag:yaml.org,2002:map`,resolve(e,t){return mu(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>Ad.from(e,t,n)},Md=class extends Gu{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(uu,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=$(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=$(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&X(r)?r.value:r}has(e){let t=$(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=$(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];X(r)&&zu(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(Fu(e,String(r++),t));return n}toString(e,t,n){return e?Td(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(Uu(a,void 0,n))}}return i}};function $(e){let t=X(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Nd={collection:`seq`,default:!0,nodeClass:Md,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return gu(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Md.from(e,t,n)};function Pd(e){return typeof e==`bigint`||Number.isInteger(e)}var Fd=({value:e})=>JSON.stringify(e),Id=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Fd},{identify:e=>e==null,createNode:()=>new Bu(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Fd},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Fd},{identify:Pd,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Pd(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Fd}];[jd,Nd].concat(Id,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}});function Ld(e,t,n){let{replacer:r}=n,i=new Md(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e))if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(Cd(o,s,n))}return i}var Rd=class e extends Md{constructor(){super(),this.add=Ad.prototype.add.bind(this),this.delete=Ad.prototype.delete.bind(this),this.get=Ad.prototype.get.bind(this),this.has=Ad.prototype.has.bind(this),this.set=Ad.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(hu(e)?(r=Fu(e.key,``,t),i=Fu(e.value,r,t)):r=Fu(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Ld(e,t,n),i=new this;return i.items=r.items,i}};Rd.tag=`tag:yaml.org,2002:omap`;var zd=class e extends Ad{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=hu(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new wd(e.key,null):new wd(e,null),kd(this.items,t.key)||this.items.push(t)}get(e,t){let n=kd(this.items,e);return!t&&hu(n)?X(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=kd(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new wd(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(Cd(e,null,n));return i}};zd.tag=`tag:yaml.org,2002:set`;var Bd=Symbol(`break visit`),Vd=Symbol(`skip children`),Hd=Symbol(`remove item`);function Ud(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Wd(Object.freeze([]),e,t)}Ud.BREAK=Bd,Ud.SKIP=Vd,Ud.REMOVE=Hd,Ud.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Ud.parentCollection=(e,t)=>{let n=Ud.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Wd(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Wd(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===Bd)return Bd;else r===Hd&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}var Gd={text(e){return{type:`text`,text:e}},imageUrl(e,t={}){let n={type:`image`,source:{type:`url`,url:e}};return t.detail!==void 0&&(n.detail=t.detail),n},imageBase64(e,t,n={}){let r={type:`image`,source:{type:`base64`,data:e,mediaType:t}};return n.detail!==void 0&&(r.detail=n.detail),r},documentUrl(e,t,n={}){return{type:`document`,source:n.filename===void 0?{type:`url`,url:e,mediaType:t}:{type:`url`,url:e,mediaType:t,filename:n.filename}}},documentBase64(e,t,n={}){return{type:`document`,source:n.filename===void 0?{type:`base64`,data:e,mediaType:t}:{type:`base64`,data:e,mediaType:t,filename:n.filename}}},documentText(e){return{type:`text`,text:e}}},Kd={toolResult(e,t,n){let r=typeof t==`string`?[{type:`text`,text:t}]:t;return n===void 0?{type:`tool_result`,id:e,content:r}:{type:`tool_result`,id:e,callId:n,content:r}}};function qd(e){if(typeof e==`string`)return e;try{let t=JSON.stringify(e);return t===void 0?String(e):t}catch{return String(e)}}function Jd(e){return Array.isArray(e)&&e.length>0&&e.every(e=>typeof e!=`object`||!e||!(`type`in e)?!1:e.type===`text`?`text`in e&&typeof e.text==`string`:e.type===`image`?`data`in e&&typeof e.data==`string`&&(!(`mediaType`in e)||e.mediaType===void 0||typeof e.mediaType==`string`):!1)}var Yd={text(e){return{type:`text`,text:e}},imageUrl(e,t={}){let n={type:`image`,source:{type:`url`,url:e}};return t.detail!==void 0&&(n.detail=t.detail),n},imageBase64(e,t,n={}){let r={type:`image`,source:{type:`base64`,data:e,mediaType:t}};return n.detail!==void 0&&(r.detail=n.detail),r},reasoning(e,t){return t===void 0?{type:`reasoning`,text:e}:{type:`reasoning`,text:e,id:t}},reasoningFromContent(e,t){let n={type:`reasoning`,text:Xd(e),content:e};return t===void 0?n:{...n,id:t}},reasoningSummary(e,t){return Yd.reasoningFromContent([{type:`summary`,text:e}],t)},reasoningEncrypted(e,t){return Yd.reasoningFromContent([{type:`encrypted`,data:e}],t)},reasoningRedacted(e,t){return Yd.reasoningFromContent([{type:`redacted`,data:e}],t)},toolCall(e,t,n,r){let i={type:`tool_call`,id:e,function:{name:t,arguments:n}};return r===void 0?i:{...i,callId:r}}};function Xd(e){let t=Array.isArray(e)?e:e.content;return t===void 0?Array.isArray(e)?``:e.text:t.flatMap(e=>e.type===`text`||e.type===`summary`?[e.text]:[]).join(``)}var Zd={system(e){return{role:`system`,content:e}},user(e){return{role:`user`,content:typeof e==`string`?[Gd.text(e)]:e}},assistant(e,t){let n=typeof e==`string`?[Yd.text(e)]:e;return t===void 0?{role:`assistant`,content:n}:{role:`assistant`,id:t,content:n}},tool(e){return{role:`tool`,content:Array.isArray(e)?e:[e]}},toolResult(e,t,n={}){let r=Jd(t)?t:qd(t);return Zd.tool(Kd.toolResult(e,r,n.callId))}};function Qd(e){let t=[];for(let n of e){let e=$d(n.parts);if(n.role===`system`){e.length>0&&t.push(Zd.system(e));continue}if(n.role===`user`){let e=[];for(let t of n.parts){if(t.type===`text`){e.push(Gd.text(t.text));continue}if(t.type===`data`&&tf(t.data)){e.push(t.data);continue}throw TypeError(`User UI messages can only be converted from text parts or image/document data parts.`)}e.length>0&&t.push(Zd.user(e));continue}if(n.role===`assistant`){let e=[],r=[];for(let t of n.parts){if(t.type===`text`&&t.text.length>0){e.push(Yd.text(t.text));continue}if(t.type===`reasoning`&&t.text.length>0){e.push(Yd.reasoning(t.text,t.reasoningId));continue}t.type===`tool`&&(t.state===`input-streaming`||t.state===`input-available`||t.state===`output-available`)&&(e.push(Yd.toolCall(t.toolCallId,t.toolName,t.input??{},t.callId)),t.state===`output-available`&&r.push(Kd.toolResult(t.toolCallId,ef(t.output),t.callId)))}e.length>0&&t.push(Zd.assistant(e,n.id)),r.length>0&&t.push(Zd.tool(r));continue}let r=[];for(let e of n.parts)e.type!==`tool`||e.state!==`output-available`||r.push(Kd.toolResult(e.toolCallId,ef(e.output),e.callId));r.length>0&&t.push(Zd.tool(r))}return t}function $d(e){return e.flatMap(e=>e.type===`text`?[e.text]:[]).join(``)}function ef(e){return[{type:`text`,text:qd(e??null)}]}function tf(e){return af(e)?e.type===`text`?typeof e.text==`string`:e.type===`image`?nf(e):e.type===`document`?rf(e):!1:!1}function nf(e){return af(e.source)?e.source.type===`url`?typeof e.source.url==`string`:e.source.type===`base64`?typeof e.source.data==`string`&&typeof e.source.mediaType==`string`:!1:!1}function rf(e){return af(e.source)?e.source.type===`url`?typeof e.source.url==`string`&&typeof e.source.mediaType==`string`:e.source.type===`base64`?typeof e.source.data==`string`&&typeof e.source.mediaType==`string`:e.source.type===`text`?typeof e.source.text==`string`&&(e.source.mediaType===void 0||typeof e.source.mediaType==`string`):!1:!1}function af(e){return typeof e==`object`&&!!e}Nl({thought:al().describe(`A thought to record while reasoning through a task.`)});async function*of(e){let t=e.getReader(),n=new TextDecoder,r=``;try{for(;;){let e=await t.read();if(e.done===!0)break;r+=n.decode(e.value,{stream:!0});let i=r.split(/\r?\n/);r=i.pop()??``;for(let e of i){let t=e.trim();t.length>0&&(yield JSON.parse(t))}}r+=n.decode();let e=r.trim();e.length>0&&(yield JSON.parse(e))}finally{t.releaseLock()}}async function*sf(e){let t=e.getReader(),n=new TextDecoder,r=``,i=cf();try{for(;;){let e=await t.read();if(e.done===!0)break;r+=n.decode(e.value,{stream:!0});let a=r.split(/\r?\n/);r=a.pop()??``;for(let e of a){let t=lf(e,i);i=t.event,t.complete===!0&&t.data!==void 0&&(yield JSON.parse(t.data))}}if(r+=n.decode(),r.length>0){let e=lf(r,i);i=e.event,e.complete===!0&&e.data!==void 0&&(yield JSON.parse(e.data))}let e=uf(i);e!==void 0&&(yield JSON.parse(e))}finally{t.releaseLock()}}function cf(){return{data:[]}}function lf(e,t){if(e===``){let e=uf(t);return e===void 0?{event:cf(),complete:!0}:{event:cf(),complete:!0,data:e}}if(e.startsWith(`:`))return{event:t};let n=e.indexOf(`:`),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n+1).replace(/^ /,``);return r===`data`&&t.data.push(i),{event:t}}function uf(e){if(e.data.length!==0)return e.data.join(`
|
|
110
|
+
`)}var df=class extends Error{constructor(e,t){super(`Event stream request failed with status ${e.status}`),this.response=e,this.body=t,this.name=`EventStreamHttpError`}response;body};async function*ff(e,t={}){let n=t.fetch??globalThis.fetch;if(n===void 0)throw Error(`fetchEventStream requires a fetch implementation`);let r=await n(e,pf(t));if(!r.ok)throw new df(r,await r.text());if(r.body===null)throw Error(`Event stream response does not include a body`);if((t.format??mf(r.headers.get(`content-type`)))===`sse`){yield*sf(r.body);return}yield*of(r.body)}function pf(e){let{format:t,fetch:n,...r}=e;return r}function mf(e){return e?.toLowerCase().includes(`text/event-stream`)?`sse`:`jsonl`}function hf(e){if(Ef(e)&&!(e.type!==`tool_approval_request`&&e.type!==`tool_approval_result`))return wf(e.approval)?e.approval:void 0}function gf(e){if(Ef(e)&&!(e.type!==`tool_question_request`&&e.type!==`tool_question_result`))return Tf(e.question)?e.question:void 0}async function _f(e,t){let n=bf(t.endpoint,`decideApproval`),r=t.fetch??globalThis.fetch;if(r===void 0)throw Error(`humanInput approval decisions require a fetch implementation`);let i=await r(xf(n,`approvals/${e.approvalId}/decision`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({approved:e.approved,...e.reason===void 0?{}:{reason:e.reason}})});if(!i.ok)throw Error(`Tool approval decision failed with status ${i.status}`);return Cf(i)}async function vf(e,t){let n=bf(t.endpoint,`answerQuestion`),r=t.fetch??globalThis.fetch;if(r===void 0)throw Error(`humanInput question answers require a fetch implementation`);let i=await r(xf(n,`questions/${e.questionId}/answer`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({answers:e.answers})});if(!i.ok)throw Error(`Tool question answer failed with status ${i.status}`);return Cf(i)}function yf(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return[...e,t];let r=[...e];return r[n]=t,r}function bf(e,t){if(e===void 0)throw Error(`humanInput.${t} requires endpoint or a custom handler`);return e}function xf(e,t){let n=t.replace(/^\/+/,``);if(e instanceof URL){let t=new URL(e.toString());return t.pathname=Sf(t.pathname,n),t}if(/^[a-z][a-z\d+\-.]*:\/\//i.test(e)){let t=new URL(e);return t.pathname=Sf(t.pathname,n),t.toString()}return Sf(e,n)}function Sf(e,t){let n=e.replace(/\/+$/,``),r=t.replace(/^\/+/,``);return n.length===0?`/${r}`:`${n}/${r}`}async function Cf(e){let t=await e.text();if(t.trim().length!==0)return JSON.parse(t)}function wf(e){return Ef(e)&&typeof e.id==`string`&&typeof e.toolName==`string`&&typeof e.status==`string`}function Tf(e){return Ef(e)&&typeof e.id==`string`&&typeof e.toolName==`string`&&typeof e.status==`string`&&Array.isArray(e.questions)}function Ef(e){return typeof e==`object`&&!!e}function Df(e){return{async*send(t,n={}){let r=typeof e.endpoint==`function`?e.endpoint(t):e.endpoint,i=Mf(await kf(e.headers,t),n.headers),a=e.method??`POST`,o=await Af(e.body,t,i,a),s={...e.init??{},method:a,headers:i,format:e.format??`jsonl`};o!==void 0&&(s.body=o),n.signal!==void 0&&(s.signal=n.signal),e.fetch!==void 0&&(s.fetch=e.fetch);for await(let t of ff(r,s))yield e.mapEvent===void 0?t:e.mapEvent(t)}}}function Of(e){return Df(e)}async function kf(e,t){return typeof e==`function`?e(t):e}async function Af(e,t,n,r){if(e!==void 0)return e(t);if(jf(r))return n.has(`content-type`)||n.set(`content-type`,`application/json`),JSON.stringify(t)}function jf(e){let t=e.toUpperCase();return t!==`GET`&&t!==`HEAD`}function Mf(...e){let t=new Headers;for(let n of e)n!==void 0&&new Headers(n).forEach((e,n)=>{t.set(n,e)});return t}function Nf(e){if(Xf(e))return e;let t=typeof e==`string`?e:e.text;if(t.trim().length!==0)return{id:typeof e==`string`||e.id===void 0?Yf(`msg`):e.id,role:`user`,parts:[{id:Yf(`part`),type:`text`,text:t}],...typeof e==`string`||e.metadata===void 0?{}:{metadata:e.metadata}}}function Pf(e,t){if(t.type===`message_start`){let n=e.findIndex(e=>e.id===t.message.id);if(n===-1)return[...e,t.message];let r=[...e];return r[n]=t.message,r}if(t.type===`text_delta`)return Vf(e,t.messageId,{id:t.partId,type:`text`,text:t.delta});if(t.type===`reasoning_delta`)return Vf(e,t.messageId,{id:t.partId,type:`reasoning`,text:t.delta});if(t.type===`tool_update`)return Vf(e,t.messageId,t.part);if(t.type===`error`){let n=Yf(`msg`);return[...e,{id:n,role:`assistant`,parts:[{id:Yf(`part`),type:`error`,error:t.error}]}]}if(t.type===`message_end`){let{metadata:n}=t;return n===void 0?e:e.map(e=>e.id===t.messageId?{...e,metadata:n}:e)}return e}function Ff(e,t){let n=Zf(t);if(n!==void 0)return Pf(e,n);if(!(!lp(t)||typeof t.type!=`string`)){if(t.type===`text_delta`&&typeof t.delta==`string`)return Rf(e,t.delta);if(t.type===`reasoning_delta`&&typeof t.delta==`string`)return zf(e,t.delta,typeof t.id==`string`?t.id:void 0);if(t.type===`tool_call_delta`&&typeof t.id==`string`)return Hf(e,{id:cp(t.id),type:`tool`,toolName:typeof t.name==`string`?t.name:``,toolCallId:t.id,...typeof t.callId==`string`?{callId:t.callId}:{},state:`input-streaming`,...typeof t.argumentsDelta==`string`?{input:t.argumentsDelta}:{}});if(t.type===`tool_call`&&tp(t.toolCall))return Hf(e,{id:cp(t.toolCall.id),type:`tool`,toolName:t.toolCall.function.name,toolCallId:t.toolCall.id,...typeof t.toolCall.callId==`string`?{callId:t.toolCall.callId}:{},state:`input-available`,input:t.toolCall.function.arguments});if(t.type===`tool_result`){let n=typeof t.internalCallId==`string`?t.internalCallId:typeof t.toolCallId==`string`?t.toolCallId:void 0;return n===void 0||typeof t.toolName!=`string`?void 0:Hf(e,{id:cp(n),type:`tool`,toolName:t.toolName,toolCallId:n,...typeof t.toolCallId==`string`?{callId:t.toolCallId}:{},state:`output-available`,output:`structuredResult`in t&&t.structuredResult!==void 0?ap(t.structuredResult):ap(t.result)})}if(t.type===`message_id`&&typeof t.id==`string`)return Gf(e,{providerMessageId:t.id});if(t.type===`final`){if(lp(t.response)&&Array.isArray(t.response.choice)){let n=np(t.response.choice),r=n.length>0?Bf(e,n):e,i=t.response.messageId;return typeof i==`string`?Gf(r,{providerMessageId:i}):r}if(typeof t.output==`string`){let n=t.output.length>0?Bf(e,t.output):e;return typeof t.runId==`string`?Gf(n,{runId:t.runId}):n}}if(t.type===`error`&&`error`in t)return Wf(e,rp(t.error))}}function If(e){let t=[...e].reverse().find(e=>e.role===`assistant`);return t===void 0?``:Lf(t)}function Lf(e){return e.parts.flatMap(e=>e.type===`text`?[e.text]:[]).join(``)}function Rf(e,t){let n=qf(e),r=n[n.length-1];return r===void 0?n:Vf(n,r.id,{id:`${r.id}_text`,type:`text`,text:t})}function zf(e,t,n){let r=qf(e),i=r[r.length-1];if(i===void 0)return r;let a=n===void 0?`${i.id}_reasoning`:`${i.id}_reasoning_${n}`;return Vf(r,i.id,{id:a,type:`reasoning`,text:t,...n===void 0?{}:{reasoningId:n}})}function Bf(e,t){let n=qf(e),r=n[n.length-1];return r===void 0?n:n.map(e=>e.id===r.id?{...e,parts:Kf(e,t)}:e)}function Vf(e,t,n){return(e.find(e=>e.id===t)===void 0?[...e,{id:t,role:`assistant`,parts:[]}]:e).map(e=>{if(e.id!==t)return e;let r=e.parts.findIndex(e=>e.id===n.id);if(r===-1)return{...e,parts:[...e.parts,n]};let i=[...e.parts],a=i[r];return a?.type===`text`&&n.type===`text`||a?.type===`reasoning`&&n.type===`reasoning`?i[r]={...a,text:`${a.text}${n.text}`}:a?.type===`tool`&&n.type===`tool`?i[r]=Uf(a,n):i[r]=n,{...e,parts:i}})}function Hf(e,t){let n=qf(e),r=n[n.length-1];return r===void 0?n:Vf(n,r.id,t)}function Uf(e,t){let n={...e,...t};return t.toolName.length===0&&(n.toolName=e.toolName),t.callId===void 0&&e.callId!==void 0&&(n.callId=e.callId),t.input===void 0&&e.input!==void 0?n.input=e.input:typeof e.input==`string`&&typeof t.input==`string`&&(n.input=`${e.input}${t.input}`),t.output===void 0&&e.output!==void 0&&(n.output=e.output),t.error===void 0&&e.error!==void 0&&(n.error=e.error),n}function Wf(e,t){let n=Yf(`msg`);return[...e,{id:n,role:`assistant`,parts:[{id:Yf(`part`),type:`error`,error:t}]}]}function Gf(e,t){let n=qf(e),r=n[n.length-1];return r===void 0?n:n.map(e=>e.id===r.id?{...e,metadata:op(e.metadata,t)}:e)}function Kf(e,t){let n=e.parts.findIndex(e=>e.type===`text`);if(n===-1)return[...e.parts,{id:`${e.id}_text`,type:`text`,text:t}];let r=[...e.parts],i=r[n];return i?.type===`text`&&(r[n]={...i,text:t}),r}function qf(e){return e.at(-1)?.role===`assistant`?e:[...e,{id:Yf(`msg`),role:`assistant`,parts:[]}]}var Jf=0;function Yf(e){let t=globalThis.crypto?.randomUUID?.();return t===void 0?(Jf+=1,`${e}_${Jf.toString(36)}`):`${e}_${t}`}function Xf(e){return typeof e!=`string`&&`role`in e&&Array.isArray(e.parts)}function Zf(e){if(!(!lp(e)||typeof e.type!=`string`)&&(e.type===`message_start`&&Qf(e.message)||(e.type===`text_delta`||e.type===`reasoning_delta`)&&typeof e.messageId==`string`&&typeof e.partId==`string`&&typeof e.delta==`string`||e.type===`tool_update`&&typeof e.messageId==`string`&&typeof e.partId==`string`&&$f(e.part)||e.type===`message_end`&&typeof e.messageId==`string`||e.type===`error`&&ep(e.error)))return e}function Qf(e){return lp(e)&&typeof e.id==`string`&&typeof e.role==`string`&&Array.isArray(e.parts)}function $f(e){return lp(e)&&typeof e.id==`string`&&typeof e.type==`string`}function ep(e){return lp(e)&&typeof e.message==`string`}function tp(e){return lp(e)&&typeof e.id==`string`&&lp(e.function)&&typeof e.function.name==`string`&&`arguments`in e.function}function np(e){return e.flatMap(e=>lp(e)&&e.type===`text`&&typeof e.text==`string`?[e.text]:[]).join(`
|
|
111
|
+
`)}function rp(e){return e instanceof Error?{name:e.name,message:e.message}:{message:typeof e==`string`?e:ip(e)}}function ip(e){try{let t=JSON.stringify(e);return t===void 0?String(e):t}catch{return String(e)}}function ap(e){return e===null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||Array.isArray(e)||lp(e)?e:ip(e)}function op(e,t){return sp(e)&&sp(t)?{...e,...t}:t}function sp(e){return lp(e)&&!Array.isArray(e)}function cp(e){return`tool_${e}`}function lp(e){return typeof e==`object`&&!!e}function up(e={}){let[t,n]=(0,_.useState)(()=>[...e.initialMessages??[]]),[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)(`idle`),[s,c]=(0,_.useState)(),[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)([]),[p,m]=(0,_.useState)(()=>new Set),[h,g]=(0,_.useState)(()=>new Set),v=(0,_.useRef)(void 0),y=(0,_.useRef)(t),b=(0,_.useRef)(l),x=(0,_.useRef)(d),S=(0,_.useRef)(p),C=(0,_.useRef)(h),w=(0,_.useRef)(0);(0,_.useEffect)(()=>{y.current=t},[t]),(0,_.useEffect)(()=>{b.current=l},[l]),(0,_.useEffect)(()=>{x.current=d},[d]),(0,_.useEffect)(()=>{S.current=p},[p]),(0,_.useEffect)(()=>{C.current=h},[h]),(0,_.useEffect)(()=>()=>{v.current?.abort()},[]);let T=(0,_.useMemo)(()=>{if(e.transport!==void 0)return e.transport;if(e.endpoint!==void 0)return Of({endpoint:e.endpoint,format:e.format??`jsonl`})},[e.transport,e.endpoint,e.format]),E=(0,_.useCallback)(e=>{let t=typeof e==`function`?e(y.current):e;y.current=t,n(t)},[]),D=(0,_.useCallback)(e=>{u(t=>{let n=yf(t,e);return b.current=n,n})},[]),O=(0,_.useCallback)(e=>{f(t=>{let n=yf(t,e);return x.current=n,n})},[]),k=(0,_.useCallback)(()=>{w.current+=1,b.current=[],x.current=[],S.current=new Set,C.current=new Set,u([]),f([]),m(new Set),g(new Set)},[]),A=(0,_.useCallback)(t=>{let n=e.eventToUIEvent?.(t);if(n!==void 0){E(e=>Pf(e,n));return}if(!(e.eventToUIEvent!==void 0||e.eventToDelta!==void 0||e.eventToFinal!==void 0)){let e=!1;if(E(n=>{let r=Ff(n,t);return r===void 0?n:(e=!0,r)}),e)return}let r=e.eventToDelta?.(t);r!==void 0&&r.length>0&&E(e=>Rf(e,r));let i=e.eventToFinal?.(t);i!==void 0&&E(e=>Bf(e,i))},[e,E]),ee=(0,_.useCallback)(t=>{let n=e.humanInput;if(n===void 0)return;let r=(n.eventToApproval??hf)(t);r!==void 0&&D(r);let i=(n.eventToQuestion??gf)(t);i!==void 0&&O(i)},[e.humanInput,D,O]),j=(0,_.useCallback)(async t=>{if(T===void 0)throw Error(`useChat requires either transport or endpoint`);v.current?.abort();let n=new AbortController;v.current=n;let r=e.createRequest??(e=>({messages:e.coreMessages,stream:!0}));E(t),i([]),c(void 0),k(),o(`streaming`);try{let a=r({messages:t,uiMessages:t,coreMessages:Qd(t)});for await(let t of T.send(a,{signal:n.signal})){if(v.current!==n||n.signal.aborted||(i(e=>[...e,t]),ee(t),e.onEvent?.(t),v.current!==n||n.signal.aborted))return;A(t)}v.current===n&&!n.signal.aborted&&o(`idle`)}catch(t){if(fp(t)){v.current===n&&o(`idle`);return}if(v.current!==n)return;c(t),o(`error`),e.onError?.(t)}finally{v.current===n&&(v.current=void 0)}},[A,ee,k,e,E,T]),te=(0,_.useCallback)(async e=>{let t=Nf(e);if(t===void 0)return;let n=y.current;await j([...v.current!==void 0&&n.at(-1)?.role===`assistant`?n.slice(0,-1):n,t])},[j]),ne=(0,_.useCallback)(async(e=``)=>{await te(e)},[te]),M=(0,_.useCallback)(async()=>{let e=dp(y.current);e!==-1&&await j(y.current.slice(0,e+1))},[j]),N=(0,_.useCallback)(()=>{v.current?.abort(),v.current=void 0,o(`idle`)},[]),P=(0,_.useCallback)(async(t,n,r)=>{let i=e.humanInput;if(i===void 0)throw Error(`useChat humanInput is not configured`);if(S.current.has(t))return;let a=w.current,o=new Set(S.current).add(t);S.current=o,m(o);try{let e=b.current.find(e=>e.id===t),o={approvalId:t,approved:n,...r===void 0?{}:{reason:r},...e===void 0?{}:{approval:e}},s=i.decideApproval===void 0?await _f(o,i):await i.decideApproval(o);s!==void 0&&w.current===a&&D(s)}finally{if(w.current===a){let e=new Set(S.current);e.delete(t),S.current=e,m(e)}}},[e.humanInput,D]),re=(0,_.useCallback)(async(e,t)=>{await P(e,!0,t)},[P]),ie=(0,_.useCallback)(async(e,t)=>{await P(e,!1,t)},[P]),ae=(0,_.useCallback)(async(t,n)=>{let r=e.humanInput;if(r===void 0)throw Error(`useChat humanInput is not configured`);if(C.current.has(t))return;let i=w.current,a=new Set(C.current).add(t);C.current=a,g(a);try{let e=x.current.find(e=>e.id===t),a={questionId:t,answers:n,...e===void 0?{}:{question:e}},o=r.answerQuestion===void 0?await vf(a,r):await r.answerQuestion(a);o!==void 0&&w.current===i&&O(o)}finally{if(w.current===i){let e=new Set(C.current);e.delete(t),C.current=e,g(e)}}},[e.humanInput,O]);return{messages:t,events:r,setMessages:E,sendMessage:te,send:ne,regenerate:M,stop:N,reset:(0,_.useCallback)((e=[])=>{v.current?.abort(),v.current=void 0,E(e),i([]),k(),c(void 0),o(`idle`)},[k,E]),status:a,error:s,text:If(t),humanInput:{approvals:{all:l,pending:l.filter(e=>e.status===`pending`)},questions:{all:d,pending:d.filter(e=>e.status===`pending`)}},decidingApprovals:new Set(p),answeringQuestions:new Set(h),approveTool:re,rejectTool:ie,answerToolQuestion:ae}}function dp(e){for(let t=e.length-1;t>=0;--t)if(e[t]?.role===`user`)return t;return-1}function fp(e){return e instanceof DOMException&&e.name===`AbortError`}async function pp(e,t){let n=``;try{let t=await e.json();typeof t==`object`&&t&&`error`in t&&typeof t.error==`object`&&t.error!==null&&`message`in t.error&&typeof t.error.message==`string`&&(n=`: ${t.error.message}`)}catch{}return`${t} with HTTP ${e.status}${n}`}function mp(e){return e instanceof df?e.response.status===401?`Authentication required`:`Run failed with HTTP ${e.response.status}`:s(e)}function hp(e){if(typeof e==`string`)return e;if(e instanceof Error)return e.message;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}var gp=0;function _p(e){gp=e}function vp(){gp=0}function yp(e){return e.filter(e=>e.kind===`message`&&e.text.trim().length>0).map(e=>({role:e.role,content:[{type:`text`,text:e.text}]}))}function bp(e){return e.currentTarget.value}function xp(e){e!==null&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)}function Sp(){let e=gp;return gp+=1,e}function Cp(e){return e.reduce((e,t)=>Math.max(e,t.entryId+1),0)}function wp(e,t,n){for(let r=e.length-1;r>=0;--r){let i=e[r];if(i!==void 0&&!(i.kind!==`tool`||i.toolName!==t||i.result!==void 0)&&(n===void 0||i.callId===n))return r}return-1}function Tp(e,t,n){for(let r=e.length-1;r>=0;--r){let i=e[r];if(i!==void 0&&!(i.kind!==`tool`||i.toolName!==t)&&(n===void 0||i.callId===n))return r}return-1}function Ep(e){return typeof e==`string`?e:c(e)?typeof e.text==`string`?e.text:typeof e.content==`string`?e.content:Array.isArray(e.content)?e.content.map(Dp).filter(Boolean).join(`
|
|
112
|
+
`):``:``}function Dp(e){return typeof e==`string`?e:c(e)?typeof e.text==`string`?e.text:e.type===`tool_call`&&c(e.function)?`${String(e.function.name??`tool`)}(${u(e.function.arguments)})`:e.type===`tool_result`&&Array.isArray(e.content)?e.content.map(Dp).filter(Boolean).join(`
|
|
113
|
+
`):typeof e.type==`string`?e.type:``:``}async function Op(e,t){for await(let n of of(e))await t(n)}function kp(){return new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>e())})})}function Ap(e){let{attachments:t,messages:n,onActivePageChange:r,onAttachmentsChange:i,onBeforeRun:a,onError:c,onPromptChange:l,onRunStateChange:d,onStatus:f,promptRef:p,runState:m,selectedAgent:h,selectedAgentId:g,selectedModelRef:v,sessions:y,sessionsEnabled:b,traces:x,transcript:S}=e,C=(0,_.useRef)(void 0),w=(0,_.useRef)(void 0),T=(0,_.useRef)(Promise.resolve()),E=up({transport:Of({endpoint:e=>`/agents/${encodeURIComponent(e.agentId)}/runs`,method:`POST`,format:`jsonl`,headers:{"content-type":`application/json`},body:e=>{let{agentId:t,...n}=e;return JSON.stringify(n)},mapEvent:e=>e}),createRequest:()=>{let e=C.current;if(e===void 0)throw Error(`Missing playground run request`);return e},eventToDelta:()=>void 0,eventToFinal:()=>void 0,onEvent(e){O(e)&&(T.current=T.current.then(kp))},onError(e){w.current=e;let t=mp(e);c(t),S.appendAssistantError(t)}});(0,_.useEffect)(()=>{d(E.status===`streaming`?`running`:`idle`)},[d,E.status]);async function D(e){let u=e.trim(),_=t,D=h?.id??g;if(u.length===0&&_.length===0||D.length===0||m===`running`||E.status===`streaming`)return;d(`running`),a(),r(`playground`),c(``),l(``),i([]),requestAnimationFrame(()=>xp(p.current));let O=_.length===0?u:ri(u,_);S.setMessages(e=>[...e,{entryId:Sp(),kind:`message`,role:`user`,text:u,..._.length===0?{}:{attachments:ii(_)}},{entryId:Sp(),kind:`message`,role:`assistant`,text:``,tone:`pending`}]);try{let e=b&&y.selectedSessionId.length===0,t=e?(await y.createSession(o(u),{updatePath:!1})).id:y.selectedSessionId,r=b?void 0:yp(n);if(w.current=void 0,T.current=Promise.resolve(),C.current={agentId:D,message:O,...t.length===0?{}:{sessionId:t},...r===void 0?{}:{history:r},...v.length===0?{}:{model:v},stream:!0,metadata:{source:`anvia-studio`,...v.length===0?{}:{studioModel:v}}},await E.send(u),await T.current,w.current===void 0){if(await y.loadAllSessions(),t.length>0){y.setSelectedSessionId(t);let[n]=await Promise.all([x.loadSessionTraceSummaries(t),y.loadSessionLogs(t)]);S.setMessages(e=>Zr(e,n)),e&&y.openSessionPath(t)}f(`Connected`)}}catch(e){let t=s(e);c(t),S.appendAssistantError(t)}finally{C.current=void 0,E.reset(),d(`idle`)}}function O(e){if(e.type===`text_delta`)return S.appendAssistantText(e.delta),!0;if(e.type===`reasoning_delta`)return S.appendReasoningText(e.delta,e.id),!0;if(e.type===`tool_call`)return S.appendToolCall(e.toolCall.function.name,u(e.toolCall.function.arguments),e.toolCall.callId??e.toolCall.id),!0;if(e.type===`tool_result`)return S.appendToolResult({toolName:e.toolName,callId:e.toolCallId,args:e.args,result:e.result,...e.structuredResult===void 0?{}:{structuredResult:e.structuredResult}}),!0;if(e.type===`agent_tool_event`)return S.appendAgentToolEvent(e),!0;if(e.type===`tool_approval_request`||e.type===`tool_approval_result`)return S.updateToolApproval(e.approval),!0;if(e.type===`tool_question_request`||e.type===`tool_question_result`)return S.updateToolQuestion(e.question),!0;if(e.type===`session_log`)return y.appendSessionLogEntry(e.log),!0;if(e.type===`final`)return e.trace?.traceId!==void 0&&S.assignAssistantTraceId(e.trace.traceId),S.clearPendingAssistant(),!0;if(e.type===`error`){let t=hp(e.error);return w.current=e.error,c(t),S.appendAssistantError(t),!0}return!1}return{runPrompt:D}}function jp(){let[e,t]=(0,_.useState)([]);return{messages:e,setMessages:t,appendAgentToolEvent:e=>t(t=>Bp(t,e)),appendAssistantError:e=>t(t=>Np(t,e)),appendAssistantText:e=>t(t=>Mp(t,e)),appendReasoningText:(e,n)=>t(t=>Lp(t,e,n)),appendToolCall:(e,n,r)=>t(t=>Rp(t,e,n,r)),appendToolResult:e=>t(t=>zp(t,e)),assignAssistantTraceId:e=>t(t=>Pp(t,e)),clearPendingAssistant:()=>t(e=>Vp(e)),updateToolApproval:e=>t(t=>Fp(t,e)),updateToolQuestion:e=>t(t=>Ip(t,e))}}function Mp(e,t){let n=[...e],r=n.at(-1);if(r?.kind===`message`&&r.role===`assistant`)if(r.tone===`pending`){let{tone:e,...i}=r;n[n.length-1]={...i,text:t}}else n[n.length-1]={...r,text:`${r.text}${t}`};else n.push({entryId:Sp(),kind:`message`,role:`assistant`,text:t});return n}function Np(e,t){let n=[...e],r=n.at(-1),i={entryId:r?.kind===`message`&&r.role===`assistant`&&r.tone===`pending`?r.entryId:Sp(),kind:`message`,role:`assistant`,text:t,tone:`error`};return r?.kind===`message`&&r.role===`assistant`&&r.tone===`pending`?(n[n.length-1]=i,n):[...n,i]}function Pp(e,t){let n=[...e];for(let e=n.length-1;e>=0;--e){let r=n[e];if(r?.kind===`message`&&r.role===`assistant`){n[e]={...r,traceId:t};break}}return n}function Fp(e,t){let n=Vp(e),r=Tp(n,t.toolName,t.callId);if(r<0)return n.push({entryId:Sp(),kind:`tool`,toolName:t.toolName,...t.callId===void 0?{}:{callId:t.callId},approval:{id:t.id,status:t.status,requestedAt:t.requestedAt,...t.resolvedAt===void 0?{}:{resolvedAt:t.resolvedAt},...t.reason===void 0?{}:{reason:t.reason}}}),n;let i=n[r];return i!==void 0&&i.kind===`tool`&&(n[r]={...i,approval:{id:t.id,status:t.status,requestedAt:t.requestedAt,...t.resolvedAt===void 0?{}:{resolvedAt:t.resolvedAt},...t.reason===void 0?{}:{reason:t.reason}}}),n}function Ip(e,t){let n=Vp(e),r=Tp(n,t.toolName,t.callId);if(r<0)return n.push({entryId:Sp(),kind:`tool`,toolName:t.toolName,...t.callId===void 0?{}:{callId:t.callId},question:{id:t.id,status:t.status,requestedAt:t.requestedAt,...t.answeredAt===void 0?{}:{answeredAt:t.answeredAt},questions:t.questions,...t.answers===void 0?{}:{answers:t.answers}}}),n;let i=n[r];return i!==void 0&&i.kind===`tool`&&(n[r]={...i,question:{id:t.id,status:t.status,requestedAt:t.requestedAt,...t.answeredAt===void 0?{}:{answeredAt:t.answeredAt},questions:t.questions,...t.answers===void 0?{}:{answers:t.answers}}}),n}function Lp(e,t,n){let r=Vp(e),i=r.at(-1);return i?.kind===`reasoning`&&(i.reasoningId??``)===(n??``)?r[r.length-1]={...i,text:`${i.text}${t}`}:r.push({entryId:Sp(),kind:`reasoning`,...n===void 0?{}:{reasoningId:n},text:t}),r}function Rp(e,t,n,r){return[...Vp(e),{entryId:Sp(),kind:`tool`,toolName:t,...r===void 0?{}:{callId:r},...n.length===0?{}:{args:n}}]}function zp(e,t){let n=Vp(e),r=wp(n,t.toolName,t.callId);if(r>=0){let e=n[r];if(e!==void 0&&e.kind===`tool`)return n[r]={...e,args:e.args??t.args,result:t.result,...t.structuredResult===void 0?{}:{structuredResult:t.structuredResult}},n}return n.push({entryId:Sp(),kind:`tool`,toolName:t.toolName,...t.callId===void 0?{}:{callId:t.callId},args:t.args,result:t.result,...t.structuredResult===void 0?{}:{structuredResult:t.structuredResult}}),n}function Bp(e,t){let n=Hp(t);if(n===void 0)return e;let r=Vp(e),i=wp(r,t.toolName,t.toolCallId);if(i<0)return r.push({entryId:Sp(),kind:`tool`,toolName:t.toolName,...t.toolCallId===void 0?{}:{callId:t.toolCallId},childEvents:[n]}),r;let a=r[i];if(a===void 0||a.kind!==`tool`)return r;let o=[...a.childEvents??[]];return Up(o,n),r[i]={...a,childEvents:o},r}function Vp(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.kind===`message`&&n.role===`assistant`&&n.tone===`pending`&&n.text.trim().length===0)return e.filter((e,n)=>n!==t)}return[...e]}function Hp(e){let t=e.event;if(t.type===`text_delta`)return{kind:`message`,agentId:e.agentId,...e.agentName===void 0?{}:{agentName:e.agentName},text:t.delta};if(t.type===`reasoning_delta`)return{kind:`reasoning`,agentId:e.agentId,...e.agentName===void 0?{}:{agentName:e.agentName},...t.id===void 0?{}:{reasoningId:t.id},text:t.delta};if(t.type===`tool_call`)return{kind:`tool`,agentId:e.agentId,...e.agentName===void 0?{}:{agentName:e.agentName},toolName:t.toolCall.function.name,...t.toolCall.callId===void 0&&t.toolCall.id===void 0?{}:{callId:t.toolCall.callId??t.toolCall.id},args:u(t.toolCall.function.arguments)};if(t.type===`tool_result`)return{kind:`tool`,agentId:e.agentId,...e.agentName===void 0?{}:{agentName:e.agentName},toolName:t.toolName,...t.toolCallId===void 0?{}:{callId:t.toolCallId},args:t.args,result:t.result,...t.structuredResult===void 0?{}:{structuredResult:t.structuredResult}};if(t.type===`error`)return{kind:`message`,agentId:e.agentId,...e.agentName===void 0?{}:{agentName:e.agentName},text:`Error: ${s(t.error)}`}}function Up(e,t){if(t.kind===`message`){let n=e.at(-1);n?.kind===`message`&&n.agentId===t.agentId?e[e.length-1]={...n,text:`${n.text}${t.text}`}:e.push(t);return}if(t.kind===`reasoning`){let n=e.at(-1);n?.kind===`reasoning`&&n.agentId===t.agentId&&(n.reasoningId??``)===(t.reasoningId??``)?e[e.length-1]={...n,text:`${n.text}${t.text}`}:e.push(t);return}let n=Wp(e,t);if(n<0){e.push(t);return}let r=e[n];r?.kind===`tool`&&(e[n]={...r,...r.args!==void 0||t.args===void 0?{}:{args:t.args},...t.result===void 0?{}:{result:t.result}})}function Wp(e,t){for(let n=e.length-1;n>=0;--n){let r=e[n];if(!(r?.kind!==`tool`||r.agentId!==t.agentId||r.toolName!==t.toolName||r.result!==void 0)&&(t.callId===void 0||r.callId===t.callId))return n}return-1}function Gp(e){let[t,n]=(0,_.useState)(()=>new Set),[r,i]=(0,_.useState)(()=>new Set);async function a(r,i){if(!t.has(r)){n(e=>new Set(e).add(r)),e.onError(``);try{let t=await fetch(`/approvals/${encodeURIComponent(r)}/decision`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({approved:i})});if(!t.ok)throw Error(`Approval decision failed with HTTP ${t.status}`);e.onToolApprovalUpdate(await t.json())}catch(t){e.onError(s(t))}finally{n(e=>{let t=new Set(e);return t.delete(r),t})}}}async function o(t,n){if(!r.has(t)){i(e=>new Set(e).add(t)),e.onError(``);try{let r=await fetch(`/questions/${encodeURIComponent(t)}/answer`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({answers:n})});if(!r.ok)throw Error(`Question answer failed with HTTP ${r.status}`);e.onToolQuestionUpdate(await r.json())}catch(t){e.onError(s(t))}finally{i(e=>{let n=new Set(e);return n.delete(t),n})}}}return{answeringQuestions:r,decidingApprovals:t,answerToolQuestion:o,decideToolApproval:a}}function Kp(e){let{currentAgentId:t,enabled:n,loadSessionTraceSummaries:r,runState:i,selectedModelRef:a,onError:o,onSessionCreated:c,onSessionDeleted:l,onSessionLoaded:u,onStatus:d}=e,[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)([]),[g,v]=(0,_.useState)([]),[y,b]=(0,_.useState)(`idle`),[x,S]=(0,_.useState)(`idle`),C=(0,_.useRef)(``),w=(0,_.useCallback)(async()=>{if(!n){h([]);return}try{let e=await fetch(`/sessions?limit=100`);if(!e.ok)throw Error(`Sessions failed with HTTP ${e.status}`);h((await e.json()).sessions)}catch(e){o(s(e))}},[n,o]);(0,_.useEffect)(()=>{w()},[w]);let T=(0,_.useCallback)(async e=>{if(!n)return v([]),[];S(`loading`);try{let t=new URLSearchParams({limit:`1000`}),n=await fetch(`/sessions/${encodeURIComponent(e)}/logs?${t}`);if(!n.ok)throw Error(`Session logs failed with HTTP ${n.status}`);let r=await n.json();return v(r.logs),r.logs}catch(e){return o(s(e)),v([]),[]}finally{S(`idle`)}},[n,o]),E=(0,_.useCallback)(async(e,n={})=>{let r=await fetch(`/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agentId:t,title:e,metadata:{source:`anvia-studio`,...a.length===0?{}:{[Gr]:a}}})});if(!r.ok)throw Error(await pp(r,`Session create failed`));let i=await r.json();return p(i.id),h(e=>[i,...e.filter(e=>e.id!==i.id)]),n.updatePath!==!1&&c(i.id),await T(i.id),i},[t,T,c,a]),D=(0,_.useCallback)(async(e,t={})=>{if(i!==`running`){C.current=e,b(`loading`),o(``);try{let n=await fetch(`/sessions/${encodeURIComponent(e)}`);if(!n.ok)throw Error(`Session load failed with HTTP ${n.status}`);let i=await n.json(),[a]=await Promise.all([r(i.id),T(i.id)]);if(C.current!==e)return;p(i.id),u(i,a,t),d(`Connected`)}catch(t){C.current===e&&o(s(t))}finally{C.current===e&&b(`idle`)}}},[T,r,o,u,d,i]),O=(0,_.useCallback)(async e=>{if(i!==`running`){o(``);try{let t=await fetch(`/sessions/${encodeURIComponent(e.id)}`,{method:`DELETE`});if(!t.ok)throw Error(`Session delete failed with HTTP ${t.status}`);let n=f===e.id;h(t=>t.filter(t=>t.id!==e.id)),n&&(p(``),v([])),l(e.id,n),d(`Connected`)}catch(e){o(s(e))}}},[o,l,d,i,f]),k=(0,_.useCallback)(()=>{p(``),v([])},[]),A=(0,_.useCallback)(e=>{v(t=>t.some(t=>t.id===e.id)?t:[...t,e].sort((e,t)=>e.sequence-t.sequence))},[]);return(0,_.useMemo)(()=>({allSessions:m,selectedSessionId:f,sessionLogs:g,sessionLoadState:y,sessionLogLoadState:x,appendSessionLogEntry:A,clearSelectedSession:k,createSession:E,deleteSession:O,loadAllSessions:w,loadSession:D,loadSessionLogs:T,openSessionPath:c,setSelectedSessionId:p}),[m,A,k,E,O,w,D,T,c,f,y,x,g])}function qp(e,t){return!0}function Jp(e,t){return e}var Yp=document.getElementById(`anvia-ui`),Xp=Yp?.dataset.uiPath??`/ui`,Zp=Yp?.dataset.uiCompatPath??`/ui`,Qp=`${em(Xp)||em(Zp)||`/ui`}/assets/logo.png`,$p=`static-context`;function em(e){return e===`/`?``:e.replace(/\/+$/,``)}function tm(e){let{activePage:t,enabled:n,onError:r,onNavigateTracing:i,onOpenTrace:a,onOpenTraceIndex:o,onOpenTraceSession:c}=e,[l,u]=(0,_.useState)([]),[d,f]=(0,_.useState)(()=>e.initialTraceId),[p,m]=(0,_.useState)(()=>e.initialTraceSessionId),[h,g]=(0,_.useState)(`idle`),v=(0,_.useCallback)(async()=>{if(!n){u([]);return}g(`loading`);try{let e=new URLSearchParams({include:`detail`,limit:`50`}),t=await fetch(`/traces?${e.toString()}`);if(!t.ok)throw Error(`Traces failed with HTTP ${t.status}`);let n=(await t.json()).traces;if(d.length>0&&!n.some(e=>e.id===d)){let e=await fetch(`/traces/${encodeURIComponent(d)}`);if(e.ok){u([await e.json(),...n]);return}}u(n)}catch(e){r(s(e))}finally{g(`idle`)}},[n,r,d]),y=(0,_.useCallback)(async(e,t={})=>{if(n){g(`loading`);try{let n=new URLSearchParams({include:`detail`,limit:`50`,sessionId:e}),r=await fetch(`/traces?${n.toString()}`);if(!r.ok)throw Error(`Session traces failed with HTTP ${r.status}`);let a=[...(await r.json()).traces].sort((e,t)=>Date.parse(e.startedAt)-Date.parse(t.startedAt));u(a);let o=a[0]?.id;if(o===void 0){f(``),m(e),t.updatePath!==!1&&c(e);return}i(),f(o),m(e),t.updatePath!==!1&&c(e)}catch(e){r(s(e))}finally{g(`idle`)}}},[n,r,i,c]),b=(0,_.useCallback)(async e=>{if(!n)return[];let t=new URLSearchParams({limit:`100`}),r=await fetch(`/sessions/${encodeURIComponent(e)}/traces?${t}`);return r.ok?(await r.json()).traces:[]},[n]);(0,_.useEffect)(()=>{t!==`tracing`||p!==void 0||v()},[t,v,p]);let x=(0,_.useCallback)((e,t)=>{f(e),m(t)},[]),S=(0,_.useCallback)(()=>{f(``),m(void 0)},[]),C=(0,_.useCallback)(e=>{if(i(),f(e),m(void 0),e.length===0){o();return}a(e)},[i,a,o]),w=(0,_.useCallback)(e=>{u(t=>t.filter(t=>t.sessionId!==e))},[]);return(0,_.useMemo)(()=>({traces:l,selectedTraceId:d,traceSessionDetailId:p,traceLoadState:h,clearTraceSelection:S,loadSessionTraceSummaries:b,loadTraces:v,removeSessionTraces:w,selectTrace:C,setTraceLocation:x,showSessionTraces:y}),[S,b,v,w,C,d,x,y,h,p,l])}var nm=(0,_.createContext)(void 0);function rm(){let e=(0,_.useContext)(nm);if(e===void 0)throw Error(`StudioConsoleContext is missing`);return e}var im=`modulepreload`,am=function(e){return`/ui/`+e},om={},sm=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}))))}r=o(t.map(t=>{if(t=am(t,n),t in om)return;om[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:im,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.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)})},cm=(0,_.lazy)(()=>sm(()=>import(`./agents-page-B8Tw2e11.js`).then(e=>({default:e.AgentsPage})),__vite__mapDeps([0,1,2]))),lm=(0,_.lazy)(()=>sm(()=>import(`./evals-page-eIWZ_vsI.js`).then(e=>({default:e.EvalsPage})),__vite__mapDeps([3,1,4]))),um=(0,_.lazy)(()=>sm(()=>import(`./knowledge-page-C6WkzIFh.js`).then(e=>({default:e.KnowledgePage})),__vite__mapDeps([5,1,6,7,8,2]))),dm=(0,_.lazy)(()=>sm(()=>import(`./mcps-page-BJ4m_GoP.js`).then(e=>({default:e.McpsPage})),__vite__mapDeps([9,1,7,8,2]))),fm=(0,_.lazy)(()=>sm(()=>import(`./memory-page-BuerJ-04.js`).then(e=>({default:e.MemoryPage})),__vite__mapDeps([10,1,7,8,2]))),pm=(0,_.lazy)(()=>sm(()=>import(`./pipelines-page-Dx0uB0Dm.js`).then(e=>({default:e.PipelinesPage})),__vite__mapDeps([11,1,4,6,7,8,12]))),mm=(0,_.lazy)(()=>sm(()=>import(`./sessions-page-UdXui_Zk.js`).then(e=>({default:e.SessionsPage})),__vite__mapDeps([13,1,8]))),hm=(0,_.lazy)(()=>sm(()=>import(`./sessions-page-UdXui_Zk.js`).then(e=>({default:e.DeleteSessionDialog})),__vite__mapDeps([13,1,8]))),gm=(0,_.lazy)(()=>sm(()=>import(`./status-page-DC5pVW4o.js`).then(e=>({default:e.StatusPage})),__vite__mapDeps([14,1,7,8,2]))),_m=(0,_.lazy)(()=>sm(()=>import(`./tools-page-ByKfOqk3.js`).then(e=>({default:e.ToolsPage})),__vite__mapDeps([15,1,7,8,2]))),vm=(0,_.lazy)(()=>sm(()=>import(`./trace-browser-Dk7nD7KO.js`).then(e=>({default:e.TraceBrowser})),__vite__mapDeps([16,1,17,2,8])));function ym(){return(0,R.jsx)(`section`,{className:`grid h-full min-h-0 place-items-center bg-background/45 text-sm font-medium text-muted-foreground`,children:`Loading`})}var bm=[[`path`,{d:`M4.31802 19.682C3 18.364 3 16.2426 3 12C3 7.75736 3 5.63604 4.31802 4.31802C5.63604 3 7.75736 3 12 3C16.2426 3 18.364 3 19.682 4.31802C21 5.63604 21 7.75736 21 12C21 16.2426 21 18.364 19.682 19.682C18.364 21 16.2426 21 12 21C7.75736 21 5.63604 21 4.31802 19.682Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 14L9.79289 11.2071C10.1834 10.8166 10.8166 10.8166 11.2071 11.2071L12.7929 12.7929C13.1834 13.1834 13.8166 13.1834 14.2071 12.7929L17 10`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],xm=[[`path`,{d:`M13 2H11C7.22876 2 5.34315 2 4.17157 3.17157C3 4.34315 3 6.22876 3 10V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V10C21 6.22876 21 4.34315 19.8284 3.17157C18.6569 2 16.7712 2 13 2Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M21 12H3`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M15 7H9`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M15 17H9`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}]],Sm=[[`path`,{d:`M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Cm=[[`path`,{d:`M12 5.5V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 11C18 11 13.5811 5.00001 12 5C10.4188 4.99999 6 11 6 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],wm=[[`path`,{d:`M19.5 12.0001V13.5001C19.5 17.6422 16.1421 21.0001 12 21.0001C7.85786 21.0001 4.5 17.6422 4.5 13.5001V8C4.5 5.23858 6.73858 3 9.5 3C12.2614 3 14.5 5.23858 14.5 8V13.5C14.5 14.8807 13.3807 16 12 16C10.6193 16 9.5 14.8807 9.5 13.5V9.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Tm=[[`path`,{d:`M18 6L6.00081 17.9992M17.9992 18L6 6.00085`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Em=[[`path`,{d:`M2 10.5C2 9.72921 2.01346 8.97679 2.03909 8.2503C2.12282 5.87683 2.16469 4.69009 3.13007 3.71745C4.09545 2.74481 5.3157 2.6926 7.7562 2.58819C9.09517 2.5309 10.5209 2.5 12 2.5C13.4791 2.5 14.9048 2.5309 16.2438 2.58819C18.6843 2.6926 19.9046 2.74481 20.8699 3.71745C21.8353 4.69009 21.8772 5.87683 21.9609 8.2503C21.9865 8.97679 22 9.72921 22 10.5C22 11.2708 21.9865 12.0232 21.9609 12.7497C21.8772 15.1232 21.8353 16.3099 20.8699 17.2826C19.9046 18.2552 18.6843 18.3074 16.2437 18.4118C15.5098 18.4432 14.7498 18.4667 13.9693 18.4815C13.2282 18.4955 12.8576 18.5026 12.532 18.6266C12.2064 18.7506 11.9325 18.9855 11.3845 19.4553L9.20503 21.3242C9.07273 21.4376 8.90419 21.5 8.72991 21.5C8.32679 21.5 8 21.1732 8 20.7701V18.4219C7.91842 18.4186 7.83715 18.4153 7.75619 18.4118C5.31569 18.3074 4.09545 18.2552 3.13007 17.2825C2.16469 16.3099 2.12282 15.1232 2.03909 12.7497C2.01346 12.0232 2 11.2708 2 10.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12.1257 10.5H12.0007M8.125 10.5H8M16.125 10.5H16M12.2507 10.5C12.2507 10.6381 12.1388 10.75 12.0007 10.75C11.8627 10.75 11.7507 10.6381 11.7507 10.5C11.7507 10.3619 11.8627 10.25 12.0007 10.25C12.1388 10.25 12.2507 10.3619 12.2507 10.5ZM8.25 10.5C8.25 10.6381 8.13807 10.75 8 10.75C7.86193 10.75 7.75 10.6381 7.75 10.5C7.75 10.3619 7.86193 10.25 8 10.25C8.13807 10.25 8.25 10.3619 8.25 10.5ZM16.25 10.5C16.25 10.6381 16.1381 10.75 16 10.75C15.8619 10.75 15.75 10.6381 15.75 10.5C15.75 10.3619 15.8619 10.25 16 10.25C16.1381 10.25 16.25 10.3619 16.25 10.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Dm=[[`path`,{d:`M5 13.2592L7.58583 15.9568C8.2525 16.6523 8.58583 17.0001 9.00004 17.0001C9.41425 17.0001 9.74759 16.6523 10.4143 15.9568L19 7.00006`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Om=[[`ellipse`,{cx:`12`,cy:`5`,rx:`8`,ry:`3`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 10.842C7.60158 11.0229 8.27434 11.1718 9 11.282`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M20 12C20 13.6569 16.4183 15 12 15C7.58172 15 4 13.6569 4 12`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M7 17.842C7.60158 18.0229 8.27434 18.1718 9 18.282`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M20 5V19C20 20.6569 16.4183 22 12 22C7.58172 22 4 20.6569 4 19V5`,stroke:`currentColor`,strokeWidth:`1.5`,key:`4`}]],km=[[`path`,{d:`M15 3H18C19.4142 3 20.1213 3 20.5607 3.43934C21 3.87868 21 4.58579 21 6V9M20 4L11 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20 13C20 16.7712 20 18.6569 18.8284 19.8284C17.6569 21 15.7712 21 12 21H11C7.22876 21 5.34315 21 4.17157 19.8284C3 18.6569 3 16.7712 3 13V12C3 8.22876 3 6.34315 4.17157 5.17157C5.34315 4 7.22876 4 11 4`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Am=[[`circle`,{cx:`12`,cy:`14`,r:`2`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20.0007 20C21.2561 18.3287 22 16.2512 22 14C22 12.5778 21.7031 11.2249 21.1679 10M3.99927 20C2.74389 18.3287 2 16.2512 2 14C2 8.47715 6.47715 4 12 4C13.4222 4 14.7751 4.2969 16 4.83209`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M13.5 12.5L19 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],jm=[[`path`,{d:`M2 11.4C2 10.2417 2.24173 10 3.4 10H20.6C21.7583 10 22 10.2417 22 11.4V12.6C22 13.7583 21.7583 14 20.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M2 19.4C2 18.2417 2.24173 18 3.4 18H20.6C21.7583 18 22 18.2417 22 19.4V20.6C22 21.7583 21.7583 22 20.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}]],Mm=[[`path`,{d:`M21.5 14.0784C20.3003 14.7189 18.9301 15.0821 17.4751 15.0821C12.7491 15.0821 8.91792 11.2509 8.91792 6.52485C8.91792 5.06986 9.28105 3.69968 9.92163 2.5C5.66765 3.49698 2.5 7.31513 2.5 11.8731C2.5 17.1899 6.8101 21.5 12.1269 21.5C16.6849 21.5 20.503 18.3324 21.5 14.0784Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Nm=[[`path`,{d:`M15.5 2V6M8.5 6V2`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6.00446 7.61331C5.93719 6.74273 6.63957 6 7.53014 6H16.4699C17.3604 6 18.0628 6.74273 17.9955 7.61331L17.8117 9.99197C17.6796 11.7019 17.1011 13.3498 16.132 14.7773L15.5312 15.6622C14.9638 16.4979 14.0077 17 12.9838 17H11.0162C9.99228 17 9.03617 16.4979 8.46881 15.6622L7.86803 14.7773C6.89885 13.3498 6.32041 11.7019 6.18827 9.99197L6.00446 7.61331Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12 17V22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M11 9H13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Pm=[[`path`,{d:`M12 4V2`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M20 22C20 17.5817 16.4183 14 12 14C7.58172 14 4 17.5817 4 22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M9.375 8.25H9.25M9.5 8.25C9.5 8.38807 9.38807 8.5 9.25 8.5C9.11193 8.5 9 8.38807 9 8.25C9 8.11193 9.11193 8 9.25 8C9.38807 8 9.5 8.11193 9.5 8.25Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M14.875 8.25H14.75M15 8.25C15 8.38807 14.8881 8.5 14.75 8.5C14.6119 8.5 14.5 8.38807 14.5 8.25C14.5 8.11193 14.6119 8 14.75 8C14.8881 8 15 8.11193 15 8.25Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M15.1538 4H8.84615C7.59095 4 6.96334 4 6.47397 4.22025C5.91693 4.47095 5.47095 4.91693 5.22025 5.47397C5 5.96334 5 6.59095 5 7.84615C5 9.85448 5 10.8586 5.3524 11.6417C5.75353 12.5329 6.46709 13.2465 7.35835 13.6476C8.14135 14 9.14552 14 11.1538 14H12.8462C14.8545 14 15.8586 14 16.6417 13.6476C17.5329 13.2465 18.2465 12.5329 18.6476 11.6417C19 10.8586 19 9.85448 19 7.84615C19 6.59095 19 5.96334 18.7797 5.47397C18.529 4.91693 18.0831 4.47095 17.526 4.22025C17.0367 4 16.4091 4 15.1538 4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],Fm=[[`path`,{d:`M18.7088 3.49534C16.8165 2.55382 14.5009 2 12 2C9.4991 2 7.1835 2.55382 5.29116 3.49534C4.36318 3.95706 3.89919 4.18792 3.4496 4.91378C3 5.63965 3 6.34248 3 7.74814V11.2371C3 16.9205 7.54236 20.0804 10.173 21.4338C10.9067 21.8113 11.2735 22 12 22C12.7265 22 13.0933 21.8113 13.8269 21.4338C16.4576 20.0804 21 16.9205 21 11.2371L21 7.74814C21 6.34249 21 5.63966 20.5504 4.91378C20.1008 4.18791 19.6368 3.95706 18.7088 3.49534Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Im=[[`path`,{d:`M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 2C11.6227 2.33333 11.0945 3.2 12 4M12 20C12.3773 20.3333 12.9055 21.2 12 22M19.5 4.50271C18.9685 4.46982 17.9253 4.72293 18.0042 5.99847M5.49576 17.5C5.52865 18.0315 5.27555 19.0747 4 18.9958M5.00271 4.5C4.96979 5.03202 5.22315 6.0763 6.5 5.99729M18 17.5026C18.5315 17.4715 19.5747 17.7108 19.4958 18.9168M22 12C21.6667 11.6227 20.8 11.0945 20 12M4 11.5C3.66667 11.8773 2.8 12.4055 2 11.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}]],Lm=[[`path`,{d:`M6 5.5C6 4.56538 6 4.09808 6.20096 3.75C6.33261 3.52197 6.52197 3.33261 6.75 3.20096C7.09808 3 7.56538 3 8.5 3H11.5C12.4346 3 12.9019 3 13.25 3.20096C13.478 3.33261 13.6674 3.52197 13.799 3.75C14 4.09808 14 4.56538 14 5.5C14 6.43462 14 6.90192 13.799 7.25C13.6674 7.47803 13.478 7.66739 13.25 7.79904C12.9019 8 12.4346 8 11.5 8H8.5C7.56538 8 7.09808 8 6.75 7.79904C6.52197 7.66739 6.33261 7.47803 6.20096 7.25C6 6.90192 6 6.43462 6 5.5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6 15.5C6 14.5654 6 14.0981 6.20096 13.75C6.33261 13.522 6.52197 13.3326 6.75 13.201C7.09808 13 7.56538 13 8.5 13H11.5C12.4346 13 12.9019 13 13.25 13.201C13.478 13.3326 13.6674 13.522 13.799 13.75C14 14.0981 14 14.5654 14 15.5C14 16.4346 14 16.9019 13.799 17.25C13.6674 17.478 13.478 17.6674 13.25 17.799C12.9019 18 12.4346 18 11.5 18H8.5C7.56538 18 7.09808 18 6.75 17.799C6.52197 17.6674 6.33261 17.478 6.20096 17.25C6 16.9019 6 16.4346 6 15.5Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M20.8398 17.1408C21.6133 16.3673 22 15.9806 22 15.5C22 15.0194 21.6133 14.6327 20.8398 13.8592L20.6408 13.6602C19.8673 12.8867 19.4806 12.5 19 12.5C18.5194 12.5 18.1327 12.8867 17.3592 13.6602L17.1602 13.8592C16.3867 14.6327 16 15.0194 16 15.5C16 15.9806 16.3867 16.3673 17.1602 17.1408L17.3592 17.3398C18.1327 18.1133 18.5194 18.5 19 18.5C19.4806 18.5 19.8673 18.1133 20.6408 17.3398L20.8398 17.1408Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6.006 5.5H2.00781M2.00781 5.5V2M2.00781 5.5V12C2.00781 13.1037 1.85651 14.4679 2.89627 15.1629C3.40049 15.5 4.1024 15.5 5.50623 15.5M14.0024 15.5H16.0015M19.0001 12.5V9.5C19.0001 7.61438 19.0001 6.67157 18.4146 6.08579C17.8291 5.5 16.8867 5.5 15.0019 5.5H14.0024`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M22.0001 22C21.0682 22 20.6023 22 20.2348 21.8695C19.7447 21.6955 19.3554 21.3618 19.1524 20.9417C19.0001 20.6267 19.0001 20.2273 19.0001 19.4286V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}]],Rm=[[`path`,{d:`M20.3584 13.3567C19.1689 14.546 16.9308 14.4998 13.4992 14.4998C11.2914 14.4998 9.50138 12.7071 9.50024 10.4993C9.50024 7.07001 9.454 4.83065 10.6435 3.64138C11.8329 2.45212 12.3583 2.50027 17.6274 2.50027C18.1366 2.49809 18.3929 3.11389 18.0329 3.47394L15.3199 6.18714C14.6313 6.87582 14.6294 7.99233 15.3181 8.68092C16.0068 9.36952 17.1234 9.36959 17.8122 8.68109L20.5259 5.96855C20.886 5.60859 21.5019 5.86483 21.4997 6.37395C21.4997 11.6422 21.5479 12.1675 20.3584 13.3567Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M13.5 14.5L7.32842 20.6716C6.22386 21.7761 4.433 21.7761 3.32843 20.6716C2.22386 19.567 2.22386 17.7761 3.32843 16.6716L9.5 10.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5.50896 18.5H5.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,key:`2`}]];function zm(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Bm(...e){return t=>{let n=!1,r=e.map(e=>{let r=zm(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():zm(e[t],null)}}}}function Vm(...e){return _.useCallback(Bm(...e),e)}function Hm(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Xm(r)&&typeof eh==`function`&&(r=eh(r._payload)),_.Children.forEach(r,e=>{if(Jm(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Xm(n)&&typeof eh==`function`&&(n=eh(n._payload)),a=Gm(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?qm(a):void 0,l=Vm(n,c);if(!a){if(r||r===0)throw Error(o?$m(e):Qm(e));return r}let u=Km(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var Um=Hm(`Slot`),Wm=Symbol.for(`radix.slottable`),Gm=(e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null};function Km(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}}function qm(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)}function Jm(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Wm}var Ym=Symbol.for(`react.lazy`);function Xm(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Ym&&`_payload`in e&&Zm(e._payload)}function Zm(e){return typeof e==`object`&&!!e&&`then`in e}var Qm=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,$m=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,eh=_.use,th=n(`inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-semibold shadow-none transition duration-200 ease-out active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-2 focus-visible:ring-ring/35 focus-visible:ring-offset-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`border border-foreground/45 bg-foreground text-background hover:bg-foreground/90`,ghost:`border border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground`,destructive:`border border-destructive bg-destructive text-destructive-foreground hover:bg-destructive/90`,secondary:`border border-border/80 bg-secondary text-secondary-foreground hover:border-muted-foreground/45 hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 px-3`,icon:`h-8 w-8 p-0`,sm:`h-8 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}});function nh({className:e,variant:t,size:n,asChild:r=!1,...i}){return(0,R.jsx)(r?Um:`button`,{className:a(th({variant:t,size:n,className:e})),...i})}var rh={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`},ih=(0,_.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n,absoluteStrokeWidth:r=!1,className:i=``,altIcon:a,showAlt:o=!1,icon:s,primaryColor:c,secondaryColor:l,disableSecondaryOpacity:u=!1,...d},f)=>{let p=n===void 0?void 0:r?Number(n)*24/Number(t):n,m=p===void 0?{}:{strokeWidth:p,stroke:`currentColor`};return(0,_.createElement)(`svg`,{ref:f,...rh,width:t,height:t,color:c||e,className:i,...m,...d},[...o&&a?a:s].sort(([,e],[,t])=>{let n=e.opacity!==void 0;return t.opacity===void 0?n?-1:0:1}).map(([t,n])=>{let r=n.opacity!==void 0,i=r&&!u?n.opacity:void 0,a=l?{...n.stroke===void 0?{fill:r?l:c||e}:{stroke:r?l:c||e}}:{};return(0,_.createElement)(t,{...n,...m,...a,opacity:i,key:n.key})}))});ih.displayName=`HugeiconsIcon`;function ah({color:e=`currentColor`,strokeWidth:t=1.5,...n}){return(0,R.jsx)(ih,{color:e,strokeWidth:t,...n})}function oh(e){let t=sh(e.icon);return(0,R.jsxs)(nh,{className:a(`h-8 min-h-8 w-full justify-start gap-3 rounded-lg bg-transparent px-2.5 text-sm font-medium text-sidebar-foreground/62 shadow-none transition duration-200 hover:bg-sidebar-accent/80 hover:text-sidebar-foreground active:translate-y-px [&_svg]:h-3.5 [&_svg]:w-3.5`,e.active&&`bg-sidebar-accent text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`),variant:`ghost`,type:`button`,disabled:e.disabled,onClick:e.onClick,children:[(0,R.jsx)(ah,{icon:t}),(0,R.jsx)(`span`,{children:e.label})]})}function sh(e){switch(e){case`activity`:return bm;case`bot`:return Pm;case`database`:return Om;case`gauge`:return Am;case`list`:return jm;case`message`:return Em;case`plug`:return Nm;case`shield`:return Fm;case`wrench`:return Rm;case`workflow`:return Lm}}function ch(e){return(0,R.jsxs)(`aside`,{className:`flex h-[100dvh] min-h-0 flex-col overflow-hidden bg-sidebar text-sidebar-foreground`,children:[(0,R.jsx)(`div`,{className:`flex h-15 items-center px-4`,children:(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,R.jsx)(`img`,{className:`h-7 w-7 shrink-0 object-contain`,src:Qp,alt:``}),(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:(0,R.jsx)(`span`,{className:`anvia-wordmark text-lg font-semibold tracking-normal text-sidebar-foreground`,children:`Anvia Studio`})})]})}),(0,R.jsxs)(`nav`,{className:`grid gap-0.5 px-3 py-3`,"aria-label":`Main`,children:[(0,R.jsx)(`div`,{className:`px-2.5 pb-1.5 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:`Workspace`}),(0,R.jsx)(oh,{active:e.activePage===`playground`,icon:`message`,label:`Chat`,onClick:()=>e.onNavigate(`playground`)}),(0,R.jsx)(oh,{active:e.activePage===`pipelines`,icon:`workflow`,label:`Pipelines`,onClick:()=>e.onNavigate(`pipelines`)}),(0,R.jsx)(oh,{active:e.activePage===`evals`,icon:`gauge`,label:`Evals`,onClick:()=>e.onNavigate(`evals`)}),(0,R.jsx)(oh,{active:e.activePage===`sessions`,icon:`list`,label:`Sessions`,onClick:()=>e.onNavigate(`sessions`)}),(0,R.jsx)(oh,{active:e.activePage===`tracing`,icon:`activity`,label:`Traces`,onClick:()=>e.onNavigate(`tracing`)})]}),(0,R.jsxs)(`nav`,{className:`grid gap-0.5 px-3 py-3`,"aria-label":`Studio`,children:[(0,R.jsx)(`div`,{className:`px-2.5 pb-1.5 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:`Inspect`}),(0,R.jsx)(oh,{active:e.activePage===`agents`,icon:`bot`,label:`Studio`,onClick:()=>e.onNavigate(`agents`)}),(0,R.jsx)(oh,{active:e.activePage===`tools`,icon:`wrench`,label:`Tools`,onClick:()=>e.onNavigate(`tools`)}),(0,R.jsx)(oh,{active:e.activePage===`mcps`,icon:`plug`,label:`MCPs`,onClick:()=>e.onNavigate(`mcps`)}),(0,R.jsx)(oh,{active:e.activePage===`knowledge`,icon:`database`,label:`Knowledge`,onClick:()=>e.onNavigate(`knowledge`)}),(0,R.jsx)(oh,{active:e.activePage===`memory`,icon:`database`,label:`Memory`,onClick:()=>e.onNavigate(`memory`)}),(0,R.jsx)(oh,{active:e.activePage===`status`,icon:`gauge`,label:`Status`,onClick:()=>e.onNavigate(`status`)})]}),(0,R.jsxs)(`nav`,{className:`grid min-h-0 gap-0.5 overflow-auto px-3 py-3`,"aria-label":`Recent sessions`,children:[(0,R.jsx)(`div`,{className:`px-2.5 pb-1.5 text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground`,children:`Recent`}),e.allSessions.slice(0,8).map(t=>(0,R.jsxs)(`div`,{className:a(`group grid min-h-7 min-w-0 grid-cols-[minmax(0,1fr)_36px] items-center gap-1 rounded-lg pr-1 transition duration-200 hover:bg-sidebar-accent/80 focus-within:bg-sidebar-accent/80`,t.id===e.selectedSessionId&&`bg-sidebar-accent`),children:[(0,R.jsx)(nh,{className:a(`grid h-auto min-h-7 min-w-0 justify-start rounded-lg border-0 bg-transparent px-2.5 py-0.5 text-left text-sidebar-foreground/72 shadow-none hover:bg-transparent hover:text-sidebar-foreground`,t.id===e.selectedSessionId&&`text-sidebar-accent-foreground`),type:`button`,variant:`ghost`,onClick:()=>e.onLoadSession(t.id),children:(0,R.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium`,children:t.title??`Untitled chat`})}),(0,R.jsxs)(`div`,{className:`relative grid h-7 min-w-0 place-items-end`,children:[(0,R.jsx)(`time`,{className:`grid h-6 min-w-6 place-items-center self-center justify-self-end rounded-lg px-1.5 text-sm font-medium tabular-nums text-muted-foreground group-hover:opacity-0 group-focus-within:opacity-0`,children:l(t.updatedAt)}),(0,R.jsx)(nh,{"aria-label":`Delete ${t.title??`Untitled chat`}`,className:`absolute right-0 top-1/2 hidden h-6 min-h-6 w-6 -translate-y-1/2 border-0 bg-transparent p-0 text-muted-foreground opacity-70 shadow-none hover:bg-transparent hover:text-destructive hover:opacity-100 group-hover:grid group-focus-within:grid [&_svg]:h-3.5 [&_svg]:w-3.5`,size:`icon`,type:`button`,variant:`ghost`,disabled:e.runState===`running`,onClick:()=>e.onDeleteSession(t),children:(0,R.jsx)(ah,{icon:xm,"aria-hidden":`true`})})]})]},t.id))]}),(0,R.jsxs)(`div`,{className:`mt-auto px-3 py-3`,children:[(0,R.jsx)(`nav`,{className:`grid gap-1`,"aria-label":`Anvia links`,children:(0,R.jsx)(uh,{href:`https://anvia.dev/docs`,label:`Anvia Docs`})}),(0,R.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:e.status})]})]})}function lh(e){return(0,R.jsx)(`header`,{className:`grid min-h-13 bg-background/88 backdrop-blur`,children:(0,R.jsxs)(`div`,{className:`grid min-h-13 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 py-0 pl-0 pr-6`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,R.jsx)(`span`,{className:`text-foreground`,children:e.activePage===`playground`?`Agents`:`Studio`}),(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.selectedAgentLabel})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(nh,{"aria-label":e.theme===`dark`?`Switch to light theme`:`Switch to dark theme`,className:`h-8 min-h-8 w-8 border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-muted/45 hover:text-foreground`,title:e.theme===`dark`?`Switch to light theme`:`Switch to dark theme`,type:`button`,variant:`ghost`,size:`icon`,onClick:e.onToggleTheme,children:e.theme===`dark`?(0,R.jsx)(ah,{icon:Im,"aria-hidden":`true`}):(0,R.jsx)(ah,{icon:Mm,"aria-hidden":`true`})}),(0,R.jsx)(nh,{className:`h-8 min-h-8 rounded-lg border border-white bg-white px-3 text-xs text-black shadow-none [box-shadow:none] hover:border-white hover:bg-white/90 hover:text-black focus-visible:ring-0 active:bg-white/85 disabled:bg-muted disabled:text-muted-foreground`,type:`button`,variant:`ghost`,disabled:!e.sessionsEnabled,onClick:e.onNewSession,children:`New session`})]})]})})}function uh(e){return(0,R.jsxs)(`a`,{className:`flex h-8 min-h-8 items-center justify-between rounded-lg px-2 text-xs font-semibold text-sidebar-foreground/62 transition duration-200 hover:bg-sidebar-accent hover:text-sidebar-foreground`,href:e.href,target:`_blank`,rel:`noreferrer`,children:[(0,R.jsx)(`span`,{children:e.label}),(0,R.jsx)(ah,{icon:km,"aria-hidden":`true`,className:`h-3 w-3 text-muted-foreground`})]})}function dh(){let e=rm();return(0,R.jsxs)(`div`,{className:`grid h-[100dvh] min-h-0 overflow-hidden bg-background text-foreground lg:grid-cols-[228px_minmax(0,1fr)]`,children:[(0,R.jsx)(ch,{activePage:e.activePage,allSessions:e.sessions.allSessions,evalsEnabled:e.evalsEnabled,hasAgents:e.hasAgents,knowledgeEnabled:e.knowledgeEnabled,mcpsEnabled:e.mcpsEnabled,memoryEnabled:e.memoryEnabled,pipelinesEnabled:e.pipelinesEnabled,runState:e.runState,selectedSessionId:e.sessions.selectedSessionId,sessionsEnabled:e.sessionsEnabled,status:e.status,statusEnabled:e.statusEnabled,toolsEnabled:e.toolsEnabled,tracesEnabled:e.tracesEnabled,onDeleteSession:e.setDeleteCandidate,onLoadSession:t=>void e.sessions.loadSession(t),onNavigate:e.navigatePage}),(0,R.jsxs)(`main`,{className:`grid h-[100dvh] min-w-0 grid-rows-[52px_minmax(0,1fr)] overflow-hidden bg-background/80`,children:[(0,R.jsx)(lh,{activePage:e.activePage,selectedAgentLabel:e.selectedAgent?.name??e.selectedAgent?.id??`Agent`,sessionsEnabled:e.sessionsEnabled,theme:e.theme,onNavigate:e.navigatePage,onNewSession:()=>e.startNewChat(),onToggleTheme:e.toggleTheme}),(0,R.jsx)(Fr,{})]}),(0,R.jsx)(_.Suspense,{fallback:null,children:(0,R.jsx)(hm,{session:e.deleteCandidate,onOpenChange:t=>{t||e.setDeleteCandidate(void 0)},onConfirm:t=>{e.sessions.deleteSession(t).finally(()=>{e.setDeleteCandidate(void 0)})}})})]})}function fh(e){let t=rm(),{activateRoute:n}=t;return(0,_.useEffect)(()=>{n(e)},[n,e]),t}function ph(e){switch(e){case`dynamic-context`:case`dynamic-tools`:case`retrieval-log`:case`static-context`:return e;default:return`static-context`}}function mh(){let e=fh(`agents`);return(0,R.jsx)(_.Suspense,{fallback:(0,R.jsx)(ym,{}),children:(0,R.jsx)(cm,{agents:e.agents,selectedAgentId:e.selectedAgentId})})}function hh(e){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(),[a,o]=(0,_.useState)(`idle`);async function c(){let n=t||e.evals[0]?.id||``;if(!(n.length===0||a===`running`)){o(`running`),i(void 0),e.onError(``);try{let t=await fetch(`/evals/${encodeURIComponent(n)}/runs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({})});if(!t.ok)throw Error(await pp(t,`Eval run failed`));i(await t.json()),e.onStatus(`Connected`)}catch(t){e.onError(s(t))}finally{o(`idle`)}}}return(0,R.jsx)(lm,{evals:e.evals,selectedEvalId:t,enabled:e.enabled,runState:a,result:r,onSelectEval:e=>{n(e),i(void 0)},onRun:()=>void c()})}function gh(){let e=fh(`evals`);return(0,R.jsx)(_.Suspense,{fallback:(0,R.jsx)(ym,{}),children:(0,R.jsx)(hh,{evals:e.evals,enabled:e.evalsEnabled,onError:e.setError,onStatus:e.setStatus})})}function _h(e){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(),[a,o]=(0,_.useState)(`idle`),c=(0,_.useCallback)(async t=>{if(!e.enabled||t.length===0){i(void 0);return}o(`loading`);try{let e=await fetch(`/agents/${encodeURIComponent(t)}/tools`);if(!e.ok)throw Error(`Tools failed with HTTP ${e.status}`);i(await e.json())}catch(t){e.onError(s(t)),i(void 0)}finally{o(`idle`)}},[e.enabled,e.onError]);return(0,_.useEffect)(()=>{e.active&&c(t||e.selectedAgentId)},[e.active,c,e.selectedAgentId,t]),(0,R.jsx)(_m,{agents:e.agents,selectedAgentId:t||e.selectedAgentId,summary:r,enabled:e.enabled,loading:a===`loading`,onSelectAgent:e=>{n(e),c(e)}})}function vh(e){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(),[a,o]=(0,_.useState)(`idle`),c=(0,_.useCallback)(async t=>{if(!e.enabled||t.length===0){i(void 0);return}o(`loading`);try{let e=await fetch(`/agents/${encodeURIComponent(t)}/mcps`);if(!e.ok)throw Error(`MCPs failed with HTTP ${e.status}`);i(await e.json())}catch(t){e.onError(s(t)),i(void 0)}finally{o(`idle`)}},[e.enabled,e.onError]);return(0,_.useEffect)(()=>{e.active&&c(t||e.selectedAgentId)},[e.active,c,t,e.selectedAgentId]),(0,R.jsx)(dm,{agents:e.agents,selectedAgentId:t||e.selectedAgentId,summary:r,enabled:e.enabled,loading:a===`loading`,onSelectAgent:e=>{n(e),c(e)}})}function yh(e){let[t,n]=(0,_.useState)(),[r,i]=(0,_.useState)(`idle`),a=(0,_.useCallback)(async()=>{if(!e.enabled){n(void 0);return}i(`loading`);try{let e=await fetch(`/knowledge?limit=25`);if(!e.ok)throw Error(`Knowledge failed with HTTP ${e.status}`);n(await e.json())}catch(t){e.onError(s(t))}finally{i(`idle`)}},[e.enabled,e.onError]);return(0,_.useEffect)(()=>{e.active&&a()},[e.active,a]),(0,R.jsx)(um,{activeTab:e.activeTab,enabled:e.enabled,summary:t,loading:r===`loading`,onOpenTrace:e.onOpenTrace,onRefresh:()=>void a(),onSelectTab:e.onSelectTab})}function bh(){let e=fh(`knowledge`),{setKnowledgeTab:t}=e,n=ph(nr({strict:!1}).tab);return(0,_.useEffect)(()=>{t(n)},[t,n]),(0,R.jsx)(_.Suspense,{fallback:(0,R.jsx)(ym,{}),children:(0,R.jsx)(yh,{active:!0,activeTab:n,enabled:e.knowledgeEnabled,onError:e.setError,onOpenTrace:e.traces.selectTrace,onSelectTab:e.navigateKnowledgeTab})})}function xh(){let e=fh(`mcps`);return(0,R.jsx)(_.Suspense,{fallback:(0,R.jsx)(ym,{}),children:(0,R.jsx)(vh,{active:!0,agents:e.agents,enabled:e.mcpsEnabled,selectedAgentId:e.selectedAgent?.id||e.selectedAgentId,onError:e.setError})})}function Sh(){let e=fh(`memory`);return(0,R.jsx)(_.Suspense,{fallback:(0,R.jsx)(ym,{}),children:(0,R.jsx)(fm,{agents:e.agents,enabled:e.memoryEnabled})})}function Ch(e){let[t,n]=(0,_.useState)(``),[r,i]=(0,_.useState)(),[a,o]=(0,_.useState)([]),[c,l]=(0,_.useState)([]),[u,d]=(0,_.useState)(`"Hello from Studio"`),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(``),[g,v]=(0,_.useState)(`idle`),[y,b]=(0,_.useState)(`idle`),[x,S]=(0,_.useState)(`idle`),[C,w]=(0,_.useState)(`idle`),T=(0,_.useRef)(0),E=(0,_.useRef)(0),D=(0,_.useCallback)(async t=>{if(!e.enabled||t.length===0)return E.current+=1,o([]),[];let n=E.current+1;E.current=n,b(`loading`);try{let e=new URLSearchParams({limit:`1000`}),r=await fetch(`/pipelines/${encodeURIComponent(t)}/logs?${e}`);if(!r.ok)throw Error(`Pipeline logs failed with HTTP ${r.status}`);let i=await r.json();return E.current===n&&o(i.logs),i.logs}catch(t){return E.current===n&&(e.onError(s(t)),o([])),[]}finally{E.current===n&&b(`idle`)}},[e.enabled,e.onError]),O=(0,_.useCallback)(async t=>{if(!e.enabled||t.length===0)return l([]),[];S(`loading`);try{let e=new URLSearchParams({limit:`50`}),n=await fetch(`/pipelines/${encodeURIComponent(t)}/runs?${e}`);if(!n.ok)throw Error(`Pipeline runs failed with HTTP ${n.status}`);let r=await n.json();return l(r.runs),r.runs}catch(t){return e.onError(s(t)),l([]),[]}finally{S(`idle`)}},[e.enabled,e.onError]),k=(0,_.useCallback)(async t=>{if(!e.enabled||t.length===0){T.current+=1,i(void 0),o([]),l([]);return}let r=T.current+1;T.current=r,v(`loading`),e.onError(``);try{let e=await fetch(`/pipelines/${encodeURIComponent(t)}`);if(!e.ok)throw Error(`Pipeline load failed with HTTP ${e.status}`);let a=await e.json();if(T.current!==r)return;n(t),i(a),await Promise.all([D(t),O(t)])}catch(t){T.current===r&&(e.onError(s(t)),i(void 0))}finally{T.current===r&&v(`idle`)}},[D,O,e.enabled,e.onError]);(0,_.useEffect)(()=>{if(!e.active)return;let n=t||e.pipelines[0]?.id||``;n.length>0&&k(n)},[e.active,e.pipelines,k,t]);async function A(e){await Op(e,async e=>{if(qr(e)){e.log.runId!==void 0&&h(t=>t||e.log.runId||``),ne(e.log),await kp();return}if(Jr(e)){p(wh(e.output)),await kp();return}if(Yr(e))throw Error(JSON.stringify(e.error))})}async function ee(){let n=t||e.pipelines[0]?.id||``;if(n.length===0||C===`running`)return;let r;try{r=JSON.parse(u)}catch{e.onError(`Pipeline input must be valid JSON`);return}w(`running`),p(``),h(``),e.onError(``);try{let t=await fetch(`/pipelines/${encodeURIComponent(n)}/runs`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({input:r,stream:!0,metadata:{source:`anvia-studio`}})});if(!t.ok||t.body===null)throw Error(await pp(t,`Pipeline run failed`));await A(t.body),await Promise.all([D(n),O(n)]),e.onStatus(`Connected`)}catch(t){e.onError(s(t))}finally{w(`idle`)}}async function j(n){let r=t||e.pipelines[0]?.id||``;if(!(r.length===0||n.length===0||C===`running`)){w(`running`),p(``),h(``),e.onError(``);try{let t=await fetch(`/pipelines/${encodeURIComponent(r)}/runs/${encodeURIComponent(n)}/replay`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({stream:!0,metadata:{source:`anvia-studio`}})});if(!t.ok||t.body===null)throw Error(await pp(t,`Pipeline replay failed`));await A(t.body),await Promise.all([D(r),O(r)]),e.onStatus(`Connected`)}catch(t){e.onError(s(t))}finally{w(`idle`)}}}function te(e){n(e),p(``),h(``),k(e)}function ne(e){o(t=>t.some(t=>t.id===e.id)?t:[...t,e].sort((e,t)=>e.sequence-t.sequence))}return{selectedPipelineId:t,pipelineDetail:r,pipelineLogs:a,pipelineRuns:c,activePipelineRunId:m,pipelineRunInput:u,pipelineRunOutput:f,pipelineDetailLoadState:g,pipelineLogLoadState:y,pipelineRunLoadState:x,pipelineRunState:C,setPipelineRunInput:d,selectPipeline:te,runPipeline:ee,replayPipelineRun:j}}function wh(e){return typeof e==`string`?e:JSON.stringify(e,null,2)}function Th(e){let t=Ch({active:e.active,enabled:e.enabled,pipelines:e.pipelines,onError:e.onError,onStatus:e.onStatus});return(0,R.jsx)(pm,{pipelines:e.pipelines,selectedPipelineId:t.selectedPipelineId,detail:t.pipelineDetail,logs:t.pipelineLogs,activeRunId:t.activePipelineRunId,runs:t.pipelineRuns,enabled:e.enabled,detailLoading:t.pipelineDetailLoadState===`loading`,logsLoading:t.pipelineLogLoadState===`loading`,runsLoading:t.pipelineRunLoadState===`loading`,runState:t.pipelineRunState,runInput:t.pipelineRunInput,runOutput:t.pipelineRunOutput,theme:e.theme,activeTab:e.activeTab,onSelectPipeline:t.selectPipeline,onRunInputChange:t.setPipelineRunInput,onRun:()=>void t.runPipeline(),onTabChange:e.onTabChange,onReplayRun:e=>void t.replayPipelineRun(e)})}function Eh(){let e=fh(`pipelines`),[t,n]=(0,_.useState)(()=>Dh());(0,_.useEffect)(()=>{function e(){n(Dh())}return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let r=(0,_.useCallback)(e=>{n(e);let t=new URL(window.location.href);t.searchParams.set(`tab`,e);let r=`${t.pathname}${t.search}${t.hash}`;`${window.location.pathname}${window.location.search}${window.location.hash}`!==r&&window.history.pushState(null,``,r)},[]);return(0,R.jsx)(_.Suspense,{fallback:(0,R.jsx)(ym,{}),children:(0,R.jsx)(Th,{active:!0,activeTab:t,pipelines:e.pipelines,enabled:e.pipelinesEnabled,theme:e.theme,onError:e.setError,onStatus:e.setStatus,onTabChange:r})})}function Dh(){return Oh(window.location.search)}function Oh(e){let t=new URLSearchParams(e).get(`tab`);return t===`metadata`||t===`runs`||t===`logs`?t:`input`}function kh(e,[t,n]){return Math.min(n,Math.max(t,e))}typeof window<`u`&&window.document&&window.document.createElement;function Ah(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function jh(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,R.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=_.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>_.createContext(e));return function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Mh(i,...t)]}function Mh(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Nh(e){let t=e+`CollectionProvider`,[n,r]=jh(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Hm(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,R.jsx)(c,{ref:Vm(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Hm(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=Vm(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.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[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Ph=_.createContext(void 0);function Fh(e){let t=_.useContext(Ph);return e||t||`ltr`}var Ih=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Hm(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,R.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Lh(e,t){e&&sr.flushSync(()=>e.dispatchEvent(t))}function Rh(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}function zh(e,t=globalThis?.document){let n=Rh(e);_.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Bh=`DismissableLayer`,Vh=`dismissableLayer.update`,Hh=`dismissableLayer.pointerDownOutside`,Uh=`dismissableLayer.focusOutside`,Wh,Gh=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Kh=_.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(Gh),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=Vm(t,e=>f(e)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(v),b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=Xh(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...u.branches].some(e=>e.contains(t));!S||n||(a?.(e),s?.(e),e.defaultPrevented||c?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces}),T=Zh(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);return zh(e=>{b===u.layers.size-1&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},p),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Wh=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Qh(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Wh))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Qh())},[d,u]),_.useEffect(()=>{let e=()=>m({});return document.addEventListener(Vh,e),()=>document.removeEventListener(Vh,e)},[]),(0,R.jsx)(Ih.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Ah(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Ah(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Ah(e.onPointerDownCapture,w.onPointerDownCapture)})});Kh.displayName=Bh;var qh=`DismissableLayerBranch`,Jh=_.forwardRef((e,t)=>{let n=_.useContext(Gh),r=_.useRef(null),i=Vm(t,r);return _.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,R.jsx)(Ih.div,{...e,ref:i})});Jh.displayName=qh;function Yh(){let e=_.useContext(Gh),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function Xh(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,o=Rh(e),s=_.useRef(!1),c=_.useRef(!1),l=_.useRef(new Map),u=_.useRef(()=>{});return _.useEffect(()=>{function e(){c.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function d(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{c.current&&u.current()},0)}function f(e){c.current&&l.current.set(e.type,!1)}let p=a=>{if(a.target&&!s.current){let s=function(){n.removeEventListener(`click`,u.current);let r=t();e(),r||$h(Hh,o,d,{discrete:!0})},d={originalEvent:a};c.current=!0,i.current=r&&a.button===0,l.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,u.current),u.current=s,n.addEventListener(`click`,u.current,{once:!0}))}else n.removeEventListener(`click`,u.current),e();s.current=!1},m=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of m)n.addEventListener(e,d,!0),n.addEventListener(e,f);let h=window.setTimeout(()=>{n.addEventListener(`pointerdown`,p)},0);return()=>{window.clearTimeout(h),n.removeEventListener(`pointerdown`,p),n.removeEventListener(`click`,u.current);for(let e of m)n.removeEventListener(e,d,!0),n.removeEventListener(e,f)}},[n,o,r,i,a]),{onPointerDownCapture:()=>s.current=!0}}function Zh(e,t=globalThis?.document){let n=Rh(e),r=_.useRef(!1);return _.useEffect(()=>{let e=e=>{e.target&&!r.current&&$h(Uh,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Qh(){let e=new CustomEvent(Vh);document.dispatchEvent(e)}function $h(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?Lh(i,a):i.dispatchEvent(a)}var eg=0,tg=null;function ng(){_.useEffect(()=>{tg||={start:rg(),end:rg()};let{start:e,end:t}=tg;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),eg++,()=>{eg===1&&(tg?.start.remove(),tg?.end.remove(),tg=null),eg=Math.max(0,eg-1)}},[])}function rg(){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}var ig=`focusScope.autoFocusOnMount`,ag=`focusScope.autoFocusOnUnmount`,og={bubbles:!1,cancelable:!0},sg=`FocusScope`,cg=_.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=Rh(i),u=Rh(a),d=_.useRef(null),f=Vm(t,e=>c(e)),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:hg(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||hg(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&hg(s)};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]),_.useEffect(()=>{if(s){gg.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ig,og);s.addEventListener(ig,l),s.dispatchEvent(t),t.defaultPrevented||(lg(yg(dg(s)),{select:!0}),document.activeElement===e&&hg(s))}return()=>{s.removeEventListener(ig,l),setTimeout(()=>{let t=new CustomEvent(ag,og);s.addEventListener(ag,u),s.dispatchEvent(t),t.defaultPrevented||hg(e??document.body,{select:!0}),s.removeEventListener(ag,u),gg.remove(p)},0)}}},[s,l,u,p]);let m=_.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]=ug(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&hg(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&hg(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,R.jsx)(Ih.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});cg.displayName=sg;function lg(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(hg(r,{select:t}),document.activeElement!==n)return}function ug(e){let t=dg(e);return[fg(t,e),fg(t.reverse(),e)]}function dg(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode: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}});for(;n.nextNode();)t.push(n.currentNode);return t}function fg(e,t){for(let n of e)if(!pg(n,{upTo:t}))return n}function pg(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}function mg(e){return e instanceof HTMLInputElement&&`select`in e}function hg(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&mg(e)&&t&&e.select()}}var gg=_g();function _g(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=vg(e,t),e.unshift(t)},remove(t){e=vg(e,t),e[0]?.resume()}}}function vg(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yg(e){return e.filter(e=>e.tagName!==`A`)}var bg=globalThis?.document?_.useLayoutEffect:()=>{},xg=_.useId||(()=>void 0),Sg=0;function Cg(e){let[t,n]=_.useState(xg());return bg(()=>{e||n(e=>e??String(Sg++))},[e]),e||(t?`radix-${t}`:``)}var wg=[`top`,`right`,`bottom`,`left`],Tg=Math.min,Eg=Math.max,Dg=Math.round,Og=Math.floor,kg=e=>({x:e,y:e}),Ag={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function jg(e,t,n){return Eg(e,Tg(t,n))}function Mg(e,t){return typeof e==`function`?e(t):e}function Ng(e){return e.split(`-`)[0]}function Pg(e){return e.split(`-`)[1]}function Fg(e){return e===`x`?`y`:`x`}function Ig(e){return e===`y`?`height`:`width`}function Lg(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Rg(e){return Fg(Lg(e))}function zg(e,t,n){n===void 0&&(n=!1);let r=Pg(e),i=Rg(e),a=Ig(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Jg(o)),[o,Jg(o)]}function Bg(e){let t=Jg(e);return[Vg(e),t,Vg(t)]}function Vg(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Hg=[`left`,`right`],Ug=[`right`,`left`],Wg=[`top`,`bottom`],Gg=[`bottom`,`top`];function Kg(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ug:Hg:t?Hg:Ug;case`left`:case`right`:return t?Wg:Gg;default:return[]}}function qg(e,t,n,r){let i=Pg(e),a=Kg(Ng(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Vg)))),a}function Jg(e){let t=Ng(e);return Ag[t]+e.slice(t.length)}function Yg(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xg(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Yg(e)}function Zg(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 Qg(e,t,n){let{reference:r,floating:i}=e,a=Lg(t),o=Rg(t),s=Ig(o),c=Ng(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}}switch(Pg(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function $g(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}=Mg(t,e),p=Xg(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Zg(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=Zg(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 e_=50,t_=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:$g},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Qg(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<e_&&(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}=Qg(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},n_=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}=Mg(e,t)||{};if(l==null)return{};let d=Xg(u),f={x:n,y:r},p=Rg(i),m=Ig(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=Tg(d[_],T),D=Tg(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,ee=jg(O,A,k),j=!c.arrow&&Pg(i)!=null&&A!==ee&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,te=j?A<O?A-O:A-k:0;return{[p]:f[p]+te,data:{[p]:ee,centerOffset:A-ee-te,...j&&{alignmentOffset:te}},reset:j}}}),r_=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}=Mg(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ng(r),_=Lg(o),v=Ng(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Jg(o)]:Bg(o)),x=p!==`none`;!d&&x&&b.push(...qg(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=zg(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`&&_!==Lg(t))||T.every(e=>Lg(e.placement)===_?e.overflows[0]>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=Lg(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 i_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function a_(e){return wg.some(t=>e[t]>=0)}var o_=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Mg(e,t);switch(i){case`referenceHidden`:{let e=i_(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:a_(e)}}}case`escaped`:{let e=i_(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:a_(e)}}}default:return{}}}}},s_=new Set([`left`,`top`]);async function c_(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ng(n),s=Pg(n),c=Lg(n)===`y`,l=s_.has(o)?-1:1,u=a&&c?-1:1,d=Mg(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 l_=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 c_(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}}}}},u_=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}=Mg(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Lg(Ng(i)),p=Fg(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=jg(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=jg(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},d_=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}=Mg(e,t),u={x:n,y:r},d=Lg(i),f=Fg(d),p=u[f],m=u[d],h=Mg(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=s_.has(Ng(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}}}},f_=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Mg(e,t),u=await o.detectOverflow(t,l),d=Ng(i),f=Pg(i),p=Lg(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Tg(h-u[g],v),x=Tg(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Eg(u.left,0),t=Eg(u.right,0),n=Eg(u.top,0),r=Eg(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Eg(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Eg(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function p_(){return typeof window<`u`}function m_(e){return __(e)?(e.nodeName||``).toLowerCase():`#document`}function h_(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function g_(e){return((__(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function __(e){return p_()?e instanceof Node||e instanceof h_(e).Node:!1}function v_(e){return p_()?e instanceof Element||e instanceof h_(e).Element:!1}function y_(e){return p_()?e instanceof HTMLElement||e instanceof h_(e).HTMLElement:!1}function b_(e){return!p_()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof h_(e).ShadowRoot}function x_(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=M_(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function S_(e){return/^(table|td|th)$/.test(m_(e))}function C_(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var w_=/transform|translate|scale|rotate|perspective|filter/,T_=/paint|layout|strict|content/,E_=e=>!!e&&e!==`none`,D_;function O_(e){let t=v_(e)?M_(e):e;return E_(t.transform)||E_(t.translate)||E_(t.scale)||E_(t.rotate)||E_(t.perspective)||!A_()&&(E_(t.backdropFilter)||E_(t.filter))||w_.test(t.willChange||``)||T_.test(t.contain||``)}function k_(e){let t=P_(e);for(;y_(t)&&!j_(t);){if(O_(t))return t;if(C_(t))return null;t=P_(t)}return null}function A_(){return D_??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),D_}function j_(e){return/^(html|body|#document)$/.test(m_(e))}function M_(e){return h_(e).getComputedStyle(e)}function N_(e){return v_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function P_(e){if(m_(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||b_(e)&&e.host||g_(e);return b_(t)?t.host:t}function F_(e){let t=P_(e);return j_(t)?e.ownerDocument?e.ownerDocument.body:e.body:y_(t)&&x_(t)?t:F_(t)}function I_(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=F_(e),i=r===e.ownerDocument?.body,a=h_(r);if(i){let e=L_(a);return t.concat(a,a.visualViewport||[],x_(r)?r:[],e&&n?I_(e):[])}else return t.concat(r,I_(r,[],n))}function L_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function R_(e){let t=M_(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=y_(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Dg(n)!==a||Dg(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function z_(e){return v_(e)?e:e.contextElement}function B_(e){let t=z_(e);if(!y_(t))return kg(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=R_(t),o=(a?Dg(n.width):n.width)/r,s=(a?Dg(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var V_=kg(0);function H_(e){let t=h_(e);return!A_()||!t.visualViewport?V_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function U_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==h_(e)?!1:t}function W_(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=z_(e),o=kg(1);t&&(r?v_(r)&&(o=B_(r)):o=B_(e));let s=U_(a,n,r)?H_(a):kg(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){let e=h_(a),t=r&&v_(r)?h_(r):r,n=e,i=L_(n);for(;i&&r&&t!==n;){let e=B_(i),t=i.getBoundingClientRect(),r=M_(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=h_(i),i=L_(n)}}return Zg({width:u,height:d,x:c,y:l})}function G_(e,t){let n=N_(e).scrollLeft;return t?t.left+n:W_(g_(e)).left+n}function K_(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-G_(e,n),y:n.top+t.scrollTop}}function q_(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=g_(r),s=t?C_(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=kg(1),u=kg(0),d=y_(r);if((d||!d&&!a)&&((m_(r)!==`body`||x_(o))&&(c=N_(r)),d)){let e=W_(r);l=B_(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?K_(o,c):kg(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 J_(e){return Array.from(e.getClientRects())}function Y_(e){let t=g_(e),n=N_(e),r=e.ownerDocument.body,i=Eg(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Eg(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+G_(e),s=-n.scrollTop;return M_(r).direction===`rtl`&&(o+=Eg(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var X_=25;function Z_(e,t){let n=h_(e),r=g_(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=A_();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=G_(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=X_&&(a-=o)}else l<=X_&&(a+=l);return{width:a,height:o,x:s,y:c}}function Q_(e,t){let n=W_(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=y_(e)?B_(e):kg(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function $_(e,t,n){let r;if(t===`viewport`)r=Z_(e,n);else if(t===`document`)r=Y_(g_(e));else if(v_(t))r=Q_(t,n);else{let n=H_(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Zg(r)}function ev(e,t){let n=P_(e);return n===t||!v_(n)||j_(n)?!1:M_(n).position===`fixed`||ev(n,t)}function tv(e,t){let n=t.get(e);if(n)return n;let r=I_(e,[],!1).filter(e=>v_(e)&&m_(e)!==`body`),i=null,a=M_(e).position===`fixed`,o=a?P_(e):e;for(;v_(o)&&!j_(o);){let t=M_(o),n=O_(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||x_(o)&&!n&&ev(e,o))?r=r.filter(e=>e!==o):i=t,o=P_(o)}return t.set(e,r),r}function nv(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?C_(t)?[]:tv(t,this._c):[].concat(n),r],o=$_(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=$_(t,a[e],i);s=Eg(n.top,s),c=Tg(n.right,c),l=Tg(n.bottom,l),u=Eg(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function rv(e){let{width:t,height:n}=R_(e);return{width:t,height:n}}function iv(e,t,n){let r=y_(t),i=g_(t),a=n===`fixed`,o=W_(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=kg(0);function l(){c.x=G_(i)}if(r||!r&&!a)if((m_(t)!==`body`||x_(i))&&(s=N_(t)),r){let e=W_(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?K_(i,s):kg(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function av(e){return M_(e).position===`static`}function ov(e,t){if(!y_(e)||M_(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return g_(e)===n&&(n=n.ownerDocument.body),n}function sv(e,t){let n=h_(e);if(C_(e))return n;if(!y_(e)){let t=P_(e);for(;t&&!j_(t);){if(v_(t)&&!av(t))return t;t=P_(t)}return n}let r=ov(e,t);for(;r&&S_(r)&&av(r);)r=ov(r,t);return r&&j_(r)&&av(r)&&!O_(r)?n:r||k_(e)||n}var cv=async function(e){let t=this.getOffsetParent||sv,n=this.getDimensions,r=await n(e.floating);return{reference:iv(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lv(e){return M_(e).direction===`rtl`}var uv={convertOffsetParentRelativeRectToViewportRelativeRect:q_,getDocumentElement:g_,getClippingRect:nv,getOffsetParent:sv,getElementRects:cv,getClientRects:J_,getDimensions:rv,getScale:B_,isElement:v_,isRTL:lv};function dv(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fv(e,t){let n=null,r,i=g_(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Og(d),h=Og(i.clientWidth-(u+f)),g=Og(i.clientHeight-(d+p)),_=Og(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Eg(0,Tg(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!dv(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function pv(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=z_(e),u=i||a?[...l?I_(l):[],...t?I_(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?fv(l,n):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?W_(e):null;c&&g();function g(){let t=W_(e);h&&!dv(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 mv=l_,hv=u_,gv=r_,_v=f_,vv=o_,yv=n_,bv=d_,xv=(e,t,n)=>{let r=new Map,i={platform:uv,...n},a={...i.platform,_c:r};return t_(e,t,{...i,platform:a})},Sv=typeof document<`u`?_.useLayoutEffect:function(){};function Cv(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(!Cv(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)&&!Cv(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function wv(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Tv(e,t){let n=wv(e);return Math.round(t*n)/n}function Ev(e){let t=_.useRef(e);return Sv(()=>{t.current=e}),t}function Dv(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]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Cv(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=Ev(c),O=Ev(i),k=Ev(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),xv(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};ee.current&&!Cv(T.current,t)&&(T.current=t,sr.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Sv(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ee=_.useRef(!1);Sv(()=>(ee.current=!0,()=>{ee.current=!1}),[]),Sv(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let j=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),te=_.useMemo(()=>({reference:x,floating:S}),[x,S]),ne=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!te.floating)return e;let t=Tv(te.floating,u.x),r=Tv(te.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...wv(te.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,te.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:j,elements:te,floatingStyles:ne}),[u,A,j,te,ne])}var Ov=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?{}:yv({element:r.current,padding:i}).fn(n):r?yv({element:r,padding:i}).fn(n):{}}}},kv=(e,t)=>{let n=mv(e);return{name:n.name,fn:n.fn,options:[e,t]}},Av=(e,t)=>{let n=hv(e);return{name:n.name,fn:n.fn,options:[e,t]}},jv=(e,t)=>({fn:bv(e).fn,options:[e,t]}),Mv=(e,t)=>{let n=gv(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nv=(e,t)=>{let n=_v(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pv=(e,t)=>{let n=vv(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fv=(e,t)=>{let n=Ov(e);return{name:n.name,fn:n.fn,options:[e,t]}},Iv=`Arrow`,Lv=_.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(Ih.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,R.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Lv.displayName=Iv;var Rv=Lv;function zv(e){let[t,n]=_.useState(void 0);return bg(()=>{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}var Bv=`Popper`,[Vv,Hv]=jh(Bv),[Uv,Wv]=Vv(Bv),Gv=e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,R.jsx)(Uv,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};Gv.displayName=Bv;var Kv=`PopperAnchor`,qv=_.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Wv(Kv,n),o=_.useRef(null),s=a.onAnchorChange,c=Vm(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&ry(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,R.jsx)(Ih.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});qv.displayName=Kv;var Jv=`PopperContent`,[Yv,Xv]=Vv(Jv),Zv=_.forwardRef((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=Wv(Jv,n),[v,y]=_.useState(null),b=Vm(t,e=>y(e)),[x,S]=_.useState(null),C=zv(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(ty),altBoundary:k},{refs:ee,floatingStyles:j,placement:te,isPositioned:ne,middlewareData:M}=Dv({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>pv(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[kv({mainAxis:i+T,alignmentAxis:o}),c&&Av({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?jv():void 0,...A}),c&&Mv({...A}),Nv({...A,apply:({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`)}}),x&&Fv({element:x,padding:s}),ny({arrowWidth:w,arrowHeight:T}),f&&Pv({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),N=g.setPlacementState;bg(()=>(N(te),()=>{N(void 0)}),[te,N]);let[P,re]=ry(te),ie=Rh(m);bg(()=>{ne&&ie?.()},[ne,ie]);let ae=M.arrow?.x,oe=M.arrow?.y,F=M.arrow?.centerOffset!==0,[I,se]=_.useState();return bg(()=>{v&&se(window.getComputedStyle(v).zIndex)},[v]),(0,R.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:ne?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:I,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(Yv,{scope:n,placedSide:P,placedAlign:re,onArrowChange:S,arrowX:ae,arrowY:oe,shouldHideArrow:F,children:(0,R.jsx)(Ih.div,{"data-side":P,"data-align":re,...h,ref:b,style:{...h.style,animation:ne?void 0:`none`}})})})});Zv.displayName=Jv;var Qv=`PopperArrow`,$v={top:`bottom`,right:`left`,bottom:`top`,left:`right`},ey=_.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Xv(Qv,n),a=$v[i.placedSide];return(0,R.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,R.jsx)(Rv,{...r,ref:t,style:{...r.style,display:`block`}})})});ey.displayName=Qv;function ty(e){return e!==null}var ny=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]=ry(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}}}});function ry(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var iy=Gv,ay=qv,oy=Zv,sy=ey,cy=`Portal`,ly=_.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=_.useState(!1);bg(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?sr.createPortal((0,R.jsx)(Ih.div,{...r,ref:t}),o):null});ly.displayName=cy;function uy(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}var dy=e=>{let{present:t,children:n}=e,r=fy(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=my(r.ref,gy(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null};dy.displayName=`Presence`;function fy(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),[o,s]=uy(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{let e=hy(r.current);a.current=o===`mounted`?e:`none`},[o]),bg(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=hy(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),bg(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=hy(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=hy(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:_.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function py(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function my(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=py(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():py(n[e],null)}}},[])}function hy(e){return e?.animationName||`none`}function gy(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)}var _y=_.useInsertionEffect||bg;function vy({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=yy({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=_.useRef(e!==void 0);_.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,_.useCallback(t=>{if(s){let n=by(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function yy({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return _y(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function by(e){return typeof e==`function`}function xy(e){let t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Sy=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`}),Cy=`VisuallyHidden`,wy=_.forwardRef((e,t)=>(0,R.jsx)(Ih.span,{...e,ref:t,style:{...Sy,...e.style}}));wy.displayName=Cy;var Ty=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ey=new WeakMap,Dy=new WeakMap,Oy={},ky=0,Ay=function(e){return e&&(e.host||Ay(e.parentNode))},jy=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ay(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})},My=function(e,t,n,r){var i=jy(t,Array.isArray(e)?e:[e]);Oy[n]||(Oy[n]=new WeakMap);var a=Oy[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=(Ey.get(e)||0)+1,l=(a.get(e)||0)+1;Ey.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Dy.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(),ky++,function(){o.forEach(function(e){var t=Ey.get(e)-1,i=a.get(e)-1;Ey.set(e,t),a.set(e,i),t||(Dy.has(e)||e.removeAttribute(r),Dy.delete(e)),i||e.removeAttribute(n)}),ky--,ky||(Ey=new WeakMap,Ey=new WeakMap,Dy=new WeakMap,Oy={})}},Ny=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ty(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),My(r,i,n,`aria-hidden`)):function(){return null}},Py=function(){return Py=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},Py.apply(this,arguments)};function Fy(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 Iy(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 Ly=`right-scroll-bar-position`,Ry=`width-before-scroll-bar`,zy=`with-scroll-bars-hidden`,By=`--removed-body-scroll-bar-size`;function Vy(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Hy(e,t){var n=(0,_.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 Uy=typeof window<`u`?_.useLayoutEffect:_.useEffect,Wy=new WeakMap;function Gy(e,t){var n=Hy(t||null,function(t){return e.forEach(function(e){return Vy(e,t)})});return Uy(function(){var t=Wy.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Vy(e,null)}),i.forEach(function(e){r.has(e)||Vy(e,a)})}Wy.set(n,e)},[e]),n}function Ky(e){return e}function qy(e,t){t===void 0&&(t=Ky);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 Jy(e){e===void 0&&(e={});var t=qy(null);return t.options=Py({async:!0,ssr:!1},e),t}var Yy=function(e){var t=e.sideCar,n=Fy(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 _.createElement(r,Py({},n))};Yy.isSideCarExport=!0;function Xy(e,t){return e.useMedium(t),Yy}var Zy=Jy(),Qy=function(){},$y=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:Qy,onWheelCapture:Qy,onTouchMoveCapture:Qy}),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,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Fy(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=Gy([n,t]),w=Py(Py({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:Zy,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Py(Py({},w),{ref:C})):_.createElement(y,Py({},w,{className:c,ref:C}),s))});$y.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$y.classNames={fullWidth:Ry,zeroRight:Ly};var eb,tb=function(){if(eb)return eb;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function nb(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=tb();return t&&e.setAttribute(`nonce`,t),e}function rb(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ib(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ab=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nb())&&(rb(t,n),ib(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ob=function(){var e=ab();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},sb=function(){var e=ob();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},cb={left:0,top:0,right:0,gap:0},lb=function(e){return parseInt(e||``,10)||0},ub=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[lb(n),lb(r),lb(i)]},db=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return cb;var t=ub(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])}},fb=sb(),pb=`data-scroll-locked`,mb=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
114
|
+
.${zy} {
|
|
115
|
+
overflow: hidden ${r};
|
|
116
|
+
padding-right: ${s}px ${r};
|
|
117
|
+
}
|
|
118
|
+
body[${pb}] {
|
|
119
|
+
overflow: hidden ${r};
|
|
120
|
+
overscroll-behavior: contain;
|
|
121
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
122
|
+
padding-left: ${i}px;
|
|
123
|
+
padding-top: ${a}px;
|
|
124
|
+
padding-right: ${o}px;
|
|
125
|
+
margin-left:0;
|
|
126
|
+
margin-top:0;
|
|
127
|
+
margin-right: ${s}px ${r};
|
|
128
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.${Ly} {
|
|
132
|
+
right: ${s}px ${r};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.${Ry} {
|
|
136
|
+
margin-right: ${s}px ${r};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.${Ly} .${Ly} {
|
|
140
|
+
right: 0 ${r};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.${Ry} .${Ry} {
|
|
144
|
+
margin-right: 0 ${r};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
body[${pb}] {
|
|
148
|
+
${By}: ${s}px;
|
|
149
|
+
}
|
|
150
|
+
`},hb=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},gb=function(){_.useEffect(function(){return document.body.setAttribute(pb,(hb()+1).toString()),function(){var e=hb()-1;e<=0?document.body.removeAttribute(pb):document.body.setAttribute(pb,e.toString())}},[])},_b=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;gb();var a=_.useMemo(function(){return db(i)},[i]);return _.createElement(fb,{styles:mb(a,!t,i,n?``:`!important`)})},vb=!1;if(typeof window<`u`)try{var yb=Object.defineProperty({},`passive`,{get:function(){return vb=!0,!0}});window.addEventListener(`test`,yb,yb),window.removeEventListener(`test`,yb,yb)}catch{vb=!1}var bb=vb?{passive:!1}:!1,xb=function(e){return e.tagName===`TEXTAREA`},Sb=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!xb(e)&&n[t]===`visible`)},Cb=function(e){return Sb(e,`overflowY`)},wb=function(e){return Sb(e,`overflowX`)},Tb=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Ob(e,r)){var i=kb(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Eb=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Db=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Ob=function(e,t){return e===`v`?Cb(t):wb(t)},kb=function(e,t){return e===`v`?Eb(t):Db(t)},Ab=function(e,t){return e===`h`&&t===`rtl`?-1:1},jb=function(e,t,n,r,i){var a=Ab(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=kb(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Ob(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},Mb=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Nb=function(e){return[e.deltaX,e.deltaY]},Pb=function(e){return e&&`current`in e?e.current:e},Fb=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ib=function(e){return`
|
|
151
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
152
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
153
|
+
`},Lb=0,Rb=[];function zb(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Lb++)[0],a=_.useState(sb)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Iy([e.lockRef.current],(e.shards||[]).map(Pb),!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=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Mb(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=Tb(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Tb(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 jb(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(!(!Rb.length||Rb[Rb.length-1]!==a)){var r=`deltaY`in n?Nb(n):Mb(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Fb(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Pb).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=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Bb(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Mb(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Nb(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Mb(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Rb.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,bb),document.addEventListener(`touchmove`,c,bb),document.addEventListener(`touchstart`,u,bb),function(){Rb=Rb.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,bb),document.removeEventListener(`touchmove`,c,bb),document.removeEventListener(`touchstart`,u,bb)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Ib(i)}):null,p?_.createElement(_b,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Bb(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Vb=Xy(Zy,zb),Hb=_.forwardRef(function(e,t){return _.createElement($y,Py({},e,{ref:t,sideCar:Vb}))});Hb.classNames=$y.classNames;var Ub=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Wb=[` `,`Enter`],Gb=`Select`,[Kb,qb,Jb]=Nh(Gb),[Yb,Xb]=jh(Gb,[Jb,Hv]),Zb=Hv(),[Qb,$b]=Yb(Gb),[ex,tx]=Yb(Gb),nx=`SelectProvider`;function rx(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=Zb(t),[v,y]=_.useState(null),[b,x]=_.useState(null),[S,C]=_.useState(!1),w=Fh(l),[T,E]=vy({prop:r,defaultProp:i??!1,onChange:a,caller:Gb}),[D,O]=vy({prop:o,defaultProp:s,onChange:c,caller:Gb}),k=_.useRef(null),A=v?!!m||!!v.closest(`form`):!0,[ee,j]=_.useState(new Set),te=Cg(),ne=Array.from(ee).map(e=>e.props.value).join(`;`),M=_.useCallback(e=>{j(t=>new Set(t).add(e))},[]),N=_.useCallback(e=>{j(t=>{let n=new Set(t);return n.delete(e),n})},[]),P={required:p,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:te,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:ee,nativeSelectKey:ne,isFormControl:A};return(0,R.jsx)(iy,{...g,children:(0,R.jsx)(Qb,{scope:t,...P,children:(0,R.jsx)(Kb.Provider,{scope:t,children:(0,R.jsx)(ex,{scope:t,onNativeOptionAdd:M,onNativeOptionRemove:N,children:rS(h)?h(P):n})})})})}rx.displayName=nx;var ix=e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,R.jsx)(rx,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,R.jsxs)(R.Fragment,{children:[n,e?(0,R.jsx)(nS,{__scopeSelect:t}):null]})})};ix.displayName=Gb;var ax=`SelectTrigger`,ox=_.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Zb(n),o=$b(ax,n),s=o.disabled||r,c=Vm(t,o.onTriggerChange),l=qb(n),u=_.useRef(`touch`),[d,f,p]=aS(e=>{let t=l().filter(e=>!e.disabled),n=oS(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)})};return(0,R.jsx)(ay,{asChild:!0,...a,children:(0,R.jsx)(Ih.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":iS(o.value)?``:void 0,...i,ref:c,onClick:Ah(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:Ah(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:Ah(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Ub.includes(e.key)&&(m(),e.preventDefault())})})})});ox.displayName=ax;var sx=`SelectValue`,cx=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=$b(sx,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Vm(t,c.onValueNodeChange);bg(()=>{l(u)},[l,u]);let f=iS(c.value);return(0,R.jsx)(Ih.span,{...s,asChild:f?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,R.jsx)(_.Fragment,{children:f?o:a},f?`placeholder`:`value`)})});cx.displayName=sx;var lx=`SelectIcon`,ux=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,R.jsx)(Ih.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ux.displayName=lx;var dx=`SelectPortal`,[fx,px]=Yb(dx,{forceMount:void 0}),mx=e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,R.jsx)(fx,{scope:e.__scopeSelect,forceMount:n,children:(0,R.jsx)(ly,{asChild:!0,...r})})};mx.displayName=dx;var hx=`SelectContent`,gx=_.forwardRef((e,t)=>{let n=px(hx,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=$b(hx,e.__scopeSelect),[o,s]=_.useState();return bg(()=>{s(new DocumentFragment)},[]),(0,R.jsx)(dy,{present:r||a.open,children:({present:e})=>e?(0,R.jsx)(Cx,{...i,ref:t}):(0,R.jsx)(_x,{...i,fragment:o})})});gx.displayName=hx;var _x=_.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,fragment:i}=e;return i?sr.createPortal((0,R.jsx)(yx,{scope:n,children:(0,R.jsx)(Kb.Slot,{scope:n,children:(0,R.jsx)(`div`,{ref:t,children:r})})}),i):null});_x.displayName=`SelectContentFragment`;var vx=10,[yx,bx]=Yb(hx),xx=`SelectContentImpl`,Sx=Hm(`SelectContent.RemoveScroll`),Cx=_.forwardRef((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,...v}=e,y=$b(hx,n),[b,x]=_.useState(null),[S,C]=_.useState(null),w=Vm(t,e=>x(e)),[T,E]=_.useState(null),[D,O]=_.useState(null),k=qb(n),[A,ee]=_.useState(!1),j=_.useRef(!1);_.useEffect(()=>{if(b)return Ny(b)},[b]),ng();let te=_.useCallback(e=>{let[t,...n]=k().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},[k,S]),ne=_.useCallback(()=>te([T,b]),[te,T,b]);_.useEffect(()=>{A&&ne()},[A,ne]);let{onOpenChange:M,triggerPointerDownPosRef:N}=y;_.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))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||M(!1),document.removeEventListener(`pointermove`,t),N.current=null};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]),_.useEffect(()=>{let e=()=>M(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[M]);let[P,re]=aS(e=>{let t=k().filter(e=>!e.disabled),n=oS(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ie=_.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=_.useCallback(()=>b?.focus(),[b]),oe=_.useCallback((e,t,n)=>{let r=!j.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),F=r===`popper`?Dx:Tx,I=F===Dx?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,R.jsx)(yx,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ie,selectedItem:T,onItemLeave:ae,itemTextRefCallback:oe,focusSelectedItem:ne,selectedItemText:D,position:r,isPositioned:A,searchRef:P,children:(0,R.jsx)(Hb,{as:Sx,allowPinchZoom:!0,children:(0,R.jsx)(cg,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Ah(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,R.jsx)(Kh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,R.jsx)(F,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...I,onPlaced:()=>ee(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:Ah(v.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=k().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()}})})})})})})});Cx.displayName=xx;var wx=`SelectItemAlignedPosition`,Tx=_.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=$b(hx,n),o=bx(hx,n),[s,c]=_.useState(null),[l,u]=_.useState(null),d=Vm(t,e=>u(e)),f=qb(n),p=_.useRef(!1),m=_.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=o,b=_.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.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-vx,d=kh(a,[vx,Math.max(vx,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-vx,d=kh(a,[vx,Math.max(vx,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-vx*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),_=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+_+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-vx,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+_+k,ee=x-A;if(A<=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=A+Math.max(D,O+(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)+O)+ee;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${vx}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,v,a.dir,r]);bg(()=>b(),[b]);let[x,S]=_.useState();return bg(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,R.jsx)(Ox,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:_.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,R.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,R.jsx)(Ih.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Tx.displayName=wx;var Ex=`SelectPopperPosition`,Dx=_.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=vx,...a}=e,o=Zb(n);return(0,R.jsx)(oy,{...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)`}})});Dx.displayName=Ex;var[Ox,kx]=Yb(hx,{}),Ax=`SelectViewport`,jx=_.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=bx(Ax,n),o=kx(Ax,n),s=Vm(t,a.onViewportChange),c=_.useRef(0);return(0,R.jsxs)(R.Fragment,{children:[(0,R.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,R.jsx)(Kb.Slot,{scope:n,children:(0,R.jsx)(Ih.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Ah(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-vx*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})})})]})});jx.displayName=Ax;var Mx=`SelectGroup`,[Nx,Px]=Yb(Mx),Fx=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Cg();return(0,R.jsx)(Nx,{scope:n,id:i,children:(0,R.jsx)(Ih.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Fx.displayName=Mx;var Ix=`SelectLabel`,Lx=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Px(Ix,n);return(0,R.jsx)(Ih.div,{id:i.id,...r,ref:t})});Lx.displayName=Ix;var Rx=`SelectItem`,[zx,Bx]=Yb(Rx),Vx=_.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=$b(Rx,n),c=bx(Rx,n),l=s.value===r,[u,d]=_.useState(a??``),[f,p]=_.useState(!1),m=Vm(t,e=>c.itemRefCallback?.(e,r,i)),h=Cg(),g=_.useRef(`touch`),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};return(0,R.jsx)(zx,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:_.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,R.jsx)(Kb.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,R.jsx)(Ih.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:Ah(o.onFocus,()=>p(!0)),onBlur:Ah(o.onBlur,()=>p(!1)),onClick:Ah(o.onClick,()=>{g.current!==`mouse`&&v()}),onPointerUp:Ah(o.onPointerUp,()=>{g.current===`mouse`&&v()}),onPointerDown:Ah(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:Ah(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ah(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Ah(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(Wb.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});Vx.displayName=Rx;var Hx=`SelectItemText`,Ux=_.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=$b(Hx,n),s=bx(Hx,n),c=Bx(Hx,n),l=tx(Hx,n),[u,d]=_.useState(null),f=Vm(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=_.useMemo(()=>(0,R.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return bg(()=>(h(m),()=>g(m)),[h,g,m]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Ih.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!iS(o.value)?sr.createPortal(a.children,o.valueNode):null]})});Ux.displayName=Hx;var Wx=`SelectItemIndicator`,Gx=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return Bx(Wx,n).isSelected?(0,R.jsx)(Ih.span,{"aria-hidden":!0,...r,ref:t}):null});Gx.displayName=Wx;var Kx=`SelectScrollUpButton`,qx=_.forwardRef((e,t)=>{let n=bx(Kx,e.__scopeSelect),r=kx(Kx,e.__scopeSelect),[i,a]=_.useState(!1),o=Vm(t,r.onScrollButtonChange);return bg(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(Xx,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});qx.displayName=Kx;var Jx=`SelectScrollDownButton`,Yx=_.forwardRef((e,t)=>{let n=bx(Jx,e.__scopeSelect),r=kx(Jx,e.__scopeSelect),[i,a]=_.useState(!1),o=Vm(t,r.onScrollButtonChange);return bg(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(Xx,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Yx.displayName=Jx;var Xx=_.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=bx(`SelectScrollButton`,n),o=_.useRef(null),s=qb(n),c=_.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),bg(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,R.jsx)(Ih.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ah(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ah(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ah(i.onPointerLeave,()=>{c()})})}),Zx=`SelectSeparator`,Qx=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,R.jsx)(Ih.div,{"aria-hidden":!0,...r,ref:t})});Qx.displayName=Zx;var $x=`SelectArrow`,eS=_.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Zb(n);return bx($x,n).position===`popper`?(0,R.jsx)(sy,{...i,...r,ref:t}):null});eS.displayName=$x;var tS=`SelectBubbleInput`,nS=_.forwardRef(({__scopeSelect:e,...t},n)=>{let r=$b(tS,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=_.useRef(null),m=Vm(n,p),h=i??``,g=xy(h),v=Array.from(d).some(e=>(e.props.value??``)===``);return _.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,R.jsxs)(Ih.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Sy,...t.style},ref:m,defaultValue:h,children:[iS(i)&&!v?(0,R.jsx)(`option`,{value:``}):null,Array.from(d)]},f)});nS.displayName=tS;function rS(e){return typeof e==`function`}function iS(e){return e===``||e===void 0}function aS(e){let t=Rh(e),n=_.useRef(``),r=_.useRef(0),i=_.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))})(i)},[t]),a=_.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function oS(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=sS(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}function sS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var cS=ix,lS=cx;function uS({className:e,children:t,...n}){return(0,R.jsxs)(ox,{className:a(`flex h-9 w-full items-center justify-between rounded-lg border border-input bg-card/90 px-3 text-sm text-foreground outline-none transition duration-200 hover:border-muted-foreground/45 focus:border-muted-foreground/60 focus:ring-2 focus:ring-muted-foreground/20 disabled:cursor-not-allowed disabled:opacity-50`,e),...n,children:[t,(0,R.jsx)(ux,{asChild:!0,children:(0,R.jsx)(ah,{icon:Sm,className:`h-4 w-4 opacity-60`})})]})}function dS({className:e,children:t,position:n=`popper`,...r}){return(0,R.jsx)(mx,{children:(0,R.jsx)(gx,{position:n,className:a(`z-50 max-h-80 min-w-[8rem] overflow-hidden rounded-xl border border-border/90 bg-popover/98 text-popover-foreground shadow-xl shadow-black/45 backdrop-blur`,e),...r,children:(0,R.jsx)(jx,{className:`p-1`,children:t})})})}function fS({className:e,children:t,...n}){return(0,R.jsxs)(Vx,{className:a(`relative flex min-h-8 cursor-default select-none items-center rounded-lg py-1.5 pl-8 pr-2 text-sm outline-none transition data-[disabled]:pointer-events-none data-[highlighted]:bg-muted/65 data-[highlighted]:text-foreground data-[disabled]:opacity-50`,e),...n,children:[(0,R.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,R.jsx)(Gx,{children:(0,R.jsx)(ah,{icon:Dm,className:`h-4 w-4`})})}),(0,R.jsx)(Ux,{children:t})]})}function pS({className:e,...t}){return(0,R.jsx)(`section`,{className:a(`grid h-full min-h-0 min-w-0 max-h-full max-w-full overflow-hidden bg-background/45`,e),...t})}function mS({className:e,...t}){return(0,R.jsx)(`div`,{className:a(`min-h-0 min-w-0 overflow-hidden rounded-2xl border border-border/80 bg-card/70`,e),...t})}function hS(e){return(0,R.jsxs)(`div`,{className:a(`grid gap-1 rounded-xl border border-border/80 bg-card/45 p-4`,e.className),children:[(0,R.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground`,children:e.label}),(0,R.jsx)(`span`,{className:`text-lg font-semibold tabular-nums text-foreground`,children:e.value})]})}function gS(e){return(0,R.jsx)(`div`,{className:a(`grid min-h-80 place-items-center rounded-xl border border-dashed border-border/80 bg-card/35 px-6 text-center`,e.className),children:(0,R.jsxs)(`div`,{className:`grid max-w-md gap-2`,children:[(0,R.jsx)(`h2`,{className:`m-0 text-base font-semibold text-foreground`,children:e.title}),(0,R.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:e.text})]})})}function _S({className:e,...t}){return(0,R.jsx)(`span`,{className:a(`inline-flex items-center rounded-lg border border-border/80 bg-muted/55 px-2 py-1 text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground`,e),...t})}function vS({className:e,...t}){return(0,R.jsx)(`div`,{className:a(`grid gap-1 rounded-xl border border-border/80 bg-background p-1`,e),...t})}function yS({className:e,...t}){return(0,R.jsx)(`textarea`,{className:a(`min-h-9 w-full resize-none rounded-lg border border-input bg-card/90 px-3 py-2.5 leading-6 text-foreground outline-none transition duration-200 placeholder:text-muted-foreground/65 focus:border-muted-foreground/60 focus:ring-2 focus:ring-muted-foreground/20`,e),...t})}function bS(e){let t=SS(e.metadata,e.limit),n=TS(e.metadata);return t.length===0&&!n?null:(0,R.jsxs)(`div`,{className:`grid min-w-0 gap-1 text-xs leading-5 text-muted-foreground`,children:[t.length===0?null:(0,R.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-x-2 gap-y-1`,children:t.map(e=>(0,R.jsxs)(`span`,{className:a(`min-w-0 break-words`,e.tone===`error`?`text-destructive/85`:`text-muted-foreground/85`),children:[(0,R.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.key,`=`]}),e.value]},e.key))}),n?(0,R.jsxs)(`details`,{className:`group min-w-0 rounded-lg border border-black/[0.06] bg-black/[0.03] px-2 py-1 dark:border-white/[0.06] dark:bg-white/[0.03]`,children:[(0,R.jsx)(`summary`,{className:`cursor-pointer select-none text-xs font-semibold uppercase tracking-[0.12em] text-muted-foreground transition group-open:text-foreground`,children:`Details`}),(0,R.jsx)(`pre`,{className:`m-0 mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words text-xs leading-4 text-muted-foreground`,children:ES(e.metadata)})]}):null]})}function xS(e,t){return SS(e,t).map(e=>`${e.key}=${e.value}`).join(` `)}function SS(e,t=6){return Object.entries(e??{}).map(([e,t])=>{let n=e===`error`?`error`:`default`;return{key:e,value:CS(e,t),tone:n}}).filter(e=>e.value.length>0).slice(0,t)}function CS(e,t){return t===null?`null`:typeof t==`string`||typeof t==`number`||typeof t==`boolean`?String(t):Array.isArray(t)?`[${t.length}]`:OS(t)?e===`error`?wS(t):DS(t):``}function wS(e){let t=typeof e.name==`string`&&e.name.length>0?e.name:void 0,n=typeof e.message==`string`&&e.message.length>0?e.message:void 0;return t!==void 0&&n!==void 0?`${t}: ${n}`:n===void 0?DS(e):n}function TS(e){return Object.values(e??{}).some(e=>Array.isArray(e)||OS(e))}function ES(e){if(e===void 0)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function DS(e){try{return JSON.stringify(e)}catch{return String(e)}}function OS(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function kS(e){let t=(0,_.useRef)(null),n=(0,_.useRef)(!0);(0,_.useEffect)(()=>{let e=t.current;e===null||!n.current||(e.scrollTop=e.scrollHeight)});function r(){let e=t.current;e!==null&&(n.current=e.scrollHeight-e.scrollTop-e.clientHeight<24)}return(0,R.jsxs)(`aside`,{className:`grid h-full min-h-0 min-w-0 max-h-full grid-rows-[auto_minmax(0,1fr)] overflow-hidden bg-background/70 max-xl:hidden`,children:[(0,R.jsxs)(`header`,{className:`grid min-h-12 min-w-0 gap-1 py-3 pl-0 pr-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,R.jsx)(`h2`,{className:`m-0 text-sm font-semibold leading-tight text-foreground`,children:`Session logs`}),(0,R.jsx)(`span`,{className:` text-xs font-semibold tabular-nums text-muted-foreground`,children:e.logs.length})]}),(0,R.jsx)(`p`,{className:`m-0 truncate text-xs font-medium text-muted-foreground`,children:e.selectedSessionId.length===0?`No active session`:e.selectedSessionId})]}),(0,R.jsxs)(`div`,{className:`min-h-0 min-w-0 overflow-y-auto overflow-x-hidden`,ref:t,onScroll:r,children:[e.selectedSessionId.length===0?(0,R.jsx)(`div`,{className:`grid h-full min-h-80 place-items-center text-center text-sm font-medium text-muted-foreground`,children:`Start or open a session to view runtime logs.`}):null,e.selectedSessionId.length>0&&e.loading&&e.logs.length===0?(0,R.jsx)(`div`,{className:`py-3 pl-0 pr-2 text-sm font-medium text-muted-foreground`,children:`Loading logs`}):null,e.selectedSessionId.length>0&&!e.loading&&e.logs.length===0?(0,R.jsx)(`div`,{className:`py-3 pl-0 pr-2 text-sm font-medium text-muted-foreground`,children:`No logs yet`}):null,(0,R.jsx)(`div`,{className:`grid min-w-0 gap-1 py-2 pl-0 pr-2 `,children:e.logs.map(e=>(0,R.jsx)(AS,{log:e},e.id))})]})]})}function AS(e){let t=xS(e.log.metadata);return(0,R.jsxs)(`article`,{className:`grid min-w-0 gap-1 rounded-lg px-3 py-2 text-xs leading-5 transition duration-200 hover:bg-black/[0.04] dark:hover:bg-white/[0.04]`,title:[jS(e.log.timestamp),e.log.level.toUpperCase().padEnd(5,` `),e.log.message,`${e.log.category}/${e.log.event}`,t].filter(e=>e.trim().length>0).join(` `),children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1`,children:[(0,R.jsx)(`time`,{className:`shrink-0 text-muted-foreground`,children:jS(e.log.timestamp)}),(0,R.jsx)(`span`,{className:a(`shrink-0 font-semibold`,MS(e.log.level)),children:e.log.level.toUpperCase()}),(0,R.jsx)(`span`,{className:`min-w-0 break-words font-medium text-foreground`,children:e.log.message})]}),(0,R.jsxs)(`div`,{className:`min-w-0 break-words text-muted-foreground/80`,children:[e.log.category,`/`,e.log.event]}),(0,R.jsx)(bS,{metadata:e.log.metadata})]})}function jS(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function MS(e){switch(e){case`error`:return`text-destructive`;case`warn`:return`text-yellow-500`;case`debug`:return`text-muted-foreground`;case`info`:return`text-foreground`}}var NS=(0,_.lazy)(()=>sm(()=>import(`./transcript-item-DbtXMj-E.js`).then(e=>({default:e.TranscriptItem})),__vite__mapDeps([18,1,17,7,8,2])));function PS(e){return(0,R.jsxs)(pS,{className:`grid-cols-[minmax(0,1fr)_minmax(0,460px)] max-xl:grid-cols-1`,children:[(0,R.jsx)(`div`,{className:`grid min-h-0 min-w-0 pb-6 pr-6`,children:(0,R.jsxs)(mS,{className:`grid h-full grid-rows-[minmax(0,1fr)_auto] p-2`,children:[(0,R.jsx)(`section`,{className:`min-h-0 overflow-y-auto overflow-x-hidden px-4 py-4 [scrollbar-gutter:stable]`,ref:e.transcriptScrollerRef,onScroll:e.onTranscriptScroll,children:(0,R.jsxs)(`div`,{className:`mx-auto grid min-h-full w-full max-w-235 content-start items-start gap-6 pb-8`,children:[e.hasMessages?null:(0,R.jsx)(`div`,{className:`grid min-h-96 place-items-center text-sm font-medium text-muted-foreground`,children:(0,R.jsxs)(`div`,{className:`grid max-w-xl gap-4 text-center`,children:[(0,R.jsx)(`div`,{className:`mx-auto h-px w-28 bg-muted/55`}),(0,R.jsx)(`h1`,{className:`m-0 text-4xl font-semibold leading-tight text-foreground text-balance`,children:`What should this agent work on?`}),(0,R.jsx)(`p`,{className:`m-0 text-base leading-7 text-muted-foreground text-pretty`,children:`Choose a prompt below or write a task. Studio will stream the response, tool calls, approvals, and trace data here.`})]})}),(0,R.jsx)(_.Suspense,{fallback:null,children:e.messages.map(t=>(0,R.jsx)(NS,{entry:t,decidingApprovals:e.decidingApprovals,answeringQuestions:e.answeringQuestions,onApprovalDecision:e.onApprovalDecision,onQuestionAnswer:e.onQuestionAnswer,onOpenTrace:e.onOpenTrace},t.entryId))})]})}),(0,R.jsxs)(`form`,{className:`grid gap-3 bg-gradient-to-t from-card via-card/95 to-card/0 px-4 pb-4 pt-2`,onSubmit:t=>{t.preventDefault(),e.onRunPrompt(e.prompt)},children:[e.hasMessages||e.selectedAgentQuickPrompts.length===0?null:(0,R.jsx)(`div`,{className:`mx-auto grid w-full max-w-235 grid-cols-3 gap-2 max-md:grid-cols-1`,children:e.selectedAgentQuickPrompts.map(t=>(0,R.jsx)(nh,{className:`h-auto min-h-16 justify-start whitespace-normal rounded-lg border border-border/80 bg-card/85 px-3 py-2.5 text-left text-sm font-medium leading-5 text-foreground shadow-sm hover:border-border/80 hover:bg-muted/45 hover:text-foreground`,type:`button`,variant:`ghost`,disabled:e.runState===`running`||e.selectedAgentId.length===0,onClick:()=>e.onRunPrompt(t),children:(0,R.jsx)(`span`,{className:`min-w-0 whitespace-normal wrap-break-words`,children:t})},t))}),(0,R.jsxs)(`div`,{className:`mx-auto grid w-full max-w-235 gap-2 rounded-xl border border-border/80 bg-card/95 p-2.5 backdrop-blur`,children:[(0,R.jsx)(yS,{className:`min-h-16 min-w-0 resize-none rounded-lg border-0 bg-transparent px-3 py-3 text-sm leading-7 text-foreground shadow-none outline-none ring-0 placeholder:text-muted-foreground/70 focus:border-transparent focus:ring-0`,ref:e.promptRef,rows:1,value:e.prompt,onChange:e.onPromptChange,onKeyDown:e.onPromptKeyDown,placeholder:`Ask anything...`}),e.attachments.length===0?null:(0,R.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-1.5 px-2`,children:e.attachments.map(t=>(0,R.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border/80 bg-muted/55 px-2 py-1 text-xs font-medium text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`min-w-0 truncate`,children:[t.kind===`image`?`Image`:`Doc`,` / `,t.name]}),(0,R.jsx)(nh,{"aria-label":`Remove ${t.name}`,className:`h-5 min-h-5 w-5 rounded-md border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-accent hover:text-foreground [&_svg]:h-3 [&_svg]:w-3`,size:`icon`,type:`button`,variant:`ghost`,onClick:()=>e.onRemovePromptAttachment(t.id),children:(0,R.jsx)(ah,{icon:Tm,"aria-hidden":`true`})})]},t.id))}),(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`input`,{ref:e.attachmentInputRef,className:`hidden`,type:`file`,multiple:!0,accept:Kr,onChange:e.onAddPromptAttachments}),(0,R.jsx)(nh,{"aria-label":`Attach image or document`,className:`h-8 min-h-8 w-8 border-0 bg-transparent p-0 text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground`,size:`icon`,type:`button`,variant:`ghost`,disabled:e.runState===`running`,onClick:()=>e.attachmentInputRef.current?.click(),children:(0,R.jsx)(ah,{icon:wm,"aria-hidden":`true`})})]}),(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.selectedAgentModels.length===0?null:(0,R.jsxs)(cS,{value:e.selectedModelRef,onValueChange:e.onSelectModel,disabled:e.runState===`running`,children:[(0,R.jsx)(uS,{"aria-label":`Select model`,className:`flex h-8 min-h-8 w-auto max-w-44 gap-2 border-0 bg-transparent px-2 py-1 text-xs font-medium text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground sm:max-w-72`,children:(0,R.jsx)(lS,{placeholder:`Model`})}),(0,R.jsx)(dS,{align:`end`,children:e.selectedAgentModels.map(e=>(0,R.jsx)(fS,{value:e.ref,children:ei(e)},e.ref))})]}),e.agents.length>1?(0,R.jsxs)(cS,{value:e.selectedAgent?.id??e.selectedAgentId,onValueChange:e.onSelectAgent,disabled:e.runState===`running`,children:[(0,R.jsx)(uS,{"aria-label":`Select agent`,className:`flex h-8 min-h-8 w-auto max-w-64 gap-2 border-0 bg-transparent px-2 py-1 text-xs font-medium text-muted-foreground shadow-none hover:bg-accent hover:text-accent-foreground`,children:(0,R.jsx)(lS,{placeholder:`Agent`})}),(0,R.jsx)(dS,{align:`end`,children:e.agents.map(e=>(0,R.jsx)(fS,{value:e.id,children:e.name??e.id},e.id))})]}):null,(0,R.jsx)(nh,{"aria-label":e.runState===`running`?`Running`:`Send message`,className:`h-9 min-h-9 w-9 rounded-full border-white bg-white text-black hover:bg-white/90`,size:`icon`,type:`submit`,disabled:e.runState===`running`||e.selectedAgentId.length===0,children:(0,R.jsx)(ah,{icon:Cm})})]})]})]})]})]})}),(0,R.jsx)(kS,{logs:e.sessionLogs,selectedSessionId:e.selectedSessionId,loading:e.sessionLogLoadState===`loading`})]})}function FS(){let e=fh(`playground`),t=nr({strict:!1}).sessionId,n=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(n.current!==t&&e.pageEnabled(`playground`)){if(e.runState===`running`){n.current=t;return}if(t===void 0){n.current=t,e.startNewChat({updatePath:!1});return}e.sessionsEnabled&&(n.current=t,t!==e.sessions.selectedSessionId&&e.sessions.loadSession(t,{updatePath:!1}))}},[t,e]),(0,R.jsx)(PS,{agents:e.agents,answeringQuestions:e.answeringQuestions,attachments:e.attachments,decidingApprovals:e.decidingApprovals,hasMessages:e.hasMessages,messages:e.messages,prompt:e.prompt,runState:e.runState,selectedAgent:e.selectedAgent,selectedAgentId:e.selectedAgentId,selectedAgentModels:e.selectedAgentModels,selectedAgentQuickPrompts:e.selectedAgentQuickPrompts,selectedModelRef:e.selectedModelRef,selectedSessionId:e.sessions.selectedSessionId,sessionLogLoadState:e.sessions.sessionLogLoadState,sessionLogs:e.sessions.sessionLogs,attachmentInputRef:e.attachmentInputRef,promptRef:e.promptRef,transcriptScrollerRef:e.transcriptScrollerRef,onAddPromptAttachments:e.addPromptAttachments,onApprovalDecision:e.decideToolApproval,onOpenTrace:e.traces.selectTrace,onPromptChange:e.updatePrompt,onPromptKeyDown:e.handlePromptKeyDown,onQuestionAnswer:e.answerToolQuestion,onRemovePromptAttachment:e.removePromptAttachment,onRunPrompt:e.runPrompt,onSelectAgent:e.selectPlaygroundAgent,onSelectModel:e.setSelectedModelRef,onTranscriptScroll:e.updateTranscriptStickiness})}function IS(){let e=fh(`sessions`);return(0,R.jsx)(_.Suspense,{fallback:(0,R.jsx)(ym,{}),children:(0,R.jsx)(mm,{agents:e.agents,sessions:e.sessions.allSessions,sessionsEnabled:e.sessionsEnabled,sessionLoadState:e.sessions.sessionLoadState,selectedSessionId:e.sessions.selectedSessionId,onOpenSession:t=>void e.sessions.loadSession(t),onViewSessionTracing:t=>void e.traces.showSessionTraces(t),onDeleteSession:e.setDeleteCandidate})})}function LS(){let e=fh(`status`);return(0,R.jsx)(_.Suspense,{fallback:(0,R.jsx)(ym,{}),children:(0,R.jsx)(gm,{enabled:e.statusEnabled})})}function RS(){let e=fh(`tools`);return(0,R.jsx)(_.Suspense,{fallback:(0,R.jsx)(ym,{}),children:(0,R.jsx)(_h,{active:!0,agents:e.agents,enabled:e.toolsEnabled,selectedAgentId:e.selectedAgent?.id||e.selectedAgentId,onError:e.setError})})}function zS(){let e=fh(`tracing`),t=nr({strict:!1}),n=(0,_.useRef)(``);return(0,_.useEffect)(()=>{let r=t.sessionId===void 0?`trace:${t.traceId??``}`:`session:${t.sessionId}`;if(n.current!==r&&e.pageEnabled(`tracing`)){if(n.current=r,t.sessionId!==void 0){e.traces.showSessionTraces(t.sessionId,{updatePath:!1});return}e.traces.setTraceLocation(t.traceId??``,void 0)}},[t.sessionId,t.traceId,e]),(0,R.jsx)(_.Suspense,{fallback:(0,R.jsx)(ym,{}),children:(0,R.jsx)(vm,{agents:e.agents,traces:e.traces.traces,tracesEnabled:e.tracesEnabled,traceLoadState:e.traces.traceLoadState,selectedTraceId:e.traces.selectedTraceId,traceSessionDetailId:e.traces.traceSessionDetailId,onRefresh:()=>void e.traces.loadTraces(),onSelectTrace:e.traces.selectTrace,onShowSessionTraces:t=>void e.traces.showSessionTraces(t)})})}var BS=wr({component:dh}),VS=Sr({getParentRoute:()=>BS,path:`/`,component:()=>(0,R.jsx)(ar,{to:`/playground`,replace:!0})}),HS=Sr({getParentRoute:()=>BS,path:`playground`,component:FS}),US=Sr({getParentRoute:()=>BS,path:`playground/$sessionId`,component:FS}),WS=Sr({getParentRoute:()=>BS,path:`tracing`,component:zS}),GS=Sr({getParentRoute:()=>BS,path:`tracing/$traceId`,component:zS}),KS=Sr({getParentRoute:()=>BS,path:`tracing/sessions/$sessionId`,component:zS}),qS=Sr({getParentRoute:()=>BS,path:`sessions`,component:IS}),JS=Sr({getParentRoute:()=>BS,path:`agents`,component:mh}),YS=Sr({getParentRoute:()=>BS,path:`tools`,component:RS}),XS=Sr({getParentRoute:()=>BS,path:`mcps`,component:xh}),ZS=Sr({getParentRoute:()=>BS,path:`pipelines`,component:Eh}),QS=Sr({getParentRoute:()=>BS,path:`evals`,component:gh}),$S=Sr({getParentRoute:()=>BS,path:`knowledge`,component:bh}),eC=Sr({getParentRoute:()=>BS,path:`knowledge/$tab`,component:bh}),tC=Sr({getParentRoute:()=>BS,path:`memory`,component:Sh}),nC=Sr({getParentRoute:()=>BS,path:`status`,component:LS}),rC=Br({routeTree:BS.addChildren([VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC])});function iC(){let[e,t]=(0,_.useState)(),[n,r]=(0,_.useState)(``),i=jp(),{messages:a,setMessages:o,updateToolApproval:c,updateToolQuestion:l}=i,[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)([]),[m,h]=(0,_.useState)(`playground`),{theme:g,toggleTheme:v}=fi(),[y,b]=(0,_.useState)($p),[x,S]=(0,_.useState)(),[C,w]=(0,_.useState)(`Loading`),[,T]=(0,_.useState)(``),[E,D]=(0,_.useState)(`idle`),O=Gp({onError:T,onToolApprovalUpdate:c,onToolQuestionUpdate:l}),k=(0,_.useRef)(null),A=(0,_.useRef)(null),ee=(0,_.useRef)(null),j=(0,_.useRef)(!0);function te(){let e=ee.current;e!==null&&(j.current=e.scrollHeight-e.scrollTop-e.clientHeight<80)}(0,_.useEffect)(()=>{if(m!==`playground`||a.length===0||!j.current)return;let e=window.requestAnimationFrame(()=>{let e=ee.current;e!==null&&(e.scrollTop=e.scrollHeight)});return()=>window.cancelAnimationFrame(e)},[m,a]);let ne=(0,_.useCallback)(async()=>{w(`Loading`),T(``);try{let e=await fetch(`/config`);if(e.status===401){w(`Authentication required`);return}if(!e.ok)throw Error(`Config failed with HTTP ${e.status}`);let n=await e.json();t(n),r(e=>e||n.agents[0]?.id||``),w(`Connected`)}catch(e){T(s(e)),w(`Config error`)}},[]);(0,_.useEffect)(()=>{ne()},[ne]);let M=e?.capabilities.sessions?.enabled===!0,N=e?.capabilities.traces?.enabled===!0,P=e?.capabilities.knowledge?.enabled===!0,re=e?.capabilities.mcps?.enabled===!0,ie=e?.capabilities.tools?.enabled===!0,ae=e?.capabilities.pipelines?.enabled===!0,oe=e?.capabilities.evals?.enabled===!0,F=e?.capabilities.memory?.enabled===!0,I=e?.capabilities.status?.enabled===!0,se=e?.agents??[],ce=e?.pipelines??[],le=e?.evals??[],L=se.length>0,ue=(0,_.useCallback)(()=>{h(`tracing`)},[]),de=(0,_.useCallback)(e=>{if(e===void 0){rC.navigate({to:`/playground`});return}rC.navigate({to:`/playground/$sessionId`,params:{sessionId:e}})},[]),fe=(0,_.useCallback)(()=>{rC.navigate({to:`/tracing`})},[]),pe=tm({activePage:m,enabled:N,initialTraceId:``,initialTraceSessionId:void 0,onError:T,onNavigateTracing:ue,onOpenTrace:(0,_.useCallback)(e=>{rC.navigate({to:`/tracing/$traceId`,params:{traceId:e}})},[]),onOpenTraceIndex:fe,onOpenTraceSession:(0,_.useCallback)(e=>{rC.navigate({to:`/tracing/sessions/$sessionId`,params:{sessionId:e}})},[])}),me=(0,_.useMemo)(()=>({hasAgents:L,sessionsEnabled:M,tracesEnabled:N,toolsEnabled:ie,mcpsEnabled:re,pipelinesEnabled:ae,evalsEnabled:oe,memoryEnabled:F,statusEnabled:I,knowledgeEnabled:P}),[L,M,N,ie,re,ae,oe,F,I,P]),he=se.find(e=>e.id===n)??se[0]??void 0,ge=he?.id,_e=he?.quickPrompts??[],{selectedAgentModels:ve,selectedModelRef:ye,setSelectedModelRef:be}=pi({enabled:e?.models!==void 0,selectedAgentId:ge,onError:T}),xe=a.length>0,Se=(0,_.useCallback)((e,t,n)=>{_p(Cp(e.transcript)),r(e.agentId),be(Qr(e)),o(Zr(e.transcript,t)),p([]),n.updatePath!==!1&&(h(`playground`),de(e.id))},[de,o,be]),Ce=(0,_.useCallback)((e,t)=>{pe.removeSessionTraces(e),t&&(vp(),o([]),d(``),p([]),m===`playground`&&de(void 0))},[m,de,o,pe]),we=Kp({activePage:m,currentAgentId:he?.id??n,enabled:M,loadSessionTraceSummaries:pe.loadSessionTraceSummaries,runState:E,selectedModelRef:ye,onError:T,onSessionCreated:de,onSessionDeleted:Ce,onSessionLoaded:Se,onStatus:w}),{runPrompt:Te}=Ap({attachments:f,messages:a,promptRef:k,runState:E,selectedAgent:he,selectedAgentId:n,selectedModelRef:ye,sessions:we,sessionsEnabled:M,traces:pe,transcript:i,onActivePageChange:h,onAttachmentsChange:p,onBeforeRun:()=>{j.current=!0},onError:T,onPromptChange:d,onRunStateChange:D,onStatus:w}),Ee=(0,_.useCallback)((e={})=>{E!==`running`&&(vp(),we.clearSelectedSession(),o([]),d(``),p([]),h(`playground`),T(``),e.updatePath!==!1&&de(void 0),requestAnimationFrame(()=>xp(k.current)))},[de,E,we,o]),De=(0,_.useCallback)(e=>{E===`running`||e===n||(r(e),be(``),vp(),we.clearSelectedSession(),o([]),d(``),p([]),h(`playground`),T(``),de(void 0),requestAnimationFrame(()=>xp(k.current)))},[de,E,n,we,o,be]);function Oe(e){d(bp(e)),xp(e.currentTarget)}async function ke(e){let t=Array.from(e.currentTarget.files??[]);if(e.currentTarget.value=``,t.length!==0)try{let e=await Promise.all(t.map(ti));p(t=>[...t,...e])}catch(e){T(s(e))}}function Ae(e){p(t=>t.filter(t=>t.id!==e))}function je(e){e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),Te(u))}let Me=(0,_.useCallback)(e=>qp(e,me),[me]),Ne=(0,_.useCallback)(e=>{if(qp(e,me)){if(h(e),e===`tracing`){pe.clearTraceSelection(),rC.navigate({to:`/tracing`});return}if(e===`knowledge`){pe.clearTraceSelection(),rC.navigate({to:`/knowledge/$tab`,params:{tab:y}});return}if(pe.clearTraceSelection(),e===`playground`&&we.selectedSessionId.length>0){de(we.selectedSessionId);return}rC.navigate({to:`/${e}`})}},[y,de,me,we.selectedSessionId,pe]),Pe=(0,_.useCallback)(e=>{Ne(Jp(e,me))},[Ne,me]);function Fe(e){h(`knowledge`),b(e),pe.clearTraceSelection(),rC.navigate({to:`/knowledge/$tab`,params:{tab:e}})}let Ie=(0,_.useCallback)(e=>{if(!qp(e,me)){Pe(e);return}h(e),e!==`tracing`&&pe.clearTraceSelection()},[Pe,me,pe]),Le={activePage:m,agents:se,answeringQuestions:O.answeringQuestions,attachments:f,decidingApprovals:O.decidingApprovals,deleteCandidate:x,evals:le,evalsEnabled:oe,hasAgents:L,hasMessages:xe,knowledgeEnabled:P,knowledgeTab:y,mcpsEnabled:re,memoryEnabled:F,messages:a,pageEnabled:Me,pipelines:ce,pipelinesEnabled:ae,prompt:u,runState:E,selectedAgent:he,selectedAgentId:n,selectedAgentModels:ve,selectedAgentQuickPrompts:_e,selectedModelRef:ye,sessions:we,sessionsEnabled:M,status:C,statusEnabled:I,theme:g,toolsEnabled:ie,traces:pe,tracesEnabled:N,attachmentInputRef:A,promptRef:k,transcriptScrollerRef:ee,activateRoute:Ie,navigateFallback:Pe,navigatePage:Ne,navigateKnowledgeTab:Fe,setDeleteCandidate:S,setError:T,setKnowledgeTab:b,setSelectedModelRef:be,setStatus:w,startNewChat:Ee,selectPlaygroundAgent:De,addPromptAttachments:ke,decideToolApproval:O.decideToolApproval,updatePrompt:Oe,handlePromptKeyDown:je,answerToolQuestion:O.answerToolQuestion,removePromptAttachment:Ae,runPrompt:Te,toggleTheme:v,updateTranscriptStickiness:te};return(0,R.jsx)(nm.Provider,{value:Le,children:(0,R.jsx)(Ur,{router:rC})})}var aC=document.getElementById(`anvia-ui`);aC!==null&&(0,Wr.createRoot)(aC).render((0,R.jsx)(iC,{}));export{Ah as A,bm as B,ng as C,Ih as D,Rh as E,Vm as F,qn as H,Rm as I,Pm as L,ah as M,nh as N,Fh as O,Hm as P,Em as R,cg as S,Yh as T,m as U,Ep as V,vy as _,hS as a,Cg as b,mS as c,dS as d,fS as f,Ny as g,Hb as h,gS as i,kh as j,jh as k,vS as l,lS as m,xS as n,pS as o,uS as p,yS as r,_S as s,bS as t,cS as u,dy as v,Kh as w,bg as x,ly as y,Sm as z};
|
|
154
|
+
//# sourceMappingURL=index-CC5mjRie.js.map
|