@modelcontextprotocol/inspector 2.0.0-rc.3 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -14
- package/clients/cli/build/index.js +134 -36
- package/clients/tui/build/index.js +129 -33
- package/clients/web/build/index.js +24 -5
- package/clients/web/dist/assets/index-CyPh2pEE.js +300 -0
- package/clients/web/dist/assets/prism-light-CCFFzO_n.js +6 -0
- package/clients/web/dist/index.html +1 -1
- package/package.json +3 -3
- package/clients/web/dist/assets/index-wIMJi5MN.js +0 -300
- package/clients/web/dist/assets/prism-light-CVa8c8_p.js +0 -6
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/markup-CWGodlA2.js","assets/markup-D5BvAyPW.js","assets/markdown-CZCm46w1.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(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=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=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)},F={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(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&&j(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 j(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,j(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}}}})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=f();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=m(),n=f(),r=g();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,h=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`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?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?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function ae(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function oe(e,t){re++,ne[re]=e.current,e.current=t}var se=ie(null),ce=ie(null),le=ie(null),ue=ie(null);function de(e,t){switch(oe(le,t),oe(ce,e),oe(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?H(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=H(t),e=$d(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(se),oe(se,e)}function fe(){ae(se),ae(ce),ae(le)}function pe(e){e.memoizedState!==null&&oe(ue,e);var t=se.current,n=$d(t,e.type);t!==n&&(oe(ce,e),oe(se,n))}function me(e){ce.current===e&&(ae(se),ae(ce)),ue.current===e&&(ae(ue),lp._currentValue=I)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!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{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(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 qe(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=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(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 Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(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 Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(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-ze(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&&L(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function L(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ze(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-ze(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=F.p;return e===0?(e=window.event,e===void 0?32:Tp(e.type)):e}function R(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sf(e);e!==null;){if(n=e[ot])return n;e=Sf(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=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]*$`),Tt={},Et={};function Dt(e){return Se.call(Et,e)?!0:Se.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(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 kt(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 At(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 jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(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 Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function It(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 Lt=/[\n"\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function zt(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=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Vt(e,o,jt(n)):Vt(e,o,jt(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=``+jt(s):e.removeAttribute(`name`)}function Bt(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)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(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),Pt(e)}function Vt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(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=``+jt(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 Ut(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=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 qt(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||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&qt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&qt(e,o,t[o])}function Yt(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 Xt=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`]]),Zt=/^[\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 Qt(e){return Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function $t(){}var en=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,rn=null;function an(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(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="`+Rt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));zt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ft(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var on=!1;function sn(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(nn!==null||rn!==null)&&(Au(),nn&&(t=nn,e=rn,rn=nn=null,an(t),e)))for(t=0;t<e.length;t++)an(e[t])}}function cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var ln=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.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 mn=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 p(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=p({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,En,Dn=p({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,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!==En&&(En&&e.type===`mousemove`?(wn=e.screenX-En.screenX,Tn=e.screenY-En.screenY):Tn=wn=0,En=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),On=yn(Dn),kn=yn(p({},Dn,{dataTransfer:0})),An=yn(p({},Sn,{relatedTarget:0})),jn=yn(p({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Mn=yn(p({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Nn=yn(p({},bn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={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`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var zn=yn(p({},Sn,{key:function(e){if(e.key){var t=Pn[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`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,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}})),Bn=yn(p({},Dn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Vn=yn(p({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Hn=yn(p({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=yn(p({},Dn,{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})),Wn=yn(p({},bn,{newState:0,oldState:0})),Gn=[9,13,27,32],Kn=ln&&`CompositionEvent`in window,qn=null;ln&&`documentMode`in document&&(qn=document.documentMode);var Jn=ln&&`TextEvent`in window&&!qn,Yn=ln&&(!Kn||qn&&8<qn&&11>=qn),Xn=` `,Zn=!1;function Qn(e,t){switch(e){case`keyup`:return Gn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function $n(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var er=!1;function tr(e,t){switch(e){case`compositionend`:return $n(t);case`keypress`:return t.which===32?(Zn=!0,Xn):null;case`textInput`:return e=t.data,e===Xn&&Zn?null:e;default:return null}}function nr(e,t){if(er)return e===`compositionend`||!Kn&&Qn(e,t)?(e=hn(),mn=pn=fn=null,er=!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 Yn&&t.locale!==`ko`?null:t.data;default:return null}}var rr={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 ir(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!rr[e.type]:t===`textarea`}function ar(e,t,n,r){nn?rn?rn.push(r):rn=[r]:nn=r,t=Ld(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var or=null,sr=null;function cr(e){kd(e,0)}function lr(e){if(Ft(_t(e)))return e}function ur(e,t){if(e===`change`)return t}var dr=!1;if(ln){var fr;if(ln){var pr=`oninput`in document;if(!pr){var mr=document.createElement(`div`);mr.setAttribute(`oninput`,`return;`),pr=typeof mr.oninput==`function`}fr=pr}else fr=!1;dr=fr&&(!document.documentMode||9<document.documentMode)}function hr(){or&&(or.detachEvent(`onpropertychange`,gr),sr=or=null)}function gr(e){if(e.propertyName===`value`&&lr(sr)){var t=[];ar(t,sr,e,tn(e)),sn(cr,t)}}function _r(e,t,n){e===`focusin`?(hr(),or=t,sr=n,or.attachEvent(`onpropertychange`,gr)):e===`focusout`&&hr()}function vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return lr(sr)}function yr(e,t){if(e===`click`)return lr(t)}function br(e,t){if(e===`input`||e===`change`)return lr(t)}function xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:xr;function Cr(e,t){if(Sr(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(!Se.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(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=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(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=It(e.document)}return t}function Or(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 kr=ln&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==It(r)||(r=Ar,`selectionStart`in r&&Or(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}),Mr&&Cr(Mr,r)||(Mr=r,r=Ld(jr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ir={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Lr={},Rr={};ln&&(Rr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),`TransitionEvent`in window||delete Ir.transitionend.transition);function zr(e){if(Lr[e])return Lr[e];if(!Ir[e])return e;var t=Ir[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rr)return Lr[e]=t[n];return e}var Br=zr(`animationend`),Vr=zr(`animationiteration`),Hr=zr(`animationstart`),Ur=zr(`transitionrun`),Wr=zr(`transitionstart`),Gr=zr(`transitioncancel`),Kr=zr(`transitionend`),qr=new Map,Jr=`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(` `);Jr.push(`scrollEnd`);function Yr(e,t){qr.set(e,t),St(t,[e])}var Xr=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)},Zr=[],Qr=0,$r=0;function ei(){for(var e=Qr,t=$r=Qr=0;t<e;){var n=Zr[t];Zr[t++]=null;var r=Zr[t];Zr[t++]=null;var i=Zr[t];Zr[t++]=null;var a=Zr[t];if(Zr[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&&ii(n,i,a)}}function ti(e,t,n,r){Zr[Qr++]=e,Zr[Qr++]=t,Zr[Qr++]=n,Zr[Qr++]=r,$r|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ni(e,t,n,r){return ti(e,t,n,r),ai(e)}function ri(e,t){return ti(e,null,null,t),ai(e)}function ii(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-ze(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ai(e){if(50<xu)throw xu=0,Su=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function si(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 ci(e,t,n,r){return new si(e,t,n,r)}function li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,t){var n=e.alternate;return n===null?(n=ci(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 di(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 z(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)li(e)&&(s=1);else if(typeof e==`string`)s=ep(e,n,se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ci(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return fi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ci(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ci(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ci(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ci(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function mi(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=ci(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:xe(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:xe(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-ze(r)-1;r&=~(1<<i),n+=1;var a=32-ze(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-ze(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,Pi=!1,Fi=null,Ii=!1,Li=Error(i(519));function Ri(e){throw Wi(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:Ad(`cancel`,t),Ad(`close`,t);break;case`iframe`:case`object`:case`embed`:Ad(`load`,t);break;case`video`:case`audio`:for(n=0;n<Dd.length;n++)Ad(Dd[n],t);break;case`source`:Ad(`error`,t);break;case`img`:case`image`:case`link`:Ad(`error`,t),Ad(`load`,t);break;case`details`:Ad(`toggle`,t);break;case`input`:Ad(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Ad(`invalid`,t);break;case`textarea`:Ad(`invalid`,t),Wt(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||Ud(t.textContent,n)?(r.popover!=null&&(Ad(`beforetoggle`,t),Ad(`toggle`,t)),r.onScroll!=null&&Ad(`scroll`,t),r.onScrollEnd!=null&&Ad(`scrollend`,t),r.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Mi=Mi.return}}function Vi(e){if(e!==Mi)return!1;if(!Pi)return Bi(e),Pi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||ef(e.type,e.memoizedProps)),n=!n),n&&Ni&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=xf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=xf(e)}else t===27?(t=Ni,lf(e.type)?(e=bf,bf=null,Ni=e):Ni=t):Ni=Mi?yf(e.stateNode.nextSibling):null;return!0}function Hi(){Ni=Mi=null,Pi=!1}function Ui(){var e=Fi;return e!==null&&(su===null?su=e:su.push.apply(su,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=ie(null),Ki=null,qi=null;function B(e,t,n){oe(Gi,t._currentValue),t._currentValue=n}function Ji(e){e._currentValue=Gi.current,ae(Gi)}function Yi(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 Xi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Yi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Yi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Zi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Sr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ue.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[lp]:e.push(lp))}a=a.return}e!==null&&Xi(t,e,n,r),t.flags|=262144}function Qi(e){for(e=e.firstContext;e!==null;){if(!Sr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $i(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ea(e){return na(Ki,e)}function ta(e,t){return Ki===null&&$i(e),na(e,t)}function na(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ra=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()})}},ia=t.unstable_scheduleCallback,aa=t.unstable_NormalPriority,oa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sa(){return{controller:new ra,data:new Map,refCount:0}}function ca(e){e.refCount--,e.refCount===0&&ia(aa,function(){e.controller.abort()})}var la=null,ua=0,da=0,fa=null;function pa(e,t){if(la===null){var n=la=[];ua=0,da=xd(),fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ua++,t.then(ma,ma),t}function ma(){if(--ua===0&&la!==null){fa!==null&&(fa.status=`fulfilled`);var e=la;la=null,da=0,fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ha(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 ga=P.S;P.S=function(e,t){uu=De(),typeof t==`object`&&t&&typeof t.then==`function`&&pa(e,t),ga!==null&&ga(e,t)};var _a=ie(null);function va(){var e=_a.current;return e===null?Gl.pooledCache:e}function ya(e,t){t===null?oe(_a,_a.current):oe(_a,t.pool)}function ba(){var e=va();return e===null?null:{parent:oa._currentValue,pool:e}}var xa=Error(i(460)),Sa=Error(i(474)),Ca=Error(i(542)),wa={then:function(){}};function Ta(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ea(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e;default:if(typeof t.status==`string`)t.then($t,$t);else{if(e=Gl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Aa(e),e}throw Oa=t,xa}}function Da(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Oa=e,xa):e}}var Oa=null;function ka(){if(Oa===null)throw Error(i(459));var e=Oa;return Oa=null,e}function Aa(e){if(e===xa||e===Ca)throw Error(i(483))}var ja=null,Ma=0;function Na(e){var t=Ma;return Ma+=1,ja===null&&(ja=[]),Ea(ja,e,t)}function Pa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Fa(e,t){throw t.$$typeof===h?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ia(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ui(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=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Da(i)===t.type)?(t=a(t,n.props),Pa(t,n),t.return=e,t):(t=z(n.type,n.key,n.props,null,e.mode,r),Pa(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=hi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=z(t.type,t.key,t.props,null,e.mode,n),Pa(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case O:return t=Da(t),f(e,t,n)}if(te(t)||M(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Na(t),n);if(t.$$typeof===C)return f(e,ta(e,t),n);Fa(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=Da(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Na(n),r);if(n.$$typeof===C)return p(e,t,ta(e,n),r);Fa(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=Da(r),m(e,t,n,r,i)}if(te(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Na(r),i);if(r.$$typeof===C)return m(e,t,n,ta(t,r),i);Fa(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),Pi&&Di(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 Pi&&Di(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)}),Pi&&Di(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Pi&&Di(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Pi&&Di(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Pi&&Di(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Da(l)===r.type){n(e,r.sibling),c=a(r,o.props),Pa(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=z(o.type,o.key,o.props,null,e.mode,c),Pa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Da(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Na(o),c);if(o.$$typeof===C)return b(e,r,ta(e,o),c);Fa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ma=0;var i=b(e,t,n,r);return ja=null,i}catch(t){if(t===xa||t===Ca)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var La=Ia(!0),Ra=Ia(!1),za=!1;function Ba(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Va(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 Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ua(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Wl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return ti(e,r,t,n),ai(e)}function Wa(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 Ga(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 Ka=!1;function qa(){if(Ka){var e=fa;if(e!==null)throw e}}function Ja(e,t,n,r){Ka=!1;var i=e.updateQueue;za=!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,m=f!==s.lane;if(m?(ql&f)===f:(r&f)===f){f!==0&&f===da&&(Ka=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:za=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),tu|=o,e.lanes=o,e.memoizedState=d}}function Ya(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Xa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ya(n[e],t)}var Za=ie(null),Qa=ie(0);function $a(e,t){e=$l,oe(Qa,e),oe(Za,t),$l=e|t.baseLanes}function eo(){oe(Qa,$l),oe(Za,Za.current)}function to(){$l=Qa.current,ae(Za),ae(Qa)}var no=ie(null),ro=null;function io(e){var t=e.alternate;oe(lo,lo.current&1),oe(no,e),ro===null&&(t===null||Za.current!==null||t.memoizedState!==null)&&(ro=e)}function ao(e){oe(lo,lo.current),oe(no,e),ro===null&&(ro=e)}function oo(e){e.tag===22?(oe(lo,lo.current),oe(no,e),ro===null&&(ro=e)):so(e)}function so(){oe(lo,lo.current),oe(no,no.current)}function co(e){ae(no),ro===e&&(ro=null),ae(lo)}var lo=ie(0);function uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gf(n)||_f(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 fo=0,po=null,mo=null,ho=null,go=!1,_o=!1,vo=!1,yo=0,bo=0,xo=null,So=0;function Co(){throw Error(i(321))}function wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function To(e,t,n,r,i,a){return fo=a,po=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Hs:Us,vo=!1,a=n(r,i),vo=!1,_o&&(a=Do(t,n,r,i)),Eo(e),a}function Eo(e){P.H=Vs;var t=mo!==null&&mo.next!==null;if(fo=0,ho=mo=po=null,go=!1,bo=0,xo=null,t)throw Error(i(300));e===null||oc||(e=e.dependencies,e!==null&&Qi(e)&&(oc=!0))}function Do(e,t,n,r){po=e;var a=0;do{if(_o&&(xo=null),bo=0,_o=!1,25<=a)throw Error(i(301));if(a+=1,ho=mo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Ws,o=t(n,r)}while(_o);return o}function Oo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?Fo(t):t,e=e.useState()[0],(mo===null?null:mo.memoizedState)!==e&&(po.flags|=1024),t}function ko(){var e=yo!==0;return yo=0,e}function Ao(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function jo(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}fo=0,ho=mo=po=null,_o=!1,bo=yo=0,xo=null}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ho===null?po.memoizedState=ho=e:ho=ho.next=e,ho}function No(){if(mo===null){var e=po.alternate;e=e===null?null:e.memoizedState}else e=mo.next;var t=ho===null?po.memoizedState:ho.next;if(t!==null)ho=t,mo=e;else{if(e===null)throw po.alternate===null?Error(i(467)):Error(i(310));mo=e,e={memoizedState:mo.memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},ho===null?po.memoizedState=ho=e:ho=ho.next=e}return ho}function Po(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=bo;return bo+=1,xo===null&&(xo=[]),e=Ea(xo,e,t),t=po,(ho===null?t.memoizedState:ho.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Hs:Us),e}function Io(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Fo(e);if(e.$$typeof===C)return ea(e)}throw Error(i(438,String(e)))}function Lo(e){var t=null,n=po.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=po.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=Po(),po.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 Ro(e,t){return typeof t==`function`?t(e):t}function zo(e){return Bo(No(),mo,e)}function Bo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(fo&f)===f:(ql&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===da&&(d=!0);else if((fo&p)===p){u=u.next,p===da&&(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,po.lanes|=p,tu|=p;f=u.action,vo&&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,po.lanes|=f,tu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Sr(o,e.memoizedState)&&(oc=!0,d&&(n=fa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Vo(e){var t=No(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Sr(o,t.memoizedState)||(oc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ho(e,t,n){var r=po,a=No(),o=Pi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Sr((mo||a).memoizedState,n);if(s&&(a.memoizedState=n,oc=!0),a=a.queue,ps(Go.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ho!==null&&ho.memoizedState.tag&1){if(r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,a,n,t),null),Gl===null)throw Error(i(349));o||fo&127||Uo(r,t,n)}return n}function Uo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=po.updateQueue,t===null?(t=Po(),po.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wo(e,t,n,r){t.value=n,t.getSnapshot=r,Ko(t)&&qo(e)}function Go(e,t,n){return n(function(){Ko(t)&&qo(e)})}function Ko(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function qo(e){var t=ri(e,2);t!==null&&Tu(t,e,2)}function Jo(e){var t=Mo();if(typeof e==`function`){var n=e;if(e=n(),vo){Re(!0);try{n()}finally{Re(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:e},t}function Yo(e,t,n,r){return e.baseState=n,Bo(e,mo,typeof r==`function`?r:Ro)}function Xo(e,t,n,r,a){if(Rs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Zo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Zo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Qo(e,t,s)}catch(n){es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Qo(e,t,a)}catch(n){es(e,t,n)}}function Qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){$o(e,t,n)},function(n){return es(e,t,n)}):$o(e,t,n)}function $o(e,t,n){t.status=`fulfilled`,t.value=n,ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zo(e,n)))}function es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ts(t),t=t.next;while(t!==r)}e.action=null}function ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ns(e,t){return t}function rs(e,t){if(Pi){var n=Gl.formState;if(n!==null){a:{var r=po;if(Pi){if(Ni){b:{for(var i=Ni,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=yf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=yf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=Mo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:t},n.queue=r,n=Fs.bind(null,po,r),r.dispatch=n,r=Jo(!1),a=Ls.bind(null,po,!1,r.queue),r=Mo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Xo.bind(null,po,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function is(e){return as(No(),mo,e)}function as(e,t,n){if(t=Bo(e,t,ns)[0],e=zo(Ro)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Fo(t)}catch(e){throw e===xa?Ca:e}else r=t;t=No();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(po.flags|=2048,cs(9,{destroy:void 0},os.bind(null,i,n),null)),[r,a,e]}function os(e,t){e.action=t}function ss(e){var t=No(),n=mo;if(n!==null)return as(t,n,e);No(),t=t.memoizedState,n=No();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function cs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=po.updateQueue,t===null&&(t=Po(),po.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 ls(){return No().memoizedState}function us(e,t,n,r){var i=Mo();po.flags|=e,i.memoizedState=cs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ds(e,t,n,r){var i=No();r=r===void 0?null:r;var a=i.memoizedState.inst;mo!==null&&r!==null&&wo(r,mo.memoizedState.deps)?i.memoizedState=cs(t,a,n,r):(po.flags|=e,i.memoizedState=cs(1|t,a,n,r))}function fs(e,t){us(8390656,8,e,t)}function ps(e,t){ds(2048,8,e,t)}function ms(e){po.flags|=4;var t=po.updateQueue;if(t===null)t=Po(),po.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function hs(e){var t=No().memoizedState;return ms({ref:t,nextImpl:e}),function(){if(Wl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function gs(e,t){return ds(4,2,e,t)}function _s(e,t){return ds(4,4,e,t)}function vs(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 ys(e,t,n){n=n==null?null:n.concat([e]),ds(4,4,vs.bind(null,t,e),n)}function bs(){}function xs(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ss(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&wo(t,r[1]))return r[0];if(r=e(),vo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r}function Cs(e,t,n){return n===void 0||fo&1073741824&&!(ql&261930)?e.memoizedState=t:(e.memoizedState=n,e=wu(),po.lanes|=e,tu|=e,n)}function ws(e,t,n,r){return Sr(n,t)?n:Za.current===null?!(fo&42)||fo&1073741824&&!(ql&261930)?(oc=!0,e.memoizedState=n):(e=wu(),po.lanes|=e,tu|=e,t):(e=Cs(e,n,r),Sr(e,t)||(oc=!0),e)}function Ts(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Ls(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,ha(c,r),Cu(e)):Is(e,t,r,Cu(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},Cu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Os(e).queue;Ts(e,a,t,I,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},Cu())}function As(){return ea(lp)}function js(){return No().memoizedState}function Ms(){return No().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cu();e=Ha(n);var r=Ua(t,e,n);r!==null&&(Tu(r,t,n),Wa(r,t,n)),t={cache:sa()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=Cu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=ni(e,t,n,r),n!==null&&(Tu(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,Cu())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(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,Sr(s,o))return ti(e,t,i,0),Gl===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return Tu(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:xd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(i(479))}else t=ni(e,n,r,2),t!==null&&Tu(t,e,2)}function Rs(e){var t=e.alternate;return e===po||t!==null&&t===po}function zs(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Vs={readContext:ea,use:Io,useCallback:Co,useContext:Co,useEffect:Co,useImperativeHandle:Co,useLayoutEffect:Co,useInsertionEffect:Co,useMemo:Co,useReducer:Co,useRef:Co,useState:Co,useDebugValue:Co,useDeferredValue:Co,useTransition:Co,useSyncExternalStore:Co,useId:Co,useHostTransitionStatus:Co,useFormState:Co,useActionState:Co,useOptimistic:Co,useMemoCache:Co,useCacheRefresh:Co};Vs.useEffectEvent=Co;var Hs={readContext:ea,use:Io,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:ea,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(vo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(vo){Re(!0);try{n(t)}finally{Re(!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=Ps.bind(null,po,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Fs.bind(null,po,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(Mo(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,po,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=po,a=Mo();if(Pi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Gl===null)throw Error(i(349));ql&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(Go.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=Mo(),t=Gl.identifierPrefix;if(Pi){var n=Ei,r=Ti;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=So++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:As,useFormState:rs,useActionState:rs,useOptimistic:function(e){var t=Mo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ls.bind(null,po,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return Mo().memoizedState=Ns.bind(null,po)},useEffectEvent:function(e){var t=Mo(),n={impl:e};return t.memoizedState=n,function(){if(Wl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Us={readContext:ea,use:Io,useCallback:xs,useContext:ea,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:zo,useRef:ls,useState:function(){return zo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){return ws(No(),mo.memoizedState,e,t)},useTransition:function(){var e=zo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:is,useActionState:is,useOptimistic:function(e,t){return Yo(No(),mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Us.useEffectEvent=hs;var Ws={readContext:ea,use:Io,useCallback:xs,useContext:ea,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:Vo,useRef:ls,useState:function(){return Vo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){var n=No();return mo===null?Cs(n,e,t):ws(n,mo.memoizedState,e,t)},useTransition:function(){var e=Vo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){var n=No();return mo===null?(n.baseState=e,[e,n.queue.dispatch]):Yo(n,mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Ws.useEffectEvent=hs;function Gs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ks={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Ha(r);i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(Tu(t,e,r),Wa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Ha(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ua(e,i,r),t!==null&&(Tu(t,e,r),Wa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cu(),r=Ha(n);r.tag=2,t!=null&&(r.callback=t),t=Ua(e,r,n),t!==null&&(Tu(t,e,n),Wa(t,e,n))}};function qs(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?!Cr(n,r)||!Cr(i,a):!0}function Js(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&&Ks.enqueueReplaceState(t,t.state,null)}function Ys(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=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Xs(e){Xr(e)}function Zs(e){console.error(e)}function Qs(e){Xr(e)}function $s(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ec(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 tc(e,t,n){return n=Ha(n),n.tag=3,n.payload={element:null},n.callback=function(){$s(e,t)},n}function nc(e){return e=Ha(e),e.tag=3,e}function rc(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(){ec(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){ec(t,n,r),typeof i!=`function`&&(pu===null?pu=new Set([this]):pu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ic(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Zi(t,n,a,!0),n=no.current,n!==null){switch(n.tag){case 31:case 13:return ro===null?Iu():n.alternate===null&&eu===0&&(eu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===wa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),td(e,r,a)),!1;case 22:return n.flags|=65536,r===wa?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)),td(e,r,a)),!1}throw Error(i(435,n.tag))}return td(e,r,a),Iu(),!1}if(Pi)return t=no.current,t===null?(r!==Li&&(t=Error(i(423),{cause:r}),Wi(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=tc(e.stateNode,r,a),Ga(e,a),eu!==4&&(eu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Li&&(e=Error(i(422),{cause:r}),Wi(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),ou===null?ou=[o]:ou.push(o),eu!==4&&(eu=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=tc(n.stateNode,r,e),Ga(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`&&(pu===null||!pu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=nc(a),rc(a,e,n,r),Ga(n,a),!1}n=n.return}while(n!==null);return!1}var ac=Error(i(461)),oc=!1;function sc(e,t,n,r){t.child=e===null?Ra(t,null,n,r):La(t,e.child,n,r)}function cc(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 $i(t),r=To(e,t,n,o,a,i),s=ko(),e!==null&&!oc?(Ao(e,t,i),Mc(e,t,i)):(Pi&&s&&ki(t),t.flags|=1,sc(e,t,r,i),t.child)}function lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,uc(e,t,a,r,i)):(e=z(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Nc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return Mc(e,t,i)}return t.flags|=1,e=ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(oc=!1,t.pendingProps=r=a,Nc(e,i))e.flags&131072&&(oc=!0);else return t.lanes=e.lanes,Mc(e,t,i)}return vc(e,t,n,r,i)}function dc(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 pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ya(t,a===null?null:a.cachePool),a===null?eo():$a(t,a),oo(t);else return r=t.lanes=536870912,pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ya(t,null),eo(),so(t)):(ya(t,a.cachePool),$a(t,a),so(t),t.memoizedState=null);return sc(e,t,i,n),t.child}function fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function pc(e,t,n,r,i){var a=va();return a=a===null?null:{parent:oa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ya(t,null),eo(),oo(t),e!==null&&Zi(e,t,r,!0),t.childLanes=i,null}function mc(e,t){return t=Dc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function hc(e,t,n){return La(t,e.child,null,n),e=mc(t,t.pendingProps),e.flags|=2,co(t),t.memoizedState=null,e}function gc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Pi){if(r.mode===`hidden`)return e=mc(t,r),t.lanes=536870912,fc(null,e);if(ao(t),(e=Ni)?(e=hf(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return mc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ao(t),a)if(t.flags&256)t.flags&=-257,t=hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(oc||Zi(e,t,n,!1),a=(n&e.childLanes)!==0,oc||a){if(r=Gl,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ri(e,s),Tu(r,e,s),ac;Iu(),t=hc(e,t,n)}else e=o.treeContext,Ni=yf(s.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=mc(t,r),t.flags|=4096;return t}return e=ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _c(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function vc(e,t,n,r,i){return $i(t),n=To(e,t,n,r,void 0,i),r=ko(),e!==null&&!oc?(Ao(e,t,i),Mc(e,t,i)):(Pi&&r&&ki(t),t.flags|=1,sc(e,t,n,i),t.child)}function yc(e,t,n,r,i,a){return $i(t),t.updateQueue=null,n=Do(t,r,n,i),Eo(e),r=ko(),e!==null&&!oc?(Ao(e,t,a),Mc(e,t,a)):(Pi&&r&&ki(t),t.flags|=1,sc(e,t,n,a),t.child)}function bc(e,t,n,r,i){if($i(t),t.stateNode===null){var a=oi,o=n.contextType;typeof o==`object`&&o&&(a=ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ks,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ba(t),o=n.contextType,a.context=typeof o==`object`&&o?ea(o):oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Gs(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&&Ks.enqueueReplaceState(a,a.state,null),Ja(t,r,a,i),qa(),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=Ys(n,s);a.props=c;var l=a.context,u=n.contextType;o=oi,typeof u==`object`&&u&&(o=ea(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)&&Js(t,a,r,o),za=!1;var f=t.memoizedState;a.state=f,Ja(t,r,a,i),qa(),l=t.memoizedState,s||f!==l||za?(typeof d==`function`&&(Gs(t,n,d,r),l=t.memoizedState),(c=za||qs(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,Va(e,t),o=t.memoizedProps,u=Ys(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=oi,typeof l==`object`&&l&&(c=ea(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)&&Js(t,a,r,c),za=!1,f=t.memoizedState,a.state=f,Ja(t,r,a,i),qa();var p=t.memoizedState;o!==d||f!==p||za||e!==null&&e.dependencies!==null&&Qi(e.dependencies)?(typeof s==`function`&&(Gs(t,n,s,r),p=t.memoizedState),(u=za||qs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Qi(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,_c(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=La(t,e.child,null,i),t.child=La(t,null,n,i)):sc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Mc(e,t,i),e}function xc(e,t,n,r){return Hi(),t.flags|=256,sc(e,t,n,r),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cc(e){return{baseLanes:e,cachePool:ba()}}function wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=iu),e}function Tc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(lo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Pi){if(a?io(t):so(t),(e=Ni)?(e=hf(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return _f(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(so(t),a=t.mode,c=Dc({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(null,r)):(io(t),Ec(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(io(t),t.flags&=-257,t=Oc(e,t,n)):t.memoizedState===null?(so(t),c=r.fallback,a=t.mode,r=Dc({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,La(t,e.child,null,n),r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,t=fc(null,r)):(so(t),t.child=e.child,t.flags|=128,t=null);else if(io(t),_f(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Oc(e,t,n)}else if(oc||Zi(e,t,n,!1),s=(n&e.childLanes)!==0,oc||s){if(s=Gl,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ri(e,r),Tu(s,e,r),ac;gf(c)||Iu(),t=Oc(e,t,n)}else gf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=yf(c.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=Ec(t,r.children),t.flags|=4096);return t}return a?(so(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ui(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=ui(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,fc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Cc(n):(a=c.cachePool,a===null?a=ba():(l=oa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(e.child,r)):(io(t),n=e.child,e=n.sibling,n=ui(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 Ec(e,t){return t=Dc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Dc(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function Oc(e,t,n){return La(t,e.child,null,n),e=Ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Yi(e.return,t,n)}function Ac(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 jc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=lo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,oe(lo,o),sc(e,t,r,n),r=Pi?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kc(e,n,t);else if(e.tag===19)kc(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&&uo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ac(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&&uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ac(t,!0,n,null,a,r);break;case`together`:Ac(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Mc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),tu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Zi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Qi(e))):!0}function Pc(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),B(t,oa,e.memoizedState.cache),Hi();break;case 27:case 5:pe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:B(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(io(t),e=Mc(e,t,n),e===null?null:e.sibling):Tc(e,t,n):(io(t),t.flags|=128,null);io(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Zi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return jc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(lo,lo.current),r)break;return null;case 22:return t.lanes=0,dc(e,t,n,t.pendingProps);case 24:B(t,oa,e.memoizedState.cache)}return Mc(e,t,n)}function Fc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)oc=!0;else{if(!Nc(e,n)&&!(t.flags&128))return oc=!1,Pc(e,t,n);oc=!!(e.flags&131072)}else oc=!1,Pi&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Da(t.elementType),t.type=e,typeof e==`function`)li(e)?(r=Ys(e,r),t.tag=1,t=bc(null,t,e,r,n)):(t.tag=0,t=vc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=cc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=lc(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ys(r,t.pendingProps),bc(e,t,r,a,n);case 3:a:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Va(e,t),Ja(t,r,null,n);var s=t.memoizedState;if(r=s.cache,B(t,oa,r),r!==o.cache&&Xi(t,[oa],n,!0),qa(),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=xc(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Wi(a),t=xc(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(Ni=yf(e.firstChild),Mi=t,Pi=!0,Fi=null,Ii=!0,n=Ra(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=Mc(e,t,n);break a}sc(e,t,r,n)}t=t.child}return t;case 26:return _c(e,t),e===null?(n=Bf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Pi||(n=t.type,e=t.pendingProps,r=Qd(le.current).createElement(n),r[ot]=t,r[st]=e,Kd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=Bf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return pe(t),e===null&&Pi&&(r=t.stateNode=Cf(t.type,t.pendingProps,le.current),Mi=t,Ii=!0,a=Ni,lf(t.type)?(bf=a,Ni=yf(r.firstChild)):Ni=a),sc(e,t,t.pendingProps.children,n),_c(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pi&&((a=r=Ni)&&(r=pf(r,t.type,t.pendingProps,Ii),r===null?a=!1:(t.stateNode=r,Mi=t,Ni=yf(r.firstChild),Ii=!1,a=!0)),a||Ri(t)),pe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,ef(a,o)?r=null:s!==null&&ef(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=To(e,t,Oo,null,null,n),lp._currentValue=a),_c(e,t),sc(e,t,r,n),t.child;case 6:return e===null&&Pi&&((e=n=Ni)&&(n=mf(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Ri(t)),null;case 13:return Tc(e,t,n);case 4:return de(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=La(t,null,r,n):sc(e,t,r,n),t.child;case 11:return cc(e,t,t.type,t.pendingProps,n);case 7:return sc(e,t,t.pendingProps,n),t.child;case 8:return sc(e,t,t.pendingProps.children,n),t.child;case 12:return sc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,B(t,t.type,r.value),sc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,$i(t),a=ea(a),r=r(a),t.flags|=1,sc(e,t,r,n),t.child;case 14:return lc(e,t,t.type,t.pendingProps,n);case 15:return uc(e,t,t.type,t.pendingProps,n);case 19:return jc(e,t,n);case 31:return gc(e,t,n);case 22:return dc(e,t,n,t.pendingProps);case 24:return $i(t),r=ea(oa),e===null?(a=va(),a===null&&(a=Gl,o=sa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ba(t),B(t,oa,a)):((e.lanes&n)!==0&&(Va(e,t),Ja(t,null,null,n),qa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,B(t,oa,r),r!==a.cache&&Xi(t,[oa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),B(t,oa,r))),sc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ic(e){e.flags|=4}function Lc(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(Pu())e.flags|=8192;else throw Oa=wa,Sa}else e.flags&=-16777217}function Rc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!tp(t))if(Pu())e.flags|=8192;else throw Oa=wa,Sa}function zc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,au|=t)}function Bc(e,t){if(!Pi)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 Vc(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 Hc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vc(t),null;case 1:return Vc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ji(oa),fe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Ic(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Vc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ic(t),o===null?(Vc(t),Lc(t,a,null,r,n)):(Vc(t),Rc(t,o))):o?o===e.memoizedState?(Vc(t),t.flags&=-16777217):(Ic(t),Vc(t),Rc(t,o)):(e=e.memoizedProps,e!==r&&Ic(t),Vc(t),Lc(t,a,e,r,n)),null;case 27:if(me(t),n=le.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Vc(t),null}e=se.current,Vi(t)?zi(t,e):(e=Cf(a,r,n),t.stateNode=e,Ic(t))}return Vc(t),null;case 5:if(me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Vc(t),null}if(o=se.current,Vi(t))zi(t,o);else{var s=Qd(le.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ot]=t,o[st]=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(Kd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ic(t)}}return Vc(t),Lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ud(e.nodeValue,n)),e||Ri(t,!0)}else e=Qd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return Vc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ot]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(co(t),t):(co(t),null);if(t.flags&128)throw Error(i(558))}return Vc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ot]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(co(t),t):(co(t),null)}return co(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),zc(t,t.updateQueue),Vc(t),null);case 4:return fe(),e===null&&Nd(t.stateNode.containerInfo),Vc(t),null;case 10:return Ji(t.type),Vc(t),null;case 19:if(ae(lo),r=t.memoizedState,r===null)return Vc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Bc(r,!1);else{if(eu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=uo(e),o!==null){for(t.flags|=128,Bc(r,!1),e=o.updateQueue,t.updateQueue=e,zc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)di(n,e),n=n.sibling;return oe(lo,lo.current&1|2),Pi&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>du&&(t.flags|=128,a=!0,Bc(r,!1),t.lanes=4194304)}else{if(!a)if(e=uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,zc(t,e),Bc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Pi)return Vc(t),null}else 2*De()-r.renderingStartTime>du&&n!==536870912&&(t.flags|=128,a=!0,Bc(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?(Vc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=lo.current,oe(lo,a?n&1|2:n&1),Pi&&Di(t,r.treeForkCount),e);case 22:case 23:return co(t),to(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Vc(t),t.subtreeFlags&6&&(t.flags|=8192)):Vc(t),n=t.updateQueue,n!==null&&zc(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&&ae(_a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ji(oa),Vc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Uc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ji(oa),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(co(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(lo),null;case 4:return fe(),null;case 10:return Ji(t.type),null;case 22:case 23:return co(t),to(),e!==null&&ae(_a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ji(oa),null;case 25:return null;default:return null}}function Wc(e,t){switch(Ai(t),t.tag){case 3:Ji(oa),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&co(t);break;case 13:co(t);break;case 19:ae(lo);break;case 10:Ji(t.type);break;case 22:case 23:co(t),to(),e!==null&&ae(_a);break;case 24:Ji(oa)}}function Gc(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){ed(t,t.return,e)}}function Kc(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){ed(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ed(t,t.return,e)}}function qc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Xa(t,n)}catch(t){ed(e,e.return,t)}}}function Jc(e,t,n){n.props=Ys(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ed(e,t,n)}}function Yc(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){ed(e,t,n)}}function Xc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){ed(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){ed(e,t,n)}else n.current=null}function Zc(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){ed(e,e.return,t)}}function Qc(e,t,n){try{var r=e.stateNode;qd(r,e.type,n,t),r[st]=t}catch(t){ed(e,e.return,t)}}function $c(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&lf(e.type)||e.tag===4}function el(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||$c(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&&lf(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 tl(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=$t));else if(r!==4&&(r===27&&lf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(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&&lf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Kd(t,r,n),t[ot]=e,t[st]=n}catch(t){ed(e,e.return,t)}}var il=!1,al=!1,ol=!1,sl=typeof WeakSet==`function`?WeakSet:Set,cl=null;function ll(e,t){if(e=e.containerInfo,Xd=vp,e=Dr(e),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Zd={focusedElem:e,selectionRange:n},vp=!1,cl=t;cl!==null;)if(t=cl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,cl=e;else for(;cl!==null;){switch(t=cl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ys(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){ed(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ff(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ff(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,cl=e;break}cl=t.return}}function ul(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Tl(e,n),r&4&&Gc(5,n);break;case 1:if(Tl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ed(n,n.return,e)}else{var i=Ys(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ed(n,n.return,e)}}r&64&&qc(n),r&512&&Yc(n,n.return);break;case 3:if(Tl(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{Xa(e,t)}catch(e){ed(n,n.return,e)}}break;case 27:t===null&&r&4&&rl(n);case 26:case 5:Tl(e,n),t===null&&r&4&&Zc(n),r&512&&Yc(n,n.return);break;case 12:Tl(e,n);break;case 31:Tl(e,n),r&4&&gl(e,n);break;case 13:Tl(e,n),r&4&&_l(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=id.bind(null,n),vf(e,n))));break;case 22:if(r=n.memoizedState!==null||il,!r){t=t!==null&&t.memoizedState!==null||al,i=il;var a=al;il=r,(al=t)&&!a?Dl(e,n,(n.subtreeFlags&8772)!=0):Tl(e,n),il=i,al=a}break;case 30:break;default:Tl(e,n)}}function dl(e){var t=e.alternate;t!==null&&(e.alternate=null,dl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(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 fl=null,pl=!1;function ml(e,t,n){for(n=n.child;n!==null;)hl(e,t,n),n=n.sibling}function hl(e,t,n){if(Le&&typeof Le.onCommitFiberUnmount==`function`)try{Le.onCommitFiberUnmount(Ie,n)}catch{}switch(n.tag){case 26:al||Xc(n,t),ml(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:al||Xc(n,t);var r=fl,i=pl;lf(n.type)&&(fl=n.stateNode,pl=!1),ml(e,t,n),wf(n.stateNode),fl=r,pl=i;break;case 5:al||Xc(n,t);case 6:if(r=fl,i=pl,fl=null,ml(e,t,n),fl=r,pl=i,fl!==null)if(pl)try{(fl.nodeType===9?fl.body:fl.nodeName===`HTML`?fl.ownerDocument.body:fl).removeChild(n.stateNode)}catch(e){ed(n,t,e)}else try{fl.removeChild(n.stateNode)}catch(e){ed(n,t,e)}break;case 18:fl!==null&&(pl?(e=fl,uf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Wp(e)):uf(fl,n.stateNode));break;case 4:r=fl,i=pl,fl=n.stateNode.containerInfo,pl=!0,ml(e,t,n),fl=r,pl=i;break;case 0:case 11:case 14:case 15:Kc(2,n,t),al||Kc(4,n,t),ml(e,t,n);break;case 1:al||(Xc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Jc(n,t,r)),ml(e,t,n);break;case 21:ml(e,t,n);break;case 22:al=(r=al)||n.memoizedState!==null,ml(e,t,n),al=r;break;default:ml(e,t,n)}}function gl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wp(e)}catch(e){ed(t,t.return,e)}}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wp(e)}catch(e){ed(t,t.return,e)}}function vl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sl),t;default:throw Error(i(435,e.tag))}}function yl(e,t){var n=vl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ad.bind(null,e,t);t.then(r,r)}})}function bl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(lf(c.type)){fl=c.stateNode,pl=!1;break a}break;case 5:fl=c.stateNode,pl=!1;break a;case 3:case 4:fl=c.stateNode.containerInfo,pl=!0;break a}c=c.return}if(fl===null)throw Error(i(160));hl(o,s,a),fl=null,pl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Sl(t,e),t=t.sibling}var xl=null;function Sl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:bl(t,e),Cl(e),r&4&&(Kc(3,e,e.return),Gc(3,e),Kc(5,e,e.return));break;case 1:bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),r&64&&il&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=xl;if(bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[pt]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Kd(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Kd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Qf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Kd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ot]=e,yt(o),r=o}e.stateNode=r}else $f(a,e.type,e.stateNode);else e.stateNode=qf(a,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?$f(a,e.type,e.stateNode):qf(a,r,e.memoizedProps))}break;case 27:bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),n!==null&&r&4&&Qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(bl(t,e),Cl(e),r&512&&(al||n===null||Xc(n,n.return)),e.flags&32){a=e.stateNode;try{Gt(a,``)}catch(t){ed(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(ol=!0);break;case 6:if(bl(t,e),Cl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){ed(e,e.return,t)}}break;case 3:if(Zf=null,a=xl,xl=Df(t.containerInfo),bl(t,e),xl=a,Cl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Wp(t.containerInfo)}catch(t){ed(e,e.return,t)}ol&&(ol=!1,wl(e));break;case 4:r=xl,xl=Df(e.stateNode.containerInfo),bl(t,e),Cl(e),xl=r;break;case 12:bl(t,e),Cl(e);break;case 31:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 13:bl(t,e),Cl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(lu=De()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=il,d=al;if(il=u||a,al=d||l,bl(t,e),al=d,il=u,Cl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||il||al||El(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){ed(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){ed(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?df(m,!0):df(l.stateNode,!1)}catch(e){ed(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,yl(e,n))));break;case 19:bl(t,e),Cl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,yl(e,r)));break;case 30:break;case 21:break;default:bl(t,e),Cl(e)}}function Cl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if($c(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;nl(e,el(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Gt(o,``),n.flags&=-33),nl(e,el(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;tl(e,el(e),s);break;default:throw Error(i(161))}}catch(t){ed(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;wl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Tl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ul(e,t.alternate,t),t=t.sibling}function El(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Kc(4,t,t.return),El(t);break;case 1:Xc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Jc(t,t.return,n),El(t);break;case 27:wf(t.stateNode);case 26:case 5:Xc(t,t.return),El(t);break;case 22:t.memoizedState===null&&El(t);break;case 30:El(t);break;default:El(t)}e=e.sibling}}function Dl(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:Dl(i,a,n),Gc(4,a);break;case 1:if(Dl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ed(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++)Ya(c[i],s)}catch(e){ed(r,r.return,e)}}n&&o&64&&qc(a),Yc(a,a.return);break;case 27:rl(a);case 26:case 5:Dl(i,a,n),n&&r===null&&o&4&&Zc(a),Yc(a,a.return);break;case 12:Dl(i,a,n);break;case 31:Dl(i,a,n),n&&o&4&&gl(i,a);break;case 13:Dl(i,a,n),n&&o&4&&_l(i,a);break;case 22:a.memoizedState===null&&Dl(i,a,n),Yc(a,a.return);break;case 30:break;default:Dl(i,a,n)}t=t.sibling}}function Ol(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&&ca(n))}function kl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ca(e))}function Al(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jl(e,t,n,r),t=t.sibling}function jl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Al(e,t,n,r),i&2048&&Gc(9,t);break;case 1:Al(e,t,n,r);break;case 3:Al(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&&ca(e)));break;case 12:if(i&2048){Al(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){ed(t,t.return,e)}}else Al(e,t,n,r);break;case 31:Al(e,t,n,r);break;case 13:Al(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Al(e,t,n,r):(a._visibility|=2,Ml(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Al(e,t,n,r):Nl(e,t),i&2048&&Ol(o,t);break;case 24:Al(e,t,n,r),i&2048&&kl(t.alternate,t);break;default:Al(e,t,n,r)}}function Ml(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:Ml(a,o,s,c,i),Gc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ml(a,o,s,c,i)):u._visibility&2?Ml(a,o,s,c,i):Nl(a,o),i&&l&2048&&Ol(o.alternate,o);break;case 24:Ml(a,o,s,c,i),i&&l&2048&&kl(o.alternate,o);break;default:Ml(a,o,s,c,i)}t=t.sibling}}function Nl(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:Nl(n,r),i&2048&&Ol(r.alternate,r);break;case 24:Nl(n,r),i&2048&&kl(r.alternate,r);break;default:Nl(n,r)}t=t.sibling}}var Pl=8192;function Fl(e,t,n){if(e.subtreeFlags&Pl)for(e=e.child;e!==null;)Il(e,t,n),e=e.sibling}function Il(e,t,n){switch(e.tag){case 26:Fl(e,t,n),e.flags&Pl&&e.memoizedState!==null&&np(n,xl,e.memoizedState,e.memoizedProps);break;case 5:Fl(e,t,n);break;case 3:case 4:var r=xl;xl=Df(e.stateNode.containerInfo),Fl(e,t,n),xl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Pl,Pl=16777216,Fl(e,t,n),Pl=r):Fl(e,t,n));break;default:Fl(e,t,n)}}function Ll(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 Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cl=r,Vl(r,e)}Ll(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)zl(e),e=e.sibling}function zl(e){switch(e.tag){case 0:case 11:case 15:Rl(e),e.flags&2048&&Kc(9,e,e.return);break;case 3:Rl(e);break;case 12:Rl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Bl(e)):Rl(e);break;default:Rl(e)}}function Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];cl=r,Vl(r,e)}Ll(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Kc(8,t,t.return),Bl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Bl(t));break;default:Bl(t)}e=e.sibling}}function Vl(e,t){for(;cl!==null;){var n=cl;switch(n.tag){case 0:case 11:case 15:Kc(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:ca(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,cl=r;else a:for(n=e;cl!==null;){r=cl;var i=r.sibling,a=r.return;if(dl(r),r===n){cl=null;break a}if(i!==null){i.return=a,cl=i;break a}cl=a}}}var Hl={getCacheForType:function(e){var t=ea(oa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ea(oa).controller.signal}},Ul=typeof WeakMap==`function`?WeakMap:Map,Wl=0,Gl=null,Kl=null,ql=0,Jl=0,Yl=null,Xl=!1,Zl=!1,Ql=!1,$l=0,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=null,su=null,cu=!1,lu=0,uu=0,du=1/0,fu=null,pu=null,mu=0,hu=null,gu=null,_u=0,vu=0,yu=null,bu=null,xu=0,Su=null;function Cu(){return Wl&2&&ql!==0?ql&-ql:P.T===null?it():xd()}function wu(){if(iu===0)if(!(ql&536870912)||Pi){var e=We;We<<=1,!(We&3932160)&&(We=262144),iu=e}else iu=536870912;return e=no.current,e!==null&&(e.flags|=32),iu}function Tu(e,t,n){(e===Gl&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)&&(Mu(e,0),ku(e,ql,iu,!1)),Qe(e,n),(!(Wl&2)||e!==Gl)&&(e===Gl&&(!(Wl&2)&&(nu|=n),eu===4&&ku(e,ql,iu,!1)),pd(e))}function Eu(e,t,n){if(Wl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Je(e,t),a=r?zu(e,t):Lu(e,t,!0),o=r;do{if(a===0){Zl&&!r&&ku(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Ou(n)){a=Lu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=ou;var l=c.current.memoizedState.isDehydrated;if(l&&(Mu(c,s).flags|=256),s=Lu(c,s,!1),s!==2){if(Ql&&!l){c.errorRecoveryDisabledLanes|=o,nu|=o,a=4;break a}o=su,su=a,o!==null&&(su===null?su=o:su.push.apply(su,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Mu(e,0),ku(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:ku(r,t,iu,!Xl);break a;case 2:su=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=lu+300-De(),10<a)){if(ku(r,t,iu,!Xl),qe(r,0,!0)!==0)break a;_u=t,r.timeoutHandle=rf(Du.bind(null,r,n,su,fu,cu,t,iu,nu,au,Xl,o,`Throttled`,-0,0),a);break a}Du(r,n,su,fu,cu,t,iu,nu,au,Xl,o,null,-0,0)}}break}while(1);pd(e)}function Du(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:$t},Il(t,a,d);var m=(a&62914560)===a?lu-De():(a&4194048)===a?uu-De():0;if(m=ip(d,m),m!==null){_u=a,e.cancelPendingCommit=m(Ku.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ku(e,a,o,!l);return}}Ku(e,t,a,n,r,i,o,s,c)}function Ou(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(!Sr(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 ku(e,t,n,r){t&=~ru,t&=~nu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ze(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&L(e,n,t)}function Au(){return Wl&6?!0:(md(0,!1),!1)}function ju(){if(Kl!==null){if(Jl===0)var e=Kl.return;else e=Kl,qi=Ki=null,jo(e),ja=null,Ma=0,e=Kl;for(;e!==null;)Wc(e.alternate,e),e=e.return;Kl=null}}function Mu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,af(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),_u=0,ju(),Gl=e,Kl=n=ui(e.current,null),ql=t,Jl=0,Yl=null,Xl=!1,Zl=Je(e,t),Ql=!1,au=iu=ru=nu=tu=eu=0,su=ou=null,cu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-ze(r),a=1<<i;t|=e[i],r&=~a}return $l=t,ei(),n}function Nu(e,t){po=null,P.H=Vs,t===xa||t===Ca?(t=ka(),Jl=3):t===Sa?(t=ka(),Jl=4):Jl=t===ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Yl=t,Kl===null&&(eu=1,$s(e,_i(t,e.current)))}function Pu(){var e=no.current;return e===null?!0:(ql&4194048)===ql?ro===null:(ql&62914560)===ql||ql&536870912?e===ro:!1}function Fu(){var e=P.H;return P.H=Vs,e===null?Vs:e}function V(){var e=P.A;return P.A=Hl,e}function Iu(){eu=4,Xl||(ql&4194048)!==ql&&no.current!==null||(Zl=!0),!(tu&134217727)&&!(nu&134217727)||Gl===null||ku(Gl,ql,iu,!1)}function Lu(e,t,n){var r=Wl;Wl|=2;var i=Fu(),a=V();(Gl!==e||ql!==t)&&(fu=null,Mu(e,t)),t=!1;var o=eu;a:do try{if(Jl!==0&&Kl!==null){var s=Kl,c=Yl;switch(Jl){case 8:ju(),o=6;break a;case 3:case 2:case 9:case 6:no.current===null&&(t=!0);var l=Jl;if(Jl=0,Yl=null,Uu(e,s,c,l),n&&Zl){o=0;break a}break;default:l=Jl,Jl=0,Yl=null,Uu(e,s,c,l)}}Ru(),o=eu;break}catch(t){Nu(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,Wl=r,P.H=i,P.A=a,Kl===null&&(Gl=null,ql=0,ei()),o}function Ru(){for(;Kl!==null;)Vu(Kl)}function zu(e,t){var n=Wl;Wl|=2;var r=Fu(),a=V();Gl!==e||ql!==t?(fu=null,du=De()+500,Mu(e,t)):Zl=Je(e,t);a:do try{if(Jl!==0&&Kl!==null){t=Kl;var o=Yl;b:switch(Jl){case 1:Jl=0,Yl=null,Uu(e,t,o,1);break;case 2:case 9:if(Ta(o)){Jl=0,Yl=null,Hu(t);break}t=function(){Jl!==2&&Jl!==9||Gl!==e||(Jl=7),pd(e)},o.then(t,t);break a;case 3:Jl=7;break a;case 4:Jl=5;break a;case 7:Ta(o)?(Jl=0,Yl=null,Hu(t)):(Jl=0,Yl=null,Uu(e,t,o,7));break;case 5:var s=null;switch(Kl.tag){case 26:s=Kl.memoizedState;case 5:case 27:var c=Kl;if(s?tp(s):c.stateNode.complete){Jl=0,Yl=null;var l=c.sibling;if(l!==null)Kl=l;else{var u=c.return;u===null?Kl=null:(Kl=u,Wu(u))}break b}}Jl=0,Yl=null,Uu(e,t,o,5);break;case 6:Jl=0,Yl=null,Uu(e,t,o,6);break;case 8:ju(),eu=6;break a;default:throw Error(i(462))}}Bu();break}catch(t){Nu(e,t)}while(1);return qi=Ki=null,P.H=r,P.A=a,Wl=n,Kl===null?(Gl=null,ql=0,ei(),eu):0}function Bu(){for(;Kl!==null&&!Te();)Vu(Kl)}function Vu(e){var t=Fc(e.alternate,e,$l);e.memoizedProps=e.pendingProps,t===null?Wu(e):Kl=t}function Hu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=yc(n,t,t.pendingProps,t.type,void 0,ql);break;case 11:t=yc(n,t,t.pendingProps,t.type.render,t.ref,ql);break;case 5:jo(t);default:Wc(n,t),t=Kl=di(t,$l),t=Fc(n,t,$l)}e.memoizedProps=e.pendingProps,t===null?Wu(e):Kl=t}function Uu(e,t,n,r){qi=Ki=null,jo(t),ja=null,Ma=0;var i=t.return;try{if(ic(e,i,t,n,ql)){eu=1,$s(e,_i(n,e.current)),Kl=null;return}}catch(t){if(i!==null)throw Kl=i,t;eu=1,$s(e,_i(n,e.current)),Kl=null;return}t.flags&32768?(Pi||r===1?e=!0:Zl||ql&536870912?e=!1:(Xl=e=!0,(r===2||r===9||r===3||r===6)&&(r=no.current,r!==null&&r.tag===13&&(r.flags|=16384))),Gu(t,e)):Wu(t)}function Wu(e){var t=e;do{if(t.flags&32768){Gu(t,Xl);return}e=t.return;var n=Hc(t.alternate,t,$l);if(n!==null){Kl=n;return}if(t=t.sibling,t!==null){Kl=t;return}Kl=t=e}while(t!==null);eu===0&&(eu=5)}function Gu(e,t){do{var n=Uc(e.alternate,e);if(n!==null){n.flags&=32767,Kl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Kl=e;return}Kl=e=n}while(e!==null);eu=6,Kl=null}function Ku(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Zu();while(mu!==0);if(Wl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=$r,$e(e,n,o,s,c,l),e===Gl&&(Kl=Gl=null,ql=0),gu=t,hu=e,_u=n,vu=o,yu=a,bu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,od(je,function(){return Qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Wl,Wl|=4;try{ll(e,t,n)}finally{Wl=s,F.p=a,P.T=r}}mu=1,qu(),Ju(),Yu()}}function qu(){if(mu===1){mu=0;var e=hu,t=gu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Wl;Wl|=4;try{Sl(t,e);var a=Zd,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Er(s.ownerDocument.documentElement,s)){if(c!==null&&Or(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 _=Tr(s,h),v=Tr(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}}vp=!!Xd,Zd=Xd=null}finally{Wl=i,F.p=r,P.T=n}}e.current=t,mu=2}}function Ju(){if(mu===2){mu=0;var e=hu,t=gu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Wl;Wl|=4;try{ul(e,t.alternate,t)}finally{Wl=i,F.p=r,P.T=n}}mu=3}}function Yu(){if(mu===4||mu===3){mu=0,Ee();var e=hu,t=gu,n=_u,r=bu;t.subtreeFlags&10256||t.flags&10256?mu=5:(mu=0,gu=hu=null,Xu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(pu=null),rt(n),t=t.stateNode,Le&&typeof Le.onCommitFiberRoot==`function`)try{Le.onCommitFiberRoot(Ie,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.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{P.T=t,F.p=i}}_u&3&&Zu(),pd(e),i=e.pendingLanes,n&261930&&i&42?e===Su?xu++:(xu=0,Su=e):xu=0,md(0,!1)}}function Xu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ca(t)))}function Zu(){return qu(),Ju(),Yu(),Qu()}function Qu(){if(mu!==5)return!1;var e=hu,t=vu;vu=0;var n=rt(_u),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=yu,yu=null;var o=hu,s=_u;if(mu=0,gu=hu=null,_u=0,Wl&6)throw Error(i(331));var c=Wl;if(Wl|=4,zl(o.current),jl(o,o.current,s,n),Wl=c,md(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{F.p=a,P.T=r,Xu(e,t)}}function $u(e,t,n){t=_i(n,t),t=tc(e.stateNode,t,2),e=Ua(e,t,2),e!==null&&(Qe(e,2),pd(e))}function ed(e,t,n){if(e.tag===3)$u(e,e,n);else for(;t!==null;){if(t.tag===3){$u(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(pu===null||!pu.has(r))){e=_i(n,e),n=nc(2),r=Ua(t,n,2),r!==null&&(rc(n,r,t,e),Qe(r,2),pd(r));break}}t=t.return}}function td(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ul;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)||(Ql=!0,i.add(n),e=nd.bind(null,e,t,n),t.then(e,e))}function nd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Gl===e&&(ql&n)===n&&(eu===4||eu===3&&(ql&62914560)===ql&&300>De()-lu?!(Wl&2)&&Mu(e,0):ru|=n,au===ql&&(au=0)),pd(e)}function rd(e,t){t===0&&(t=Xe()),e=ri(e,t),e!==null&&(Qe(e,t),pd(e))}function id(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rd(e,n)}function ad(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),rd(e,n)}function od(e,t){return Ce(e,t)}var sd=null,cd=null,ld=!1,ud=!1,dd=!1,fd=0;function pd(e){e!==cd&&e.next===null&&(cd===null?sd=cd=e:cd=cd.next=e),ud=!0,ld||(ld=!0,bd())}function md(e,t){if(!dd&&ud){dd=!0;do for(var n=!1,r=sd;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-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,yd(r,a))}else a=ql,a=qe(r,r===Gl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,yd(r,a));r=r.next}while(n);dd=!1}}function hd(){gd()}function gd(){ud=ld=!1;var e=0;fd!==0&&nf()&&(e=fd);for(var t=De(),n=null,r=sd;r!==null;){var i=r.next,a=_d(r,t);a===0?(r.next=null,n===null?sd=i:n.next=i,i===null&&(cd=n)):(n=r,(e!==0||a&3)&&(ud=!0)),r=i}mu!==0&&mu!==5||md(e,!1),fd!==0&&(fd=0)}function _d(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ze(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ye(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Gl,n=ql,n=qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Jl===2||Jl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&we(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Je(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&we(r),rt(n)){case 2:case 8:n=Ae;break;case 32:n=je;break;case 268435456:n=Ne;break;default:n=je}return r=vd.bind(null,e),n=Ce(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&we(r),e.callbackPriority=2,e.callbackNode=null,2}function vd(e,t){if(mu!==0&&mu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Zu()&&e.callbackNode!==n)return null;var r=ql;return r=qe(e,e===Gl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Eu(e,r,t),_d(e,De()),e.callbackNode!=null&&e.callbackNode===n?vd.bind(null,e):null)}function yd(e,t){if(Zu())return null;Eu(e,t,!0)}function bd(){sf(function(){Wl&6?Ce(ke,hd):gd()})}function xd(){if(fd===0){var e=da;e===0&&(e=Ue,Ue<<=1,!(Ue&261888)&&(Ue=256)),fd=e}return fd}function Sd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function Cd(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 wd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Sd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?Sd(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(fd!==0){var e=o?Cd(i,o):new FormData(i);Ds(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Cd(i,o):new FormData(i),Ds(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Td=0;Td<Jr.length;Td++){var Ed=Jr[Td];Yr(Ed.toLowerCase(),`on`+(Ed[0].toUpperCase()+Ed.slice(1)))}Yr(Br,`onAnimationEnd`),Yr(Vr,`onAnimationIteration`),Yr(Hr,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Ur,`onTransitionRun`),Yr(Wr,`onTransitionStart`),Yr(Gr,`onTransitionCancel`),Yr(Kr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Dd=`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(` `),Od=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Dd));function kd(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){Xr(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){Xr(e)}i.currentTarget=null,a=c}}}}function Ad(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Pd(t,e,2,!1),n.add(r))}function jd(e,t,n){var r=0;t&&(r|=4),Pd(n,e,r,t)}var Md=`_reactListening`+Math.random().toString(36).slice(2);function Nd(e){if(!e[Md]){e[Md]=!0,bt.forEach(function(t){t!==`selectionchange`&&(Od.has(t)||jd(t,!1,e),jd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Md]||(t[Md]=!0,jd(`selectionchange`,!1,t))}}function Pd(e,t,n,r){switch(Tp(t)){case 2:var i=yp;break;case 8:i=bp;break;default:i=xp}n=i.bind(null,t,n,e),i=void 0,!un||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 Fd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ht(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}sn(function(){var r=a,i=tn(n),s=[];a:{var c=qr.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=zn;break;case`focusin`:u=`focus`,l=An;break;case`focusout`:u=`blur`,l=An;break;case`beforeblur`:case`afterblur`:l=An;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=On;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Vn;break;case Br:case Vr:case Hr:l=jn;break;case Kr:l=Hn;break;case`scroll`:case`scrollend`:l=Cn;break;case`wheel`:l=Un;break;case`copy`:case`cut`:case`paste`:l=Mn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Bn;break;case`toggle`:case`beforetoggle`:l=Wn}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=cn(m,p),g!=null&&d.push(Id(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==en&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))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?ht(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=On,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(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=Rd,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&&zd(s,c,l,d,!1),u!==null&&f!==null&&zd(s,f,u,d,!0)}}a:{if(c=r?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ur;else if(ir(c))if(dr)v=br;else{v=vr;var y=_r}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Yt(r.elementType)&&(v=ur):v=yr;if(v&&=v(e,r)){ar(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Vt(c,`number`,c.value)}switch(y=r?_t(r):window,e){case`focusin`:(ir(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(s,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:Pr(s,n,i)}var b;if(Kn)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 er?Qn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Yn&&n.locale!==`ko`&&(er||x!==`onCompositionStart`?x===`onCompositionEnd`&&er&&(b=hn()):(fn=i,pn=`value`in fn?fn.value:fn.textContent,er=!0)),y=Ld(r,x),0<y.length&&(x=new Nn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=$n(n),b!==null&&(x.data=b)))),(b=Jn?tr(e,n):nr(e,n))&&(x=Ld(r,`onBeforeInput`),0<x.length&&(y=new Nn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),wd(s,e,r,n,i)}kd(s,t)})}function Id(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ld(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=cn(e,n),i!=null&&r.unshift(Id(e,i,a)),i=cn(e,t),i!=null&&r.push(Id(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Rd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zd(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=cn(n,a),l!=null&&o.unshift(Id(n,l,c))):i||(l=cn(n,a),l!=null&&o.push(Id(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Bd=/\r\n?/g,Vd=/\u0000|\uFFFD/g;function Hd(e){return(typeof e==`string`?e:``+e).replace(Bd,`
|
|
10
|
-
`).replace(Vd,``)}function Ud(e,t){return t=Hd(t),Hd(e)===t}function Wd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:Jt(e,r,o);break;case`data`:if(t!==`object`){kt(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=Qt(``+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`&&Wd(e,t,`name`,a.name,a,null),Wd(e,t,`formEncType`,a.formEncType,a,null),Wd(e,t,`formMethod`,a.formMethod,a,null),Wd(e,t,`formTarget`,a.formTarget,a,null)):(Wd(e,t,`encType`,a.encType,a,null),Wd(e,t,`method`,a.method,a,null),Wd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`onScroll`:r!=null&&Ad(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ad(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Qt(``+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`:Ad(`beforetoggle`,e),Ad(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(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=Xt.get(n)||n,Ot(e,n,r))}}function Gd(e,t,n,r,a,o){switch(n){case`style`:Jt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&Ad(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ad(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[st]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ot(e,n,r)}}}function Kd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Ad(`error`,e),Ad(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Wd(e,t,o,s,n,null)}}a&&Wd(e,t,`srcSet`,n.srcSet,n,null),r&&Wd(e,t,`src`,n.src,n,null);return;case`input`:Ad(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Wd(e,t,r,d,n,null)}}Bt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Ad(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Wd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(s in Ad(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Wd(e,t,s,c,n,null)}Wt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Wd(e,t,l,r,n,null)}return;case`dialog`:Ad(`beforetoggle`,e),Ad(`toggle`,e),Ad(`cancel`,e),Ad(`close`,e);break;case`iframe`:case`object`:Ad(`load`,e);break;case`video`:case`audio`:for(r=0;r<Dd.length;r++)Ad(Dd[r],e);break;case`image`:Ad(`error`,e),Ad(`load`,e);break;case`details`:Ad(`toggle`,e);break;case`embed`:case`source`:case`link`:Ad(`error`,e),Ad(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Wd(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Gd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Wd(e,t,c,r,n,null))}function qd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Wd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Wd(e,t,p,m,r,f)}}zt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Wd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Wd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Wd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Wd(e,t,s,a,r,o)}Ut(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:Wd(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:Wd(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)&&Wd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Wd(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Gd(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||Gd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Wd(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||Wd(e,t,f,p,r,m)}function Jd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Yd(){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&&Jd(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&&Jd(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 Xd=null,Zd=null;function Qd(e){return e.nodeType===9?e:e.ownerDocument}function H(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 $d(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 ef(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 tf=null;function nf(){var e=window.event;return e&&e.type===`popstate`?e===tf?!1:(tf=e,!0):(tf=null,!1)}var rf=typeof setTimeout==`function`?setTimeout:void 0,af=typeof clearTimeout==`function`?clearTimeout:void 0,of=typeof Promise==`function`?Promise:void 0,sf=typeof queueMicrotask==`function`?queueMicrotask:of===void 0?rf:function(e){return of.resolve(null).then(e).catch(cf)};function cf(e){setTimeout(function(){throw e})}function lf(e){return e===`head`}function uf(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),Wp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wf(e.ownerDocument.body);n=i}while(n);Wp(t)}function df(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 ff(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`:ff(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pf(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[pt])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=yf(e.nextSibling),e===null)break}return null}function mf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=yf(e.nextSibling),e===null))return null;return e}function hf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=yf(e.nextSibling),e===null))return null;return e}function gf(e){return e.data===`$?`||e.data===`$~`}function _f(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vf(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 yf(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 bf=null;function xf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return yf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sf(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 Cf(e,t,n){switch(t=Qd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function wf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var Tf=new Map,Ef=new Set;function Df(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Of=F.d;F.d={f:kf,r:Af,D:Nf,C:Pf,L:Ff,m:If,X:Rf,S:Lf,M:zf};function kf(){var e=Of.f(),t=Au();return e||t}function Af(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):Of.r(e)}var jf=typeof document>`u`?null:document;function Mf(e,t,n){var r=jf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Ef.has(i)||(Ef.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Kd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Nf(e){Of.D(e),Mf(`dns-prefetch`,e,null)}function Pf(e,t){Of.C(e,t),Mf(`preconnect`,e,t)}function Ff(e,t,n){Of.L(e,t,n);var r=jf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Vf(e);break;case`script`:a=Gf(e)}Tf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hf(a))||t===`script`&&r.querySelector(Kf(a))||(t=r.createElement(`link`),Kd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function If(e,t){Of.m(e,t);var n=jf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gf(e)}if(!Tf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),Tf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Kf(a)))return}r=n.createElement(`link`),Kd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Lf(e,t,n){Of.S(e,t,n);var r=jf;if(r&&e){var i=vt(r).hoistableStyles,a=Vf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tf.get(a))&&Yf(e,n);var c=o=r.createElement(`link`);yt(c),Kd(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,Jf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rf(e,t){Of.X(e,t);var n=jf;if(n&&e){var r=vt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=p({src:e,async:!0},t),(t=Tf.get(i))&&Xf(e,t),a=n.createElement(`script`),yt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t){Of.M(e,t);var n=jf;if(n&&e){var r=vt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=Tf.get(i))&&Xf(e,t),a=n.createElement(`script`),yt(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t,n,r){var a=(a=le.current)?Df(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Vf(n.href),n=vt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Vf(n.href);var o=vt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Hf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Tf.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},Tf.set(e,n),o||Wf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Gf(n),n=vt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vf(e){return`href="`+Rt(e)+`"`}function Hf(e){return`link[rel="stylesheet"][`+e+`]`}function Uf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Wf(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}),Kd(t,`link`,n),yt(t),e.head.appendChild(t))}function Gf(e){return`[src="`+Rt(e)+`"]`}function Kf(e){return`script[async]`+e}function qf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Kd(r,`style`,a),Jf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vf(n.href);var o=e.querySelector(Hf(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=Uf(n),(a=Tf.get(a))&&Yf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Kd(o,`link`,r),t.state.loading|=4,Jf(o,n.precedence,e),t.instance=o;case`script`:return o=Gf(n.src),(a=e.querySelector(Kf(o)))?(t.instance=a,yt(a),a):(r=n,(a=Tf.get(o))&&(r=p({},n),Xf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),Kd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Jf(r,n.precedence,e));return t.instance}function Jf(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 Yf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zf=null;function Qf(e,t,n){if(Zf===null){var r=new Map,i=Zf=new Map;i.set(n,r)}else i=Zf,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[pt]||a[ot]||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 $f(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ep(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 tp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function np(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=Vf(r.href),a=t.querySelector(Hf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ap.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Uf(r),(i=Tf.get(i))&&Yf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Kd(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=ap.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rp=0;function ip(e,t){return e.stylesheets&&e.count===0&&sp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rp===0&&(rp=62500*Yd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ap(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var op=null;function sp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,op=new Map,t.forEach(cp,e),op=null,ap.call(e))}function cp(e,t){if(!(t.state.loading&4)){var n=op.get(e);if(n)var r=n.get(null);else{n=new Map,op.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=ap.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 lp={$$typeof:C,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function up(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=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(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 dp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new up(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=sa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ba(a),e}function fp(e){return e?(e=oi,e):oi}function pp(e,t,n,r,i,a){i=fp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ha(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ua(e,r,t),n!==null&&(Tu(n,e,t),Wa(n,e,t))}function mp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hp(e,t){mp(e,t),(e=e.alternate)&&mp(e,t)}function gp(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&Tu(t,e,67108864),hp(e,67108864)}}function _p(e){if(e.tag===13||e.tag===31){var t=Cu();t=nt(t);var n=ri(e,t);n!==null&&Tu(n,e,t),hp(e,t)}}var vp=!0;function yp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,xp(e,t,n,r)}finally{F.p=a,P.T=i}}function bp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,xp(e,t,n,r)}finally{F.p=a,P.T=i}}function xp(e,t,n,r){if(vp){var i=Sp(r);if(i===null)Fd(e,t,r,Cp,n),Pp(e,r);else if(Ip(i,e,t,n,r))r.stopPropagation();else if(Pp(e,r),t&4&&-1<Np.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ke(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ze(o);s.entanglements[1]|=c,o&=~c}pd(a),!(Wl&6)&&(du=De()+500,md(0,!1))}}break;case 31:case 13:s=ri(a,2),s!==null&&Tu(s,a,2),Au(),hp(a,2)}if(a=Sp(r),a===null&&Fd(e,t,r,Cp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Fd(e,t,r,null,n)}}function Sp(e){return e=tn(e),wp(e)}var Cp=null;function wp(e){if(Cp=null,e=ht(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Cp=e,null}function Tp(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(Oe()){case ke:return 2;case Ae:return 8;case je:case Me:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Ep=!1,Dp=null,Op=null,kp=null,Ap=new Map,jp=new Map,Mp=[],Np=`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 Pp(e,t){switch(e){case`focusin`:case`focusout`:Dp=null;break;case`dragenter`:case`dragleave`:Op=null;break;case`mouseover`:case`mouseout`:kp=null;break;case`pointerover`:case`pointerout`:Ap.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:jp.delete(t.pointerId)}}function Fp(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=gt(t),t!==null&&gp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ip(e,t,n,r,i){switch(t){case`focusin`:return Dp=Fp(Dp,e,t,n,r,i),!0;case`dragenter`:return Op=Fp(Op,e,t,n,r,i),!0;case`mouseover`:return kp=Fp(kp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ap.set(a,Fp(Ap.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,jp.set(a,Fp(jp.get(a)||null,e,t,n,r,i)),!0}return!1}function Lp(e){var t=ht(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,R(e.priority,function(){_p(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,R(e.priority,function(){_p(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 Rp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);en=r,n.target.dispatchEvent(r),en=null}else return t=gt(n),t!==null&&gp(t),e.blockedOn=n,!1;t.shift()}return!0}function zp(e,t,n){Rp(e)&&n.delete(t)}function Bp(){Ep=!1,Dp!==null&&Rp(Dp)&&(Dp=null),Op!==null&&Rp(Op)&&(Op=null),kp!==null&&Rp(kp)&&(kp=null),Ap.forEach(zp),jp.forEach(zp)}function Vp(e,n){e.blockedOn===n&&(e.blockedOn=null,Ep||(Ep=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bp)))}var Hp=null;function Up(e){Hp!==e&&(Hp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Hp===e&&(Hp=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(wp(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Wp(e){function t(t){return Vp(t,e)}Dp!==null&&Vp(Dp,e),Op!==null&&Vp(Op,e),kp!==null&&Vp(kp,e),Ap.forEach(t),jp.forEach(t);for(var n=0;n<Mp.length;n++){var r=Mp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mp.length&&(n=Mp[0],n.blockedOn===null);)Lp(n),n.blockedOn===null&&Mp.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[st]||null;if(typeof a==`function`)o||Up(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(wp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Up(n)}}}function Gp(){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 Kp(e){this._internalRoot=e}qp.prototype.render=Kp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;pp(n,Cu(),e,t,null,null)},qp.prototype.unmount=Kp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pp(e.current,2,null,e,null,null),Au(),t[ct]=null}};function qp(e){this._internalRoot=e}qp.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mp.length&&t!==0&&t<Mp[n].priority;n++);Mp.splice(n,0,e),n===0&&Lp(e)}};var Jp=n.version;if(Jp!==`19.2.4`)throw Error(i(527,Jp,`19.2.4`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Yp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Xp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xp.isDisabled&&Xp.supportsFiber)try{Ie=Xp.inject(Yp),Le=Xp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Xs,s=Zs,c=Qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dp(e,1,!1,null,null,n,r,null,o,s,c,Gp),e[ct]=t.current,Nd(e),new Kp(t)}})),v=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_()})),y=function(){return y=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},y.apply(this,arguments)};function b(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 x(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 S=`right-scroll-bar-position`,C=`width-before-scroll-bar`,w=`with-scroll-bars-hidden`,T=`--removed-body-scroll-bar-size`;function E(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}var D=l(f());function O(e,t){var n=(0,D.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 k=typeof window<`u`?D.useLayoutEffect:D.useEffect,A=new WeakMap;function j(e,t){var n=O(t||null,function(t){return e.forEach(function(e){return E(e,t)})});return k(function(){var t=A.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||E(e,null)}),i.forEach(function(e){r.has(e)||E(e,a)})}A.set(n,e)},[e]),n}function M(e){return e}function N(e,t){t===void 0&&(t=M);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 ee(e){e===void 0&&(e={});var t=N(null);return t.options=y({async:!0,ssr:!1},e),t}var te=function(e){var t=e.sideCar,n=b(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 D.createElement(r,y({},n))};te.isSideCarExport=!0;function P(e,t){return e.useMedium(t),te}var F=ee(),I=function(){},ne=D.forwardRef(function(e,t){var n=D.useRef(null),r=D.useState({onScrollCapture:I,onWheelCapture:I,onTouchMoveCapture:I}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,x=e.gapMode,S=b(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),C=f,w=j([n,t]),T=y(y({},S),i);return D.createElement(D.Fragment,null,u&&D.createElement(C,{sideCar:F,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:x}),o?D.cloneElement(D.Children.only(s),y(y({},T),{ref:w})):D.createElement(v,y({},T,{className:c,ref:w}),s))});ne.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ne.classNames={fullWidth:C,zeroRight:S};var re,ie=function(){if(re)return re;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ae(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ie();return t&&e.setAttribute(`nonce`,t),e}function oe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function se(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ce=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ae())&&(oe(t,n),se(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},le=function(){var e=ce();return function(t,n){D.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ue=function(){var e=le();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},de={left:0,top:0,right:0,gap:0},fe=function(e){return parseInt(e||``,10)||0},pe=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[fe(n),fe(r),fe(i)]},me=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return de;var t=pe(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])}},he=ue(),ge=`data-scroll-locked`,_e=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
11
|
-
.${w} {
|
|
12
|
-
overflow: hidden ${r};
|
|
13
|
-
padding-right: ${s}px ${r};
|
|
14
|
-
}
|
|
15
|
-
body[${ge}] {
|
|
16
|
-
overflow: hidden ${r};
|
|
17
|
-
overscroll-behavior: contain;
|
|
18
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
19
|
-
padding-left: ${i}px;
|
|
20
|
-
padding-top: ${a}px;
|
|
21
|
-
padding-right: ${o}px;
|
|
22
|
-
margin-left:0;
|
|
23
|
-
margin-top:0;
|
|
24
|
-
margin-right: ${s}px ${r};
|
|
25
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.${S} {
|
|
29
|
-
right: ${s}px ${r};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.${C} {
|
|
33
|
-
margin-right: ${s}px ${r};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.${S} .${S} {
|
|
37
|
-
right: 0 ${r};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.${C} .${C} {
|
|
41
|
-
margin-right: 0 ${r};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
body[${ge}] {
|
|
45
|
-
${T}: ${s}px;
|
|
46
|
-
}
|
|
47
|
-
`},ve=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ye=function(){D.useEffect(function(){return document.body.setAttribute(ge,(ve()+1).toString()),function(){var e=ve()-1;e<=0?document.body.removeAttribute(ge):document.body.setAttribute(ge,e.toString())}},[])},be=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ye();var a=D.useMemo(function(){return me(i)},[i]);return D.createElement(he,{styles:_e(a,!t,i,n?``:`!important`)})},xe=!1;if(typeof window<`u`)try{var Se=Object.defineProperty({},"passive",{get:function(){return xe=!0,!0}});window.addEventListener(`test`,Se,Se),window.removeEventListener(`test`,Se,Se)}catch{xe=!1}var Ce=xe?{passive:!1}:!1,we=function(e){return e.tagName===`TEXTAREA`},Te=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!we(e)&&n[t]===`visible`)},Ee=function(e){return Te(e,`overflowY`)},De=function(e){return Te(e,`overflowX`)},Oe=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),je(e,r)){var i=Me(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ke=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ae=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},je=function(e,t){return e===`v`?Ee(t):De(t)},Me=function(e,t){return e===`v`?ke(t):Ae(t)},Ne=function(e,t){return e===`h`&&t===`rtl`?-1:1},Pe=function(e,t,n,r,i){var a=Ne(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=Me(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&je(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},Fe=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ie=function(e){return[e.deltaX,e.deltaY]},Le=function(e){return e&&`current`in e?e.current:e},Re=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ze=function(e){return`
|
|
48
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
49
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
50
|
-
`},Be=0,Ve=[];function He(e){var t=D.useRef([]),n=D.useRef([0,0]),r=D.useRef(),i=D.useState(Be++)[0],a=D.useState(ue)[0],o=D.useRef(e);D.useEffect(function(){o.current=e},[e]),D.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=x([e.lockRef.current],(e.shards||[]).map(Le),!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=D.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Fe(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=Oe(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Oe(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 Pe(h,t,e,h===`h`?s:c,!0)},[]),c=D.useCallback(function(e){var n=e;if(!(!Ve.length||Ve[Ve.length-1]!==a)){var r=`deltaY`in n?Ie(n):Fe(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Re(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Le).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=D.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ue(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=D.useCallback(function(e){n.current=Fe(e),r.current=void 0},[]),d=D.useCallback(function(t){l(t.type,Ie(t),t.target,s(t,e.lockRef.current))},[]),f=D.useCallback(function(t){l(t.type,Fe(t),t.target,s(t,e.lockRef.current))},[]);D.useEffect(function(){return Ve.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ce),document.addEventListener(`touchmove`,c,Ce),document.addEventListener(`touchstart`,u,Ce),function(){Ve=Ve.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ce),document.removeEventListener(`touchmove`,c,Ce),document.removeEventListener(`touchstart`,u,Ce)}},[]);var p=e.removeScrollBar,m=e.inert;return D.createElement(D.Fragment,null,m?D.createElement(a,{styles:ze(i)}):null,p?D.createElement(be,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ue(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var We=P(F,He),Ge=D.forwardRef(function(e,t){return D.createElement(ne,y({},e,{ref:t,sideCar:We}))});Ge.classNames=ne.classNames;function Ke(e){return Object.keys(e)}function qe(e){return e&&typeof e==`object`&&!Array.isArray(e)}function Je(e,t){let n={...e},r=t;return qe(e)&&qe(t)&&Object.keys(t).forEach(t=>{qe(r[t])&&t in e?n[t]=Je(n[t],r[t]):n[t]=r[t]}),n}function Ye(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Xe(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function Ze(e){let t=Xe(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}function Qe(e){return e===`0rem`?`0rem`:`calc(${e} * var(--mantine-scale))`}function $e(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r===`0`)return`0${e}`;if(typeof r==`number`){let n=`${r/16}${e}`;return t?Qe(n):n}if(typeof r==`string`){if(r===``||r.startsWith(`calc(`)||r.startsWith(`clamp(`)||r.includes(`rgba(`))return r;if(r.includes(`,`))return r.split(`,`).map(e=>n(e)).join(`,`);if(r.includes(` `))return r.split(` `).map(e=>n(e)).join(` `);let i=r.replace(`px`,``);if(!Number.isNaN(Number(i))){let n=`${Number(i)/16}${e}`;return t?Qe(n):n}}return r}return n}var L=$e(`rem`,{shouldScale:!0}),et=$e(`em`);function tt(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function nt(e){if(typeof e==`number`)return!0;if(typeof e==`string`){if(e.startsWith(`calc(`)||e.startsWith(`var(`)||e.includes(` `)&&e.trim()!==``)return!0;let t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(e=>t.test(e))}return!1}function rt(e){return Array.isArray(e)||e===null?!1:typeof e==`object`&&e.type!==D.Fragment}var it=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),R=o(((e,t)=>{t.exports=it()}))();function at(e){let t=(0,D.createContext)(null);return[({children:e,value:n})=>(0,R.jsx)(t.Provider,{value:n,children:e}),()=>{let n=(0,D.useContext)(t);if(n===null)throw Error(e);return n}]}function ot(e=null){let t=(0,D.createContext)(e);return[({children:e,value:n})=>(0,R.jsx)(t.Provider,{value:n,children:e}),()=>(0,D.useContext)(t)]}function st(e,t){return n=>{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}function ct(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function lt(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function ut(e,t,n){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(n){for(let e=0;e<t.length;e+=1)if(!t[e].disabled)return e}return e}function dt(e,t,n){return ct(e,n)===ct(t,n)}function ft({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:a=`rtl`,orientation:o}){return s=>{n?.(s);let c=Array.from(ct(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>dt(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=ut(l,c,r),d=lt(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),!c[0].disabled&&c[0].focus();break;case`End`:{s.stopPropagation(),s.preventDefault();let e=c.length-1;!c[e].disabled&&c[e].focus();break}}}}var pt={app:100,modal:200,popover:300,overlay:400,max:9999};function mt(e){return pt[e]}var ht=()=>{};function gt(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||ht:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function _t(e,t=`size`,n=!0){if(e!==void 0)return nt(e)?n?L(e):e:`var(--${t}-${e})`}function vt(e){return _t(e,`mantine-spacing`)}function yt(e){return e===void 0?`var(--mantine-radius-default)`:_t(e,`mantine-radius`)}function bt(e){return _t(e,`mantine-font-size`)}function xt(e){return _t(e,`mantine-line-height`,!1)}function St(e){if(e)return _t(e,`mantine-shadow`,!1)}function Ct(e,t){return n=>{e?.(n),t?.(n)}}function wt(e,t){return e in t?Ze(t[e]):Ze(e)}function Tt(e,t){let n=e.map(e=>({value:e,px:wt(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function Et(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Dt(e,t,n){return n?Array.from(ct(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}function Ot(e,t,n){return t===void 0&&n===void 0?e:t!==void 0&&n===void 0?Math.max(e,t):Math.min(t===void 0&&n!==void 0?e:Math.max(e,t),n)}function kt(e=`mantine-`){return`${e}${Math.random().toString(36).slice(2,11)}`}function At(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i<r;i+=1){let r=n[i];if(!(r in t)||e[r]!==t[r]&&!(Number.isNaN(e[r])&&Number.isNaN(t[r])))return!1}return!0}function jt(e){let t=(0,D.useRef)(e);return(0,D.useEffect)(()=>{t.current=e}),(0,D.useMemo)(()=>((...e)=>t.current?.(...e)),[])}function Mt(e,t){let{delay:n,flushOnUnmount:r,leading:i}=typeof t==`number`?{delay:t,flushOnUnmount:!1,leading:!1}:t,a=jt(e),o=(0,D.useRef)(0),s=(0,D.useMemo)(()=>{let e=Object.assign((...t)=>{window.clearTimeout(o.current);let r=e._isFirstCall;e._isFirstCall=!1;function s(){window.clearTimeout(o.current),o.current=0,e._isFirstCall=!0}if(i&&r){a(...t),e.flush=()=>{o.current!==0&&(s(),a(...t))},e.cancel=()=>{s()},o.current=window.setTimeout(()=>{s()},n);return}if(i&&!r){e.flush=()=>{o.current!==0&&(s(),a(...t))},e.cancel=()=>{s()},o.current=window.setTimeout(()=>{s()},n);return}let c=()=>{o.current!==0&&(s(),a(...t))};e.flush=c,e.cancel=()=>{s()},o.current=window.setTimeout(c,n)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return e},[a,n,i]);return(0,D.useEffect)(()=>()=>{r?s.flush():s.cancel()},[s,r]),s}var Nt=[`mousedown`,`touchstart`];function Pt(e,t,n){let r=(0,D.useRef)(null),i=t||Nt;return(0,D.useEffect)(()=>{let t=t=>{let{target:i}=t??{};if(Array.isArray(n)){let r=!document.body.contains(i)&&i?.tagName!==`HTML`;n.every(e=>!!e&&!t.composedPath().includes(e))&&!r&&e(t)}else r.current&&!r.current.contains(i)&&e(t)};return i.forEach(e=>document.addEventListener(e,t)),()=>{i.forEach(e=>document.removeEventListener(e,t))}},[r,e,n]),r}function Ft(e={timeout:2e3}){let[t,n]=(0,D.useState)(null),[r,i]=(0,D.useState)(!1),[a,o]=(0,D.useState)(null),s=t=>{window.clearTimeout(a),o(window.setTimeout(()=>i(!1),e.timeout)),i(t)};return{copy:e=>{`clipboard`in navigator?navigator.clipboard.writeText(e).then(()=>s(!0)).catch(e=>n(e)):n(Error(`useClipboard: navigator.clipboard is not supported`))},reset:()=>{i(!1),n(null),window.clearTimeout(a)},error:t,copied:r}}function It(e,t){try{return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function Lt(e,t){return typeof window<`u`&&`matchMedia`in window&&window.matchMedia(e).matches}function Rt(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=(0,D.useState)(n?t:Lt(e));return(0,D.useEffect)(()=>{try{let t=window.matchMedia(e);return i(t.matches),It(t,e=>i(e.matches))}catch{return}},[e]),r||!1}function zt(e,t){return Rt(`(prefers-color-scheme: dark)`,e===`dark`,t)?`dark`:`light`}var Bt=typeof document<`u`?D.useLayoutEffect:D.useEffect;function Vt(e,t){let n=(0,D.useRef)(!1);(0,D.useEffect)(()=>()=>{n.current=!1},[]),(0,D.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}function Ht({opened:e,shouldReturnFocus:t=!0}){let n=(0,D.useRef)(null),r=()=>{n.current&&`focus`in n.current&&typeof n.current.focus==`function`&&n.current?.focus({preventScroll:!0})};return Vt(()=>{let i=-1,a=e=>{e.key===`Tab`&&window.clearTimeout(i)};return document.addEventListener(`keydown`,a),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener(`keydown`,a)}},[e,t]),r}var Ut=/input|select|textarea|button|object/,Wt=`a, input, select, textarea, button, object, [tabindex]`;function Gt(e){return e.style.display===`none`}function Kt(e){if(e.getAttribute(`aria-hidden`)||e.getAttribute(`hidden`)||e.getAttribute(`type`)===`hidden`)return!1;let t=e;for(;t&&!(t===document.body||t.nodeType===11);){if(Gt(t))return!1;t=t.parentNode}return!0}function qt(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function Jt(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(qt(e));return(Ut.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&Kt(e)}function Yt(e){let t=qt(e);return(Number.isNaN(t)||t>=0)&&Jt(e)}function Xt(e){return Array.from(e.querySelectorAll(Wt)).filter(Yt)}function Zt(e,t){let n=Xt(e);if(!n.length){t.preventDefault();return}let r=n[t.shiftKey?0:n.length-1],i=e.getRootNode(),a=r===i.activeElement||e===i.activeElement,o=i.activeElement;if(o.tagName===`INPUT`&&o.getAttribute(`type`)===`radio`&&(a=n.filter(e=>e.getAttribute(`type`)===`radio`&&e.getAttribute(`name`)===o.getAttribute(`name`)).includes(r)),!a)return;t.preventDefault();let s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function Qt(e=!0){let t=(0,D.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(Wt));t=n.find(Yt)||n.find(Jt)||null,!t&&Jt(e)&&(t=e)}t&&t.focus({preventScroll:!0})},r=(0,D.useCallback)(r=>{e&&r!==null&&t.current!==r&&(r?(setTimeout(()=>{r.getRootNode()&&n(r)}),t.current=r):t.current=null)},[e]);return(0,D.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));let r=e=>{e.key===`Tab`&&t.current&&Zt(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}var $t=e=>(e+1)%1e6;function en(){let[,e]=(0,D.useReducer)($t,0);return e}var tn=D.default.useId||(()=>void 0);function nn(){let e=tn();return e?`mantine-${e.replace(/:/g,``)}`:``}function rn(e){let t=nn(),[n,r]=(0,D.useState)(t);return Bt(()=>{r(kt())},[]),typeof e==`string`?e:typeof window>`u`?t:n}function an(e,t,n){(0,D.useEffect)(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function on(e,t=`use-local-storage`){try{return JSON.stringify(e)}catch{throw Error(`@mantine/hooks ${t}: Failed to serialize the value`)}}function sn(e){try{return e&&JSON.parse(e)}catch{return e}}function cn(e){return{getItem:t=>{try{return window[e].getItem(t)}catch{return console.warn(`use-local-storage: Failed to get value from storage, localStorage is blocked`),null}},setItem:(t,n)=>{try{window[e].setItem(t,n)}catch{console.warn(`use-local-storage: Failed to set value to storage, localStorage is blocked`)}},removeItem:t=>{try{window[e].removeItem(t)}catch{console.warn(`use-local-storage: Failed to remove value from storage, localStorage is blocked`)}}}}function ln(e,t){let n=e===`localStorage`?`mantine-local-storage`:`mantine-session-storage`,{getItem:r,setItem:i,removeItem:a}=cn(e);return function({key:o,defaultValue:s,getInitialValueInEffect:c=!0,sync:l=!0,deserialize:u=sn,serialize:d=e=>on(e,t)}){let f=(0,D.useCallback)(t=>{let n;try{n=typeof window>`u`||!(e in window)||window[e]===null||!!t}catch{n=!0}if(n)return s;let i=r(o);return i===null?s:u(i)},[o,s]),[p,m]=(0,D.useState)(f(c)),h=(0,D.useCallback)(e=>{e instanceof Function?m(t=>{let r=e(t);return i(o,d(r)),queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(n,{detail:{key:o,value:e(t)}}))}),r}):(i(o,d(e)),window.dispatchEvent(new CustomEvent(n,{detail:{key:o,value:e}})),m(e))},[o]),g=(0,D.useCallback)(()=>{a(o),m(s),window.dispatchEvent(new CustomEvent(n,{detail:{key:o,value:s}}))},[o,s]);return an(`storage`,t=>{l&&t.storageArea===window[e]&&t.key===o&&m(u(t.newValue??void 0))}),an(n,e=>{l&&e.detail.key===o&&m(e.detail.value)}),(0,D.useEffect)(()=>{s!==void 0&&p===void 0&&h(s)},[s,p,h]),(0,D.useEffect)(()=>{let e=f();e!==void 0&&h(e)},[o]),[p===void 0?s:p,h,g]}}function un(e){let{getItem:t}=cn(e);return function({key:n,defaultValue:r,deserialize:i=sn}){let a;try{a=typeof window>`u`||!(e in window)||window[e]===null}catch{a=!0}if(a)return r;let o=t(n);return o===null?r:i(o)}}function dn(e){return ln(`localStorage`,`use-local-storage`)(e)}un(`localStorage`);function fn(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function pn(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=fn(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():fn(e,null)}),t.clear()}}}function mn(...e){return(0,D.useCallback)(pn(...e),e)}function hn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,D.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}function gn(e,t){return Rt(`(prefers-reduced-motion: reduce)`,e,t)}function _n(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!At(e[n],t[n]))return!1;return!0}function vn(e){let t=(0,D.useRef)([]),n=(0,D.useRef)(0);return _n(t.current,e)||(t.current=e,n.current+=1),[n.current]}function yn(e,t){(0,D.useEffect)(e,vn(t))}function bn(e=!1,t={}){let[n,r]=(0,D.useState)(e),i=(0,D.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,D.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,D.useCallback)(()=>{n?a():i()},[a,i,n])}]}function xn(e,t,n={autoInvoke:!1}){let r=(0,D.useRef)(null),i=(0,D.useCallback)((...n)=>{r.current||=window.setTimeout(()=>{e(n),r.current=null},t)},[t]),a=(0,D.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,D.useEffect)(()=>(n.autoInvoke&&i(),a),[a,i]),{start:i,clear:a}}function Sn(e){let t=(0,D.useRef)(void 0);return(0,D.useEffect)(()=>{t.current=e},[e]),t.current}function Cn(e,t,n){let r=(0,D.useRef)(null),i=(0,D.useRef)(null);return(0,D.useEffect)(()=>{let a=typeof n==`function`?n():n;return(a||i.current)&&(r.current=new MutationObserver(e),r.current.observe(a||i.current,t)),()=>{r.current?.disconnect()}},[e,t]),i}function wn(){let[e,t]=(0,D.useState)(!1);return(0,D.useEffect)(()=>t(!0),[]),e}function Tn(){return typeof process<`u`?`production`:`development`}function En(e){return e?.props?.ref}function Dn(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t<r.length;t+=1){let n=r[t];if(n.shadowRoot){let t=Dn(e,n.shadowRoot);if(t)return t}}return null}function On(e,t=document){let n=[],r=t.querySelectorAll(e);n.push(...Array.from(r));let i=t.querySelectorAll(`*`);for(let t=0;t<i.length;t+=1){let r=i[t];if(r.shadowRoot){let t=On(e,r.shadowRoot);n.push(...t)}}return n}function kn(e){if(!e)return document;let t=e.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t:document}function An(e){let t=D.Children.toArray(e);return t.length!==1||!rt(t[0])?null:t[0]}function jn(e){return e}function Mn(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Mn(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Nn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Mn(e))&&(r&&(r+=` `),r+=t);return r}var Pn={};function Fn(e){let t={};return e.forEach(e=>{Object.entries(e).forEach(([e,n])=>{t[e]?t[e]=Nn(t[e],n):t[e]=n})}),t}function In({theme:e,classNames:t,props:n,stylesCtx:r}){return Fn((Array.isArray(t)?t:[t]).map(t=>typeof t==`function`?t(e,n,r):t||Pn))}function Ln({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((t,i)=>typeof i==`function`?{...t,...i(e,n,r)}:{...t,...i},{})}var Rn=(0,D.createContext)(null);function zn(){let e=(0,D.useContext)(Rn);if(!e)throw Error(`[@mantine/core] MantineProvider was not found in tree`);return e}function Bn(){return zn().cssVariablesResolver}function Vn(){return zn().classNamesPrefix}function Hn(){return zn().getStyleNonce}function Un(){return zn().withStaticClasses}function Wn(){return zn().headless}function Gn(){return zn().stylesTransform?.sx}function Kn(){return zn().stylesTransform?.styles}function qn(){return zn().env||`default`}function Jn(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function Yn(e){let t=e.replace(`#`,``);if(t.length===3){let e=t.split(``);t=[e[0],e[0],e[1],e[1],e[2],e[2]].join(``)}if(t.length===8){let e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}let n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:1}}function Xn(e){let[t,n,r,i]=e.replace(/[^0-9,./]/g,``).split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function Zn(e){let t=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!t)return{r:0,g:0,b:0,a:1};let n=parseInt(t[1],10),r=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100,a=t[5]?parseFloat(t[5]):void 0,o=(1-Math.abs(2*i-1))*r,s=n/60,c=o*(1-Math.abs(s%2-1)),l=i-o/2,u,d,f;return s>=0&&s<1?(u=o,d=c,f=0):s>=1&&s<2?(u=c,d=o,f=0):s>=2&&s<3?(u=0,d=o,f=c):s>=3&&s<4?(u=0,d=c,f=o):s>=4&&s<5?(u=c,d=0,f=o):(u=o,d=0,f=c),{r:Math.round((u+l)*255),g:Math.round((d+l)*255),b:Math.round((f+l)*255),a:a||1}}function Qn(e){return Jn(e)?Yn(e):e.startsWith(`rgb`)?Xn(e):e.startsWith(`hsl`)?Zn(e):{r:0,g:0,b:0,a:1}}function $n(e,t){if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, black ${t*100}%)`;let{r:n,g:r,b:i,a}=Qn(e),o=1-t,s=e=>Math.round(e*o);return`rgba(${s(n)}, ${s(r)}, ${s(i)}, ${a})`}function er(e,t){return typeof e.primaryShade==`number`?e.primaryShade:t===`dark`?e.primaryShade.dark:e.primaryShade.light}function tr(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function nr(e){let t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function rr(e){if(e.startsWith(`oklch(`))return(nr(e)||0)/100;let{r:t,g:n,b:r}=Qn(e),i=t/255,a=n/255,o=r/255,s=tr(i),c=tr(a),l=tr(o);return .2126*s+.7152*c+.0722*l}function ir(e,t=.179){return!e.startsWith(`var(`)&&rr(e)>t}function ar({color:e,theme:t,colorScheme:n}){if(typeof e!=`string`)throw Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e===`bright`)return{color:e,value:n===`dark`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:ir(n===`dark`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-bright`};if(e===`dimmed`)return{color:e,value:n===`dark`?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:ir(n===`dark`?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:`--mantine-color-dimmed`};if(e===`white`||e===`black`)return{color:e,value:e===`white`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:ir(e===`white`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};let[r,i]=e.split(`.`),a=i?Number(i):void 0,o=r in t.colors;if(o){let e=a===void 0?t.colors[r][er(t,n||`light`)]:t.colors[r][a];return{color:r,value:e,shade:a,isThemeColor:o,isLight:ir(e,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${a}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:ir(e,t.luminanceThreshold),shade:a,variable:void 0}}function or(e,t){let n=ar({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function sr(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=or(n.from,t),i=or(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function cr(e,t){if(typeof e!=`string`||t>1||t<0)return`rgba(0, 0, 0, 1)`;if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, transparent ${(1-t)*100}%)`;if(e.startsWith(`oklch`))return e.includes(`/`)?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(`)`,` / ${t})`);let{r:n,g:r,b:i}=Qn(e);return`rgba(${n}, ${r}, ${i}, ${t})`}var lr=cr,ur=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{let a=ar({color:e,theme:t}),o=typeof i==`boolean`?i:t.autoContrast;if(n===`none`)return{background:`transparent`,hover:`transparent`,color:`inherit`,border:`none`};if(n===`filled`){let t=o&&a.isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`;return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:t,border:`${L(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:t,border:`${L(1)} solid transparent`}:{background:e,hover:$n(e,.1),color:t,border:`${L(1)} solid transparent`}}if(n===`light`){if(a.isThemeColor){if(a.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${L(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:cr(n,.1),hover:cr(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${L(1)} solid transparent`}}return{background:cr(e,.1),hover:cr(e,.12),color:e,border:`${L(1)} solid transparent`}}if(n===`outline`)return a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${L(1)} solid var(--mantine-color-${e}-outline)`}:{background:`transparent`,hover:cr(t.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${L(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:`transparent`,hover:cr(e,.05),color:e,border:`${L(1)} solid ${e}`};if(n===`subtle`){if(a.isThemeColor){if(a.shade===void 0)return{background:`transparent`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${L(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:`transparent`,hover:cr(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${L(1)} solid transparent`}}return{background:`transparent`,hover:cr(e,.12),color:e,border:`${L(1)} solid transparent`}}return n===`transparent`?a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${e}-light-color)`,border:`${L(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${L(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:e,border:`${L(1)} solid transparent`}:n===`white`?a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-white)`,hover:$n(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${L(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:$n(t.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${L(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:$n(t.white,.01),color:e,border:`${L(1)} solid transparent`}:n===`gradient`?{background:sr(r,t),hover:sr(r,t),color:`var(--mantine-color-white)`,border:`none`}:n==="default"?{background:`var(--mantine-color-default)`,hover:`var(--mantine-color-default-hover)`,color:`var(--mantine-color-default-color)`,border:`${L(1)} solid var(--mantine-color-default-border)`}:{}},dr={dark:[`#C9C9C9`,`#b8b8b8`,`#828282`,`#696969`,`#424242`,`#3b3b3b`,`#2e2e2e`,`#242424`,`#1f1f1f`,`#141414`],gray:[`#f8f9fa`,`#f1f3f5`,`#e9ecef`,`#dee2e6`,`#ced4da`,`#adb5bd`,`#868e96`,`#495057`,`#343a40`,`#212529`],red:[`#fff5f5`,`#ffe3e3`,`#ffc9c9`,`#ffa8a8`,`#ff8787`,`#ff6b6b`,`#fa5252`,`#f03e3e`,`#e03131`,`#c92a2a`],pink:[`#fff0f6`,`#ffdeeb`,`#fcc2d7`,`#faa2c1`,`#f783ac`,`#f06595`,`#e64980`,`#d6336c`,`#c2255c`,`#a61e4d`],grape:[`#f8f0fc`,`#f3d9fa`,`#eebefa`,`#e599f7`,`#da77f2`,`#cc5de8`,`#be4bdb`,`#ae3ec9`,`#9c36b5`,`#862e9c`],violet:[`#f3f0ff`,`#e5dbff`,`#d0bfff`,`#b197fc`,`#9775fa`,`#845ef7`,`#7950f2`,`#7048e8`,`#6741d9`,`#5f3dc4`],indigo:[`#edf2ff`,`#dbe4ff`,`#bac8ff`,`#91a7ff`,`#748ffc`,`#5c7cfa`,`#4c6ef5`,`#4263eb`,`#3b5bdb`,`#364fc7`],blue:[`#e7f5ff`,`#d0ebff`,`#a5d8ff`,`#74c0fc`,`#4dabf7`,`#339af0`,`#228be6`,`#1c7ed6`,`#1971c2`,`#1864ab`],cyan:[`#e3fafc`,`#c5f6fa`,`#99e9f2`,`#66d9e8`,`#3bc9db`,`#22b8cf`,`#15aabf`,`#1098ad`,`#0c8599`,`#0b7285`],teal:[`#e6fcf5`,`#c3fae8`,`#96f2d7`,`#63e6be`,`#38d9a9`,`#20c997`,`#12b886`,`#0ca678`,`#099268`,`#087f5b`],green:[`#ebfbee`,`#d3f9d8`,`#b2f2bb`,`#8ce99a`,`#69db7c`,`#51cf66`,`#40c057`,`#37b24d`,`#2f9e44`,`#2b8a3e`],lime:[`#f4fce3`,`#e9fac8`,`#d8f5a2`,`#c0eb75`,`#a9e34b`,`#94d82d`,`#82c91e`,`#74b816`,`#66a80f`,`#5c940d`],yellow:[`#fff9db`,`#fff3bf`,`#ffec99`,`#ffe066`,`#ffd43b`,`#fcc419`,`#fab005`,`#f59f00`,`#f08c00`,`#e67700`],orange:[`#fff4e6`,`#ffe8cc`,`#ffd8a8`,`#ffc078`,`#ffa94d`,`#ff922b`,`#fd7e14`,`#f76707`,`#e8590c`,`#d9480f`]},fr=`-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji`,pr={scale:1,fontSmoothing:!0,focusRing:`auto`,white:`#fff`,black:`#000`,colors:dr,primaryShade:{light:6,dark:8},primaryColor:`blue`,variantColorResolver:ur,autoContrast:!1,luminanceThreshold:.3,fontFamily:fr,fontFamilyMonospace:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace`,respectReducedMotion:!1,cursorType:`default`,defaultGradient:{from:`blue`,to:`cyan`,deg:45},defaultRadius:`sm`,activeClassName:`mantine-active`,focusClassName:``,headings:{fontFamily:fr,fontWeight:`700`,textWrap:`wrap`,sizes:{h1:{fontSize:L(34),lineHeight:`1.3`},h2:{fontSize:L(26),lineHeight:`1.35`},h3:{fontSize:L(22),lineHeight:`1.4`},h4:{fontSize:L(18),lineHeight:`1.45`},h5:{fontSize:L(16),lineHeight:`1.5`},h6:{fontSize:L(14),lineHeight:`1.5`}}},fontSizes:{xs:L(12),sm:L(14),md:L(16),lg:L(18),xl:L(20)},lineHeights:{xs:`1.4`,sm:`1.45`,md:`1.55`,lg:`1.6`,xl:`1.65`},radius:{xs:L(2),sm:L(4),md:L(8),lg:L(16),xl:L(32)},spacing:{xs:L(10),sm:L(12),md:L(16),lg:L(20),xl:L(32)},breakpoints:{xs:`36em`,sm:`48em`,md:`62em`,lg:`75em`,xl:`88em`},shadows:{xs:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), 0 ${L(1)} ${L(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(10)} ${L(15)} ${L(-5)}, rgba(0, 0, 0, 0.04) 0 ${L(7)} ${L(7)} ${L(-5)}`,md:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(20)} ${L(25)} ${L(-5)}, rgba(0, 0, 0, 0.04) 0 ${L(10)} ${L(10)} ${L(-5)}`,lg:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(28)} ${L(23)} ${L(-7)}, rgba(0, 0, 0, 0.04) 0 ${L(12)} ${L(12)} ${L(-7)}`,xl:`0 ${L(1)} ${L(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${L(36)} ${L(28)} ${L(-7)}, rgba(0, 0, 0, 0.04) 0 ${L(17)} ${L(17)} ${L(-7)}`},other:{},components:{}};function mr(e){return e===`auto`||e===`dark`||e===`light`}function hr({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return mr(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&mr(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}var gr=`[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color`,_r=`[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }`;function vr(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function yr(e){if(!(e.primaryColor in e.colors))throw Error(gr);if(typeof e.primaryShade==`object`&&(!vr(e.primaryShade.dark)||!vr(e.primaryShade.light))||typeof e.primaryShade==`number`&&!vr(e.primaryShade))throw Error(_r)}function br(e,t){if(!t)return yr(e),e;let n=Je(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),yr(n),n}var xr=(0,D.createContext)(null),Sr=()=>(0,D.useContext)(xr)||pr;function Cr(){let e=(0,D.useContext)(xr);if(!e)throw Error(`@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app`);return e}function wr({theme:e,children:t,inherit:n=!0}){let r=Sr(),i=(0,D.useMemo)(()=>br(n?r:pr,e),[e,r,n]);return(0,R.jsx)(xr.Provider,{value:i,children:t})}wr.displayName=`@mantine/core/MantineThemeProvider`;function Tr(){let e=Cr(),t=Hn(),n=Ke(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=Ze(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:et(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:et(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,R.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function Er(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function Dr(e,t){let n=t?[t]:[`:root`,`:host`],r=Er(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=Er(e.dark),o=Er(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}
|
|
51
|
-
|
|
52
|
-
${a?`${s(`dark`)}{${a}}`:``}
|
|
53
|
-
|
|
54
|
-
${o?`${s(`light`)}{${o}}`:``}`}function Or({color:e,theme:t,autoContrast:n}){return(typeof n==`boolean`?n:t.autoContrast)&&ar({color:e||t.primaryColor,theme:t}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function kr(e,t){return Or({color:e.colors[e.primaryColor][er(e,t)],theme:e,autoContrast:null})}function Ar({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=er(e,`light`),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${n===9?8:n+1})`,[`--mantine-color-${r}-light`]:lr(e.colors[t][n],.1),[`--mantine-color-${r}-light-hover`]:lr(e.colors[t][n],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:lr(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}let a=er(e,`dark`),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:lr(e.colors[t][Math.max(0,a-2)],.15),[`--mantine-color-${r}-light-hover`]:lr(e.colors[t][Math.max(0,a-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(a-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(a-4,0)})`,[`--mantine-color-${r}-outline-hover`]:lr(e.colors[t][Math.max(a-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}function jr(e){return!!e&&typeof e==`object`&&`mantine-virtual-color`in e}function Mr(e,t,n){Ke(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var Nr=e=>{let t=er(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:L(e.defaultRadius),r={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":kr(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":kr(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};Mr(r.variables,e.breakpoints,`breakpoint`),Mr(r.variables,e.spacing,`spacing`),Mr(r.variables,e.fontSizes,`font-size`),Mr(r.variables,e.lineHeights,`line-height`),Mr(r.variables,e.shadows,`shadow`),Mr(r.variables,e.radius,`radius`),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),Ke(e.colors).forEach(t=>{let n=e.colors[t];if(jr(n)){Object.assign(r.light,Ar({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,Ar({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0}));return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,Ar({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,Ar({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return Ke(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r};function Pr({theme:e,generator:t}){let n=Nr(e),r=t?.(e);return r?Je(n,r):n}var Fr=Nr(pr);function Ir(e){let t={variables:{},light:{},dark:{}};return Ke(e.variables).forEach(n=>{Fr.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Ke(e.light).forEach(n=>{Fr.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Ke(e.dark).forEach(n=>{Fr.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function Lr(e){return Dr({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Rr({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=Cr(),r=Hn(),i=Pr({theme:n,generator:Bn()}),a=(e===void 0||e===`:root`||e===`:host`)&&t,o=Dr(a?Ir(i):i,e);return o?(0,R.jsx)(`style`,{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${o}${a?``:Lr(e)}`}}):null}Rr.displayName=`@mantine/CssVariables`;function zr(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function Br({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,D.useRef)(null),[a,o]=(0,D.useState)(()=>e.get(t)),s=r||a,c=(0,D.useCallback)(t=>{r||(zr(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,D.useCallback)(()=>{o(t),zr(t,n),e.clear()},[e.clear,t]);return(0,D.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),Bt(()=>{zr(e.get(t),n)},[]),(0,D.useEffect)(()=>{if(r)return zr(r,n),()=>{};r===void 0&&zr(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&zr(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:l}}function Vr({respectReducedMotion:e,getRootElement:t}){Bt(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function Hr({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:a=!0,withCssVariables:o=!0,cssVariablesSelector:s,classNamesPrefix:c=`mantine`,colorSchemeManager:l=hr(),defaultColorScheme:u=`light`,getRootElement:d=()=>document.documentElement,cssVariablesResolver:f,forceColorScheme:p,stylesTransform:m,env:h}){let{colorScheme:g,setColorScheme:_,clearColorScheme:v}=Br({defaultColorScheme:u,forceColorScheme:p,manager:l,getRootElement:d});return Vr({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:d}),(0,R.jsx)(Rn.Provider,{value:{colorScheme:g,setColorScheme:_,clearColorScheme:v,getRootElement:d,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:f,cssVariablesSelector:s??`:root`,withStaticClasses:r,stylesTransform:m,env:h},children:(0,R.jsxs)(wr,{theme:e,children:[o&&(0,R.jsx)(Rr,{cssVariablesSelector:s,deduplicateCssVariables:a}),i&&(0,R.jsx)(Tr,{}),t]})})}Hr.displayName=`@mantine/core/MantineProvider`;function Ur({children:e,theme:t,env:n}){return(0,R.jsx)(Rn.Provider,{value:{colorScheme:`auto`,setColorScheme:()=>{},clearColorScheme:()=>{},getRootElement:()=>document.documentElement,classNamesPrefix:`mantine`,cssVariablesSelector:`:root`,withStaticClasses:!1,headless:!0,env:n},children:(0,R.jsx)(wr,{theme:t,children:e})})}Ur.displayName=`@mantine/core/HeadlessMantineProvider`;function Wr({classNames:e,styles:t,props:n,stylesCtx:r}){let i=Cr();return{resolvedClassNames:In({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Ln({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}var Gr={always:`mantine-focus-always`,auto:`mantine-focus-auto`,never:`mantine-focus-never`};function Kr({theme:e,options:t,unstyled:n}){return Nn(t?.focusable&&!n&&(e.focusClassName||Gr[e.focusRing]),t?.active&&!n&&e.activeClassName)}function qr({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return In({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function Jr({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return In({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function Yr({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function Xr({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function Zr({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(e=>`${t}-${e}-${n}`)}function Qr({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(e=>In({theme:t,classNames:t.components[e]?.classNames,props:r,stylesCtx:i})?.[n])}function $r({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function ei({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:a,classes:o,unstyled:s,className:c,rootSelector:l,props:u,stylesCtx:d,withStaticClasses:f,headless:p,transformedStyles:m}){return Nn(Kr({theme:e,options:t,unstyled:s||p}),Qr({theme:e,themeName:n,selector:r,props:u,stylesCtx:d}),$r({options:t,classes:o,selector:r,unstyled:s}),Jr({selector:r,stylesCtx:d,theme:e,classNames:a,props:u}),Jr({selector:r,stylesCtx:d,theme:e,classNames:m,props:u}),qr({selector:r,stylesCtx:d,options:t,props:u,theme:e}),Yr({rootSelector:l,selector:r,className:c}),Xr({selector:r,classes:o,unstyled:s||p}),f&&!p&&Zr({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function ti({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(t=>Ln({theme:e,styles:e.components[t]?.styles,props:n,stylesCtx:r})[i]).reduce((e,t)=>({...e,...t}),{})}function ni({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...ni({style:n,theme:t})}),{}):typeof e==`function`?e(t):e??{}}function ri(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...tt(t[n])}}),e),{})}function ii({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:a,themeName:o,headless:s}){return ri([s?{}:t?.(n,r,i),...o.map(e=>n.components?.[e]?.vars?.(n,r,i)),e?.(n,r,i)])?.[a]}function ai({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:a,rootSelector:o,styles:s,style:c,vars:l,varsResolver:u,headless:d,withStylesTransform:f}){return{...!f&&ti({theme:e,themeName:t,props:i,stylesCtx:a,selector:n}),...!f&&Ln({theme:e,styles:s,props:i,stylesCtx:a})[n],...!f&&Ln({theme:e,styles:r?.styles,props:r?.props||i,stylesCtx:a})[n],...ii({theme:e,props:i,stylesCtx:a,vars:l,varsResolver:u,selector:n,themeName:t,headless:d}),...o===n?ni({style:c,theme:e}):null,...ni({style:r?.style,theme:e})}}function oi({props:e,stylesCtx:t,themeName:n}){let r=Cr(),i=Kn()?.();return{getTransformedStyles:a=>i?[...a.map(n=>i(n,{props:e,theme:r,ctx:t})),...n.map(n=>i(r.components[n]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!i}}function si({name:e,classes:t,props:n,stylesCtx:r,className:i,style:a,rootSelector:o=`root`,unstyled:s,classNames:c,styles:l,vars:u,varsResolver:d,attributes:f}){let p=Cr(),m=Vn(),h=Un(),g=Wn(),_=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:v,getTransformedStyles:y}=oi({props:n,stylesCtx:r,themeName:_});return(e,b)=>({className:ei({theme:p,options:b,themeName:_,selector:e,classNamesPrefix:m,classNames:c,classes:t,unstyled:s,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:h,headless:g,transformedStyles:y([b?.styles,l])}),style:ai({theme:p,themeName:_,selector:e,options:b,props:n,stylesCtx:r,rootSelector:o,styles:l,style:a,vars:u,varsResolver:d,headless:g,withStylesTransform:v}),...f?.[e]})}function ci(e,t){return typeof e==`boolean`?e:t.autoContrast}function li(e){let t=document.createElement(`style`);return t.setAttribute(`data-mantine-styles`,`inline`),t.innerHTML=`*, *::before, *::after {transition: none !important;}`,t.setAttribute(`data-mantine-disable-transition`,`true`),e&&t.setAttribute(`nonce`,e),document.head.appendChild(t),()=>document.querySelectorAll(`[data-mantine-disable-transition]`).forEach(e=>e.remove())}function ui({keepTransitions:e}={}){let t=(0,D.useRef)(ht),n=(0,D.useRef)(-1),r=(0,D.useContext)(Rn),i=(0,D.useRef)(Hn()?.());if(!r)throw Error(`[@mantine/core] MantineProvider was not found in tree`);let a=a=>{r.setColorScheme(a),t.current=e?()=>{}:li(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},o=()=>{r.clearColorScheme(),t.current=e?()=>{}:li(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},s=zt(`light`,{getInitialValueInEffect:!1}),c=r.colorScheme===`auto`?s:r.colorScheme,l=(0,D.useCallback)(()=>a(c===`light`?`dark`:`light`),[a,c]);return(0,D.useEffect)(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:a,clearColorScheme:o,toggleColorScheme:l}}function di(e,t={getInitialValueInEffect:!0}){let n=zt(e,t),{colorScheme:r}=ui();return r===`auto`?n:r}function z(e,t,n){let r=Cr(),i=r.components[e]?.defaultProps,a=typeof i==`function`?i(r):i;return{...t,...a,...tt(n)}}function fi(e){return e}function pi(e){return Ke(e).reduce((t,n)=>e[n]===void 0?t:`${t}${Ye(n)}:${e[n]};`,``).trim()}function mi({selector:e,styles:t,media:n,container:r}){let i=t?pi(t):``,a=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${pi(t.styles)}}}`):[],o=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${pi(t.styles)}}}`):[];return`${i?`${e}{${i}}`:``}${a.join(``)}${o.join(``)}`.trim()}function hi(e){return(0,R.jsx)(`style`,{"data-mantine-styles":`inline`,nonce:Hn()?.(),dangerouslySetInnerHTML:{__html:mi(e)}})}function gi(e){let{m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,p:u,px:d,py:f,pt:p,pb:m,pl:h,pr:g,pe:_,ps:v,bd:y,bdrs:b,bg:x,c:S,opacity:C,ff:w,fz:T,fw:E,lts:D,ta:O,lh:k,fs:A,tt:j,td:M,w:N,miw:ee,maw:te,h:P,mih:F,mah:I,bgsz:ne,bgp:re,bgr:ie,bga:ae,pos:oe,top:se,left:ce,bottom:le,right:ue,inset:de,display:fe,flex:pe,hiddenFrom:me,visibleFrom:he,lightHidden:ge,darkHidden:_e,sx:ve,...ye}=e;return{styleProps:tt({m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,p:u,px:d,py:f,pt:p,pb:m,pl:h,pr:g,pe:_,ps:v,bd:y,bg:x,c:S,opacity:C,ff:w,fz:T,fw:E,lts:D,ta:O,lh:k,fs:A,tt:j,td:M,w:N,miw:ee,maw:te,h:P,mih:F,mah:I,bgsz:ne,bgp:re,bgr:ie,bga:ae,pos:oe,top:se,left:ce,bottom:le,right:ue,inset:de,display:fe,flex:pe,bdrs:b,hiddenFrom:me,visibleFrom:he,lightHidden:ge,darkHidden:_e,sx:ve}),rest:ye}}var _i={m:{type:`spacing`,property:`margin`},mt:{type:`spacing`,property:`marginTop`},mb:{type:`spacing`,property:`marginBottom`},ml:{type:`spacing`,property:`marginLeft`},mr:{type:`spacing`,property:`marginRight`},ms:{type:`spacing`,property:`marginInlineStart`},me:{type:`spacing`,property:`marginInlineEnd`},mx:{type:`spacing`,property:`marginInline`},my:{type:`spacing`,property:`marginBlock`},p:{type:`spacing`,property:`padding`},pt:{type:`spacing`,property:`paddingTop`},pb:{type:`spacing`,property:`paddingBottom`},pl:{type:`spacing`,property:`paddingLeft`},pr:{type:`spacing`,property:`paddingRight`},ps:{type:`spacing`,property:`paddingInlineStart`},pe:{type:`spacing`,property:`paddingInlineEnd`},px:{type:`spacing`,property:`paddingInline`},py:{type:`spacing`,property:`paddingBlock`},bd:{type:`border`,property:`border`},bdrs:{type:`radius`,property:`borderRadius`},bg:{type:`color`,property:`background`},c:{type:`textColor`,property:`color`},opacity:{type:`identity`,property:`opacity`},ff:{type:`fontFamily`,property:`fontFamily`},fz:{type:`fontSize`,property:`fontSize`},fw:{type:`identity`,property:`fontWeight`},lts:{type:`size`,property:`letterSpacing`},ta:{type:`identity`,property:`textAlign`},lh:{type:`lineHeight`,property:`lineHeight`},fs:{type:`identity`,property:`fontStyle`},tt:{type:`identity`,property:`textTransform`},td:{type:`identity`,property:`textDecoration`},w:{type:`spacing`,property:`width`},miw:{type:`spacing`,property:`minWidth`},maw:{type:`spacing`,property:`maxWidth`},h:{type:`spacing`,property:`height`},mih:{type:`spacing`,property:`minHeight`},mah:{type:`spacing`,property:`maxHeight`},bgsz:{type:`size`,property:`backgroundSize`},bgp:{type:`identity`,property:`backgroundPosition`},bgr:{type:`identity`,property:`backgroundRepeat`},bga:{type:`identity`,property:`backgroundAttachment`},pos:{type:`identity`,property:`position`},top:{type:`size`,property:`top`},left:{type:`size`,property:`left`},bottom:{type:`size`,property:`bottom`},right:{type:`size`,property:`right`},inset:{type:`size`,property:`inset`},display:{type:`identity`,property:`display`},flex:{type:`identity`,property:`flex`}};function vi(e,t){let n=ar({color:e,theme:t});return n.color===`dimmed`?`var(--mantine-color-dimmed)`:n.color===`bright`?`var(--mantine-color-bright)`:n.variable?`var(${n.variable})`:n.color}function yi(e,t){let n=ar({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:vi(e,t)}function bi(e,t){if(typeof e==`number`)return L(e);if(typeof e==`string`){let[n,r,...i]=e.split(` `).filter(e=>e.trim()!==``),a=`${L(n)}`;return r&&(a+=` ${r}`),i.length>0&&(a+=` ${vi(i.join(` `),t)}`),a.trim()}return e}var xi={text:`var(--mantine-font-family)`,mono:`var(--mantine-font-family-monospace)`,monospace:`var(--mantine-font-family-monospace)`,heading:`var(--mantine-font-family-headings)`,headings:`var(--mantine-font-family-headings)`};function Si(e){return typeof e==`string`&&e in xi?xi[e]:e}var Ci=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function wi(e,t){return typeof e==`string`&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e==`string`&&Ci.includes(e)?`var(--mantine-${e}-font-size)`:typeof e==`number`||typeof e==`string`?L(e):e}function Ti(e){return e}var Ei=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function Di(e,t){return typeof e==`string`&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e==`string`&&Ei.includes(e)?`var(--mantine-${e}-line-height)`:e}function Oi(e,t){return typeof e==`string`&&e in t.radius?`var(--mantine-radius-${e})`:typeof e==`number`||typeof e==`string`?L(e):e}function ki(e){return typeof e==`number`?L(e):e}function Ai(e,t){if(typeof e==`number`)return L(e);if(typeof e==`string`){let n=e.replace(`-`,``);if(!(n in t.spacing))return L(e);let r=`--mantine-spacing-${n}`;return e.startsWith(`-`)?`calc(var(${r}) * -1)`:`var(${r})`}return e}var ji={color:vi,textColor:yi,fontSize:wi,spacing:Ai,radius:Oi,identity:Ti,size:ki,lineHeight:Di,fontFamily:Si,border:bi};function Mi(e){return e.replace(`(min-width: `,``).replace(`em)`,``)}function Ni({media:e,...t}){let n=Object.keys(e).sort((e,t)=>Number(Mi(e))-Number(Mi(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}function Pi(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return!(t.length===1&&t[0]===`base`)}function Fi(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Ii(e){return typeof e==`object`&&e?Ke(e).filter(e=>e!==`base`):[]}function Li(e,t){return typeof e==`object`&&e&&t in e?e[t]:e}function Ri({styleProps:e,data:t,theme:n}){return Ni(Ke(e).reduce((r,i)=>{if(i===`hiddenFrom`||i===`visibleFrom`||i===`sx`)return r;let a=t[i],o=Array.isArray(a.property)?a.property:[a.property],s=Fi(e[i]);if(!Pi(e[i]))return o.forEach(e=>{r.inlineStyles[e]=ji[a.type](s,n)}),r;r.hasResponsiveStyles=!0;let c=Ii(e[i]);return o.forEach(t=>{s!=null&&(r.styles[t]=ji[a.type](s,n)),c.forEach(o=>{let s=`(min-width: ${n.breakpoints[o]})`;r.media[s]={...r.media[s],[t]:ji[a.type](Li(e[i],o),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function zi(){return`__m__-${(0,D.useId)().replace(/[:«»]/g,``)}`}function Bi(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Bi(n,t)}),{}):typeof e==`function`?e(t):e??{}}function Vi(e){return e}function Hi(e){return e.startsWith(`data-`)?e:`data-${e}`}function Ui(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r===void 0||r===``||r===!1||r===null||(t[Hi(n)]=e[n]),t},{})}function Wi(e){return e?typeof e==`string`?{[Hi(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...Wi(t)}),{}):Ui(e):null}function Gi(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Gi(n,t)}),{}):typeof e==`function`?e(t):e??{}}function Ki({theme:e,style:t,vars:n,styleProps:r}){let i=Gi(t,e),a=Gi(n,e);return{...i,...a,...r}}var qi=(0,D.forwardRef)(({component:e,style:t,__vars:n,className:r,variant:i,mod:a,size:o,hiddenFrom:s,visibleFrom:c,lightHidden:l,darkHidden:u,renderRoot:d,__size:f,...p},m)=>{let h=Cr(),g=e||`div`,{styleProps:_,rest:v}=gi(p),y=Gn()?.()?.(_.sx),b=zi(),x=Ri({styleProps:_,theme:h,data:_i}),S={ref:m,style:Ki({theme:h,style:t,vars:n,styleProps:x.inlineStyles}),className:Nn(r,y,{[b]:x.hasResponsiveStyles,"mantine-light-hidden":l,"mantine-dark-hidden":u,[`mantine-hidden-from-${s}`]:s,[`mantine-visible-from-${c}`]:c}),"data-variant":i,"data-size":nt(o)?void 0:o||void 0,size:f,...Wi(a),...v};return(0,R.jsxs)(R.Fragment,{children:[x.hasResponsiveStyles&&(0,R.jsx)(hi,{selector:`.${b}`,styles:x.styles,media:x.media}),typeof d==`function`?d(S):(0,R.jsx)(g,{...S})]})});qi.displayName=`@mantine/core/Box`;var B=Vi(qi);function Ji(e){return e}function Yi(e){let t=e;return e=>{let n=(0,D.forwardRef)((n,r)=>(0,R.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n}}function Xi(e){let t=(0,D.forwardRef)(e);return t.extend=Ji,t.withProps=e=>{let n=(0,D.forwardRef)((n,r)=>(0,R.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}function Zi(e){let t=(0,D.forwardRef)(e);return t.withProps=e=>{let n=(0,D.forwardRef)((n,r)=>(0,R.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=Ji,t}var Qi=(0,D.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}});function $i(){return(0,D.useContext)(Qi)}var ea=l(g(),1);function ta(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function na(e){return e?.current?e.current.scrollHeight:`auto`}var ra=typeof window<`u`&&window.requestAnimationFrame,ia=0,aa=e=>({height:0,overflow:`hidden`,...e?{}:{display:`none`}});function oa({transitionDuration:e,transitionTimingFunction:t=`ease`,onTransitionEnd:n=()=>{},opened:r,keepMounted:i=!1}){let a=(0,D.useRef)(null),o=aa(i),[s,c]=(0,D.useState)(r?{}:o),l=e=>{(0,ea.flushSync)(()=>c(e))},u=e=>{l(t=>({...t,...e}))};function d(n){let r=e||ta(n);return{transition:`height ${r}ms ${t}, opacity ${r}ms ${t}`}}Vt(()=>{typeof ra==`function`&&ra(r?()=>{u({willChange:`height`,display:`block`,overflow:`hidden`}),ra(()=>{let e=na(a);u({...d(e),height:e})})}:()=>{let e=na(a);u({...d(e),willChange:`height`,height:e}),ra(()=>u({height:ia,overflow:`hidden`}))})},[r]);let f=e=>{if(!(e.target!==a.current||e.propertyName!==`height`))if(r){let e=na(a);e===s.height?l({}):u({height:e}),n()}else s.height===ia&&(l(o),n())};function p({style:e={},refKey:t=`ref`,...n}={}){let i=n[t],o={"aria-hidden":!r,...n,[t]:pn(a,i),onTransitionEnd:f,style:{boxSizing:`border-box`,...e,...s}};return o.inert=!r,o}return p}var sa={transitionDuration:200,transitionTimingFunction:`ease`,animateOpacity:!0},ca=Xi((e,t)=>{let{children:n,in:r,transitionDuration:i,transitionTimingFunction:a,style:o,onTransitionEnd:s,animateOpacity:c,keepMounted:l,...u}=z(`Collapse`,sa,e),d=Cr(),f=gn(),p=d.respectReducedMotion&&f?0:i,m=oa({opened:r,transitionDuration:p,transitionTimingFunction:a,onTransitionEnd:s,keepMounted:l});return p===0?r?(0,R.jsx)(B,{...u,children:n}):null:(0,R.jsx)(B,{...m({style:{opacity:r||!c?1:0,transition:c?`opacity ${p}ms ${a}`:`none`,...Bi(o,d)},ref:t,...u}),children:n})});ca.displayName=`@mantine/core/Collapse`;function la(){return typeof window<`u`}function ua(e){return pa(e)?(e.nodeName||``).toLowerCase():`#document`}function da(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fa(e){return((pa(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function pa(e){return la()?e instanceof Node||e instanceof da(e).Node:!1}function ma(e){return la()?e instanceof Element||e instanceof da(e).Element:!1}function ha(e){return la()?e instanceof HTMLElement||e instanceof da(e).HTMLElement:!1}function ga(e){return!la()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof da(e).ShadowRoot}function _a(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Oa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function va(e){return/^(table|td|th)$/.test(ua(e))}function ya(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ba=/transform|translate|scale|rotate|perspective|filter/,xa=/paint|layout|strict|content/,Sa=e=>!!e&&e!==`none`,Ca;function wa(e){let t=ma(e)?Oa(e):e;return Sa(t.transform)||Sa(t.translate)||Sa(t.scale)||Sa(t.rotate)||Sa(t.perspective)||!Ea()&&(Sa(t.backdropFilter)||Sa(t.filter))||ba.test(t.willChange||``)||xa.test(t.contain||``)}function Ta(e){let t=Aa(e);for(;ha(t)&&!Da(t);){if(wa(t))return t;if(ya(t))return null;t=Aa(t)}return null}function Ea(){return Ca??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ca}function Da(e){return/^(html|body|#document)$/.test(ua(e))}function Oa(e){return da(e).getComputedStyle(e)}function ka(e){return ma(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Aa(e){if(ua(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ga(e)&&e.host||fa(e);return ga(t)?t.host:t}function ja(e){let t=Aa(e);return Da(t)?e.ownerDocument?e.ownerDocument.body:e.body:ha(t)&&_a(t)?t:ja(t)}function Ma(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=ja(e),i=r===e.ownerDocument?.body,a=da(r);if(i){let e=Na(a);return t.concat(a,a.visualViewport||[],_a(r)?r:[],e&&n?Ma(e):[])}else return t.concat(r,Ma(r,[],n))}function Na(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Pa=[`top`,`right`,`bottom`,`left`],Fa=Math.min,Ia=Math.max,La=Math.round,Ra=Math.floor,za=e=>({x:e,y:e}),Ba={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Va(e,t,n){return Ia(e,Fa(t,n))}function Ha(e,t){return typeof e==`function`?e(t):e}function Ua(e){return e.split(`-`)[0]}function Wa(e){return e.split(`-`)[1]}function Ga(e){return e===`x`?`y`:`x`}function Ka(e){return e===`y`?`height`:`width`}function qa(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Ja(e){return Ga(qa(e))}function Ya(e,t,n){n===void 0&&(n=!1);let r=Wa(e),i=Ja(e),a=Ka(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=io(o)),[o,io(o)]}function Xa(e){let t=io(e);return[Za(e),t,Za(t)]}function Za(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Qa=[`left`,`right`],$a=[`right`,`left`],eo=[`top`,`bottom`],to=[`bottom`,`top`];function no(e,t,n){switch(e){case`top`:case`bottom`:return n?t?$a:Qa:t?Qa:$a;case`left`:case`right`:return t?eo:to;default:return[]}}function ro(e,t,n,r){let i=Wa(e),a=no(Ua(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Za)))),a}function io(e){let t=Ua(e);return Ba[t]+e.slice(t.length)}function ao(e){return{top:0,right:0,bottom:0,left:0,...e}}function oo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ao(e)}function so(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 co(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function lo(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function uo(){return/apple/i.test(navigator.vendor)}function fo(){return co().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function po(){return lo().includes(`jsdom/`)}var mo=`data-floating-ui-focusable`,ho=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function go(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function _o(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ga(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function vo(e){return`composedPath`in e?e.composedPath()[0]:e.target}function yo(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function bo(e){return e.matches(`html,body`)}function xo(e){return e?.ownerDocument||document}function So(e){return ha(e)&&e.matches(ho)}function Co(e){if(!e||po())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function wo(e){return e?e.hasAttribute(mo)?e:e.querySelector(`[data-floating-ui-focusable]`)||e:null}function To(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...To(e,t.id,n)])}function Eo(e){return`nativeEvent`in e}function Do(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Oo=typeof document<`u`?D.useLayoutEffect:function(){},ko={...D};function Ao(e){let t=D.useRef(e);return Oo(()=>{t.current=e}),t}var jo=ko.useInsertionEffect||(e=>e());function Mo(e){let t=D.useRef(()=>{});return jo(()=>{t.current=e}),D.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function No(e,t,n){let{reference:r,floating:i}=e,a=qa(t),o=Ja(t),s=Ka(o),c=Ua(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(Wa(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 Po(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}=Ha(t,e),p=oo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=so(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=so(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 Fo=50,Io=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Po},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=No(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<Fo&&(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}=No(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Lo=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}=Ha(e,t)||{};if(l==null)return{};let d=oo(u),f={x:n,y:r},p=Ja(i),m=Ka(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=Fa(d[_],T),D=Fa(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Va(O,A,k),M=!c.arrow&&Wa(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Ro=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}=Ha(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ua(r),_=qa(o),v=Ua(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[io(o)]:Xa(o)),x=p!==`none`;!d&&x&&b.push(...ro(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=Ya(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`&&_!==qa(t))||T.every(e=>qa(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=qa(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 zo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bo(e){return Pa.some(t=>e[t]>=0)}var Vo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ha(e,t);switch(i){case`referenceHidden`:{let e=zo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Bo(e)}}}case`escaped`:{let e=zo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Bo(e)}}}default:return{}}}}};function Ho(e){let t=Fa(...e.map(e=>e.left)),n=Fa(...e.map(e=>e.top)),r=Ia(...e.map(e=>e.right)),i=Ia(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Uo(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>so(Ho(e)))}var Wo=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=Ha(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=Uo(u),f=so(Ho(u)),p=oo(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(qa(n)===`y`){let e=d[0],t=d[d.length-1],r=Ua(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=Ua(n)===`left`,t=Ia(...d.map(e=>e.right)),r=Fa(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Go=new Set([`left`,`top`]);async function Ko(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ua(n),s=Wa(n),c=qa(n)===`y`,l=Go.has(o)?-1:1,u=a&&c?-1:1,d=Ha(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 qo=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 Ko(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}}}}},Jo=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}=Ha(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=qa(Ua(i)),p=Ga(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=Va(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=Va(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}}}}}},Yo=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}=Ha(e,t),u={x:n,y:r},d=qa(i),f=Ga(d),p=u[f],m=u[d],h=Ha(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=Go.has(Ua(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}}}},Xo=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}=Ha(e,t),u=await o.detectOverflow(t,l),d=Ua(i),f=Wa(i),p=qa(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=Fa(h-u[g],v),x=Fa(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=Ia(u.left,0),t=Ia(u.right,0),n=Ia(u.top,0),r=Ia(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ia(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ia(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 Zo(e){let t=Oa(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ha(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=La(n)!==a||La(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Qo(e){return ma(e)?e:e.contextElement}function $o(e){let t=Qo(e);if(!ha(t))return za(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Zo(t),o=(a?La(n.width):n.width)/r,s=(a?La(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var es=za(0);function ts(e){let t=da(e);return!Ea()||!t.visualViewport?es:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ns(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==da(e)?!1:t}function rs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Qo(e),o=za(1);t&&(r?ma(r)&&(o=$o(r)):o=$o(e));let s=ns(a,n,r)?ts(a):za(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=da(a),t=r&&ma(r)?da(r):r,n=e,i=Na(n);for(;i&&r&&t!==n;){let e=$o(i),t=i.getBoundingClientRect(),r=Oa(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=da(i),i=Na(n)}}return so({width:u,height:d,x:c,y:l})}function is(e,t){let n=ka(e).scrollLeft;return t?t.left+n:rs(fa(e)).left+n}function as(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-is(e,n),y:n.top+t.scrollTop}}function os(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=fa(r),s=t?ya(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=za(1),u=za(0),d=ha(r);if((d||!d&&!a)&&((ua(r)!==`body`||_a(o))&&(c=ka(r)),d)){let e=rs(r);l=$o(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?as(o,c):za(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 ss(e){return Array.from(e.getClientRects())}function cs(e){let t=fa(e),n=ka(e),r=e.ownerDocument.body,i=Ia(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ia(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+is(e),s=-n.scrollTop;return Oa(r).direction===`rtl`&&(o+=Ia(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var ls=25;function us(e,t){let n=da(e),r=fa(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ea();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=is(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<=ls&&(a-=o)}else l<=ls&&(a+=l);return{width:a,height:o,x:s,y:c}}function ds(e,t){let n=rs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ha(e)?$o(e):za(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function fs(e,t,n){let r;if(t===`viewport`)r=us(e,n);else if(t===`document`)r=cs(fa(e));else if(ma(t))r=ds(t,n);else{let n=ts(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return so(r)}function ps(e,t){let n=Aa(e);return n===t||!ma(n)||Da(n)?!1:Oa(n).position===`fixed`||ps(n,t)}function ms(e,t){let n=t.get(e);if(n)return n;let r=Ma(e,[],!1).filter(e=>ma(e)&&ua(e)!==`body`),i=null,a=Oa(e).position===`fixed`,o=a?Aa(e):e;for(;ma(o)&&!Da(o);){let t=Oa(o),n=wa(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||_a(o)&&!n&&ps(e,o))?r=r.filter(e=>e!==o):i=t,o=Aa(o)}return t.set(e,r),r}function hs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ya(t)?[]:ms(t,this._c):[].concat(n),r],o=fs(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=fs(t,a[e],i);s=Ia(n.top,s),c=Fa(n.right,c),l=Fa(n.bottom,l),u=Ia(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function gs(e){let{width:t,height:n}=Zo(e);return{width:t,height:n}}function _s(e,t,n){let r=ha(t),i=fa(t),a=n===`fixed`,o=rs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=za(0);function l(){c.x=is(i)}if(r||!r&&!a)if((ua(t)!==`body`||_a(i))&&(s=ka(t)),r){let e=rs(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?as(i,s):za(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 vs(e){return Oa(e).position===`static`}function ys(e,t){if(!ha(e)||Oa(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return fa(e)===n&&(n=n.ownerDocument.body),n}function bs(e,t){let n=da(e);if(ya(e))return n;if(!ha(e)){let t=Aa(e);for(;t&&!Da(t);){if(ma(t)&&!vs(t))return t;t=Aa(t)}return n}let r=ys(e,t);for(;r&&va(r)&&vs(r);)r=ys(r,t);return r&&Da(r)&&vs(r)&&!wa(r)?n:r||Ta(e)||n}var xs=async function(e){let t=this.getOffsetParent||bs,n=this.getDimensions,r=await n(e.floating);return{reference:_s(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ss(e){return Oa(e).direction===`rtl`}var Cs={convertOffsetParentRelativeRectToViewportRelativeRect:os,getDocumentElement:fa,getClippingRect:hs,getOffsetParent:bs,getElementRects:xs,getClientRects:ss,getDimensions:gs,getScale:$o,isElement:ma,isRTL:Ss};function ws(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ts(e,t){let n=null,r,i=fa(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=Ra(d),h=Ra(i.clientWidth-(u+f)),g=Ra(i.clientHeight-(d+p)),_=Ra(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ia(0,Fa(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&&!ws(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 Es(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=Qo(e),u=i||a?[...l?Ma(l):[],...t?Ma(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ts(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?rs(e):null;c&&g();function g(){let t=rs(e);h&&!ws(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 Ds=qo,Os=Jo,ks=Ro,As=Xo,js=Vo,Ms=Lo,Ns=Wo,Ps=Yo,Fs=(e,t,n)=>{let r=new Map,i={platform:Cs,...n},a={...i.platform,_c:r};return Io(e,t,{...i,platform:a})},Is=typeof document<`u`?D.useLayoutEffect:function(){};function Ls(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(!Ls(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)&&!Ls(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rs(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zs(e,t){let n=Rs(e);return Math.round(t*n)/n}function Bs(e){let t=D.useRef(e);return Is(()=>{t.current=e}),t}function Vs(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]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=D.useState(r);Ls(f,r)||p(r);let[m,h]=D.useState(null),[g,_]=D.useState(null),v=D.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=D.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=D.useRef(null),C=D.useRef(null),w=D.useRef(u),T=c!=null,E=Bs(c),O=Bs(i),k=Bs(l),A=D.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Fs(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Ls(w.current,t)&&(w.current=t,ea.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Is(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=D.useRef(!1);Is(()=>(j.current=!0,()=>{j.current=!1}),[]),Is(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,A);A()}},[b,x,A,E,T]);let M=D.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=D.useMemo(()=>({reference:b,floating:x}),[b,x]),ee=D.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=zs(N.floating,u.x),r=zs(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rs(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return D.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:ee}),[u,A,M,N,ee])}var Hs=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?{}:Ms({element:r.current,padding:i}).fn(n):r?Ms({element:r,padding:i}).fn(n):{}}}},Us=(e,t)=>{let n=Ds(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ws=(e,t)=>{let n=Os(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gs=(e,t)=>({fn:Ps(e).fn,options:[e,t]}),Ks=(e,t)=>{let n=ks(e);return{name:n.name,fn:n.fn,options:[e,t]}},qs=(e,t)=>{let n=As(e);return{name:n.name,fn:n.fn,options:[e,t]}},Js=(e,t)=>{let n=js(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ys=(e,t)=>{let n=Ns(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xs=(e,t)=>{let n=Hs(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Zs(e){let t=D.useRef(void 0),n=D.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return D.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var Qs=`data-floating-ui-focusable`,$s=`active`,ec=`selected`,tc=`ArrowLeft`,nc=`ArrowRight`,rc=`ArrowUp`,ic=`ArrowDown`,ac=[tc,nc],oc=[rc,ic];[...ac,...oc];var sc={...D},cc=!1,lc=0,uc=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+lc++;function dc(){let[e,t]=D.useState(()=>cc?uc():void 0);return Oo(()=>{e??t(uc())},[]),D.useEffect(()=>{cc=!0},[]),e}var fc=sc.useId||dc;function pc(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var mc=D.createContext(null),hc=D.createContext(null),gc=()=>D.useContext(mc)?.id||null,_c=()=>D.useContext(hc);function vc(e){return`data-floating-ui-`+e}function yc(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var bc=vc(`safe-polygon`);function xc(e,t,n){if(n&&!Do(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function Sc(e){return typeof e==`function`?e():e}function Cc(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=_c(),m=gc(),h=Ao(l),g=Ao(c),_=Ao(n),v=Ao(d),y=D.useRef(),b=D.useRef(-1),x=D.useRef(),S=D.useRef(-1),C=D.useRef(!0),w=D.useRef(!1),T=D.useRef(()=>{}),E=D.useRef(!1),O=Mo(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});D.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(yc(b),yc(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),D.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){O()&&r(!1,e,`hover`)}let t=xo(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,O]);let k=D.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=xc(g.current,`close`,y.current);i&&!x.current?(yc(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(yc(b),r(!1,e,n))},[g,r]),A=Mo(()=>{T.current(),x.current=void 0}),j=Mo(()=>{if(w.current){let e=xo(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(bc),w.current=!1}}),M=Mo(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);D.useEffect(()=>{if(!s)return;function e(e){if(yc(b),C.current=!1,u&&!Do(y.current)||Sc(v.current)>0&&!xc(g.current,`open`))return;let t=xc(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(M()){j();return}T.current();let t=xo(o.floating);if(yc(S),E.current=!1,h.current&&i.current.floatingContext){n||yc(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!_o(o.floating,e.relatedTarget))&&k(e)}function a(e){M()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function c(){yc(b)}function l(e){M()||k(e,!1)}if(ma(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,k,A,j,r,n,_,p,g,h,i,M,v]),Oo(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){w.current=!0;let e=o.floating;if(ma(o.domReference)&&e){var t;let n=xo(o.floating).body;n.setAttribute(bc,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,O]),Oo(()=>{n||(y.current=void 0,E.current=!1,A(),j())},[n,A,j]),D.useEffect(()=>()=>{A(),yc(b),yc(S),j()},[s,o.domReference,A,j]);let N=D.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}u&&!Do(y.current)||n||Sc(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||(yc(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,Sc(v.current))))}}},[u,r,n,_,v]);return D.useMemo(()=>s?{reference:N}:{},[s,N])}var wc=()=>{},Tc=D.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:wc,setState:wc,isInstantPhase:!1}),Ec=()=>D.useContext(Tc);function Dc(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=D.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=D.useRef(null),s=D.useCallback(e=>{a({currentId:e})},[]);return Oo(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||a({isInstantPhase:!0}):(i.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),(0,R.jsx)(Tc.Provider,{value:D.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function Oc(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=Ec(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Oo(()=>{o&&l&&(f({delay:{open:1,close:xc(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Oo(()=>{function e(){r(!1),f({delay:d,currentId:null})}if(o&&l&&!n&&l===s){if(p){let t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,f,l,s,r,d,p]),Oo(()=>{o&&(u===wc||!n||u(s))},[o,n,u,s]),c}var kc={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Ac={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},jc=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function Mc(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=_c(),g=Mo(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=D.useRef(!1),{escapeKey:y,outsidePress:b}=jc(p),{escapeKey:x,outsidePress:S}=jc(m),C=D.useRef(!1),w=Mo(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?To(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,Eo(e)?e.nativeEvent:e,`escape-key`)}),T=Mo(e=>{var t;let n=()=>{var t;w(e),(t=vo(e))==null||t.removeEventListener(`keydown`,n)};(t=vo(e))==null||t.addEventListener(`keydown`,n)}),E=Mo(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=vo(e),s=`[`+vc(`inert`)+`]`,c=xo(i.floating).querySelectorAll(s),u=ma(o)?o:null;for(;u&&!Da(u);){let e=Aa(u);if(Da(e)||!ma(e))break;u=e}if(c.length&&ma(o)&&!bo(o)&&!_o(o,i.floating)&&Array.from(c).every(e=>!_o(u,e)))return;if(ha(o)&&A){let t=Da(o),n=Oa(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&To(h.nodesRef.current,d).some(t=>yo(e,t.context?.elements.floating));if(yo(e,i.floating)||yo(e,i.domReference)||f)return;let p=h?To(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),O=Mo(e=>{var t;let n=()=>{var t;E(e),(t=vo(e))==null||t.removeEventListener(l,n)};(t=vo(e))==null||t.addEventListener(l,n)});D.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},Ea()?5:0)}let d=xo(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?O:E,S);let p=[];return f&&(ma(i.domReference)&&(p=Ma(i.domReference)),ma(i.floating)&&(p=p.concat(Ma(i.floating))),!ma(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(Ma(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?O:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,O]),D.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let k=D.useMemo(()=>({onKeyDown:w,...u&&{[kc[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),A=D.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:w,onMouseDown:e,onMouseUp:e,[Ac[l]]:()=>{a.current.insideReactTree=!0}}},[w,l,a]);return D.useMemo(()=>o?{reference:k,floating:A}:{},[o,k,A])}function Nc(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=fc(),a=D.useRef({}),[o]=D.useState(()=>pc()),s=gc()!=null,[c,l]=D.useState(r.reference),u=Mo((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=D.useMemo(()=>({setPositionReference:l}),[]),f=D.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return D.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Pc(e){e===void 0&&(e={});let{nodeId:t}=e,n=Nc({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=D.useState(null),[s,c]=D.useState(null),l=i?.domReference||a,u=D.useRef(null),d=_c();Oo(()=>{l&&(u.current=l)},[l]);let f=Vs({...e,elements:{...i,...s&&{reference:s}}}),p=D.useCallback(e=>{let t=ma(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),m=D.useCallback(e=>{(ma(e)||e===null)&&(u.current=e,o(e)),(ma(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!ma(e))&&f.refs.setReference(e)},[f.refs]),h=D.useMemo(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:u}),[f.refs,m,p]),g=D.useMemo(()=>({...f.elements,domReference:l}),[f.elements,l]),_=D.useMemo(()=>({...f,...r,refs:h,elements:g,nodeId:t}),[f,h,g,t,r]);return Oo(()=>{r.dataRef.current.floatingContext=_;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=_)}),D.useMemo(()=>({...f,context:_,refs:h,elements:g}),[f,h,g,_])}function Fc(){return fo()&&uo()}function Ic(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=D.useRef(!1),u=D.useRef(-1),d=D.useRef(!0);D.useEffect(()=>{if(!s)return;let e=da(o.domReference);function t(){!n&&ha(o.domReference)&&o.domReference===go(xo(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),Fc()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Fc()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),D.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),D.useEffect(()=>()=>{yc(u)},[]);let f=D.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=vo(e.nativeEvent);if(c&&ma(t)){if(Fc()&&!e.relatedTarget){if(!d.current&&!So(t))return}else if(!Co(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=ma(t)&&t.hasAttribute(vc(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=go(o.domReference?o.domReference.ownerDocument:document);!t&&e===o.domReference||_o(a.current.floatingContext?.refs.floating.current,e)||_o(o.domReference,e)||i||r(!1,n,`focus`)})}}),[a,o.domReference,r,c]);return D.useMemo(()=>s?{reference:f}:{},[s,f])}function Lc(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[$s]:t,[ec]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[Qs]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[$s,ec].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function Rc(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=D.useCallback(t=>Lc(t,e,`reference`),t),a=D.useCallback(t=>Lc(t,e,`floating`),n),o=D.useCallback(t=>Lc(t,e,`item`),r);return D.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var zc=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Bc(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=fc(),c=r.domReference?.id||s,l=D.useMemo(()=>wo(r.floating)?.id||i,[r.floating,i]),u=zc.get(o)??o,d=gc()!=null,f=D.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=D.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=D.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return D.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}var Vc={root:`m_d57069b5`,content:`m_b1336c6`,viewport:`m_c0783ff9`,viewportInner:`m_f8f631dd`,scrollbar:`m_c44ba933`,thumb:`m_d8b5e363`,corner:`m_21657268`},[Hc,Uc]=at(`ScrollArea.Root component was not found in tree`);function Wc(e,t){let n=jt(t);Bt(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Gc=(0,D.forwardRef)((e,t)=>{let{style:n,...r}=e,i=Uc(),[a,o]=(0,D.useState)(0),[s,c]=(0,D.useState)(0),l=!!(a&&s);return Wc(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),Wc(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,R.jsx)(`div`,{...r,ref:t,style:{...n,width:a,height:s}}):null}),Kc=(0,D.forwardRef)((e,t)=>{let n=Uc(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,R.jsx)(Gc,{...e,ref:t}):null}),qc={scrollHideDelay:1e3,type:`hover`},Jc=(0,D.forwardRef)((e,t)=>{let{type:n,scrollHideDelay:r,scrollbars:i,getStyles:a,...o}=z(`ScrollAreaRoot`,qc,e),[s,c]=(0,D.useState)(null),[l,u]=(0,D.useState)(null),[d,f]=(0,D.useState)(null),[p,m]=(0,D.useState)(null),[h,g]=(0,D.useState)(null),[_,v]=(0,D.useState)(0),[y,b]=(0,D.useState)(0),[x,S]=(0,D.useState)(!1),[C,w]=(0,D.useState)(!1),T=mn(t,e=>c(e));return(0,R.jsx)(Hc,{value:{type:n,scrollHideDelay:r,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,getStyles:a},children:(0,R.jsx)(B,{...o,ref:T,__vars:{"--sa-corner-width":i===`xy`?`${_}px`:`0px`,"--sa-corner-height":i===`xy`?`${y}px`:`0px`}})})});Jc.displayName=`@mantine/core/ScrollAreaRoot`;function Yc(e,t){let n=e/t;return Number.isNaN(n)?0:n}function Xc(e){let t=Yc(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Zc(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Qc(e,[t,n]){return Math.min(n,Math.max(t,e))}function $c(e,t,n=`ltr`){let r=Xc(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Qc(e,n===`ltr`?[0,o]:[o*-1,0]);return Zc([0,o],[0,s])(c)}function el(e,t,n,r=`ltr`){let i=Xc(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Zc([c,l],d)(e)}function tl(e,t){return e>0&&e<t}function nl(e){return e?parseInt(e,10):0}function rl(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}var[il,al]=at(`ScrollAreaScrollbar was not found in tree`),ol=(0,D.forwardRef)((e,t)=>{let{sizes:n,hasThumb:r,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:s,onDragScroll:c,onWheelScroll:l,onResize:u,...d}=e,f=Uc(),[p,m]=(0,D.useState)(null),h=mn(t,e=>m(e)),g=(0,D.useRef)(null),_=(0,D.useRef)(``),{viewport:v}=f,y=n.content-n.viewport,b=jt(l),x=jt(s),S=Mt(u,10),C=e=>{if(g.current){let t=e.clientX-g.current.left,n=e.clientY-g.current.top;c({x:t,y:n})}};return(0,D.useEffect)(()=>{let e=e=>{let t=e.target;p?.contains(t)&&b(e,y)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[v,p,y,b]),(0,D.useEffect)(x,[n,x]),Wc(p,S),Wc(f.content,S),(0,R.jsx)(il,{value:{scrollbar:p,hasThumb:r,onThumbChange:jt(i),onThumbPointerUp:jt(a),onThumbPositionChange:x,onThumbPointerDown:jt(o)},children:(0,R.jsx)(`div`,{...d,ref:h,"data-mantine-scrollbar":!0,style:{position:`absolute`,...d.style},onPointerDown:rl(e.onPointerDown,e=>{e.preventDefault(),e.button===0&&(e.target.setPointerCapture(e.pointerId),g.current=p.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,C(e))}),onPointerMove:rl(e.onPointerMove,C),onPointerUp:rl(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(e.preventDefault(),t.releasePointerCapture(e.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=_.current,g.current=null}})})}),sl=(0,D.forwardRef)((e,t)=>{let{sizes:n,onSizesChange:r,style:i,...a}=e,o=Uc(),[s,c]=(0,D.useState)(),l=(0,D.useRef)(null),u=mn(t,l,o.onScrollbarXChange);return(0,D.useEffect)(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,R.jsx)(ol,{"data-orientation":`horizontal`,...a,ref:u,sizes:n,style:{...i,"--sa-thumb-width":`${Xc(n)}px`},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),tl(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:nl(s.paddingLeft),paddingEnd:nl(s.paddingRight)}})}})});sl.displayName=`@mantine/core/ScrollAreaScrollbarX`;var cl=(0,D.forwardRef)((e,t)=>{let{sizes:n,onSizesChange:r,style:i,...a}=e,o=Uc(),[s,c]=(0,D.useState)(),l=(0,D.useRef)(null),u=mn(t,l,o.onScrollbarYChange);return(0,D.useEffect)(()=>{l.current&&c(window.getComputedStyle(l.current))},[]),(0,R.jsx)(ol,{...a,"data-orientation":`vertical`,ref:u,sizes:n,style:{"--sa-thumb-height":`${Xc(n)}px`,...i},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),tl(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:nl(s.paddingTop),paddingEnd:nl(s.paddingBottom)}})}})});cl.displayName=`@mantine/core/ScrollAreaScrollbarY`;var ll=(0,D.forwardRef)((e,t)=>{let{orientation:n=`vertical`,...r}=e,{dir:i}=$i(),a=Uc(),o=(0,D.useRef)(null),s=(0,D.useRef)(0),[c,l]=(0,D.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Yc(c.viewport,c.content),d={...r,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:e=>{o.current=e},onThumbPointerUp:()=>{s.current=0},onThumbPointerDown:e=>{s.current=e}},f=(e,t)=>el(e,s.current,c,t);return n===`horizontal`?(0,R.jsx)(sl,{...d,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){let e=a.viewport.scrollLeft,t=$c(e,c,i);o.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=f(e,i))}}):n===`vertical`?(0,R.jsx)(cl,{...d,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){let e=a.viewport.scrollTop,t=$c(e,c);c.scrollbar.size===0?o.current.style.setProperty(`--thumb-opacity`,`0`):o.current.style.setProperty(`--thumb-opacity`,`1`),o.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=f(e))}}):null});ll.displayName=`@mantine/core/ScrollAreaScrollbarVisible`;var ul=(0,D.forwardRef)((e,t)=>{let n=Uc(),{forceMount:r,...i}=e,[a,o]=(0,D.useState)(!1),s=e.orientation===`horizontal`,c=Mt(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Wc(n.viewport,c),Wc(n.content,c),r||a?(0,R.jsx)(ll,{"data-state":a?`visible`:`hidden`,...i,ref:t}):null});ul.displayName=`@mantine/core/ScrollAreaScrollbarAuto`;var dl=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=Uc(),[a,o]=(0,D.useState)(!1);return(0,D.useEffect)(()=>{let{scrollArea:e}=i,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),n||a?(0,R.jsx)(ul,{"data-state":a?`visible`:`hidden`,...r,ref:t}):null});dl.displayName=`@mantine/core/ScrollAreaScrollbarHover`;var fl=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=Uc(),a=e.orientation===`horizontal`,[o,s]=(0,D.useState)(`hidden`),c=Mt(()=>s(`idle`),100);return(0,D.useEffect)(()=>{if(o===`idle`){let e=window.setTimeout(()=>s(`hidden`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[o,i.scrollHideDelay]),(0,D.useEffect)(()=>{let{viewport:e}=i,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(s(`scrolling`),c()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c]),n||o!==`hidden`?(0,R.jsx)(ll,{"data-state":o===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:rl(e.onPointerEnter,()=>s(`interacting`)),onPointerLeave:rl(e.onPointerLeave,()=>s(`idle`))}):null}),pl=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=Uc(),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return(0,D.useEffect)(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,R.jsx)(dl,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,R.jsx)(fl,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,R.jsx)(ul,{...r,ref:t,forceMount:n}):i.type===`always`?(0,R.jsx)(ll,{...r,ref:t}):null});pl.displayName=`@mantine/core/ScrollAreaScrollbar`;function ml(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}var hl=(0,D.forwardRef)((e,t)=>{let{style:n,...r}=e,i=Uc(),a=al(),{onThumbPositionChange:o}=a,s=mn(t,e=>a.onThumbChange(e)),c=(0,D.useRef)(void 0),l=Mt(()=>{c.current&&=(c.current(),void 0)},100);return(0,D.useEffect)(()=>{let{viewport:e}=i;if(e){let t=()=>{if(l(),!c.current){let t=ml(e,o);c.current=t,o()}};return o(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[i.viewport,l,o]),(0,R.jsx)(`div`,{"data-state":a.hasThumb?`visible`:`hidden`,...r,ref:s,style:{width:`var(--sa-thumb-width)`,height:`var(--sa-thumb-height)`,...n},onPointerDownCapture:rl(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;a.onThumbPointerDown({x:n,y:r})}),onPointerUp:rl(e.onPointerUp,a.onThumbPointerUp)})});hl.displayName=`@mantine/core/ScrollAreaThumb`;var gl=(0,D.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=al();return n||i.hasThumb?(0,R.jsx)(hl,{ref:t,...r}):null});gl.displayName=`@mantine/core/ScrollAreaThumb`;var _l=(0,D.forwardRef)(({children:e,style:t,onWheel:n,...r},i)=>{let a=Uc(),o=mn(i,a.onViewportChange),s=e=>{if(n?.(e),a.scrollbarXEnabled&&a.viewport&&e.shiftKey){let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollWidth:i,clientWidth:o}=a.viewport,s=t<1,c=t>=n-r-1;i>o&&(s||c)&&e.stopPropagation()}};return(0,R.jsx)(B,{...r,ref:o,onWheel:s,style:{overflowX:a.scrollbarXEnabled?`scroll`:`hidden`,overflowY:a.scrollbarYEnabled?`scroll`:`hidden`,...t},children:(0,R.jsx)(`div`,{...a.getStyles(`content`),ref:a.onContentChange,children:e})})});_l.displayName=`@mantine/core/ScrollAreaViewport`;var vl={scrollHideDelay:1e3,type:`hover`,scrollbars:`xy`},yl=jn((e,{scrollbarSize:t,overscrollBehavior:n,scrollbars:r})=>{let i=n;return n&&r&&(r===`x`?i=`${n} auto`:r===`y`&&(i=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":L(t),"--scrollarea-over-scroll-behavior":i}}}),bl=Xi((e,t)=>{let n=z(`ScrollArea`,vl,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,scrollbarSize:c,vars:l,type:u,scrollHideDelay:d,viewportProps:f,viewportRef:p,onScrollPositionChange:m,children:h,offsetScrollbars:g,scrollbars:_,onBottomReached:v,onTopReached:y,overscrollBehavior:b,attributes:x,...S}=n,[C,w]=(0,D.useState)(!1),[T,E]=(0,D.useState)(!1),[O,k]=(0,D.useState)(!1),A=si({name:`ScrollArea`,props:n,classes:Vc,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:x,vars:l,varsResolver:yl}),j=(0,D.useRef)(null),M=Zs([p,j]);return(0,D.useEffect)(()=>{if(!j.current||g!==`present`)return;let e=j.current,t=new ResizeObserver(()=>{let{scrollHeight:t,clientHeight:n,scrollWidth:r,clientWidth:i}=e;E(t>n),k(r>i)});return t.observe(e),()=>t.disconnect()},[j,g]),(0,R.jsxs)(Jc,{getStyles:A,type:u===`never`?`always`:u,scrollHideDelay:d,ref:t,scrollbars:_,...A(`root`),...S,children:[(0,R.jsx)(_l,{...f,...A(`viewport`,{style:f?.style}),ref:M,"data-offset-scrollbars":g===!0?`xy`:g||void 0,"data-scrollbars":_||void 0,"data-horizontal-hidden":g===`present`&&!O?`true`:void 0,"data-vertical-hidden":g===`present`&&!T?`true`:void 0,onScroll:e=>{f?.onScroll?.(e),m?.({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop});let{scrollTop:t,scrollHeight:n,clientHeight:r}=e.currentTarget;t-(n-r)>=-.8&&v?.(),t===0&&y?.()},children:h}),(_===`xy`||_===`x`)&&(0,R.jsx)(pl,{...A(`scrollbar`),orientation:`horizontal`,"data-hidden":u===`never`||g===`present`&&!O||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:(0,R.jsx)(gl,{...A(`thumb`)})}),(_===`xy`||_===`y`)&&(0,R.jsx)(pl,{...A(`scrollbar`),orientation:`vertical`,"data-hidden":u===`never`||g===`present`&&!T||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:(0,R.jsx)(gl,{...A(`thumb`)})}),(0,R.jsx)(Kc,{...A(`corner`),"data-hovered":C||void 0,"data-hidden":u===`never`||void 0})]})});bl.displayName=`@mantine/core/ScrollArea`;var xl=Xi((e,t)=>{let{children:n,classNames:r,styles:i,scrollbarSize:a,scrollHideDelay:o,type:s,dir:c,offsetScrollbars:l,overscrollBehavior:u,viewportRef:d,onScrollPositionChange:f,unstyled:p,variant:m,viewportProps:h,scrollbars:g,style:_,vars:v,onBottomReached:y,onTopReached:b,onOverflowChange:x,...S}=z(`ScrollAreaAutosize`,vl,e),C=(0,D.useRef)(null),w=Zs([d,C]),[T,E]=(0,D.useState)(!1),O=(0,D.useRef)(!1);return(0,D.useEffect)(()=>{if(!x)return;let e=C.current;if(!e)return;let t=()=>{let t=e.scrollHeight>e.clientHeight;t!==T&&(O.current?x?.(t):(O.current=!0,t&&x?.(!0)),E(t))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[x,T]),(0,R.jsx)(B,{...S,ref:t,style:[{display:`flex`,overflow:`hidden`},_],children:(0,R.jsx)(B,{style:{display:`flex`,flexDirection:`column`,flex:1,overflow:`hidden`,...g===`y`&&{minWidth:0},...g===`x`&&{minHeight:0},...g===`xy`&&{minWidth:0,minHeight:0},...g===!1&&{minWidth:0,minHeight:0}},children:(0,R.jsx)(bl,{classNames:r,styles:i,scrollHideDelay:o,scrollbarSize:a,type:s,dir:c,offsetScrollbars:l,overscrollBehavior:u,viewportRef:w,onScrollPositionChange:f,unstyled:p,variant:m,viewportProps:h,vars:v,scrollbars:g,onBottomReached:y,onTopReached:b,"data-autosize":`true`,children:n})})})});bl.classes=Vc,xl.displayName=`@mantine/core/ScrollAreaAutosize`,xl.classes=Vc,bl.Autosize=xl;var Sl={root:`m_87cf2631`},Cl={__staticSelector:`UnstyledButton`},wl=Zi((e,t)=>{let n=z(`UnstyledButton`,Cl,e),{className:r,component:i=`button`,__staticSelector:a,unstyled:o,classNames:s,styles:c,style:l,attributes:u,...d}=n;return(0,R.jsx)(B,{...si({name:a,props:n,classes:Sl,className:r,style:l,classNames:s,styles:c,unstyled:o,attributes:u})(`root`,{focusable:!0}),component:i,ref:t,type:i===`button`?`button`:void 0,...d})});wl.classes=Sl,wl.displayName=`@mantine/core/UnstyledButton`;var Tl={root:`m_515a97f8`},El=Xi((e,t)=>{let n=z(`VisuallyHidden`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,attributes:l,...u}=n;return(0,R.jsx)(B,{component:`span`,ref:t,...si({name:`VisuallyHidden`,classes:Tl,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:l})(`root`),...u})});El.classes=Tl,El.displayName=`@mantine/core/VisuallyHidden`;var Dl={root:`m_1b7284a3`},Ol=jn((e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:yt(t),"--paper-shadow":St(n)}})),kl=Zi((e,t)=>{let n=z(`Paper`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,withBorder:c,vars:l,radius:u,shadow:d,variant:f,mod:p,attributes:m,...h}=n,g=si({name:`Paper`,props:n,classes:Dl,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:l,varsResolver:Ol});return(0,R.jsx)(B,{ref:t,mod:[{"data-with-border":c},p],...g(`root`),variant:f,...h})});kl.classes=Dl,kl.displayName=`@mantine/core/Paper`;function Al(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function jl(e,t,n,r,i){return e===`center`||r===`center`?{left:t}:e===`end`?{[i===`ltr`?`right`:`left`]:n}:e===`start`?{[i===`ltr`?`left`:`right`]:n}:{}}var Ml={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`};function Nl({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){let[c,l=`center`]=e.split(`-`),u={width:t,height:t,transform:`rotate(45deg)`,position:`absolute`,[Ml[c]]:r},d=-t/2;return c===`left`?{...u,...Al(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...Al(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...jl(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...jl(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}var Pl=(0,D.forwardRef)(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l},u)=>{let{dir:d}=$i();return a?(0,R.jsx)(`div`,{...l,ref:u,style:{...c,...Nl({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:d,arrowX:o,arrowY:s})}}):null});Pl.displayName=`@mantine/core/FloatingArrow`;function Fl(e,t){if(e===`rtl`&&(t.includes(`right`)||t.includes(`left`))){let[e,n]=t.split(`-`),r=e===`right`?`left`:`right`;return n===void 0?r:`${r}-${n}`}return t}var Il={root:`m_9814e45f`},Ll={zIndex:mt(`modal`)},Rl=jn((e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:a,zIndex:o})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&cr(n||`#000`,r??.6)||void 0,"--overlay-filter":i?`blur(${L(i)})`:void 0,"--overlay-radius":a===void 0?void 0:yt(a),"--overlay-z-index":o?.toString()}})),zl=Zi((e,t)=>{let n=z(`Overlay`,Ll,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,fixed:l,center:u,children:d,radius:f,zIndex:p,gradient:m,blur:h,color:g,backgroundOpacity:_,mod:v,attributes:y,...b}=n;return(0,R.jsx)(B,{ref:t,...si({name:`Overlay`,props:n,classes:Il,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:y,vars:c,varsResolver:Rl})(`root`),mod:[{center:u,fixed:l},v],...b,children:d})});zl.classes=Il,zl.displayName=`@mantine/core/Overlay`;function Bl(e){let t=document.createElement(`div`);return t.setAttribute(`data-portal`,`true`),typeof e.className==`string`&&t.classList.add(...e.className.split(` `).filter(Boolean)),typeof e.style==`object`&&Object.assign(t.style,e.style),typeof e.id==`string`&&t.setAttribute(`id`,e.id),t}function Vl({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||Bl(n):e;if(t){let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return e;let t=Bl(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),t}return Bl(n)}var Hl={reuseTargetNode:!0},Ul=Xi((e,t)=>{let{children:n,target:r,reuseTargetNode:i,...a}=z(`Portal`,Hl,e),[o,s]=(0,D.useState)(!1),c=(0,D.useRef)(null);return Bt(()=>(s(!0),c.current=Vl({target:r,reuseTargetNode:i,...a}),fn(t,c.current),!r&&!i&&c.current&&document.body.appendChild(c.current),()=>{!r&&!i&&c.current&&document.body.removeChild(c.current)}),[r]),!o||!c.current?null:(0,ea.createPortal)((0,R.jsx)(R.Fragment,{children:n}),c.current)});Ul.displayName=`@mantine/core/Portal`;var Wl=Xi(({withinPortal:e=!0,children:t,...n},r)=>qn()===`test`||!e?(0,R.jsx)(R.Fragment,{children:t}):(0,R.jsx)(Ul,{ref:r,...n,children:t}));Wl.displayName=`@mantine/core/OptionalPortal`;var Gl=e=>({in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(.9) translateY(${e===`bottom`?10:-10}px)`},transitionProperty:`transform, opacity`}),Kl={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:`opacity`},"fade-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(30px)`},transitionProperty:`opacity, transform`},"fade-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-30px)`},transitionProperty:`opacity, transform`},"fade-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(30px)`},transitionProperty:`opacity, transform`},"fade-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-30px)`},transitionProperty:`opacity, transform`},scale:{in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-y":{in:{opacity:1,transform:`scaleY(1)`},out:{opacity:0,transform:`scaleY(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-x":{in:{opacity:1,transform:`scaleX(1)`},out:{opacity:0,transform:`scaleX(0)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"skew-up":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(-20px) skew(-10deg, -5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"skew-down":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(20px) skew(-10deg, -5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-left":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(-5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-right":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-100%)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(100%)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"slide-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(100%)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"slide-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-100%)`},common:{transformOrigin:`right`},transitionProperty:`transform, opacity`},pop:{...Gl(`bottom`),common:{transformOrigin:`center center`}},"pop-bottom-left":{...Gl(`bottom`),common:{transformOrigin:`bottom left`}},"pop-bottom-right":{...Gl(`bottom`),common:{transformOrigin:`bottom right`}},"pop-top-left":{...Gl(`top`),common:{transformOrigin:`top left`}},"pop-top-right":{...Gl(`top`),common:{transformOrigin:`top right`}}},ql={entering:`in`,entered:`in`,exiting:`out`,exited:`out`,"pre-exiting":`out`,"pre-entering":`out`};function Jl({transition:e,state:t,duration:n,timingFunction:r}){let i={WebkitBackfaceVisibility:`hidden`,transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e==`string`?e in Kl?{transitionProperty:Kl[e].transitionProperty,...i,...Kl[e].common,...Kl[e][ql[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[ql[t]]}}function Yl({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:a,onEntered:o,onExited:s,enterDelay:c,exitDelay:l}){let u=Cr(),d=gn(),f=u.respectReducedMotion?d:!1,[p,m]=(0,D.useState)(f?0:e),[h,g]=(0,D.useState)(r?`entered`:`exited`),_=(0,D.useRef)(-1),v=(0,D.useRef)(-1),y=(0,D.useRef)(-1);function b(){window.clearTimeout(_.current),window.clearTimeout(v.current),cancelAnimationFrame(y.current)}let x=n=>{b();let r=n?i:a,c=n?o:s,l=f?0:n?e:t;m(l),l===0?(typeof r==`function`&&r(),typeof c==`function`&&c(),g(n?`entered`:`exited`)):y.current=requestAnimationFrame(()=>{ea.flushSync(()=>{g(n?`pre-entering`:`pre-exiting`)}),y.current=requestAnimationFrame(()=>{typeof r==`function`&&r(),g(n?`entering`:`exiting`),_.current=window.setTimeout(()=>{typeof c==`function`&&c(),g(n?`entered`:`exited`)},l)})})},S=e=>{if(b(),typeof(e?c:l)!=`number`){x(e);return}v.current=window.setTimeout(()=>{x(e)},e?c:l)};return Vt(()=>{S(r)},[r]),(0,D.useEffect)(()=>()=>{b()},[]),{transitionDuration:p,transitionStatus:h,transitionTimingFunction:n||`ease`}}function Xl({keepMounted:e,transition:t=`fade`,duration:n=250,exitDuration:r=n,mounted:i,children:a,timingFunction:o=`ease`,onExit:s,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f}){let p=qn(),{transitionDuration:m,transitionStatus:h,transitionTimingFunction:g}=Yl({mounted:i,exitDuration:r,duration:n,timingFunction:o,onExit:s,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f});return m===0||p===`test`?i?(0,R.jsx)(R.Fragment,{children:a({})}):e?a({display:`none`}):null:h===`exited`?e?a({display:`none`}):null:(0,R.jsx)(R.Fragment,{children:a(Jl({transition:t,duration:m,state:h,timingFunction:g}))})}Xl.displayName=`@mantine/core/Transition`;var[Zl,Ql]=at(`Popover component was not found in the tree`),$l={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`};function eu({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=mn(Qt(t),r),a=An(e);return a?(0,D.cloneElement)(a,{[n]:i}):e}function tu(e){return(0,R.jsx)(El,{tabIndex:-1,"data-autofocus":!0,...e})}eu.displayName=`@mantine/core/FocusTrap`,tu.displayName=`@mantine/core/FocusTrapInitialFocus`,eu.InitialFocus=tu;var nu=Xi((e,t)=>{let n=z(`PopoverDropdown`,null,e),{className:r,style:i,vars:a,children:o,onKeyDownCapture:s,variant:c,classNames:l,styles:u,...d}=n,f=Ql(),p=Ht({opened:f.opened,shouldReturnFocus:f.returnFocus}),m=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:`dialog`,tabIndex:-1}:{},h=mn(t,f.floating);return f.disabled?null:(0,R.jsx)(Wl,{...f.portalProps,withinPortal:f.withinPortal,children:(0,R.jsx)(Xl,{mounted:f.opened,...f.transitionProps,transition:f.transitionProps?.transition||`fade`,duration:f.transitionProps?.duration??150,keepMounted:f.keepMounted,exitDuration:typeof f.transitionProps?.exitDuration==`number`?f.transitionProps.exitDuration:f.transitionProps?.duration,children:e=>(0,R.jsx)(eu,{active:f.trapFocus&&f.opened,innerRef:h,children:(0,R.jsxs)(B,{...m,...d,variant:c,onKeyDownCapture:gt(()=>{f.onClose?.(),f.onDismiss?.()},{active:f.closeOnEscape,onTrigger:p,onKeyDown:s}),"data-position":f.placement,"data-fixed":f.floatingStrategy===`fixed`||void 0,...f.getStyles(`dropdown`,{className:r,props:n,classNames:l,styles:u,style:[{...e,zIndex:f.zIndex,top:f.y??0,left:f.x??0,width:f.width===`target`?void 0:L(f.width),...f.referenceHidden?{display:`none`}:null},f.resolvedStyles.dropdown,u?.dropdown,i]}),children:[o,(0,R.jsx)(Pl,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,...f.getStyles(`arrow`,{props:n,classNames:l,styles:u})})]})})})})});nu.classes=$l,nu.displayName=`@mantine/core/PopoverDropdown`;var ru={refProp:`ref`,popupType:`dialog`},iu=Xi((e,t)=>{let{children:n,refProp:r,popupType:i,...a}=z(`PopoverTarget`,ru,e),o=An(n);if(!o)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let s=a,c=Ql(),l=mn(c.reference,En(o),t),u=c.withRoles?{"aria-haspopup":i,"aria-expanded":c.opened,"aria-controls":c.opened?c.getDropdownId():void 0,id:c.getTargetId()}:{},d=o.props;return(0,D.cloneElement)(o,{...s,...u,...c.targetProps,className:Nn(c.targetProps.className,s.className,d.className),[r]:l,...c.controlled?null:{onClick:()=>{c.onToggle(),d.onClick?.()}}})});iu.displayName=`@mantine/core/PopoverTarget`;function au(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function ou(e,t,n){let r=au(e.middlewares),i=[Us(e.offset),Js()];return e.dropdownVisible&&n!==`test`&&e.preventPositionChangeWhenVisible&&(r.flip=!1),r.flip&&i.push(typeof r.flip==`boolean`?Ks():Ks(r.flip)),r.shift&&i.push(Ws(typeof r.shift==`boolean`?{limiter:Gs(),padding:5}:{limiter:Gs(),padding:5,...r.shift})),r.inline&&i.push(typeof r.inline==`boolean`?Ys():Ys(r.inline)),i.push(Xs({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width===`target`)&&i.push(qs({...typeof r.size==`boolean`?{}:r.size,apply({rects:n,availableWidth:i,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};r.size&&(typeof r.size==`object`&&r.size.apply?r.size.apply({rects:n,availableWidth:i,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${i}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),i}function su(e){let t=qn(),[n,r]=hn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),i=(0,D.useRef)(n),a=()=>{n&&!e.disabled&&r(!1)},o=()=>{e.disabled||r(!n)},s=Pc({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:ou(e,()=>s,t),whileElementsMounted:e.keepMounted?void 0:Es});return(0,D.useEffect)(()=>{if(!(!s.refs.reference.current||!s.refs.floating.current)&&n)return Es(s.refs.reference.current,s.refs.floating.current,s.update)},[n,s.update]),Vt(()=>{e.onPositionChange?.(s.placement),e.positionRef.current=s.placement},[s.placement,e.preventPositionChangeWhenVisible]),Vt(()=>{n!==i.current&&(n?e.onOpen?.():e.onClose?.()),i.current=n},[n,e.onClose,e.onOpen]),Bt(()=>{let t=-1;return n&&(t=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(t)}},[n,e.position]),{floating:s,controlled:typeof e.opened==`boolean`,opened:n,onClose:a,onToggle:o}}var cu={position:`bottom`,offset:8,positionDependencies:[],transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:mt(`popover`),__staticSelector:`Popover`,width:`max-content`},lu=jn((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:yt(t),"--popover-shadow":St(n)}}));function uu(e){let t=z(`Popover`,cu,e),{children:n,position:r,offset:i,onPositionChange:a,positionDependencies:o,opened:s,transitionProps:c,onExitTransitionEnd:l,onEnterTransitionEnd:u,width:d,middlewares:f,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,unstyled:v,classNames:y,styles:b,closeOnClickOutside:x,withinPortal:S,portalProps:C,closeOnEscape:w,clickOutsideEvents:T,trapFocus:E,onClose:O,onDismiss:k,onOpen:A,onChange:j,zIndex:M,radius:N,shadow:ee,id:te,defaultOpened:P,__staticSelector:F,withRoles:I,disabled:ne,returnFocus:re,variant:ie,keepMounted:ae,vars:oe,floatingStrategy:se,withOverlay:ce,overlayProps:le,hideDetached:ue,attributes:de,preventPositionChangeWhenVisible:fe,...pe}=t,me=si({name:F,props:t,classes:$l,classNames:y,styles:b,unstyled:v,attributes:de,rootSelector:`dropdown`,vars:oe,varsResolver:lu}),{resolvedStyles:he}=Wr({classNames:y,styles:b,props:t}),[ge,_e]=(0,D.useState)(s??P??!1),ve=(0,D.useRef)(r),ye=(0,D.useRef)(null),[be,xe]=(0,D.useState)(null),[Se,Ce]=(0,D.useState)(null),{dir:we}=$i(),Te=qn(),Ee=rn(te),De=su({middlewares:f,width:d,position:Fl(we,r),offset:typeof i==`number`?i+(p?m/2:0):i,arrowRef:ye,arrowOffset:h,onPositionChange:a,positionDependencies:o,opened:s,defaultOpened:P,onChange:j,onOpen:A,onClose:O,onDismiss:k,strategy:se,dropdownVisible:ge,setDropdownVisible:_e,positionRef:ve,disabled:ne,preventPositionChangeWhenVisible:fe,keepMounted:ae});Pt(()=>{x&&(De.onClose(),k?.())},T,[be,Se]);let Oe=(0,D.useCallback)(e=>{xe(e),De.floating.refs.setReference(e)},[De.floating.refs.setReference]),ke=(0,D.useCallback)(e=>{Ce(e),De.floating.refs.setFloating(e)},[De.floating.refs.setFloating]),Ae=(0,D.useCallback)(()=>{c?.onExited?.(),l?.(),_e(!1),fe||(ve.current=r)},[c?.onExited,l,fe,r]),je=(0,D.useCallback)(()=>{c?.onEntered?.(),u?.()},[c?.onEntered,u]);return(0,R.jsxs)(Zl,{value:{returnFocus:re,disabled:ne,controlled:De.controlled,reference:Oe,floating:ke,x:De.floating.x,y:De.floating.y,arrowX:De.floating?.middlewareData?.arrow?.x,arrowY:De.floating?.middlewareData?.arrow?.y,opened:De.opened,arrowRef:ye,transitionProps:{...c,onExited:Ae,onEntered:je},width:d,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,placement:De.floating.placement,trapFocus:E,withinPortal:S,portalProps:C,zIndex:M,radius:N,shadow:ee,closeOnEscape:w,onDismiss:k,onClose:De.onClose,onToggle:De.onToggle,getTargetId:()=>`${Ee}-target`,getDropdownId:()=>`${Ee}-dropdown`,withRoles:I,targetProps:pe,__staticSelector:F,classNames:y,styles:b,unstyled:v,variant:ie,keepMounted:ae,getStyles:me,resolvedStyles:he,floatingStrategy:se,referenceHidden:ue&&Te!==`test`?De.floating.middlewareData.hide?.referenceHidden:!1},children:[n,ce&&(0,R.jsx)(Xl,{transition:`fade`,mounted:De.opened,duration:c?.duration||250,exitDuration:c?.exitDuration||250,children:e=>(0,R.jsx)(Wl,{withinPortal:S,children:(0,R.jsx)(zl,{...le,...me(`overlay`,{className:le?.className,style:[e,le?.style]})})})})]})}uu.Target=iu,uu.Dropdown=nu,uu.displayName=`@mantine/core/Popover`,uu.extend=e=>e;var du={root:`m_5ae2e3c`,barsLoader:`m_7a2bd4cd`,bar:`m_870bb79`,"bars-loader-animation":`m_5d2b3b9d`,dotsLoader:`m_4e3f22d7`,dot:`m_870c4af`,"loader-dots-animation":`m_aac34a1`,ovalLoader:`m_b34414df`,"oval-loader-animation":`m_f8e89c4b`},fu=(0,D.forwardRef)(({className:e,...t},n)=>(0,R.jsxs)(B,{component:`span`,className:Nn(du.barsLoader,e),...t,ref:n,children:[(0,R.jsx)(`span`,{className:du.bar}),(0,R.jsx)(`span`,{className:du.bar}),(0,R.jsx)(`span`,{className:du.bar})]}));fu.displayName=`@mantine/core/Bars`;var pu=(0,D.forwardRef)(({className:e,...t},n)=>(0,R.jsxs)(B,{component:`span`,className:Nn(du.dotsLoader,e),...t,ref:n,children:[(0,R.jsx)(`span`,{className:du.dot}),(0,R.jsx)(`span`,{className:du.dot}),(0,R.jsx)(`span`,{className:du.dot})]}));pu.displayName=`@mantine/core/Dots`;var mu=(0,D.forwardRef)(({className:e,...t},n)=>(0,R.jsx)(B,{component:`span`,className:Nn(du.ovalLoader,e),...t,ref:n}));mu.displayName=`@mantine/core/Oval`;var hu={bars:fu,oval:mu,dots:pu},gu={loaders:hu,type:`oval`},_u=jn((e,{size:t,color:n})=>({root:{"--loader-size":_t(t,`loader-size`),"--loader-color":n?or(n,e):void 0}})),vu=Xi((e,t)=>{let n=z(`Loader`,gu,e),{size:r,color:i,type:a,vars:o,className:s,style:c,classNames:l,styles:u,unstyled:d,loaders:f,variant:p,children:m,attributes:h,...g}=n,_=si({name:`Loader`,props:n,classes:du,className:s,style:c,classNames:l,styles:u,unstyled:d,attributes:h,vars:o,varsResolver:_u});return m?(0,R.jsx)(B,{..._(`root`),ref:t,...g,children:m}):(0,R.jsx)(B,{..._(`root`),ref:t,component:f[a],variant:p,size:r,...g})});vu.defaultLoaders=hu,vu.classes=du,vu.displayName=`@mantine/core/Loader`;var yu={root:`m_8d3f4000`,icon:`m_8d3afb97`,loader:`m_302b9fb1`,group:`m_1a0f1b21`,groupSection:`m_437b6484`},bu={orientation:`horizontal`},xu=jn((e,{borderWidth:t})=>({group:{"--ai-border-width":L(t)}})),Su=Xi((e,t)=>{let n=z(`ActionIconGroup`,bu,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,attributes:p,...m}=z(`ActionIconGroup`,bu,e);return(0,R.jsx)(B,{...si({name:`ActionIconGroup`,props:n,classes:yu,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:l,varsResolver:xu,rootSelector:`group`})(`group`),ref:t,variant:d,mod:[{"data-orientation":c},f],role:`group`,...m})});Su.classes=yu,Su.displayName=`@mantine/core/ActionIconGroup`;var Cu=jn((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":_t(o,`section-height`),"--section-padding-x":_t(o,`section-padding-x`),"--section-fz":bt(o),"--section-radius":t===void 0?void 0:yt(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),wu=Xi((e,t)=>{let n=z(`ActionIconGroupSection`,null,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=n;return(0,R.jsx)(B,{...si({name:`ActionIconGroupSection`,props:n,classes:yu,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:Cu,rootSelector:`groupSection`})(`groupSection`),ref:t,variant:l,...m})});wu.classes=yu,wu.displayName=`@mantine/core/ActionIconGroupSection`;var Tu=jn((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ai-size":_t(t,`ai-size`),"--ai-radius":n===void 0?void 0:yt(n),"--ai-bg":a||r?s.background:void 0,"--ai-hover":a||r?s.hover:void 0,"--ai-hover-color":a||r?s.hoverColor:void 0,"--ai-color":s.color,"--ai-bd":a||r?s.border:void 0}}}),Eu=Zi((e,t)=>{let n=z(`ActionIcon`,null,e),{className:r,unstyled:i,variant:a,classNames:o,styles:s,style:c,loading:l,loaderProps:u,size:d,color:f,radius:p,__staticSelector:m,gradient:h,vars:g,children:_,disabled:v,"data-disabled":y,autoContrast:b,mod:x,attributes:S,...C}=n,w=si({name:[`ActionIcon`,m],props:n,className:r,style:c,classes:yu,classNames:o,styles:s,unstyled:i,attributes:S,vars:g,varsResolver:Tu});return(0,R.jsxs)(wl,{...w(`root`,{active:!v&&!l&&!y}),...C,unstyled:i,variant:a,size:d,disabled:v||l,ref:t,mod:[{loading:l,disabled:v||y},x],children:[typeof l==`boolean`&&(0,R.jsx)(Xl,{mounted:l,transition:`slide-down`,duration:150,children:e=>(0,R.jsx)(B,{component:`span`,...w(`loader`,{style:e}),"aria-hidden":!0,children:(0,R.jsx)(vu,{color:`var(--ai-color)`,size:`calc(var(--ai-size) * 0.55)`,...u})})}),(0,R.jsx)(B,{component:`span`,mod:{loading:l},...w(`icon`),children:_})]})});Eu.classes=yu,Eu.displayName=`@mantine/core/ActionIcon`,Eu.Group=Su,Eu.GroupSection=wu;var Du=(0,D.forwardRef)(({size:e=`var(--cb-icon-size, 70%)`,style:t,...n},r)=>(0,R.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...t,width:e,height:e},ref:r,...n,children:(0,R.jsx)(`path`,{d:`M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})}));Du.displayName=`@mantine/core/CloseIcon`;var Ou={root:`m_86a44da5`,"root--subtle":`m_220c80f2`},ku={variant:`subtle`},Au=jn((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":_t(t,`cb-size`),"--cb-radius":n===void 0?void 0:yt(n),"--cb-icon-size":L(r)}})),ju=Zi((e,t)=>{let n=z(`CloseButton`,ku,e),{iconSize:r,children:i,vars:a,radius:o,className:s,classNames:c,style:l,styles:u,unstyled:d,"data-disabled":f,disabled:p,variant:m,icon:h,mod:g,attributes:_,__staticSelector:v,...y}=n,b=si({name:v||`CloseButton`,props:n,className:s,style:l,classes:Ou,classNames:c,styles:u,unstyled:d,attributes:_,vars:a,varsResolver:Au});return(0,R.jsxs)(wl,{ref:t,...y,unstyled:d,variant:m,disabled:p,mod:[{disabled:p||f},g],...b(`root`,{variant:m,active:!p&&!f}),children:[h||(0,R.jsx)(Du,{}),i]})});ju.classes=Ou,ju.displayName=`@mantine/core/CloseButton`;function Mu(e){return D.Children.toArray(e).filter(Boolean)}var Nu={root:`m_4081bf90`},Pu={preventGrowOverflow:!0,gap:`md`,align:`center`,justify:`flex-start`,wrap:`wrap`},Fu=jn((e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:a,wrap:o},{childWidth:s})=>({root:{"--group-child-width":t&&n?s:void 0,"--group-gap":vt(r),"--group-align":i,"--group-justify":a,"--group-wrap":o}})),V=Xi((e,t)=>{let n=z(`Group`,Pu,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,children:c,gap:l,align:u,justify:d,wrap:f,grow:p,preventGrowOverflow:m,vars:h,variant:g,__size:_,mod:v,attributes:y,...b}=n,x=Mu(c),S=x.length,C=vt(l??`md`);return(0,R.jsx)(B,{...si({name:`Group`,props:n,stylesCtx:{childWidth:`calc(${100/S}% - (${C} - ${C} / ${S}))`},className:i,style:a,classes:Nu,classNames:r,styles:o,unstyled:s,attributes:y,vars:h,varsResolver:Fu})(`root`),ref:t,variant:g,mod:[{grow:p},v],size:_,...b,children:x})});V.classes=Nu,V.displayName=`@mantine/core/Group`;var[Iu,Lu]=at(`ModalBase component was not found in tree`);function Ru({opened:e,transitionDuration:t}){let[n,r]=(0,D.useState)(e),i=(0,D.useRef)(-1),a=gn()?0:t;return(0,D.useEffect)(()=>(e?(r(!0),window.clearTimeout(i.current)):a===0?r(!1):i.current=window.setTimeout(()=>r(!1),a),()=>window.clearTimeout(i.current)),[e,a]),n}function zu({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:a,returnFocus:o}){let s=rn(e),[c,l]=(0,D.useState)(!1),[u,d]=(0,D.useState)(!1),f=Ru({opened:n,transitionDuration:typeof t?.duration==`number`?t?.duration:200});return an(`keydown`,e=>{e.key===`Escape`&&i&&!e.isComposing&&n&&e.target?.getAttribute(`data-mantine-stop-propagation`)!==`true`&&a()},{capture:!0}),Ht({opened:n,shouldReturnFocus:r&&o}),{_id:s,titleMounted:c,bodyMounted:u,shouldLockScroll:f,setTitleMounted:l,setBodyMounted:d}}var Bu=(0,D.forwardRef)(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:a,onEnterTransitionEnd:o,trapFocus:s,closeOnEscape:c,returnFocus:l,closeOnClickOutside:u,withinPortal:d,portalProps:f,lockScroll:p,children:m,zIndex:h,shadow:g,padding:_,__vars:v,unstyled:y,removeScrollProps:b,...x},S)=>{let{_id:C,titleMounted:w,bodyMounted:T,shouldLockScroll:E,setTitleMounted:D,setBodyMounted:O}=zu({id:r,transitionProps:i,opened:t,trapFocus:s,closeOnEscape:c,onClose:n,returnFocus:l}),{key:k,...A}=b||{};return(0,R.jsx)(Wl,{...f,withinPortal:d,children:(0,R.jsx)(Iu,{value:{opened:t,onClose:n,closeOnClickOutside:u,onExitTransitionEnd:a,onEnterTransitionEnd:o,transitionProps:{...i,keepMounted:e},getTitleId:()=>`${C}-title`,getBodyId:()=>`${C}-body`,titleMounted:w,bodyMounted:T,setTitleMounted:D,setBodyMounted:O,trapFocus:s,closeOnEscape:c,zIndex:h,unstyled:y},children:(0,R.jsx)(Ge,{enabled:E&&p,...A,children:(0,R.jsx)(B,{ref:S,...x,__vars:{...v,"--mb-z-index":(h||mt(`modal`)).toString(),"--mb-shadow":St(g),"--mb-padding":vt(_)},children:m})},k)})})});Bu.displayName=`@mantine/core/ModalBase`;var Vu={title:`m_615af6c9`,header:`m_b5489c3c`,inner:`m_60c222c7`,content:`m_fd1ab0aa`,close:`m_606cb269`,body:`m_5df29311`};function Hu(){let e=Lu();return(0,D.useEffect)(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Uu=(0,D.forwardRef)(({className:e,...t},n)=>{let r=Hu(),i=Lu();return(0,R.jsx)(B,{ref:n,...t,id:r,className:Nn({[Vu.body]:!i.unstyled},e)})});Uu.displayName=`@mantine/core/ModalBaseBody`;var Wu=(0,D.forwardRef)(({className:e,onClick:t,...n},r)=>{let i=Lu();return(0,R.jsx)(ju,{ref:r,...n,onClick:e=>{i.onClose(),t?.(e)},className:Nn({[Vu.close]:!i.unstyled},e),unstyled:i.unstyled})});Wu.displayName=`@mantine/core/ModalBaseCloseButton`;var Gu=(0,D.forwardRef)(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,...a},o)=>{let s=Lu();return(0,R.jsx)(Xl,{mounted:s.opened,transition:`pop`,...s.transitionProps,onExited:()=>{s.onExitTransitionEnd?.(),s.transitionProps?.onExited?.()},onEntered:()=>{s.onEnterTransitionEnd?.(),s.transitionProps?.onEntered?.()},...e,children:e=>(0,R.jsx)(`div`,{...n,className:Nn({[Vu.inner]:!s.unstyled},n.className),children:(0,R.jsx)(eu,{active:s.opened&&s.trapFocus,innerRef:o,children:(0,R.jsx)(kl,{...a,component:`section`,role:`dialog`,tabIndex:-1,"aria-modal":!0,"aria-describedby":s.bodyMounted?s.getBodyId():void 0,"aria-labelledby":s.titleMounted?s.getTitleId():void 0,style:[i,e],className:Nn({[Vu.content]:!s.unstyled},t),unstyled:s.unstyled,children:a.children})})})})});Gu.displayName=`@mantine/core/ModalBaseContent`;var Ku=(0,D.forwardRef)(({className:e,...t},n)=>{let r=Lu();return(0,R.jsx)(B,{component:`header`,ref:n,className:Nn({[Vu.header]:!r.unstyled},e),...t})});Ku.displayName=`@mantine/core/ModalBaseHeader`;var qu={duration:200,timingFunction:`ease`,transition:`fade`};function Ju(e){let t=Lu();return{...qu,...t.transitionProps,...e}}var Yu=(0,D.forwardRef)(({onClick:e,transitionProps:t,style:n,visible:r,...i},a)=>{let o=Lu(),s=Ju(t);return(0,R.jsx)(Xl,{mounted:r===void 0?o.opened:r,...s,transition:`fade`,children:t=>(0,R.jsx)(zl,{ref:a,fixed:!0,style:[n,t],zIndex:o.zIndex,unstyled:o.unstyled,onClick:t=>{e?.(t),o.closeOnClickOutside&&o.onClose()},...i})})});Yu.displayName=`@mantine/core/ModalBaseOverlay`;function Xu(){let e=Lu();return(0,D.useEffect)(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}var Zu=(0,D.forwardRef)(({className:e,...t},n)=>{let r=Xu(),i=Lu();return(0,R.jsx)(B,{component:`h2`,ref:n,className:Nn({[Vu.title]:!i.unstyled},e),...t,id:r})});Zu.displayName=`@mantine/core/ModalBaseTitle`;function Qu({children:e}){return(0,R.jsx)(R.Fragment,{children:e})}var[$u,ed]=ot({size:`sm`}),td={wrapper:`m_6c018570`,input:`m_8fb7ebe7`,section:`m_82577fc2`,placeholder:`m_88bacfd0`,root:`m_46b77525`,label:`m_8fdc1311`,required:`m_78a94662`,error:`m_8f816625`,description:`m_fe47ce59`},nd=Xi((e,t)=>{let n=z(`InputClearButton`,null,e),{size:r,variant:i,vars:a,classNames:o,styles:s,...c}=n,l=ed(),{resolvedClassNames:u,resolvedStyles:d}=Wr({classNames:o,styles:s,props:n});return(0,R.jsx)(ju,{variant:i||`transparent`,ref:t,size:r||l?.size||`sm`,classNames:u,styles:d,__staticSelector:`InputClearButton`,style:{pointerEvents:`all`,background:`var(--input-bg)`,...c.style},...c})});nd.displayName=`@mantine/core/InputClearButton`;var rd={xs:7,sm:8,md:10,lg:12,xl:15};function id({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:r,size:i=`sm`}){let a=e&&t;return a&&(n||r)?(0,R.jsxs)(`div`,{"data-combined-clear-section":!0,style:{display:`flex`,gap:2,alignItems:`center`,paddingInlineEnd:rd[i]},children:[a,n||r]}):n===null?null:n||a||r}var[ad,od]=ot({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0}),sd=jn((e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`}})),cd=Xi((e,t)=>{let n=z(`InputDescription`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,__staticSelector:u,__inheritStyles:d=!0,attributes:f,variant:p,...m}=z(`InputDescription`,null,n),h=od(),g=si({name:[`InputWrapper`,u],props:n,classes:td,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:f,rootSelector:`description`,vars:c,varsResolver:sd});return(0,R.jsx)(B,{component:`p`,ref:t,variant:p,size:l,...(d&&h?.getStyles||g)(`description`,h?.getStyles?{className:i,style:a}:void 0),...m})});cd.classes=td,cd.displayName=`@mantine/core/InputDescription`;var ld=jn((e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`}})),ud=Xi((e,t)=>{let n=z(`InputError`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,variant:p,...m}=n,h=si({name:[`InputWrapper`,d],props:n,classes:td,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:u,rootSelector:`error`,vars:c,varsResolver:ld}),g=od();return(0,R.jsx)(B,{component:`p`,ref:t,variant:p,size:l,...(f&&g?.getStyles||h)(`error`,g?.getStyles?{className:i,style:a}:void 0),...m})});ud.classes=td,ud.displayName=`@mantine/core/InputError`;var dd={labelElement:`label`},fd=jn((e,{size:t})=>({label:{"--input-label-size":bt(t),"--input-asterisk-color":void 0}})),pd=Xi((e,t)=>{let n=z(`InputLabel`,dd,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,labelElement:l,size:u,required:d,htmlFor:f,onMouseDown:p,children:m,__staticSelector:h,variant:g,mod:_,attributes:v,...y}=z(`InputLabel`,dd,n),b=si({name:[`InputWrapper`,h],props:n,classes:td,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,rootSelector:`label`,vars:c,varsResolver:fd}),x=od(),S=x?.getStyles||b;return(0,R.jsxs)(B,{...S(`label`,x?.getStyles?{className:i,style:a}:void 0),component:l,variant:g,size:u,ref:t,htmlFor:l===`label`?f:void 0,mod:[{required:d},_],onMouseDown:e=>{p?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...y,children:[m,d&&(0,R.jsx)(`span`,{...S(`required`),"aria-hidden":!0,children:` *`})]})});pd.classes=td,pd.displayName=`@mantine/core/InputLabel`;var md=Xi((e,t)=>{let n=z(`InputPlaceholder`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,__staticSelector:l,variant:u,error:d,mod:f,attributes:p,...m}=n;return(0,R.jsx)(B,{...si({name:[`InputPlaceholder`,l],props:n,classes:td,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,rootSelector:`placeholder`})(`placeholder`),mod:[{error:!!d},f],component:`span`,variant:u,ref:t,...m})});md.classes=td,md.displayName=`@mantine/core/InputPlaceholder`;function hd(e,{hasDescription:t,hasError:n}){let r=e.findIndex(e=>e===`input`),i=e.slice(0,r),a=e.slice(r+1),o=t&&i.includes(`description`)||n&&i.includes(`error`);return{offsetBottom:t&&a.includes(`description`)||n&&a.includes(`error`),offsetTop:o}}var gd={labelElement:`label`,inputContainer:e=>e,inputWrapperOrder:[`label`,`description`,`input`,`error`]},_d=jn((e,{size:t})=>({label:{"--input-label-size":bt(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${bt(t)} - ${L(2)})`}})),vd=Xi((e,t)=>{let n=z(`InputWrapper`,gd,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,variant:u,__staticSelector:d,inputContainer:f,inputWrapperOrder:p,label:m,error:h,description:g,labelProps:_,descriptionProps:v,errorProps:y,labelElement:b,children:x,withAsterisk:S,id:C,required:w,__stylesApiProps:T,mod:E,attributes:O,...k}=n,A=si({name:[`InputWrapper`,d],props:T||n,classes:td,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:O,vars:c,varsResolver:_d}),j={size:l,variant:u,__staticSelector:d},M=rn(C),N=typeof S==`boolean`?S:w,ee=y?.id||`${M}-error`,te=v?.id||`${M}-description`,P=M,F=!!h&&typeof h!=`boolean`,I=!!g,ne=`${F?ee:``} ${I?te:``}`,re=ne.trim().length>0?ne.trim():void 0,ie=_?.id||`${M}-label`,ae=m&&(0,R.jsx)(pd,{labelElement:b,id:ie,htmlFor:P,required:N,...j,..._,children:m},`label`),oe=I&&(0,R.jsx)(cd,{...v,...j,size:v?.size||j.size,id:v?.id||te,children:g},`description`),se=(0,R.jsx)(D.Fragment,{children:f(x)},`input`),ce=F&&(0,D.createElement)(ud,{...y,...j,size:y?.size||j.size,key:`error`,id:y?.id||ee},h),le=p.map(e=>{switch(e){case`label`:return ae;case`input`:return se;case`description`:return oe;case`error`:return ce;default:return null}});return(0,R.jsx)(ad,{value:{getStyles:A,describedBy:re,inputId:P,labelId:ie,...hd(p,{hasDescription:I,hasError:F})},children:(0,R.jsx)(B,{ref:t,variant:u,size:l,mod:[{error:!!h},E],...A(`root`),...k,children:le})})});vd.classes=td,vd.displayName=`@mantine/core/InputWrapper`;var yd={variant:`default`,leftSectionPointerEvents:`none`,rightSectionPointerEvents:`none`,withAria:!0,withErrorStyles:!0,size:`sm`},bd=jn((e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-margin-bottom":n.offsetBottom?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-height":_t(t.size,`input-height`),"--input-fz":bt(t.size),"--input-radius":t.radius===void 0?void 0:yt(t.radius),"--input-left-section-width":t.leftSectionWidth===void 0?void 0:L(t.leftSectionWidth),"--input-right-section-width":t.rightSectionWidth===void 0?void 0:L(t.rightSectionWidth),"--input-padding-y":t.multiline?_t(t.size,`input-padding-y`):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),xd=Zi((e,t)=>{let n=z(`Input`,yd,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,required:c,__staticSelector:l,__stylesApiProps:u,size:d,wrapperProps:f,error:p,disabled:m,leftSection:h,leftSectionProps:g,leftSectionWidth:_,rightSection:v,rightSectionProps:y,rightSectionWidth:b,rightSectionPointerEvents:x,leftSectionPointerEvents:S,variant:C,vars:w,pointer:T,multiline:E,radius:D,id:O,withAria:k,withErrorStyles:A,mod:j,inputSize:M,attributes:N,__clearSection:ee,__clearable:te,__defaultRightSection:P,...F}=n,{styleProps:I,rest:ne}=gi(F),re=od(),ie={offsetBottom:re?.offsetBottom,offsetTop:re?.offsetTop},ae=si({name:[`Input`,l],props:u||n,classes:td,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:N,stylesCtx:ie,rootSelector:`wrapper`,vars:w,varsResolver:bd}),oe=k?{required:c,disabled:m,"aria-invalid":!!p,"aria-describedby":re?.describedBy,id:re?.inputId||O}:{},se=id({__clearable:te,__clearSection:ee,rightSection:v,__defaultRightSection:P,size:d});return(0,R.jsx)($u,{value:{size:d||`sm`},children:(0,R.jsxs)(B,{...ae(`wrapper`),...I,...f,mod:[{error:!!p&&A,pointer:T,disabled:m,multiline:E,"data-with-right-section":!!se,"data-with-left-section":!!h},j],variant:C,size:d,children:[h&&(0,R.jsx)(`div`,{...g,"data-position":`left`,...ae(`section`,{className:g?.className,style:g?.style}),children:h}),(0,R.jsx)(B,{component:`input`,...ne,...oe,ref:t,required:c,mod:{disabled:m,error:!!p&&A},variant:C,__size:M,...ae(`input`)}),se&&(0,R.jsx)(`div`,{...y,"data-position":`right`,...ae(`section`,{className:y?.className,style:y?.style}),children:se})]})})});xd.classes=td,xd.Wrapper=vd,xd.Label=pd,xd.Error=ud,xd.Description=cd,xd.Placeholder=md,xd.ClearButton=nd,xd.displayName=`@mantine/core/Input`;function Sd(e,t,n){let r=z(e,t,n),{label:i,description:a,error:o,required:s,classNames:c,styles:l,className:u,unstyled:d,__staticSelector:f,__stylesApiProps:p,errorProps:m,labelProps:h,descriptionProps:g,wrapperProps:_,id:v,size:y,style:b,inputContainer:x,inputWrapperOrder:S,withAsterisk:C,variant:w,vars:T,mod:E,attributes:D,...O}=r,{styleProps:k,rest:A}=gi(O),j={label:i,description:a,error:o,required:s,classNames:c,className:u,__staticSelector:f,__stylesApiProps:p||r,errorProps:m,labelProps:h,descriptionProps:g,unstyled:d,styles:l,size:y,style:b,inputContainer:x,inputWrapperOrder:S,withAsterisk:C,variant:w,id:v,mod:E,attributes:D,..._};return{...A,classNames:c,styles:l,unstyled:d,wrapperProps:{...j,...k},inputProps:{required:s,classNames:c,styles:l,unstyled:d,size:y,__staticSelector:f,__stylesApiProps:p||r,error:o,variant:w,id:v,attributes:D}}}var Cd={__staticSelector:`InputBase`,withAria:!0,size:`sm`},wd=Zi((e,t)=>{let{inputProps:n,wrapperProps:r,...i}=Sd(`InputBase`,Cd,e);return(0,R.jsx)(xd.Wrapper,{...r,children:(0,R.jsx)(xd,{...n,...i,ref:t})})});wd.classes={...xd.classes,...xd.Wrapper.classes},wd.displayName=`@mantine/core/InputBase`;var Td={gap:{type:`spacing`,property:`gap`},rowGap:{type:`spacing`,property:`rowGap`},columnGap:{type:`spacing`,property:`columnGap`},align:{type:`identity`,property:`alignItems`},justify:{type:`identity`,property:`justifyContent`},wrap:{type:`identity`,property:`flexWrap`},direction:{type:`identity`,property:`flexDirection`}},Ed={root:`m_8bffd616`},Dd=Zi((e,t)=>{let n=z(`Flex`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,gap:l,rowGap:u,columnGap:d,align:f,justify:p,wrap:m,direction:h,attributes:g,..._}=n,v=si({name:`Flex`,classes:Ed,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c}),y=Cr(),b=zi(),x=Ri({styleProps:{gap:l,rowGap:u,columnGap:d,align:f,justify:p,wrap:m,direction:h},theme:y,data:Td});return(0,R.jsxs)(R.Fragment,{children:[x.hasResponsiveStyles&&(0,R.jsx)(hi,{selector:`.${b}`,styles:x.styles,media:x.media}),(0,R.jsx)(B,{ref:t,...v(`root`,{className:b,style:tt(x.inlineStyles)}),..._})]})});Dd.classes=Ed,Dd.displayName=`@mantine/core/Flex`;var Od={root:`m_96b553a6`};function kd(e,t){if(!t||!e)return!1;let n=t.parentNode;for(;n!=null;){if(n===e)return!0;n=n.parentNode}return!1}function Ad({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){let i=(0,D.useRef)(-1),[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(typeof r==`boolean`&&r),l=()=>{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=window.getComputedStyle(e),o=window.getComputedStyle(t),s=nl(a.borderTopWidth)+nl(o.borderTopWidth),c=nl(a.borderLeftWidth)+nl(o.borderLeftWidth),l={top:r.top-i.top-s,left:r.left-i.left-c,width:r.width,height:r.height};n.current.style.transform=`translateY(${l.top}px) translateX(${l.left}px)`,n.current.style.width=`${l.width}px`,n.current.style.height=`${l.height}px`},u=()=>{window.clearTimeout(i.current),n.current&&(n.current.style.transitionDuration=`0ms`),l(),i.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},d=(0,D.useRef)(null),f=(0,D.useRef)(null);return(0,D.useEffect)(()=>{if(l(),e)return d.current=new ResizeObserver(u),d.current.observe(e),t&&(f.current=new ResizeObserver(u),f.current.observe(t)),()=>{d.current?.disconnect(),f.current?.disconnect()}},[t,e]),(0,D.useEffect)(()=>{if(t){let e=e=>{kd(e.target,t)&&(u(),c(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),xn(()=>{Tn()!==`test`&&o(!0)},20,{autoInvoke:!0}),Cn(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&u()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:a,hidden:s}}var jd=jn((e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t==`number`?`${t}ms`:t}})),Md=Xi((e,t)=>{let n=z(`FloatingIndicator`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,target:l,parent:u,transitionDuration:d,mod:f,displayAfterTransitionEnd:p,attributes:m,...h}=n,g=si({name:`FloatingIndicator`,classes:Od,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:jd}),_=(0,D.useRef)(null),{initialized:v,hidden:y}=Ad({target:l,parent:u,ref:_,displayAfterTransitionEnd:p}),b=mn(t,_);return!l||!u?null:(0,R.jsx)(B,{ref:b,mod:[{initialized:v,hidden:y},f],...g(`root`),...h})});Md.displayName=`@mantine/core/FloatingIndicator`,Md.classes=Od;function Nd({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,D.useRef)(-1),a=(0,D.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,D.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var[Pd,Fd]=at(`Accordion component was not found in the tree`),Id={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`};function Ld({style:e,size:t=16,...n}){return(0,R.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:L(t),height:L(t),display:`block`},...n,children:(0,R.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}Ld.displayName=`@mantine/core/AccordionChevron`;var[Rd,zd]=at(`Accordion.Item component was not found in the tree`),Bd=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,chevron:s,icon:c,onClick:l,onKeyDown:u,children:d,disabled:f,mod:p,...m}=z(`AccordionControl`,null,e),{value:h}=zd(),g=Fd(),_=g.isItemActive(h),v=typeof g.order==`number`,y=`h${g.order}`,b=(0,R.jsxs)(wl,{...m,...g.getStyles(`control`,{className:r,classNames:n,style:i,styles:a,variant:g.variant}),unstyled:g.unstyled,mod:[`accordion-control`,{active:_,"chevron-position":g.chevronPosition,disabled:f},p],ref:t,onClick:e=>{l?.(e),g.onChange(h)},type:`button`,disabled:f,"aria-expanded":_,"aria-controls":g.getRegionId(h),id:g.getControlId(h),onKeyDown:ft({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:g.loop,orientation:`vertical`,onKeyDown:u}),children:[(0,R.jsx)(B,{component:`span`,mod:{rotate:!g.disableChevronRotation&&_,position:g.chevronPosition},...g.getStyles(`chevron`,{classNames:n,styles:a}),children:s||g.chevron}),(0,R.jsx)(`span`,{...g.getStyles(`label`,{classNames:n,styles:a}),children:d}),c&&(0,R.jsx)(B,{component:`span`,mod:{"chevron-position":g.chevronPosition},...g.getStyles(`icon`,{classNames:n,styles:a}),children:c})]});return v?(0,R.jsx)(y,{...g.getStyles(`itemTitle`,{classNames:n,styles:a}),children:b}):b});Bd.displayName=`@mantine/core/AccordionControl`,Bd.classes=Id;var Vd=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,value:s,mod:c,...l}=z(`AccordionItem`,null,e),u=Fd();return(0,R.jsx)(Rd,{value:{value:s},children:(0,R.jsx)(B,{ref:t,mod:[{active:u.isItemActive(s)},c],...u.getStyles(`item`,{className:r,classNames:n,styles:a,style:i,variant:u.variant}),...l})})});Vd.displayName=`@mantine/core/AccordionItem`,Vd.classes=Id;var Hd=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,...c}=z(`AccordionPanel`,null,e),{value:l}=zd(),u=Fd();return(0,R.jsx)(ca,{ref:t,...u.getStyles(`panel`,{className:r,classNames:n,style:i,styles:a}),...c,in:u.isItemActive(l),transitionDuration:u.transitionDuration??200,role:`region`,id:u.getRegionId(l),"aria-labelledby":u.getControlId(l),children:(0,R.jsx)(`div`,{...u.getStyles(`content`,{classNames:n,styles:a}),children:s})})});Hd.displayName=`@mantine/core/AccordionPanel`,Hd.classes=Id;var Ud={multiple:!1,disableChevronRotation:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16},Wd=jn((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:L(n),"--accordion-radius":r===void 0?void 0:yt(r)}}));function Gd(e){let t=z(`Accordion`,Ud,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,children:c,multiple:l,value:u,defaultValue:d,onChange:f,id:p,loop:m,transitionDuration:h,disableChevronRotation:g,chevronPosition:_,chevronSize:v,order:y,chevron:b,variant:x,radius:S,chevronIconSize:C,attributes:w,...T}=t,E=rn(p),[D,O]=hn({value:u,defaultValue:d,finalValue:l?[]:null,onChange:f}),k=e=>Array.isArray(D)?D.includes(e):e===D,A=e=>{let t=Array.isArray(D)?D.includes(e)?D.filter(t=>t!==e):[...D,e]:e===D?null:e;O(t)},j=si({name:`Accordion`,classes:Id,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:w,vars:s,varsResolver:Wd});return(0,R.jsx)(Pd,{value:{isItemActive:k,onChange:A,getControlId:st(`${E}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:st(`${E}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:b===null?null:b||(0,R.jsx)(Ld,{size:C}),transitionDuration:h,disableChevronRotation:g,chevronPosition:_,order:y,loop:m,getStyles:j,variant:x,unstyled:o},children:(0,R.jsx)(B,{...j(`root`),id:E,...T,variant:x,"data-accordion":!0,children:c})})}Gd.extend=e=>e,Gd.withProps=Yi(Gd),Gd.classes=Id,Gd.displayName=`@mantine/core/Accordion`,Gd.Item=Vd,Gd.Panel=Hd,Gd.Control=Bd,Gd.Chevron=Ld;var Kd={root:`m_66836ed3`,wrapper:`m_a5d60502`,body:`m_667c2793`,title:`m_6a03f287`,label:`m_698f4f23`,icon:`m_667f2a6a`,message:`m_7fa78076`,closeButton:`m_87f54839`},qd=jn((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||`light`,autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:yt(t),"--alert-bg":n||r?a.background:void 0,"--alert-color":a.color,"--alert-bd":n||r?a.border:void 0}}}),Jd=Xi((e,t)=>{let n=z(`Alert`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,radius:l,color:u,title:d,children:f,id:p,icon:m,withCloseButton:h,onClose:g,closeButtonLabel:_,variant:v,autoContrast:y,role:b,attributes:x,...S}=n,C=si({name:`Alert`,classes:Kd,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:x,vars:c,varsResolver:qd}),w=rn(p),T=d&&`${w}-title`||void 0,E=`${w}-body`;return(0,R.jsx)(B,{id:w,...C(`root`,{variant:v}),variant:v,ref:t,role:b||`alert`,...S,"aria-describedby":f?E:void 0,"aria-labelledby":d?T:void 0,children:(0,R.jsxs)(`div`,{...C(`wrapper`),children:[m&&(0,R.jsx)(`div`,{...C(`icon`),children:m}),(0,R.jsxs)(`div`,{...C(`body`),children:[d&&(0,R.jsx)(`div`,{...C(`title`),"data-with-close-button":h||void 0,children:(0,R.jsx)(`span`,{id:T,...C(`label`),children:d})}),f&&(0,R.jsx)(`div`,{id:E,...C(`message`),"data-variant":v,children:f})]}),h&&(0,R.jsx)(ju,{...C(`closeButton`),onClick:g,variant:`transparent`,size:16,iconSize:16,"aria-label":_,unstyled:s})]})})});Jd.classes=Kd,Jd.displayName=`@mantine/core/Alert`;var Yd={root:`m_b6d8b162`};function Xd(e){if(e===`start`)return`start`;if(e===`end`||e)return`end`}var Zd={inherit:!1},Qd=jn((e,{variant:t,lineClamp:n,gradient:r,size:i,color:a})=>({root:{"--text-fz":bt(i),"--text-lh":xt(i),"--text-gradient":t===`gradient`?sr(r,e):void 0,"--text-line-clamp":typeof n==`number`?n.toString():void 0,"--text-color":a?or(a,e):void 0}})),H=Zi((e,t)=>{let n=z(`Text`,Zd,e),{lineClamp:r,truncate:i,inline:a,inherit:o,gradient:s,span:c,__staticSelector:l,vars:u,className:d,style:f,classNames:p,styles:m,unstyled:h,variant:g,mod:_,size:v,attributes:y,...b}=n;return(0,R.jsx)(B,{...si({name:[`Text`,l],props:n,classes:Yd,className:d,style:f,classNames:p,styles:m,unstyled:h,attributes:y,vars:u,varsResolver:Qd})(`root`,{focusable:!0}),ref:t,component:c?`span`:`p`,variant:g,mod:[{"data-truncate":Xd(i),"data-line-clamp":typeof r==`number`,"data-inline":a,"data-inherit":o},_],size:v,...b})});H.classes=Yd,H.displayName=`@mantine/core/Text`;var $d={root:`m_849cf0da`},ef={underline:`hover`},tf=Zi((e,t)=>{let{underline:n,className:r,unstyled:i,mod:a,...o}=z(`Anchor`,ef,e);return(0,R.jsx)(H,{component:`a`,ref:t,className:Nn({[$d.root]:!i},r),...o,mod:[{underline:n},a],__staticSelector:`Anchor`,unstyled:i})});tf.classes=$d,tf.displayName=`@mantine/core/Anchor`;var[nf,rf]=at(`AppShell was not found in tree`),af={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`},of=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellAside`,null,e),f=rf();return f.disabled?null:(0,R.jsx)(B,{component:`aside`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`aside`,{className:Nn({[Ge.classNames.zeroRight]:f.offsetScrollbars},r),classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-aside-z-index":`calc(${l??f.zIndex} + 1)`}})});of.classes=af,of.displayName=`@mantine/core/AppShellAside`;var sf=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellFooter`,null,e),f=rf();return f.disabled?null:(0,R.jsx)(B,{component:`footer`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`footer`,{className:Nn({[Ge.classNames.zeroRight]:f.offsetScrollbars},r),classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-footer-z-index":(l??f.zIndex)?.toString()}})});sf.classes=af,sf.displayName=`@mantine/core/AppShellFooter`;var cf=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellHeader`,null,e),f=rf();return f.disabled?null:(0,R.jsx)(B,{component:`header`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`header`,{className:Nn({[Ge.classNames.zeroRight]:f.offsetScrollbars},r),classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-header-z-index":(l??f.zIndex)?.toString()}})});cf.classes=af,cf.displayName=`@mantine/core/AppShellHeader`;var lf=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`AppShellMain`,null,e);return(0,R.jsx)(B,{component:`main`,ref:t,...rf().getStyles(`main`,{className:r,style:i,classNames:n,styles:a}),...s})});lf.classes=af,lf.displayName=`@mantine/core/AppShellMain`;function uf(e){return typeof e==`object`?e.base:e}function df(e){let t=typeof e==`object`&&!!e&&e.base!==void 0&&Object.keys(e).length===1;return typeof e==`number`||typeof e==`string`||t}function ff(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function pf({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a}){let o=r?.width,s=`translateX(var(--app-shell-aside-width))`,c=`translateX(calc(var(--app-shell-aside-width) * -1))`;if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},a===`fixed`?(n[r?.breakpoint][`--app-shell-aside-width`]=`100%`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`):(n[r?.breakpoint][`--app-shell-aside-width`]=`0px`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`)),df(o)){let t=L(uf(o));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}if(ff(o)&&(o.base!==void 0&&(e[`--app-shell-aside-width`]=L(o.base),e[`--app-shell-aside-offset`]=L(o.base)),Ke(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=L(o[e]),t[e][`--app-shell-aside-offset`]=L(o[e]))})),r?.breakpoint&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-aside-position`]=`sticky`,t[r.breakpoint][`--app-shell-aside-grid-row`]=`2`,t[r.breakpoint][`--app-shell-aside-grid-column`]=`3`,t[r.breakpoint][`--app-shell-main-column-end`]=`3`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-aside-transform`]=s,t[e][`--app-shell-aside-transform-rtl`]=c,a===`fixed`?t[e][`--app-shell-aside-offset`]=`0px !important`:(t[e][`--app-shell-aside-width`]=`0px`,t[e][`--app-shell-aside-display`]=`none`,t[e][`--app-shell-main-column-end`]=`-1`),t[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}if(r?.collapsed?.mobile){let e=wt(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},a===`fixed`?(n[e][`--app-shell-aside-width`]=`100%`,n[e][`--app-shell-aside-offset`]=`0px`):n[e][`--app-shell-aside-width`]=`0px`,n[e][`--app-shell-aside-transform`]=s,n[e][`--app-shell-aside-transform-rtl`]=c,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}}function mf({baseStyles:e,minMediaStyles:t,footer:n,mode:r}){let i=n?.height,a=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-footer-position`]=`sticky`,e[`--app-shell-footer-grid-column`]=`1 / -1`,e[`--app-shell-footer-grid-row`]=`3`),df(i)){let t=L(uf(i));e[`--app-shell-footer-height`]=t,a&&(e[`--app-shell-footer-offset`]=t)}ff(i)&&(i.base!==void 0&&(e[`--app-shell-footer-height`]=L(i.base),a&&(e[`--app-shell-footer-offset`]=L(i.base))),Ke(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=L(i[e]),a&&(t[e][`--app-shell-footer-offset`]=L(i[e])))})),n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`))}function hf({baseStyles:e,minMediaStyles:t,header:n,mode:r}){let i=n?.height,a=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-header-position`]=`sticky`,e[`--app-shell-header-grid-column`]=`1 / -1`,e[`--app-shell-header-grid-row`]=`1`),df(i)){let t=L(uf(i));e[`--app-shell-header-height`]=t,a&&(e[`--app-shell-header-offset`]=t)}ff(i)&&(i.base!==void 0&&(e[`--app-shell-header-height`]=L(i.base),a&&(e[`--app-shell-header-offset`]=L(i.base))),Ke(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=L(i[e]),a&&(t[e][`--app-shell-header-offset`]=L(i[e])))})),n?.collapsed&&(e[`--app-shell-header-transform`]=`translateY(calc(var(--app-shell-header-height) * -1))`,r===`fixed`&&(e[`--app-shell-header-offset`]=`0px !important`))}function gf({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a}){let o=r?.width,s=`translateX(calc(var(--app-shell-navbar-width) * -1))`,c=`translateX(var(--app-shell-navbar-width))`;if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint][`--app-shell-navbar-offset`]=`0px`,n[r?.breakpoint][`--app-shell-navbar-width`]=`100%`,a===`static`&&(n[r?.breakpoint][`--app-shell-navbar-grid-width`]=`0px`)),df(o)){let t=L(uf(o));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}if(ff(o)&&(o.base!==void 0&&(e[`--app-shell-navbar-width`]=L(o.base),e[`--app-shell-navbar-offset`]=L(o.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=L(o.base))),Ke(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=L(o[e]),t[e][`--app-shell-navbar-offset`]=L(o[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=L(o[e])))})),r?.breakpoint&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-navbar-position`]=`sticky`,t[r.breakpoint][`--app-shell-navbar-grid-row`]=`2`,t[r.breakpoint][`--app-shell-navbar-grid-column`]=`1`,t[r.breakpoint][`--app-shell-main-column-start`]=`2`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-navbar-transform`]=s,t[e][`--app-shell-navbar-transform-rtl`]=c,a===`fixed`?t[e][`--app-shell-navbar-offset`]=`0px !important`:(t[e][`--app-shell-navbar-width`]=`0px`,t[e][`--app-shell-navbar-display`]=`none`,t[e][`--app-shell-main-column-start`]=`1`)}if(r?.collapsed?.mobile){let e=wt(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},n[e][`--app-shell-navbar-width`]=`100%`,n[e][`--app-shell-navbar-offset`]=`0px`,a===`static`&&(n[e][`--app-shell-navbar-grid-width`]=`0px`),n[e][`--app-shell-navbar-transform`]=s,n[e][`--app-shell-navbar-transform-rtl`]=c}}function _f(e){return Number(e)===0?`0px`:vt(e)}function vf({padding:e,baseStyles:t,minMediaStyles:n}){df(e)&&(t[`--app-shell-padding`]=_f(uf(e))),ff(e)&&(e.base&&(t[`--app-shell-padding`]=_f(e.base)),Ke(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=_f(e[t]))}))}function yf({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o}){let s={},c={},l={};o===`static`&&(l[`--app-shell-main-grid-column`]=`1 / -1`,l[`--app-shell-main-grid-row`]=`2`),gf({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,navbar:e,theme:a,mode:o}),pf({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,aside:r,theme:a,mode:o}),hf({baseStyles:l,minMediaStyles:s,header:t,mode:o}),mf({baseStyles:l,minMediaStyles:s,footer:n,mode:o}),vf({baseStyles:l,minMediaStyles:s,padding:i});let u=Tt(Ke(s),a.breakpoints).map(e=>({query:`(min-width: ${et(e.px)})`,styles:s[e.value]})),d=Tt(Ke(c),a.breakpoints).map(e=>({query:`(max-width: ${et(e.px)})`,styles:c[e.value]}));return{baseStyles:l,media:[...u,...d]}}function bf({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o}){let s=Cr(),c=zn(),{media:l,baseStyles:u}=yf({navbar:e,header:t,footer:r,aside:n,padding:i,theme:s,mode:a});return(0,R.jsx)(hi,{media:l,styles:u,selector:o||c.cssVariablesSelector})}var xf=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,withBorder:c,zIndex:l,mod:u,...d}=z(`AppShellNavbar`,null,e),f=rf();return f.disabled?null:(0,R.jsx)(B,{component:`nav`,ref:t,mod:[{"with-border":c??f.withBorder},u],...f.getStyles(`navbar`,{className:r,classNames:n,styles:a,style:i}),...d,__vars:{"--app-shell-navbar-z-index":`calc(${l??f.zIndex} + 1)`}})});xf.classes=af,xf.displayName=`@mantine/core/AppShellNavbar`;var Sf=Zi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,grow:s,mod:c,...l}=z(`AppShellSection`,null,e),u=rf();return(0,R.jsx)(B,{ref:t,mod:[{grow:s},c],...u.getStyles(`section`,{className:r,style:i,classNames:n,styles:a}),...l})});Sf.classes=af,Sf.displayName=`@mantine/core/AppShellSection`;function Cf({transitionDuration:e,disabled:t}){let[n,r]=(0,D.useState)(!0),i=(0,D.useRef)(-1),a=(0,D.useRef)(-1);return an(`resize`,()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>(0,D.startTransition)(()=>{r(!1)}),200)}),Bt(()=>{r(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>(0,D.startTransition)(()=>{r(!1)}),e||0)},[t,e]),n}var wf={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:mt(`app`),mode:`fixed`},Tf=jn((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}})),Ef=Xi((e,t)=>{let n=z(`AppShell`,wf,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,navbar:l,withBorder:u,padding:d,transitionDuration:f,transitionTimingFunction:p,header:m,zIndex:h,layout:g,disabled:_,aside:v,footer:y,offsetScrollbars:b=!0,mode:x,mod:S,attributes:C,id:w,...T}=n,E=si({name:`AppShell`,classes:af,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:C,vars:c,varsResolver:Tf}),D=Cf({disabled:_,transitionDuration:f}),O=rn(w);return(0,R.jsxs)(nf,{value:{getStyles:E,withBorder:u,zIndex:h,disabled:_,offsetScrollbars:b,mode:x},children:[(0,R.jsx)(bf,{navbar:l,header:m,aside:v,footer:y,padding:d,mode:x,selector:x===`static`?`#${O}`:void 0}),(0,R.jsx)(B,{ref:t,...E(`root`),mod:[{resizing:D,layout:g,disabled:_,mode:x},S],id:O,...T})]})});Ef.classes=af,Ef.displayName=`@mantine/core/AppShell`,Ef.Navbar=xf,Ef.Header=cf,Ef.Main=lf,Ef.Aside=of,Ef.Footer=sf,Ef.Section=Sf;function Df(e){return typeof e==`string`?{value:e,label:e}:`value`in e&&!(`label`in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e==`number`?{value:e.toString(),label:e.toString()}:`group`in e?{group:e.group,items:e.items.map(e=>Df(e))}:e}function Of(e){return e?e.map(e=>Df(e)):[]}function kf(e){return e.reduce((e,t)=>`group`in t?{...e,...kf(t.items)}:(e[t.value]=t,e),{})}var Af={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},jf={error:null},Mf=jn((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":_t(t,`combobox-chevron-size`),"--combobox-chevron-color":n?or(n,e):void 0}})),Nf=Xi((e,t)=>{let n=z(`ComboboxChevron`,jf,e),{size:r,error:i,style:a,className:o,classNames:s,styles:c,unstyled:l,vars:u,mod:d,...f}=n,p=si({name:`ComboboxChevron`,classes:Af,props:n,style:a,className:o,classNames:s,styles:c,unstyled:l,vars:u,varsResolver:Mf,rootSelector:`chevron`});return(0,R.jsx)(B,{component:`svg`,...f,...p(`chevron`),size:r,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:i},d],ref:t,children:(0,R.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});Nf.classes=Af,Nf.displayName=`@mantine/core/ComboboxChevron`;var[Pf,Ff]=at(`Combobox component was not found in tree`),If=(0,D.forwardRef)(({size:e,onMouseDown:t,onClick:n,onClear:r,...i},a)=>(0,R.jsx)(xd.ClearButton,{ref:a,tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:e=>{e.preventDefault(),t?.(e)},onClick:e=>{r(),n?.(e)}}));If.displayName=`@mantine/core/ComboboxClearButton`;var Lf=Xi((e,t)=>{let{classNames:n,styles:r,className:i,style:a,hidden:o,...s}=z(`ComboboxDropdown`,null,e),c=Ff();return(0,R.jsx)(uu.Dropdown,{...s,ref:t,role:`presentation`,"data-hidden":o||void 0,...c.getStyles(`dropdown`,{className:i,style:a,classNames:n,styles:r})})});Lf.classes=Af,Lf.displayName=`@mantine/core/ComboboxDropdown`;var Rf={refProp:`ref`},zf=Xi((e,t)=>{let{children:n,refProp:r}=z(`ComboboxDropdownTarget`,Rf,e);if(Ff(),!rt(n))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,R.jsx)(uu.Target,{ref:t,refProp:r,children:n})});zf.displayName=`@mantine/core/ComboboxDropdownTarget`;var Bf=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ComboboxEmpty`,null,e);return(0,R.jsx)(B,{ref:t,...Ff().getStyles(`empty`,{className:r,classNames:n,styles:a,style:i}),...s})});Bf.classes=Af,Bf.displayName=`@mantine/core/ComboboxEmpty`;function Vf({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:i,autoComplete:a}){let o=Ff(),[s,c]=(0,D.useState)(null),l=n=>{if(e?.(n),!o.readOnly&&t){if(n.nativeEvent.isComposing)return;if(n.nativeEvent.code===`ArrowDown`&&(n.preventDefault(),o.store.dropdownOpened?c(o.store.selectNextOption()):(o.store.openDropdown(`keyboard`),c(o.store.selectActiveOption()),o.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),n.nativeEvent.code===`ArrowUp`&&(n.preventDefault(),o.store.dropdownOpened?c(o.store.selectPreviousOption()):(o.store.openDropdown(`keyboard`),c(o.store.selectActiveOption()),o.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),n.nativeEvent.code===`Enter`||n.nativeEvent.code===`NumpadEnter`){if(n.nativeEvent.keyCode===229)return;let e=o.store.getSelectedOptionIndex();o.store.dropdownOpened&&e!==-1?(n.preventDefault(),o.store.clickSelectedOption()):i===`button`&&(n.preventDefault(),o.store.openDropdown(`keyboard`))}n.key===`Escape`&&o.store.closeDropdown(`keyboard`),n.nativeEvent.code===`Space`&&i===`button`&&(n.preventDefault(),o.store.toggleDropdown(`keyboard`))}};return{...n?{"aria-haspopup":`listbox`,"aria-expanded":r?!!(o.store.listId&&o.store.dropdownOpened):void 0,"aria-controls":o.store.dropdownOpened&&o.store.listId?o.store.listId:void 0,"aria-activedescendant":o.store.dropdownOpened&&s||void 0,autoComplete:a,"data-expanded":o.store.dropdownOpened||void 0,"data-mantine-stop-propagation":o.store.dropdownOpened||void 0}:{},onKeyDown:l}}var Hf={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Uf=Xi((e,t)=>{let{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:a,withExpandedAttribute:o,targetType:s,autoComplete:c,...l}=z(`ComboboxEventsTarget`,Hf,e),u=An(n);if(!u)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let d=Ff();return(0,D.cloneElement)(u,{...Vf({targetType:s,withAriaAttributes:a,withKeyboardNavigation:i,withExpandedAttribute:o,onKeyDown:u.props.onKeyDown,autoComplete:c}),...l,[r]:mn(t,d.store.targetRef,En(u))})});Uf.displayName=`@mantine/core/ComboboxEventsTarget`;var Wf=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ComboboxFooter`,null,e);return(0,R.jsx)(B,{ref:t,...Ff().getStyles(`footer`,{className:r,classNames:n,style:i,styles:a}),...s,onMouseDown:e=>{e.preventDefault()}})});Wf.classes=Af,Wf.displayName=`@mantine/core/ComboboxFooter`;var Gf=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,label:c,id:l,...u}=z(`ComboboxGroup`,null,e),d=Ff(),f=rn(l);return(0,R.jsxs)(B,{ref:t,role:`group`,"aria-labelledby":c?f:void 0,...d.getStyles(`group`,{className:r,classNames:n,style:i,styles:a}),...u,children:[c&&(0,R.jsx)(`div`,{id:f,...d.getStyles(`groupLabel`,{classNames:n,styles:a}),children:c}),s]})});Gf.classes=Af,Gf.displayName=`@mantine/core/ComboboxGroup`;var Kf=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ComboboxHeader`,null,e);return(0,R.jsx)(B,{ref:t,...Ff().getStyles(`header`,{className:r,classNames:n,style:i,styles:a}),...s,onMouseDown:e=>{e.preventDefault()}})});Kf.classes=Af,Kf.displayName=`@mantine/core/ComboboxHeader`;function qf({value:e,valuesDivider:t=`,`,...n}){return(0,R.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e||``,...n})}qf.displayName=`@mantine/core/ComboboxHiddenInput`;var Jf=Xi((e,t)=>{let n=z(`ComboboxOption`,null,e),{classNames:r,className:i,style:a,styles:o,vars:s,onClick:c,id:l,active:u,onMouseDown:d,onMouseOver:f,disabled:p,selected:m,mod:h,...g}=n,_=Ff(),v=(0,D.useId)(),y=l||v;return(0,R.jsx)(B,{..._.getStyles(`option`,{className:i,classNames:r,styles:o,style:a}),...g,ref:t,id:y,mod:[`combobox-option`,{"combobox-active":u,"combobox-disabled":p,"combobox-selected":m},h],role:`option`,onClick:e=>{p?e.preventDefault():(_.onOptionSubmit?.(n.value,n),c?.(e))},onMouseDown:e=>{e.preventDefault(),d?.(e)},onMouseOver:e=>{_.resetSelectionOnOptionHover&&_.store.resetSelectedOption(),f?.(e)}})});Jf.classes=Af,Jf.displayName=`@mantine/core/ComboboxOption`;var Yf=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,id:o,onMouseDown:s,labelledBy:c,...l}=z(`ComboboxOptions`,null,e),u=Ff(),d=rn(o);return(0,D.useEffect)(()=>{u.store.setListId(d)},[d]),(0,R.jsx)(B,{ref:t,...u.getStyles(`options`,{className:r,style:i,classNames:n,styles:a}),...l,id:d,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});Yf.classes=Af,Yf.displayName=`@mantine/core/ComboboxOptions`;var Xf={withAriaAttributes:!0,withKeyboardNavigation:!0},Zf=Xi((e,t)=>{let{classNames:n,styles:r,unstyled:i,vars:a,withAriaAttributes:o,onKeyDown:s,withKeyboardNavigation:c,size:l,...u}=z(`ComboboxSearch`,Xf,e),d=Ff(),f=d.getStyles(`search`),p=Vf({targetType:`input`,withAriaAttributes:o,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:s,autoComplete:`off`});return(0,R.jsx)(xd,{ref:mn(t,d.store.searchRef),classNames:[{input:f.className},n],styles:[{input:f.style},r],size:l||d.size,...p,...u,__staticSelector:`Combobox`})});Zf.classes=Af,Zf.displayName=`@mantine/core/ComboboxSearch`;var Qf={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},$f=Xi((e,t)=>{let{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:a,withExpandedAttribute:o,targetType:s,autoComplete:c,...l}=z(`ComboboxTarget`,Qf,e),u=An(n);if(!u)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let d=Ff(),f=(0,D.cloneElement)(u,{...Vf({targetType:s,withAriaAttributes:a,withKeyboardNavigation:i,withExpandedAttribute:o,onKeyDown:u.props.onKeyDown,autoComplete:c}),...l});return(0,R.jsx)(uu.Target,{ref:mn(t,d.store.targetRef),children:f})});$f.displayName=`@mantine/core/ComboboxTarget`;function ep(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function tp(e,t,n){for(let n=e+1;n<t.length;n+=1)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=0;e<t.length;e+=1)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function np(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute(`data-combobox-disabled`))return t;return-1}function rp({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:a=!0,scrollBehavior:o=`instant`}={}){let[s,c]=hn({value:t,defaultValue:e,finalValue:!1,onChange:n}),l=(0,D.useRef)(null),u=(0,D.useRef)(-1),d=(0,D.useRef)(null),f=(0,D.useRef)(null),p=(0,D.useRef)(-1),m=(0,D.useRef)(-1),h=(0,D.useRef)(-1),g=(0,D.useCallback)((e=`unknown`)=>{s||(c(!0),i?.(e))},[c,i,s]),_=(0,D.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,D.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,D.useCallback)(()=>{let e=kn(f.current),t=Dn(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,D.useCallback)(e=>{let t=kn(f.current),n=Dn(`#${l.current}`,t),r=n?On(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,D.useCallback)(()=>{let e=kn(f.current),t=Dn(`#${l.current} [data-combobox-active]`,e);if(t){let n=On(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,D.useCallback)(()=>{let e=kn(f.current),t=On(`#${l.current} [data-combobox-option]`,e);return b(tp(u.current,t,a))},[b,a]),C=(0,D.useCallback)(()=>{let e=kn(f.current),t=On(`#${l.current} [data-combobox-option]`,e);return b(ep(u.current,t,a))},[b,a]),w=(0,D.useCallback)(()=>{let e=kn(f.current),t=On(`#${l.current} [data-combobox-option]`,e);return b(np(t))},[b]),T=(0,D.useCallback)((e=`selected`,t)=>{h.current=window.setTimeout(()=>{let n=kn(f.current),r=On(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,D.useCallback)(()=>{u.current=-1,y()},[y]),O=(0,D.useCallback)(()=>{let e=kn(f.current);(On(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),k=(0,D.useCallback)(e=>{l.current=e},[]),A=(0,D.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),j=(0,D.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),M=(0,D.useCallback)(()=>u.current,[]);return(0,D.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:M,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:k,clickSelectedOption:O,searchRef:d,focusSearchInput:A,targetRef:f,focusTarget:j}}var ip={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},ap=jn((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":bt(t),"--combobox-option-padding":_t(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:L(n),"--combobox-option-fz":bt(t),"--combobox-option-padding":_t(t,`combobox-option-padding`)}}));function op(e){let t=z(`Combobox`,ip,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:l,size:u,dropdownPadding:d,resetSelectionOnOptionHover:f,__staticSelector:p,readOnly:m,attributes:h,...g}=t,_=rp(),v=o||_,y=si({name:p||`Combobox`,classes:Af,props:t,classNames:n,styles:r,unstyled:i,attributes:h,vars:s,varsResolver:ap}),b=()=>{l?.(),v.closeDropdown()};return(0,R.jsx)(Pf,{value:{getStyles:y,store:v,onOptionSubmit:c,size:u,resetSelectionOnOptionHover:f,readOnly:m},children:(0,R.jsx)(uu,{opened:v.dropdownOpened,preventPositionChangeWhenVisible:!1,...g,onChange:e=>!e&&b(),withRoles:!1,unstyled:i,children:a})})}op.extend=e=>e,op.classes=Af,op.displayName=`@mantine/core/Combobox`,op.Target=$f,op.Dropdown=Lf,op.Options=Yf,op.Option=Jf,op.Search=Zf,op.Empty=Bf,op.Chevron=Nf,op.Footer=Wf,op.Header=Kf,op.EventsTarget=Uf,op.DropdownTarget=zf,op.Group=Gf,op.ClearButton=If,op.HiddenInput=qf;var sp={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},cp=sp,lp=(0,D.forwardRef)(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:a,children:o,label:s,description:c,id:l,disabled:u,error:d,size:f,labelPosition:p=`left`,bodyElement:m=`div`,labelElement:h=`label`,variant:g,style:_,vars:v,mod:y,attributes:b,...x},S)=>{let C=si({name:e,props:t,className:n,style:_,classes:sp,classNames:r,styles:i,unstyled:a,attributes:b});return(0,R.jsx)(B,{...C(`root`),ref:S,__vars:{"--label-fz":bt(f),"--label-lh":_t(f,`label-lh`)},mod:[{"label-position":p},y],variant:g,size:f,...x,children:(0,R.jsxs)(B,{component:m,htmlFor:m===`label`?l:void 0,...C(`body`),children:[o,(0,R.jsxs)(`div`,{...C(`labelWrapper`),"data-disabled":u||void 0,children:[s&&(0,R.jsx)(B,{component:h,htmlFor:h===`label`?l:void 0,...C(`label`),"data-disabled":u||void 0,children:s}),c&&(0,R.jsx)(xd.Description,{size:f,__inheritStyles:!1,...C(`description`),children:c}),d&&typeof d!=`boolean`&&(0,R.jsx)(xd.Error,{size:f,__inheritStyles:!1,...C(`error`),children:d})]})]})})});lp.displayName=`@mantine/core/InlineInput`;var up={root:`m_bf2d988c`,inner:`m_26062bec`,input:`m_26063560`,icon:`m_bf295423`,"input--outline":`m_215c4542`},dp=(0,D.createContext)(null),fp=dp.Provider,pp=()=>(0,D.useContext)(dp),[mp,hp]=ot(),gp={card:`m_26775b0a`},_p={withBorder:!0},vp=jn((e,{radius:t})=>({card:{"--card-radius":yt(t)}})),yp=Xi((e,t)=>{let n=z(`CheckboxCard`,_p,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,checked:l,mod:u,withBorder:d,value:f,onClick:p,defaultChecked:m,onChange:h,attributes:g,..._}=n,v=si({name:`CheckboxCard`,classes:gp,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:vp,rootSelector:`card`}),y=pp(),[b,x]=hn({value:typeof l==`boolean`?l:y?y.value.includes(f||``):void 0,defaultValue:m,finalValue:!1,onChange:h});return(0,R.jsx)(mp,{value:{checked:b},children:(0,R.jsx)(wl,{ref:t,mod:[{"with-border":d,checked:b},u],...v(`card`),..._,role:`checkbox`,"aria-checked":b,onClick:e=>{p?.(e),y?.onChange(f||``),x(!b)}})})});yp.displayName=`@mantine/core/CheckboxCard`,yp.classes=gp;function bp({children:e,role:t}){let n=od();return n?(0,R.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,R.jsx)(R.Fragment,{children:e})}var xp=Xi((e,t)=>{let{value:n,defaultValue:r,onChange:i,size:a,wrapperProps:o,children:s,readOnly:c,disabled:l,...u}=z(`CheckboxGroup`,null,e),[d,f]=hn({value:n,defaultValue:r,finalValue:[],onChange:i});return(0,R.jsx)(fp,{value:{value:d,onChange:e=>{let t=typeof e==`string`?e:e.currentTarget.value;!c&&f(d.includes(t)?d.filter(e=>e!==t):[...d,t])},size:a,disabled:l},children:(0,R.jsx)(xd.Wrapper,{size:a,ref:t,...o,...u,labelElement:`div`,__staticSelector:`CheckboxGroup`,children:(0,R.jsx)(bp,{role:`group`,children:s})})})});xp.classes=xd.Wrapper.classes,xp.displayName=`@mantine/core/CheckboxGroup`;function Sp({size:e,style:t,...n}){return(0,R.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:e===void 0?t:{width:L(e),height:L(e),...t},"aria-hidden":!0,...n,children:(0,R.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function Cp({indeterminate:e,...t}){return e?(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 32 6`,"aria-hidden":!0,...t,children:(0,R.jsx)(`rect`,{width:`32`,height:`6`,fill:`currentColor`,rx:`3`})}):(0,R.jsx)(Sp,{...t})}var wp={indicator:`m_5e5256ee`,icon:`m_1b1c543a`,"indicator--outline":`m_76e20374`},Tp={icon:Cp,variant:`filled`},Ep=jn((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--checkbox-size":_t(r,`checkbox-size`),"--checkbox-radius":t===void 0?void 0:yt(t),"--checkbox-color":a===`outline`?c:or(n,e),"--checkbox-icon-color":i?or(i,e):ci(o,e)?Or({color:n,theme:e,autoContrast:o}):void 0}}}),Dp=Xi((e,t)=>{let n=z(`CheckboxIndicator`,Tp,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,icon:l,indeterminate:u,radius:d,color:f,iconColor:p,autoContrast:m,checked:h,mod:g,variant:_,disabled:v,attributes:y,...b}=n,x=si({name:`CheckboxIndicator`,classes:wp,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:y,vars:c,varsResolver:Ep,rootSelector:`indicator`}),S=hp(),C=typeof h==`boolean`||typeof u==`boolean`?h||u:S?.checked||!1;return(0,R.jsx)(B,{ref:t,...x(`indicator`,{variant:_}),variant:_,mod:[{checked:C,disabled:v},g],...b,children:(0,R.jsx)(l,{indeterminate:u,...x(`icon`)})})});Dp.displayName=`@mantine/core/CheckboxIndicator`,Dp.classes=wp;var Op={labelPosition:`right`,icon:Cp,variant:`filled`},kp=jn((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--checkbox-size":_t(r,`checkbox-size`),"--checkbox-radius":t===void 0?void 0:yt(t),"--checkbox-color":a===`outline`?c:or(n,e),"--checkbox-icon-color":i?or(i,e):ci(o,e)?Or({color:n,theme:e,autoContrast:o}):void 0}}}),Ap=Xi((e,t)=>{let n=z(`Checkbox`,Op,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,label:u,id:d,size:f,radius:p,wrapperProps:m,checked:h,labelPosition:g,description:_,error:v,disabled:y,variant:b,indeterminate:x,icon:S,rootRef:C,iconColor:w,onChange:T,autoContrast:E,mod:O,attributes:k,...A}=n,j=pp(),M=f||j?.size,N=si({name:`Checkbox`,props:n,classes:up,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:k,vars:c,varsResolver:kp}),{styleProps:ee,rest:te}=gi(A),P=rn(d),F={checked:j?.value.includes(te.value)??h,onChange:e=>{j?.onChange(e),T?.(e)},disabled:j?.disabled??y},I=(0,D.useRef)(null),ne=t||I;return(0,D.useEffect)(()=>{ne&&`current`in ne&&ne.current&&(ne.current.indeterminate=x||!1,x?ne.current.setAttribute(`data-indeterminate`,`true`):ne.current.removeAttribute(`data-indeterminate`))},[x,ne]),(0,R.jsx)(lp,{...N(`root`),__staticSelector:`Checkbox`,__stylesApiProps:n,id:P,size:M,labelPosition:g,label:u,description:_,error:v,disabled:F.disabled,classNames:r,styles:o,unstyled:s,"data-checked":F.checked||h||void 0,variant:b,ref:C,mod:O,inert:te.inert,...ee,...m,children:(0,R.jsxs)(B,{...N(`inner`),mod:{"data-label-position":g},children:[(0,R.jsx)(B,{component:`input`,id:P,ref:ne,mod:{error:!!v},...N(`input`,{focusable:!0,variant:b}),...te,...F,inert:te.inert,type:`checkbox`}),(0,R.jsx)(S,{indeterminate:x,...N(`icon`)})]})})});Ap.classes={...up,...cp},Ap.displayName=`@mantine/core/Checkbox`,Ap.Group=xp,Ap.Indicator=Dp,Ap.Card=yp;function jp(e){return`group`in e}function Mp({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a<e.length;a+=1){let o=e[a];if(i.length===n)return i;jp(o)&&i.push({group:o.group,items:Mp({options:o.items,search:t,limit:n-i.length})}),jp(o)||o.label.toLowerCase().includes(r)&&i.push(o)}return i}function Np(e){if(e.length===0)return!0;for(let t of e)if(!(`group`in t)||t.items.length>0)return!1;return!0}function Pp(e,t=new Set){if(Array.isArray(e))for(let n of e)if(jp(n))Pp(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(typeof n.value!=`string`)throw Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function Fp(e,t){return Array.isArray(e)?e.includes(t):e===t}function Ip({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!jp(e)){let s=Fp(r,e.value),c=t&&(s?(0,R.jsx)(Sp,{className:Af.optionsDropdownCheckIcon}):n?(0,R.jsx)(`div`,{className:Af.optionsDropdownCheckPlaceholder}):null),l=(0,R.jsxs)(R.Fragment,{children:[i===`left`&&c,(0,R.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,R.jsx)(op.Option,{value:e.value,disabled:e.disabled,className:Nn({[Af.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,R.jsx)(Ip,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},e.value));return(0,R.jsx)(op.Group,{label:e.group,children:s})}function Lp({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,withScrollArea:s=!0,filterOptions:c=!0,withCheckIcon:l=!1,withAlignedLabels:u=!1,value:d,checkIconPosition:f,nothingFoundMessage:p,unstyled:m,labelId:h,renderOption:g,scrollAreaProps:_,"aria-label":v}){Pp(e);let y=typeof i==`string`?(r||Mp)({options:e,search:c?i:``,limit:a??1/0}):e,b=Np(y),x=y.map(e=>(0,R.jsx)(Ip,{data:e,withCheckIcon:l,withAlignedLabels:u,value:d,checkIconPosition:f,unstyled:m,renderOption:g},jp(e)?e.group:e.value));return(0,R.jsx)(op.Dropdown,{hidden:t||n&&b,"data-composed":!0,children:(0,R.jsxs)(op.Options,{labelledBy:h,"aria-label":v,children:[s?(0,R.jsx)(bl.Autosize,{mah:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,..._,children:x}):x,b&&p&&(0,R.jsx)(op.Empty,{children:p})]})})}var Rp=Xi((e,t)=>{let n=z(`Autocomplete`,null,e),{classNames:r,styles:i,unstyled:a,vars:o,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,size:k,id:A,renderOption:j,autoComplete:M,scrollAreaProps:N,onClear:ee,clearButtonProps:te,error:P,clearable:F,rightSection:I,autoSelectOnBlur:ne,openOnFocus:re=!0,attributes:ie,...ae}=n,oe=rn(A),se=Of(h),ce=kf(se),[le,ue]=hn({value:g,defaultValue:_,finalValue:``,onChange:m}),de=rp({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y&&de.selectFirstOption()},onDropdownClose:()=>{l?.(),setTimeout(de.resetSelectedOption,0)}}),fe=e=>{ue(e),de.resetSelectedOption()},{resolvedClassNames:pe,resolvedStyles:me}=Wr({props:n,styles:i,classNames:r});(0,D.useEffect)(()=>{v&&de.selectFirstOption()},[v,le]);let he=(0,R.jsx)(op.ClearButton,{...te,onClear:()=>{fe(``),ee?.()}});return(0,R.jsxs)(op,{store:de,__staticSelector:`Autocomplete`,classNames:pe,styles:me,unstyled:a,readOnly:S,size:k,attributes:ie,keepMounted:ne,onOptionSubmit:e=>{b?.(e),fe(ce[e].label),de.closeDropdown()},...x,children:[(0,R.jsx)(op.Target,{autoComplete:M,children:(0,R.jsx)(wd,{ref:t,...ae,size:k,__staticSelector:`Autocomplete`,__clearSection:he,__clearable:F&&!!le&&!C&&!S,rightSection:I,disabled:C,readOnly:S,value:le,error:P,onChange:e=>{fe(e.currentTarget.value),de.openDropdown(),v&&de.selectFirstOption()},onFocus:e=>{re&&de.openDropdown(),d?.(e)},onBlur:e=>{ne&&de.clickSelectedOption(),de.closeDropdown(),f?.(e)},onClick:e=>{de.openDropdown(),p?.(e)},classNames:pe,styles:me,unstyled:a,attributes:ie,id:oe})}),(0,R.jsx)(Lp,{data:se,hidden:S||C,filter:w,search:le,limit:T,hiddenWhenEmpty:!0,withScrollArea:E,maxDropdownHeight:O,unstyled:a,labelId:ae.label?`${oe}-label`:void 0,"aria-label":ae.label?void 0:ae[`aria-label`],renderOption:j,scrollAreaProps:N})]})});Rp.classes={...wd.classes,...op.classes},Rp.displayName=`@mantine/core/Autocomplete`;var zp={root:`m_347db0ec`,"root--dot":`m_fbd81e3d`,label:`m_5add502a`,section:`m_91fdda9b`},Bp=jn((e,{radius:t,color:n,gradient:r,variant:i,size:a,autoContrast:o,circle:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:o});return{root:{"--badge-height":_t(a,`badge-height`),"--badge-padding-x":_t(a,`badge-padding-x`),"--badge-fz":_t(a,`badge-fz`),"--badge-radius":s||t===void 0?void 0:yt(t),"--badge-bg":n||i?c.background:void 0,"--badge-color":n||i?c.color:void 0,"--badge-bd":n||i?c.border:void 0,"--badge-dot-color":i===`dot`?or(n,e):void 0}}}),Vp=Zi((e,t)=>{let n=z(`Badge`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,radius:l,color:u,gradient:d,leftSection:f,rightSection:p,children:m,variant:h,fullWidth:g,autoContrast:_,circle:v,mod:y,attributes:b,...x}=n,S=si({name:`Badge`,props:n,classes:zp,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:b,vars:c,varsResolver:Bp});return(0,R.jsxs)(B,{variant:h,mod:[{block:g,circle:v,"with-right-section":!!p,"with-left-section":!!f},y],...S(`root`,{variant:h}),ref:t,...x,children:[f&&(0,R.jsx)(`span`,{...S(`section`),"data-position":`left`,children:f}),(0,R.jsx)(`span`,{...S(`label`),children:m}),p&&(0,R.jsx)(`span`,{...S(`section`),"data-position":`right`,children:p})]})});Vp.classes=zp,Vp.displayName=`@mantine/core/Badge`;var Hp={root:`m_77c9d27d`,inner:`m_80f1301b`,label:`m_811560b9`,section:`m_a74036a`,loader:`m_a25b86ee`,group:`m_80d6d844`,groupSection:`m_70be2a01`},Up={orientation:`horizontal`},Wp=jn((e,{borderWidth:t})=>({group:{"--button-border-width":L(t)}})),Gp=Xi((e,t)=>{let n=z(`ButtonGroup`,Up,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,attributes:p,...m}=z(`ButtonGroup`,Up,e);return(0,R.jsx)(B,{...si({name:`ButtonGroup`,props:n,classes:Hp,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:l,varsResolver:Wp,rootSelector:`group`})(`group`),ref:t,variant:d,mod:[{"data-orientation":c},f],role:`group`,...m})});Gp.classes=Hp,Gp.displayName=`@mantine/core/ButtonGroup`;var Kp=jn((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":_t(o,`section-height`),"--section-padding-x":_t(o,`section-padding-x`),"--section-fz":o?.includes(`compact`)?bt(o.replace(`compact-`,``)):bt(o),"--section-radius":t===void 0?void 0:yt(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),qp=Xi((e,t)=>{let n=z(`ButtonGroupSection`,null,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=n;return(0,R.jsx)(B,{...si({name:`ButtonGroupSection`,props:n,classes:Hp,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:Kp,rootSelector:`groupSection`})(`groupSection`),ref:t,variant:l,...m})});qp.classes=Hp,qp.displayName=`@mantine/core/ButtonGroupSection`;var Jp={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${L(1)}))`},out:{opacity:0,transform:`translate(-50%, -200%)`},common:{transformOrigin:`center`},transitionProperty:`transform, opacity`},Yp=jn((e,{radius:t,color:n,gradient:r,variant:i,size:a,justify:o,autoContrast:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:s});return{root:{"--button-justify":o,"--button-height":_t(a,`button-height`),"--button-padding-x":_t(a,`button-padding-x`),"--button-fz":a?.includes(`compact`)?bt(a.replace(`compact-`,``)):bt(a),"--button-radius":t===void 0?void 0:yt(t),"--button-bg":n||i?c.background:void 0,"--button-hover":n||i?c.hover:void 0,"--button-color":c.color,"--button-bd":n||i?c.border:void 0,"--button-hover-color":n||i?c.hoverColor:void 0}}}),Xp=Zi((e,t)=>{let n=z(`Button`,null,e),{style:r,vars:i,className:a,color:o,disabled:s,children:c,leftSection:l,rightSection:u,fullWidth:d,variant:f,radius:p,loading:m,loaderProps:h,gradient:g,classNames:_,styles:v,unstyled:y,"data-disabled":b,autoContrast:x,mod:S,attributes:C,...w}=n,T=si({name:`Button`,props:n,classes:Hp,className:a,style:r,classNames:_,styles:v,unstyled:y,attributes:C,vars:i,varsResolver:Yp}),E=!!l,D=!!u;return(0,R.jsxs)(wl,{ref:t,...T(`root`,{active:!s&&!m&&!b}),unstyled:y,variant:f,disabled:s||m,mod:[{disabled:s||b,loading:m,block:d,"with-left-section":E,"with-right-section":D},S],...w,children:[typeof m==`boolean`&&(0,R.jsx)(Xl,{mounted:m,transition:Jp,duration:150,children:e=>(0,R.jsx)(B,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,R.jsx)(vu,{color:`var(--button-color)`,size:`calc(var(--button-height) / 1.8)`,...h})})}),(0,R.jsxs)(`span`,{...T(`inner`),children:[l&&(0,R.jsx)(B,{component:`span`,...T(`section`),mod:{position:`left`},children:l}),(0,R.jsx)(B,{component:`span`,mod:{loading:m},...T(`label`),children:c}),u&&(0,R.jsx)(B,{component:`span`,...T(`section`),mod:{position:`right`},children:u})]})]})});Xp.classes=Hp,Xp.displayName=`@mantine/core/Button`,Xp.Group=Gp,Xp.GroupSection=qp;var[Zp,eee]=at(`Card component was not found in tree`),Qp={root:`m_e615b15f`,section:`m_599a2148`},$p=Zi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,withBorder:s,inheritPadding:c,mod:l,...u}=z(`CardSection`,null,e),d=eee();return(0,R.jsx)(B,{ref:t,mod:[{"with-border":s,"inherit-padding":c},l],...d.getStyles(`section`,{className:r,style:i,styles:a,classNames:n}),...u})});$p.classes=Qp,$p.displayName=`@mantine/core/CardSection`;var em=jn((e,{padding:t})=>({root:{"--card-padding":vt(t)}})),tm=Zi((e,t)=>{let n=z(`Card`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,padding:u,attributes:d,...f}=n,p=si({name:`Card`,props:n,classes:Qp,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:d,vars:c,varsResolver:em}),m=D.Children.toArray(l),h=m.map((e,t)=>typeof e==`object`&&e&&`type`in e&&e.type===$p?(0,D.cloneElement)(e,{"data-first-section":t===0||void 0,"data-last-section":t===m.length-1||void 0}):e);return(0,R.jsx)(Zp,{value:{getStyles:p},children:(0,R.jsx)(kl,{ref:t,unstyled:s,...p(`root`),...f,children:h})})});tm.classes=Qp,tm.displayName=`@mantine/core/Card`,tm.Section=$p;var nm={root:`m_b183c0a2`},rm=jn((e,{color:t})=>({root:{"--code-bg":t?or(t,e):void 0}})),im=Xi((e,t)=>{let n=z(`Code`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,block:u,variant:d,mod:f,attributes:p,...m}=n,h=si({name:`Code`,props:n,classes:nm,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:rm});return(0,R.jsx)(B,{component:u?`pre`:`code`,variant:d,ref:t,mod:[{block:u},f],...h(`root`),...m,dir:`ltr`})});im.classes=nm,im.displayName=`@mantine/core/Code`;var am={timeout:1e3};function om(e){let{children:t,timeout:n,value:r,...i}=z(`CopyButton`,am,e),a=Ft({timeout:n});return(0,R.jsx)(R.Fragment,{children:t({copy:()=>a.copy(r),copied:a.copied,...i})})}om.displayName=`@mantine/core/CopyButton`;var sm={root:`m_3eebeb36`,label:`m_9e365f20`},tee={orientation:`horizontal`},cm=jn((e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?or(t,e):void 0,"--divider-border-style":n,"--divider-size":_t(r,`divider-size`)}})),lm=Xi((e,t)=>{let n=z(`Divider`,tee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,orientation:u,label:d,labelPosition:f,mod:p,attributes:m,...h}=n,g=si({name:`Divider`,classes:sm,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:cm});return(0,R.jsx)(B,{ref:t,mod:[{orientation:u,"with-label":!!d},p],...g(`root`),...h,role:`separator`,children:d&&(0,R.jsx)(B,{component:`span`,mod:{position:f},...g(`label`),children:d})})});lm.classes=sm,lm.displayName=`@mantine/core/Divider`;var um={multiple:!1},dm=(0,D.forwardRef)((e,t)=>{let{onChange:n,children:r,multiple:i,accept:a,name:o,form:s,resetRef:c,disabled:l,capture:u,inputProps:d,...f}=z(`FileButton`,um,e),p=(0,D.useRef)(null),m=()=>{!l&&p.current?.click()};return fn(c,()=>{p.current&&(p.current.value=``)}),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`input`,{style:{display:`none`},type:`file`,accept:a,multiple:i,onChange:e=>{if(e.currentTarget.files===null)return n(i?[]:null);n(i?Array.from(e.currentTarget.files):e.currentTarget.files[0]||null)},ref:mn(t,p),name:o,form:s,capture:u,...d}),r({onClick:m,...f})]})});dm.displayName=`@mantine/core/FileButton`;var fm={root:`m_9e117634`},pm=jn((e,{radius:t,fit:n})=>({root:{"--image-radius":t===void 0?void 0:yt(t),"--image-object-fit":n}})),mm=Zi((e,t)=>{let n=z(`Image`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,onError:l,src:u,radius:d,fit:f,fallbackSrc:p,mod:m,attributes:h,...g}=n,[_,v]=(0,D.useState)(!u);(0,D.useEffect)(()=>v(!u),[u]);let y=si({name:`Image`,classes:fm,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:h,vars:c,varsResolver:pm});return _&&p?(0,R.jsx)(B,{component:`img`,ref:t,src:p,...y(`root`),onError:l,mod:[`fallback`,m],...g}):(0,R.jsx)(B,{component:`img`,ref:t,...y(`root`),src:u,onError:e=>{l?.(e),v(!0)},mod:m,...g})});mm.classes=fm,mm.displayName=`@mantine/core/Image`;function hm(){return hm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hm.apply(null,arguments)}function gm(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var nee=D.useLayoutEffect,_m=function(e){var t=D.useRef(e);return nee(function(){t.current=e}),t},vm=function(e,t){if(typeof e==`function`){e(t);return}e.current=t},ym=function(e,t){var n=D.useRef();return D.useCallback(function(r){e.current=r,n.current&&vm(n.current,null),n.current=t,t&&vm(t,r)},[t])},bm={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`},xm=function(e){Object.keys(bm).forEach(function(t){e.style.setProperty(t,bm[t],`important`)})},Sm=null,Cm=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize};function wm(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Sm||(Sm=document.createElement(`textarea`),Sm.setAttribute(`tabindex`,`-1`),Sm.setAttribute(`aria-hidden`,`true`),xm(Sm)),Sm.parentNode===null&&document.body.appendChild(Sm);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach(function(e){var t=e;Sm.style[t]=o[t]}),xm(Sm),Sm.value=t;var c=Cm(Sm,e);Sm.value=t,c=Cm(Sm,e),Sm.value=`x`;var l=Sm.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);var d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}var Tm=function(){},Em=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},Dm=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],Om=!!document.documentElement.currentStyle,km=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n=Em(Dm,t),r=n.boxSizing;return r===``?null:(Om&&r===`border-box`&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+`px`),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function Am(e,t,n){var r=_m(n);D.useLayoutEffect(function(){var n=function(e){return r.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var jm=function(e,t){Am(document.body,`reset`,function(n){e.current.form===n.target&&t(n)})},ree=function(e){Am(window,`resize`,e)},iee=function(e){Am(document.fonts,`loadingdone`,e)},aee=[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`],oee=D.forwardRef(function(e,t){var n=e.cacheMeasurements,r=e.maxRows,i=e.minRows,a=e.onChange,o=a===void 0?Tm:a,s=e.onHeightChange,c=s===void 0?Tm:s,l=gm(e,aee),u=l.value!==void 0,d=D.useRef(null),f=ym(d,t),p=D.useRef(0),m=D.useRef(),h=function(){var e=d.current,t=n&&m.current?m.current:km(e);if(t){m.current=t;var a=wm(t,e.value||e.placeholder||`x`,i,r),o=a[0],s=a[1];p.current!==o&&(p.current=o,e.style.setProperty(`height`,o+`px`,`important`),c(o,{rowHeight:s}))}};return D.useLayoutEffect(h),jm(d,function(){if(!u){var e=d.current.value;requestAnimationFrame(function(){var t=d.current;t&&e!==t.value&&h()})}}),ree(h),iee(h),D.createElement(`textarea`,hm({},l,{onChange:function(e){u||h(),o(e)},ref:f}))}),see={size:`sm`},Mm=Xi((e,t)=>{let{autosize:n,maxRows:r,minRows:i,__staticSelector:a,resize:o,...s}=z(`Textarea`,see,e),c=n&&Tn()!==`test`,l=c?{maxRows:r,minRows:i}:{};return(0,R.jsx)(wd,{component:c?oee:`textarea`,ref:t,...s,__staticSelector:a||`Textarea`,multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":o},...l})});Mm.classes=wd.classes,Mm.displayName=`@mantine/core/Textarea`;function Nm(e,t){if(typeof e==`string`&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var cee={serialize:JSON.stringify,deserialize:JSON.parse,size:`sm`},Pm=Xi((e,t)=>{let{value:n,defaultValue:r,onChange:i,formatOnBlur:a,validationError:o,serialize:s,deserialize:c,onFocus:l,onBlur:u,readOnly:d,error:f,...p}=z(`JsonInput`,cee,e),[m,h]=hn({value:n,defaultValue:r,finalValue:``,onChange:i}),[g,_]=(0,D.useState)(Nm(m,c));return(0,R.jsx)(Mm,{value:m,onChange:e=>h(e.currentTarget.value),onFocus:e=>{l?.(e),_(!0)},onBlur:e=>{typeof u==`function`&&u(e);let t=Nm(e.currentTarget.value,c);a&&!d&&t&&e.currentTarget.value.trim()!==``&&h(s(c(e.currentTarget.value),null,2)),_(t)},ref:t,readOnly:d,...p,autoComplete:`off`,__staticSelector:`JsonInput`,error:g?f:o||!0,"data-monospace":!0})});Pm.classes=wd.classes,Pm.displayName=`@mantine/core/JsonInput`;var[Fm,Im]=at(`List component was not found in tree`),Lm={root:`m_abbac491`,item:`m_abb6bec2`,itemWrapper:`m_75cd9f71`,itemIcon:`m_60f83e5b`},Rm=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,icon:s,children:c,mod:l,...u}=z(`ListItem`,null,e),d=Im(),f=s||d.icon,p={classNames:n,styles:a};return(0,R.jsx)(B,{...d.getStyles(`item`,{...p,className:r,style:i}),component:`li`,mod:[{"with-icon":!!f,centered:d.center},l],ref:t,...u,children:(0,R.jsxs)(`div`,{...d.getStyles(`itemWrapper`,p),children:[f&&(0,R.jsx)(`span`,{...d.getStyles(`itemIcon`,p),children:f}),(0,R.jsx)(`span`,{...d.getStyles(`itemLabel`,p),children:c})]})})});Rm.classes=Lm,Rm.displayName=`@mantine/core/ListItem`;var zm={type:`unordered`},Bm=jn((e,{size:t,spacing:n})=>({root:{"--list-fz":bt(t),"--list-lh":xt(t),"--list-spacing":vt(n)}})),Vm=Xi((e,t)=>{let n=z(`List`,zm,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,type:u,withPadding:d,icon:f,spacing:p,center:m,listStyleType:h,mod:g,attributes:_,...v}=n,y=si({name:`List`,classes:Lm,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:_,vars:c,varsResolver:Bm});return(0,R.jsx)(Fm,{value:{center:m,icon:f,getStyles:y},children:(0,R.jsx)(B,{...y(`root`,{style:{listStyleType:h}}),component:u===`unordered`?`ul`:`ol`,mod:[{"with-padding":d,type:f?`none`:h},g],ref:t,...v,children:l})})});Vm.classes=Lm,Vm.displayName=`@mantine/core/List`,Vm.Item=Rm;var[Hm,Um]=at(`Menu component was not found in the tree`),Wm={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,itemLabel:`m_5476e0d3`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`},Gm=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`MenuDivider`,null,e);return(0,R.jsx)(B,{ref:t,...Um().getStyles(`divider`,{className:r,style:i,styles:a,classNames:n}),...s})});Gm.classes=Wm,Gm.displayName=`@mantine/core/MenuDivider`;var Km=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,...d}=z(`MenuDropdown`,null,e),f=(0,D.useRef)(null),p=Um(),m=Ct(l,e=>{(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),f.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),h=Ct(s,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.openDropdown()),g=Ct(c,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.closeDropdown());return(0,R.jsxs)(uu.Dropdown,{...d,onMouseEnter:h,onMouseLeave:g,role:`menu`,"aria-orientation":`vertical`,ref:mn(t,f),...p.getStyles(`dropdown`,{className:r,style:i,styles:a,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:m,children:[p.withInitialFocusPlaceholder&&(0,R.jsx)(`div`,{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})});Km.classes=Wm,Km.displayName=`@mantine/core/MenuDropdown`;var[qm,Jm]=ot(),Ym=Zi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,color:s,closeMenuOnClick:c,leftSection:l,rightSection:u,children:d,disabled:f,"data-disabled":p,...m}=z(`MenuItem`,null,e),h=Um(),g=Jm(),_=Cr(),{dir:v}=$i(),y=(0,D.useRef)(null),b=m,x=Ct(b.onClick,()=>{p||(typeof c==`boolean`?c&&h.closeDropdownImmediately():h.closeOnItemClick&&h.closeDropdownImmediately())}),S=s?_.variantColorResolver({color:s,theme:_,variant:`light`}):void 0,C=s?ar({color:s,theme:_}):null,w=Ct(b.onKeyDown,e=>{e.key===`ArrowLeft`&&g&&(g.close(),g.focusParentItem())});return(0,R.jsxs)(wl,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:r,style:i,styles:a,classNames:n}),ref:mn(y,t),role:`menuitem`,disabled:f,"data-menu-item":!0,"data-disabled":f||p||void 0,"data-mantine-stop-propagation":!0,onClick:x,onKeyDown:ft({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:v,orientation:`vertical`,onKeyDown:w}),__vars:{"--menu-item-color":C?.isThemeColor&&C?.shade===void 0?`var(--mantine-color-${C.color}-6)`:S?.color,"--menu-item-hover":S?.hover},children:[l&&(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`left`,children:l}),d&&(0,R.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:a,classNames:n}),children:d}),u&&(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`right`,children:u})]})});Ym.classes=Wm,Ym.displayName=`@mantine/core/MenuItem`;var Xm=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`MenuLabel`,null,e);return(0,R.jsx)(B,{ref:t,...Um().getStyles(`label`,{className:r,style:i,styles:a,classNames:n}),...s})});Xm.classes=Wm,Xm.displayName=`@mantine/core/MenuLabel`;var Zm=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,...d}=z(`MenuSubDropdown`,null,e),f=(0,D.useRef)(null),p=Um(),m=Jm(),h=Ct(s,m?.open),g=Ct(c,m?.close);return(0,R.jsx)(uu.Dropdown,{...d,onMouseEnter:h,onMouseLeave:g,role:`menu`,"aria-orientation":`vertical`,ref:mn(t,f),...p.getStyles(`dropdown`,{className:r,style:i,styles:a,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:u})});Zm.classes=Wm,Zm.displayName=`@mantine/core/MenuSubDropdown`;var Qm=Zi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,color:s,leftSection:c,rightSection:l,children:u,disabled:d,"data-disabled":f,closeMenuOnClick:p,...m}=z(`MenuSubItem`,null,e),h=Um(),g=Jm(),_=Cr(),{dir:v}=$i(),y=(0,D.useRef)(null),b=m,x=s?_.variantColorResolver({color:s,theme:_,variant:`light`}):void 0,S=s?ar({color:s,theme:_}):null,C=Ct(b.onKeyDown,e=>{e.key===`ArrowRight`&&(g?.open(),g?.focusFirstItem()),e.key===`ArrowLeft`&&g?.parentContext&&(g.parentContext.close(),g.parentContext.focusParentItem())}),w=Ct(b.onClick,()=>{!f&&p&&h.closeDropdownImmediately()}),T=Ct(b.onMouseEnter,g?.open),E=Ct(b.onMouseLeave,g?.close);return(0,R.jsxs)(wl,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:r,style:i,styles:a,classNames:n}),ref:mn(y,t),role:`menuitem`,disabled:d,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":d||f||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:T,onMouseLeave:E,onClick:w,onKeyDown:ft({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:v,orientation:`vertical`,onKeyDown:C}),__vars:{"--menu-item-color":S?.isThemeColor&&S?.shade===void 0?`var(--mantine-color-${S.color}-6)`:x?.color,"--menu-item-hover":x?.hover},children:[c&&(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`left`,children:c}),u&&(0,R.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:a,classNames:n}),children:u}),(0,R.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`right`,children:l||(0,R.jsx)(Ld,{...h.getStyles(`chevron`),size:14})})]})});Qm.classes=Wm,Qm.displayName=`@mantine/core/MenuSubItem`;function $m({children:e,refProp:t}){if(!rt(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return Um(),(0,R.jsx)(uu.Target,{refProp:t,popupType:`menu`,children:e})}$m.displayName=`@mantine/core/MenuSubTarget`;var eh={offset:0,position:`right-start`,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function th(e){let{children:t,closeDelay:n,openDelay:r,...i}=z(`MenuSub`,eh,e),a=rn(),[o,{open:s,close:c}]=bn(!1),l=Jm(),{openDropdown:u,closeDropdown:d}=Nd({open:s,close:c,closeDelay:n,openDelay:r});return(0,R.jsx)(qm,{value:{opened:o,close:d,open:u,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${a}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${a}-target`)?.focus()},16),parentContext:l},children:(0,R.jsx)(uu,{opened:o,withinPortal:!1,withArrow:!1,id:a,...i,children:t})})}th.extend=e=>e,th.displayName=`@mantine/core/MenuSub`,th.Target=$m,th.Dropdown=Zm,th.Item=Qm;var nh={refProp:`ref`},rh=(0,D.forwardRef)((e,t)=>{let{children:n,refProp:r,...i}=z(`MenuTarget`,nh,e),a=An(n);if(!a)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=Um(),s=a.props,c=Ct(s.onClick,()=>{o.trigger===`click`?o.toggleDropdown():o.trigger===`click-hover`&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),l=Ct(s.onMouseEnter,()=>(o.trigger===`hover`||o.trigger===`click-hover`)&&o.openDropdown()),u=Ct(s.onMouseLeave,()=>{(o.trigger===`hover`||o.trigger===`click-hover`&&!o.openedViaClick)&&o.closeDropdown()});return(0,R.jsx)(uu.Target,{refProp:r,popupType:`menu`,ref:t,...i,children:(0,D.cloneElement)(a,{onClick:c,onMouseEnter:l,onMouseLeave:u,"data-expanded":o.opened?!0:void 0})})});rh.displayName=`@mantine/core/MenuTarget`;var lee={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1};function ih(e){let t=z(`Menu`,lee,e),{children:n,onOpen:r,onClose:i,opened:a,defaultOpened:o,trapFocus:s,onChange:c,closeOnItemClick:l,loop:u,closeOnEscape:d,trigger:f,openDelay:p,closeDelay:m,classNames:h,styles:g,unstyled:_,variant:v,vars:y,menuItemTabIndex:b,keepMounted:x,withInitialFocusPlaceholder:S,attributes:C,...w}=t,T=si({name:`Menu`,classes:Wm,props:t,classNames:h,styles:g,unstyled:_,attributes:C}),[E,O]=hn({value:a,defaultValue:o,finalValue:!1,onChange:c}),[k,A]=(0,D.useState)(!1),j=()=>{O(!1),A(!1),E&&i?.()},M=()=>{O(!0),!E&&r?.()},N=()=>{E?j():M()},{openDropdown:ee,closeDropdown:te}=Nd({open:M,close:j,closeDelay:m,openDelay:p}),P=e=>Dt(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:F,resolvedStyles:I}=Wr({classNames:h,styles:g,props:t});return(0,R.jsx)(Hm,{value:{getStyles:T,opened:E,toggleDropdown:N,getItemIndex:P,openedViaClick:k,setOpenedViaClick:A,closeOnItemClick:l,closeDropdown:f===`click`?j:te,openDropdown:f===`click`?M:ee,closeDropdownImmediately:j,loop:u,trigger:f,unstyled:_,menuItemTabIndex:b,withInitialFocusPlaceholder:S},children:(0,R.jsx)(uu,{returnFocus:!0,...w,opened:E,onChange:N,defaultOpened:o,trapFocus:!x&&s,closeOnEscape:d,__staticSelector:`Menu`,classNames:F,styles:I,unstyled:_,variant:v,keepMounted:x,children:n})})}ih.extend=e=>e,ih.withProps=Yi(ih),ih.classes=Wm,ih.displayName=`@mantine/core/Menu`,ih.Item=Ym,ih.Label=Xm,ih.Dropdown=Km,ih.Target=rh,ih.Divider=Gm,ih.Sub=th;var ah={root:`m_9df02822`,content:`m_54c44539`,inner:`m_1f958f16`,header:`m_d0e2b9cd`},[uee,oh]=at(`Modal component was not found in tree`),sh=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalBody`,null,e);return(0,R.jsx)(Uu,{ref:t,...oh().getStyles(`body`,{classNames:n,style:i,styles:a,className:r}),...s})});sh.classes=ah,sh.displayName=`@mantine/core/ModalBody`;var ch=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalCloseButton`,null,e);return(0,R.jsx)(Wu,{ref:t,...oh().getStyles(`close`,{classNames:n,style:i,styles:a,className:r}),...s})});ch.classes=ah,ch.displayName=`@mantine/core/ModalCloseButton`;var lh=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,children:s,__hidden:c,...l}=z(`ModalContent`,null,e),u=oh(),d=u.scrollAreaComponent||Qu;return(0,R.jsx)(Gu,{...u.getStyles(`content`,{className:r,style:i,styles:a,classNames:n}),innerProps:u.getStyles(`inner`,{className:r,style:i,styles:a,classNames:n}),"data-full-screen":u.fullScreen||void 0,"data-modal-content":!0,"data-hidden":c||void 0,ref:t,...l,children:(0,R.jsx)(d,{style:{maxHeight:u.fullScreen?`100dvh`:`calc(100dvh - (${L(u.yOffset)} * 2))`},children:s})})});lh.classes=ah,lh.displayName=`@mantine/core/ModalContent`;var uh=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalHeader`,null,e);return(0,R.jsx)(Ku,{ref:t,...oh().getStyles(`header`,{classNames:n,style:i,styles:a,className:r}),...s})});uh.classes=ah,uh.displayName=`@mantine/core/ModalHeader`;var dh=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalOverlay`,null,e);return(0,R.jsx)(Yu,{ref:t,...oh().getStyles(`overlay`,{classNames:n,style:i,styles:a,className:r}),...s})});dh.classes=ah,dh.displayName=`@mantine/core/ModalOverlay`;var dee={__staticSelector:`Modal`,closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:mt(`modal`),transitionProps:{duration:200,transition:`fade-down`},yOffset:`5dvh`},fee=jn((e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:yt(t),"--modal-size":_t(n,`modal-size`),"--modal-y-offset":L(r),"--modal-x-offset":L(i)}})),fh=Xi((e,t)=>{let n=z(`ModalRoot`,dee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,yOffset:l,scrollAreaComponent:u,radius:d,fullScreen:f,centered:p,xOffset:m,__staticSelector:h,attributes:g,..._}=n,v=si({name:h,classes:ah,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:fee});return(0,R.jsx)(uee,{value:{yOffset:l,scrollAreaComponent:u,getStyles:v,fullScreen:f},children:(0,R.jsx)(Bu,{ref:t,...v(`root`),"data-full-screen":f||void 0,"data-centered":p||void 0,"data-offset-scrollbars":u===bl.Autosize||void 0,unstyled:s,..._})})});fh.classes=ah,fh.displayName=`@mantine/core/ModalRoot`;var[pee,ph]=ot();function mh({children:e}){let[t,n]=(0,D.useState)([]),[r,i]=(0,D.useState)(mt(`modal`));return(0,R.jsx)(pee,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}mh.displayName=`@mantine/core/ModalStack`;var hh=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ModalTitle`,null,e);return(0,R.jsx)(Zu,{ref:t,...oh().getStyles(`title`,{classNames:n,style:i,styles:a,className:r}),...s})});hh.classes=ah,hh.displayName=`@mantine/core/ModalTitle`;var gh={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:mt(`modal`),transitionProps:{duration:200,transition:`fade-down`},withOverlay:!0,withCloseButton:!0},_h=Xi((e,t)=>{let{title:n,withOverlay:r,overlayProps:i,withCloseButton:a,closeButtonProps:o,children:s,radius:c,opened:l,stackId:u,zIndex:d,...f}=z(`Modal`,gh,e),p=ph(),m=!!n||a,h=p&&u?{closeOnEscape:p.currentId===u,trapFocus:p.currentId===u,zIndex:p.getZIndex(u)}:{},g=r===!1?!1:u&&p?p.currentId===u:l;return(0,D.useEffect)(()=>{p&&u&&(l?p.addModal(u,d||mt(`modal`)):p.removeModal(u))},[l,u,d]),(0,R.jsxs)(fh,{ref:t,radius:c,opened:l,zIndex:p&&u?p.getZIndex(u):d,...f,...h,children:[r&&(0,R.jsx)(dh,{visible:g,transitionProps:p&&u?{duration:0}:void 0,...i}),(0,R.jsxs)(lh,{radius:c,__hidden:p&&u&&l?u!==p.currentId:!1,children:[m&&(0,R.jsxs)(uh,{children:[n&&(0,R.jsx)(hh,{children:n}),a&&(0,R.jsx)(ch,{...o})]}),(0,R.jsx)(sh,{children:s})]})]})});_h.classes=ah,_h.displayName=`@mantine/core/Modal`,_h.Root=fh,_h.Overlay=dh,_h.Content=lh,_h.Body=sh,_h.Header=uh,_h.Title=hh,_h.CloseButton=ch,_h.Stack=mh;var[vh,yh]=ot(),bh={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},[xh,Sh]=ot(),Ch=jn((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?_t(n,`pg-gap`):_t(t)}})),wh=Xi((e,t)=>{let n=z(`PillGroup`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,disabled:u,attributes:d,...f}=n,p=yh()?.size||l||void 0,m=si({name:`PillGroup`,classes:bh,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:d,vars:c,varsResolver:Ch,stylesCtx:{size:p},rootSelector:`group`});return(0,R.jsx)(xh,{value:{size:p,disabled:u},children:(0,R.jsx)(B,{ref:t,size:p,...m(`group`),...f})})});wh.classes=bh,wh.displayName=`@mantine/core/PillGroup`;var Th={variant:`default`},Eh=jn((e,{radius:t},{size:n})=>({root:{"--pill-fz":_t(n,`pill-fz`),"--pill-height":_t(n,`pill-height`),"--pill-radius":t===void 0?void 0:yt(t)}})),Dh=Xi((e,t)=>{let n=z(`Pill`,Th,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,variant:l,children:u,withRemoveButton:d,onRemove:f,removeButtonProps:p,radius:m,size:h,disabled:g,mod:_,attributes:v,...y}=n,b=Sh(),x=yh(),S=h||b?.size||void 0,C=x?.variant===`filled`?`contrast`:l||`default`,w=si({name:`Pill`,classes:bh,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,vars:c,varsResolver:Eh,stylesCtx:{size:S}});return(0,R.jsxs)(B,{component:`span`,ref:t,variant:C,size:S,...w(`root`,{variant:C}),mod:[{"with-remove":d&&!g,disabled:g||b?.disabled},_],...y,children:[(0,R.jsx)(`span`,{...w(`label`),children:u}),d&&(0,R.jsx)(ju,{variant:`transparent`,radius:m,tabIndex:-1,"aria-hidden":!0,unstyled:s,...p,...w(`remove`,{className:p?.className,style:p?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),p?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),f?.(),p?.onClick?.(e)}})]})});Dh.classes=bh,Dh.displayName=`@mantine/core/Pill`,Dh.Group=wh;var Oh={field:`m_45c4369d`},kh={type:`visible`},Ah=Xi((e,t)=>{let n=z(`PillsInputField`,kh,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,type:l,disabled:u,id:d,pointer:f,mod:p,attributes:m,...h}=n,g=yh(),_=od(),v=si({name:`PillsInputField`,classes:Oh,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,rootSelector:`field`}),y=u||g?.disabled;return(0,R.jsx)(B,{component:`input`,ref:mn(t,g?.fieldRef),"data-type":l,disabled:y,mod:[{disabled:y,pointer:f},p],...v(`field`),...h,id:_?.inputId||d,"aria-invalid":g?.hasError,"aria-describedby":_?.describedBy,type:`text`,onMouseDown:e=>!f&&e.stopPropagation()})});Ah.classes=Oh,Ah.displayName=`@mantine/core/PillsInputField`;var jh={size:`sm`},Mh=Xi((e,t)=>{let{children:n,onMouseDown:r,onClick:i,size:a,disabled:o,__staticSelector:s,error:c,variant:l,...u}=z(`PillsInput`,jh,e),d=(0,D.useRef)(null);return(0,R.jsx)(vh,{value:{fieldRef:d,size:a,disabled:o,hasError:!!c,variant:l},children:(0,R.jsx)(wd,{size:a,error:c,variant:l,component:`div`,ref:t,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),r?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),i?.(e))},...u,multiline:!0,disabled:o,__staticSelector:s||`PillsInput`,withAria:!1,children:n})})});Mh.displayName=`@mantine/core/PillsInput`,Mh.Field=Ah;function Nh({data:e,value:t}){let n=t.map(e=>e.trim().toLowerCase());return e.reduce((e,t)=>(jp(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(e.value.toLowerCase().trim())===-1)}):n.indexOf(t.value.toLowerCase().trim())===-1&&e.push(t),e),[])}var Ph={xs:41,sm:50,md:60,lg:72,xl:89},Fh={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},Ih=Xi((e,t)=>{let n=z(`MultiSelect`,Fh,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,value:u,defaultValue:d,onChange:f,onKeyDown:p,variant:m,data:h,dropdownOpened:g,defaultDropdownOpened:_,onDropdownOpen:v,onDropdownClose:y,selectFirstOptionOnChange:b,selectFirstOptionOnDropdownOpen:x,onOptionSubmit:S,comboboxProps:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,searchValue:k,defaultSearchValue:A,onSearchChange:j,readOnly:M,disabled:N,onFocus:ee,onBlur:te,radius:P,rightSection:F,rightSectionWidth:I,rightSectionPointerEvents:ne,rightSectionProps:re,leftSection:ie,leftSectionWidth:ae,leftSectionPointerEvents:oe,leftSectionProps:se,inputContainer:ce,inputWrapperOrder:le,withAsterisk:ue,labelProps:de,descriptionProps:fe,errorProps:pe,wrapperProps:me,description:he,label:ge,error:_e,maxValues:ve,searchable:ye,nothingFoundMessage:be,withCheckIcon:xe,withAlignedLabels:Se,checkIconPosition:Ce,hidePickedOptions:we,withErrorStyles:Te,name:Ee,form:De,id:Oe,clearable:ke,clearButtonProps:Ae,hiddenInputProps:je,placeholder:Me,hiddenInputValuesDivider:Ne,required:Pe,mod:Fe,renderOption:Ie,onRemove:Le,onClear:Re,scrollAreaProps:ze,chevronColor:Be,attributes:Ve,clearSearchOnChange:He,openOnFocus:Ue,...We}=n,Ge=rn(Oe),Ke=Of(h),qe=kf(Ke),Je=(0,D.useRef)({}),Ye=rp({opened:g,defaultOpened:_,onDropdownOpen:()=>{v?.(),x&&Ye.selectFirstOption()},onDropdownClose:()=>{y?.(),Ye.resetSelectedOption()}}),{styleProps:Xe,rest:{type:Ze,autoComplete:Qe,...$e}}=gi(We),[L,et]=hn({value:u,defaultValue:d,finalValue:[],onChange:f}),[tt,nt]=hn({value:k,defaultValue:A,finalValue:``,onChange:j}),rt=e=>{nt(e),Ye.resetSelectedOption()},it=si({name:`MultiSelect`,classes:{},props:n,classNames:r,styles:o,unstyled:s,attributes:Ve}),{resolvedClassNames:at,resolvedStyles:ot}=Wr({props:n,styles:o,classNames:r}),st=e=>{p?.(e),e.key===` `&&!ye&&(e.preventDefault(),Ye.toggleDropdown()),e.key===`Backspace`&&tt.length===0&&L.length>0&&(Le?.(L[L.length-1]),et(L.slice(0,L.length-1)))},ct=L.map((e,t)=>{let n=qe[e]||Je.current[e];return(0,R.jsx)(Dh,{withRemoveButton:!M&&!qe[e]?.disabled,onRemove:()=>{et(L.filter(t=>e!==t)),Le?.(e)},unstyled:s,disabled:N,...it(`pill`),children:n?.label||e},`${e}-${t}`)});(0,D.useEffect)(()=>{b&&Ye.selectFirstOption()},[b,tt]),(0,D.useEffect)(()=>{L.forEach(e=>{e in qe&&(Je.current[e]=qe[e])})},[qe,L]);let lt=(0,R.jsx)(op.ClearButton,{...Ae,onClear:()=>{Re?.(),et([]),rt(``)}}),ut=Nh({data:Ke,value:L}),dt=ke&&L.length>0&&!N&&!M,ft=dt?{paddingInlineEnd:Ph[l]??Ph.sm}:void 0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(op,{store:Ye,classNames:at,styles:ot,unstyled:s,size:l,readOnly:M,__staticSelector:`MultiSelect`,attributes:Ve,onOptionSubmit:e=>{S?.(e),He&&rt(``),Ye.updateSelectedOptionIndex(`selected`),L.includes(qe[e].value)?(et(L.filter(t=>t!==qe[e].value)),Le?.(qe[e].value)):L.length<ve&&et([...L,qe[e].value])},...C,children:[(0,R.jsx)(op.DropdownTarget,{children:(0,R.jsx)(Mh,{...Xe,__staticSelector:`MultiSelect`,classNames:at,styles:ot,unstyled:s,size:l,className:i,style:a,variant:m,disabled:N,radius:P,__defaultRightSection:(0,R.jsx)(op.Chevron,{size:l,error:_e,unstyled:s,color:Be}),__clearSection:lt,__clearable:dt,rightSection:F,rightSectionPointerEvents:ne||`none`,rightSectionWidth:I,rightSectionProps:re,leftSection:ie,leftSectionWidth:ae,leftSectionPointerEvents:oe,leftSectionProps:se,inputContainer:ce,inputWrapperOrder:le,withAsterisk:ue,labelProps:de,descriptionProps:fe,errorProps:pe,wrapperProps:me,description:he,label:ge,error:_e,withErrorStyles:Te,__stylesApiProps:{...n,rightSectionPointerEvents:ne||`none`,multiline:!0},pointer:!ye,onClick:()=>ye?Ye.openDropdown():Ye.toggleDropdown(),"data-expanded":Ye.dropdownOpened||void 0,id:Ge,required:Pe,mod:Fe,attributes:Ve,children:(0,R.jsxs)(Dh.Group,{attributes:Ve,disabled:N,unstyled:s,...it(`pillsList`,{style:ft}),children:[ct,(0,R.jsx)(op.EventsTarget,{autoComplete:Qe,children:(0,R.jsx)(Mh.Field,{...$e,ref:t,id:Ge,placeholder:Me,type:!ye&&!Me?`hidden`:`visible`,...it(`inputField`),unstyled:s,onFocus:e=>{ee?.(e),Ue&&ye&&Ye.openDropdown()},onBlur:e=>{te?.(e),Ye.closeDropdown(),rt(``)},onKeyDown:st,value:tt,onChange:e=>{rt(e.currentTarget.value),ye&&Ye.openDropdown(),b&&Ye.selectFirstOption()},disabled:N,readOnly:M||!ye,pointer:!ye})})]})})}),(0,R.jsx)(Lp,{data:we?ut:Ke,hidden:M||N,filter:w,search:tt,limit:T,hiddenWhenEmpty:!be,withScrollArea:E,maxDropdownHeight:O,filterOptions:ye,value:L,checkIconPosition:Ce,withCheckIcon:xe,withAlignedLabels:Se,nothingFoundMessage:be,unstyled:s,labelId:ge?`${Ge}-label`:void 0,"aria-label":ge?void 0:We[`aria-label`],renderOption:Ie,scrollAreaProps:ze})]}),(0,R.jsx)(op.HiddenInput,{name:Ee,valuesDivider:Ne,value:L,form:De,disabled:N,...je})]})});Ih.classes={...wd.classes,...op.classes},Ih.displayName=`@mantine/core/MultiSelect`;function Lh(e){return`group`in e}function Rh({data:e}){if(Lh(e)){let t=e.items.map(e=>(0,R.jsx)(Rh,{data:e},e.value));return(0,R.jsx)(`optgroup`,{label:e.group,children:t})}let{value:t,label:n,...r}=e;return(0,R.jsx)(`option`,{value:e.value,...r,children:e.label},e.value)}Rh.displayName=`@mantine/core/NativeSelectOption`;var zh={rightSectionPointerEvents:`none`},Bh=Xi((e,t)=>{let{data:n,children:r,size:i,error:a,rightSection:o,unstyled:s,...c}=z(`NativeSelect`,zh,e),l=Of(n).map((e,t)=>(0,R.jsx)(Rh,{data:e},t));return(0,R.jsx)(wd,{component:`select`,ref:t,...c,__staticSelector:`NativeSelect`,size:i,pointer:!0,error:a,unstyled:s,rightSection:o||(0,R.jsx)(Nf,{size:i,error:a,unstyled:s}),children:r||l})});Bh.classes=wd.classes,Bh.displayName=`@mantine/core/NativeSelect`;var Vh={root:`m_a513464`,icon:`m_a4ceffb`,loader:`m_b0920b15`,body:`m_a49ed24`,title:`m_3feedf16`,description:`m_3d733a3a`,closeButton:`m_919a4d88`},Hh={withCloseButton:!0},Uh=jn((e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:yt(t),"--notification-color":n?or(n,e):void 0}})),Wh=Xi((e,t)=>{let n=z(`Notification`,Hh,e),{className:r,color:i,radius:a,loading:o,withCloseButton:s,withBorder:c,title:l,icon:u,children:d,onClose:f,closeButtonProps:p,classNames:m,style:h,styles:g,unstyled:_,vars:v,mod:y,loaderProps:b,role:x,attributes:S,...C}=n,w=si({name:`Notification`,classes:Vh,props:n,className:r,style:h,classNames:m,styles:g,unstyled:_,attributes:S,vars:v,varsResolver:Uh});return(0,R.jsxs)(B,{...w(`root`),mod:[{"data-with-icon":!!u||o,"data-with-border":c},y],ref:t,role:x||`alert`,...C,children:[u&&!o&&(0,R.jsx)(`div`,{...w(`icon`),children:u}),o&&(0,R.jsx)(vu,{size:28,color:i,...b,...w(`loader`)}),(0,R.jsxs)(`div`,{...w(`body`),children:[l&&(0,R.jsx)(`div`,{...w(`title`),children:l}),(0,R.jsx)(B,{...w(`description`),mod:{"data-with-title":!!l},children:d})]}),s&&(0,R.jsx)(ju,{iconSize:16,color:`gray`,...p,unstyled:_,onClick:f,...w(`closeButton`)})]})});Wh.classes=Vh,Wh.displayName=`@mantine/core/Notification`;function Gh(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}var Kh;(function(e){e.event=`event`,e.props=`prop`})(Kh||={});function qh(){}function Jh(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(e,n){return e===t[n]})?n:(t=r,n=e.apply(void 0,r),n)}}function Yh(e){return!!(e||``).match(/\d/)}function Xh(e){return e==null}function Zh(e){return typeof e==`number`&&isNaN(e)}function Qh(e){return Xh(e)||Zh(e)||typeof e==`number`&&!isFinite(e)}function $h(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,`\\$&`)}function eg(e){switch(e){case`lakh`:return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case`wan`:return/(\d)(?=(\d{4})+(?!\d))/g;default:return/(\d)(?=(\d{3})+(?!\d))/g}}function tg(e,t,n){var r=eg(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,`$1`+t)}function ng(e){var t=(0,D.useRef)(e);return t.current=e,(0,D.useRef)(function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return t.current.apply(t,e)}).current}function rg(e,t){t===void 0&&(t=!0);var n=e[0]===`-`,r=n&&t;e=e.replace(`-`,``);var i=e.split(`.`);return{beforeDecimal:i[0],afterDecimal:i[1]||``,hasNegation:n,addNegation:r}}function mee(e){if(!e)return e;var t=e[0]===`-`;t&&(e=e.substring(1,e.length));var n=e.split(`.`),r=n[0].replace(/^0+/,``)||`0`,i=n[1]||``;return(t?`-`:``)+r+(i?`.`+i:``)}function ig(e,t,n){for(var r=``,i=n?`0`:``,a=0;a<=t-1;a++)r+=e[a]||i;return r}function ag(e,t){return Array(t+1).join(e)}function og(e){var t=e+``,n=t[0]===`-`?`-`:``;n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],a=r[1];if(a=Number(a),!a)return n+i;i=i.replace(`.`,``);var o=1+a,s=i.length;return o<0?i=`0.`+ag(`0`,Math.abs(o))+i:o>=s?i+=ag(`0`,o-s):i=(i.substring(0,o)||`0`)+`.`+i.substring(o),n+i}function sg(e,t,n){if([``,`-`].indexOf(e)!==-1)return e;var r=(e.indexOf(`.`)!==-1||n)&&t,i=rg(e),a=i.beforeDecimal,o=i.afterDecimal,s=i.hasNegation,c=parseFloat(`0.`+(o||`0`)),l=(o.length<=t?`0.`+o:c.toFixed(t)).split(`.`),u=a;a&&Number(l[0])&&(u=a.split(``).reverse().reduce(function(e,t,n){return e.length>n?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e},l[0]));var d=ig(l[1]||``,t,n),f=s?`-`:``,p=r?`.`:``;return``+f+u+p+d}function cg(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move(`character`,t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var lg=Jh(function(e,t){for(var n=0,r=0,i=e.length,a=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[a-1-r]&&a-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:a-r}}}),hee=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function gee(e,t,n){return Math.min(Math.max(e,t),n)}function ug(e){return Math.max(e.selectionStart,e.selectionEnd)}function _ee(){return typeof navigator<`u`&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function vee(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:``}}function yee(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function bee(e,t,n,r,i,a,o){o===void 0&&(o=yee);var s=i.findIndex(function(e){return e}),c=e.slice(0,s);!t&&!n.startsWith(c)&&(t=c,n=c+n,r+=c.length);for(var l=n.length,u=e.length,d={},f=Array(l),p=0;p<l;p++){f[p]=-1;for(var m=0,h=u;m<h;m++)if(o({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:p,formattedValueIndex:m})&&d[m]!==!0){f[p]=m,d[m]=!0;break}}for(var g=r;g<l&&(f[g]===-1||!a(n[g]));)g++;var _=g===l||f[g]===-1?u:f[g];for(g=r-1;g>0&&f[g]===-1;)g--;var v=g===-1||f[g]===-1?0:f[g]+1;return v>_?_:r-v<_-r?v:_}function dg(e,t,n,r){var i=e.length;if(t=gee(t,0,i),r===`left`){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function xee(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(Yh(e[n])||Yh(e[n-1]));return t}function fg(e,t,n,r,i,a){a===void 0&&(a=qh);var o=ng(function(e,t){var n,a;return Qh(e)?(a=``,n=``):typeof e==`number`||t?(a=typeof e==`number`?og(e):e,n=r(a)):(a=i(e,void 0),n=r(a)),{formattedValue:n,numAsString:a}}),s=(0,D.useState)(function(){return o(Xh(e)?t:e,n)}),c=s[0],l=s[1],u=function(e,t){e.formattedValue!==c.formattedValue&&l({formattedValue:e.formattedValue,numAsString:e.value}),a(e,t)},d=e,f=n;Xh(e)&&(d=c.numAsString,f=!0);var p=o(d,f);return(0,D.useMemo)(function(){l(p)},[p.formattedValue]),[c,u]}function See(e){return e.replace(/[^0-9]/g,``)}function Cee(e){return e}function wee(e){var t=e.type;t===void 0&&(t=`text`);var n=e.displayType;n===void 0&&(n=`input`);var r=e.customInput,i=e.renderText,a=e.getInputRef,o=e.format;o===void 0&&(o=Cee);var s=e.removeFormatting;s===void 0&&(s=See);var c=e.defaultValue,l=e.valueIsNumericString,u=e.onValueChange,d=e.isAllowed,f=e.onChange;f===void 0&&(f=qh);var p=e.onKeyDown;p===void 0&&(p=qh);var m=e.onMouseUp;m===void 0&&(m=qh);var h=e.onFocus;h===void 0&&(h=qh);var g=e.onBlur;g===void 0&&(g=qh);var _=e.value,v=e.getCaretBoundary;v===void 0&&(v=xee);var y=e.isValidInputCharacter;y===void 0&&(y=Yh);var b=e.isCharacterSame,x=Gh(e,[`type`,`displayType`,`customInput`,`renderText`,`getInputRef`,`format`,`removeFormatting`,`defaultValue`,`valueIsNumericString`,`onValueChange`,`isAllowed`,`onChange`,`onKeyDown`,`onMouseUp`,`onFocus`,`onBlur`,`value`,`getCaretBoundary`,`isValidInputCharacter`,`isCharacterSame`]),S=fg(_,c,!!l,o,s,u),C=S[0],w=C.formattedValue,T=C.numAsString,E=S[1],O=(0,D.useRef)(),k=(0,D.useRef)({formattedValue:w,numAsString:T}),A=function(e,t){k.current={formattedValue:e.formattedValue,numAsString:e.value},E(e,t)},j=(0,D.useState)(!1),M=j[0],N=j[1],ee=(0,D.useRef)(null),te=(0,D.useRef)({setCaretTimeout:null,focusTimeout:null});(0,D.useEffect)(function(){return N(!0),function(){clearTimeout(te.current.setCaretTimeout),clearTimeout(te.current.focusTimeout)}},[]);var P=o,F=function(e,t){var n=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(n)?void 0:n}},I=function(e,t,n){e.selectionStart===0&&e.selectionEnd===e.value.length||(cg(e,t),te.current.setCaretTimeout=setTimeout(function(){e.value===n&&e.selectionStart!==t&&cg(e,t)},0))},ne=function(e,t,n){return dg(e,t,v(e),n)},re=function(e,t,n){var r=v(t),i=bee(t,w,e,n,r,y,b);return i=dg(t,i,r),i},ie=function(e){var t=e.formattedValue;t===void 0&&(t=``);var n=e.input,r=e.source,i=e.event,a=e.numAsString,o;if(n){var s=e.inputValue||n.value,c=ug(n);n.value=t,o=re(s,t,c),o!==void 0&&I(n,o,t)}t!==w&&A(F(t,a),{event:i,source:r})};(0,D.useEffect)(function(){var e=k.current,t=e.formattedValue,n=e.numAsString;(w!==t||T!==n)&&A(F(w,T),{event:void 0,source:Kh.props})},[w,T]);var ae=ee.current?ug(ee.current):void 0;(typeof window<`u`?D.useLayoutEffect:D.useEffect)(function(){var e=ee.current;if(w!==k.current.formattedValue&&e){var t=re(k.current.formattedValue,w,ae);e.value=w,I(e,t,w)}},[w]);var oe=function(e,t,n){var r=t.target,i=O.current?hee(O.current,r.selectionEnd):lg(w,e),a=Object.assign(Object.assign({},i),{lastValue:w}),o=s(e,a),c=P(o);if(o=s(c,void 0),d&&!d(F(c,o))){var l=t.target,u=re(e,w,ug(l));return l.value=w,I(l,u,w),!1}return ie({formattedValue:c,numAsString:o,inputValue:e,event:t,source:n,input:t.target}),!0},se=function(e,t){t===void 0&&(t=0),O.current={selectionStart:e.selectionStart,selectionEnd:e.selectionEnd+t}},ce=function(e){var t=e.target.value;oe(t,e,Kh.event)&&f(e),O.current=void 0},le=function(e){var t=e.target,n=e.key,r=t.selectionStart,i=t.selectionEnd,a=t.value;a===void 0&&(a=``);var o;n===`ArrowLeft`||n===`Backspace`?o=Math.max(r-1,0):n===`ArrowRight`?o=Math.min(r+1,a.length):n===`Delete`&&(o=r);var s=0;n===`Delete`&&r===i&&(s=1);var c=n===`ArrowLeft`||n===`ArrowRight`;if(o===void 0||r!==i&&!c){p(e),se(t,s);return}var l=o;c?(l=ne(a,o,n===`ArrowLeft`?`left`:`right`),l!==o&&e.preventDefault()):n===`Delete`&&!y(a[o])?l=ne(a,o,`right`):n===`Backspace`&&!y(a[o])&&(l=ne(a,o,`left`)),l!==o&&I(t,l,a),p(e),se(t,s)},ue=function(e){var t=e.target,n=function(){var e=t.selectionStart,n=t.selectionEnd,r=t.value;if(r===void 0&&(r=``),e===n){var i=ne(r,e);i!==e&&I(t,i,r)}};n(),requestAnimationFrame(function(){n()}),m(e),se(t)},de=function(e){e.persist&&e.persist();var t=e.target,n=e.currentTarget;ee.current=t,te.current.focusTimeout=setTimeout(function(){var r=t.selectionStart,i=t.selectionEnd,a=t.value;a===void 0&&(a=``);var o=ne(a,r);o!==r&&!(r===0&&i===a.length)&&I(t,o,a),h(Object.assign(Object.assign({},e),{currentTarget:n}))},0)},fe=function(e){ee.current=null,clearTimeout(te.current.focusTimeout),clearTimeout(te.current.setCaretTimeout),g(e)},pe=M&&_ee()?`numeric`:void 0,me=Object.assign({inputMode:pe},x,{type:t,value:w,onChange:ce,onKeyDown:le,onMouseUp:ue,onFocus:de,onBlur:fe});if(n===`text`)return i?D.createElement(D.Fragment,null,i(w,x)||null):D.createElement(`span`,Object.assign({},x,{ref:a}),w);if(r){var he=r;return D.createElement(he,Object.assign({},me,{ref:a}))}return D.createElement(`input`,Object.assign({},me,{ref:a}))}function pg(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i=``);var a=t.suffix;a===void 0&&(a=``);var o=t.allowNegative,s=t.thousandsGroupStyle;if(s===void 0&&(s=`thousand`),e===``||e===`-`)return e;var c=mg(t),l=c.thousandSeparator,u=c.decimalSeparator,d=n!==0&&e.indexOf(`.`)!==-1||n&&r,f=rg(e,o),p=f.beforeDecimal,m=f.afterDecimal,h=f.addNegation;return n!==void 0&&(m=ig(m,n,!!r)),l&&(p=tg(p,l,s)),i&&(p=i+p),a&&(m+=a),h&&(p=`-`+p),e=p+(d&&u||``)+m,e}function mg(e){var t=e.decimalSeparator;t===void 0&&(t=`.`);var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=`,`),r||=[t,`.`],{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function Tee(e,t){e===void 0&&(e=``);var n=RegExp(`(-)`),r=RegExp(`(-)(.)*(-)`),i=n.test(e),a=r.test(e);return e=e.replace(/-/g,``),i&&!a&&t&&(e=`-`+e),e}function Eee(e,t){return RegExp(`(^-)|[0-9]|`+$h(e),t?`g`:void 0)}function Dee(e,t,n){return e===``||!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e==`string`&&!isNaN(Number(e))}function Oee(e,t,n){var r;t===void 0&&(t=vee(e));var i=n.allowNegative,a=n.prefix;a===void 0&&(a=``);var o=n.suffix;o===void 0&&(o=``);var s=n.decimalScale,c=t.from,l=t.to,u=l.start,d=l.end,f=mg(n),p=f.allowedDecimalSeparators,m=f.decimalSeparator,h=e[d]===m;if(Yh(e)&&(e===a||e===o)&&t.lastValue===``)return e;if(d-u===1&&p.indexOf(e[u])!==-1){var g=s===0?``:m;e=e.substring(0,u)+g+e.substring(u+1,e.length)}var _=function(e,t,n){var r=!1,i=!1;a.startsWith(`-`)?r=!1:e.startsWith(`--`)?(r=!1,i=!0):o.startsWith(`-`)&&e.length===o.length?r=!1:e[0]===`-`&&(r=!0);var s=+!!r;return i&&(s=2),s&&(e=e.substring(s),t-=s,n-=s),{value:e,start:t,end:n,hasNegation:r}},v=_(e,u,d),y=v.hasNegation;r=v,e=r.value,u=r.start,d=r.end;var b=_(t.lastValue,c.start,c.end),x=b.start,S=b.end,C=b.value,w=e.substring(u,d);e.length&&C.length&&(x>C.length-o.length||S<a.length)&&!(w&&o.startsWith(w))&&(e=C);var T=0;e.startsWith(a)?T+=a.length:u<a.length&&(T=u),e=e.substring(T),d-=T;var E=e.length,D=e.length-o.length;e.endsWith(o)?E=D:(d>D||d>e.length-o.length)&&(E=d),e=e.substring(0,E),e=Tee(y?`-`+e:e,i),e=(e.match(Eee(m,!0))||[]).join(``);var O=e.indexOf(m);e=e.replace(new RegExp($h(m),`g`),function(e,t){return t===O?`.`:``});var k=rg(e,i),A=k.beforeDecimal,j=k.afterDecimal,M=k.addNegation;return l.end-l.start<c.end-c.start&&A===``&&h&&!parseFloat(j)&&(e=M?`-`:``),e}function kee(e,t){var n=t.prefix;n===void 0&&(n=``);var r=t.suffix;r===void 0&&(r=``);var i=Array.from({length:e.length+1}).map(function(){return!0}),a=e[0]===`-`;i.fill(!1,0,n.length+ +!!a);var o=e.length;return i.fill(!1,o-r.length+1,o+1),i}function Aee(e){var t=mg(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i=``);var a=e.allowNegative;if(a===void 0&&(a=!0),n===r)throw Error(`
|
|
55
|
-
Decimal separator can't be same as thousand separator.
|
|
56
|
-
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
57
|
-
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
58
|
-
`);return i.startsWith(`-`)&&a&&(console.error(`
|
|
59
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
60
|
-
prefix: `+i+`
|
|
61
|
-
allowNegative: `+a+`
|
|
62
|
-
`),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function jee(e){e=Aee(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=qh);var a=e.onBlur;a===void 0&&(a=qh);var o=e.thousandSeparator,s=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l=``);var u=e.defaultValue,d=e.value,f=e.valueIsNumericString,p=e.onValueChange,m=Gh(e,[`decimalSeparator`,`allowedDecimalSeparators`,`thousandsGroupStyle`,`suffix`,`allowNegative`,`allowLeadingZeros`,`onKeyDown`,`onBlur`,`thousandSeparator`,`decimalScale`,`fixedDecimalScale`,`prefix`,`defaultValue`,`value`,`valueIsNumericString`,`onValueChange`]),h=mg(e),g=h.decimalSeparator,_=h.allowedDecimalSeparators,v=function(t){return pg(t,e)},y=function(t,n){return Oee(t,n,e)},b=Xh(d)?u:d,x=f??Dee(b,l,t);Xh(d)?Xh(u)||(x||=typeof u==`number`):x||=typeof d==`number`;var S=function(e){return Qh(e)?e:(typeof e==`number`&&(e=og(e)),x&&typeof s==`number`?sg(e,s,!!c):e)},C=fg(S(d),S(u),!!x,v,y,p),w=C[0],T=w.numAsString,E=w.formattedValue,D=C[1];return Object.assign(Object.assign({},m),{value:E,valueIsNumericString:!1,isValidInputCharacter:function(e){return e===g||Yh(e)},isCharacterSame:function(e){var t=e.currentValue,n=e.lastValue,r=e.formattedValue,i=e.currentValueIndex,a=e.formattedValueIndex,o=t[i],u=r[a],f=lg(n,t).to,p=function(e){return y(e).indexOf(`.`)+l.length};return d===0&&c&&s&&t[f.start]===g&&p(t)<i&&p(r)>a?!1:i>=f.start&&i<f.end&&_&&_.includes(o)&&u===g?!0:o===u},onValueChange:D,format:v,removeFormatting:y,getCaretBoundary:function(t){return kee(t,e)},onKeyDown:function(e){var t=e.target,r=e.key,a=t.selectionStart,u=t.selectionEnd,d=t.value;if(d===void 0&&(d=``),(r===`Backspace`||r===`Delete`)&&u<l.length){e.preventDefault();return}if(a!==u){i(e);return}r===`Backspace`&&d[0]===`-`&&a===l.length+1&&n&&cg(t,1),s&&c&&(r===`Backspace`&&d[a-1]===g?(cg(t,a-1),e.preventDefault()):r===`Delete`&&d[a]===g&&e.preventDefault()),_?.includes(r)&&d[a]===g&&cg(t,a+1);var f=o===!0?`,`:o;r===`Backspace`&&d[a-1]===f&&cg(t,a-1),r===`Delete`&&d[a]===f&&cg(t,a+1),i(e)},onBlur:function(t){var n=T;n.match(/\d/g)||(n=``),r||(n=mee(n)),c&&s&&(n=sg(n,s,c)),n!==T&&D({formattedValue:pg(n,e),value:n,floatValue:parseFloat(n)},{event:t,source:Kh.event}),a(t)}})}function Mee(e){var t=jee(e);return D.createElement(wee,Object.assign({},t))}var hg={root:`m_e2f5cd4e`,controls:`m_95e17d22`,control:`m_80b4b171`};function gg({direction:e,style:t,...n}){return(0,R.jsx)(`svg`,{style:{width:`var(--ni-chevron-size)`,height:`var(--ni-chevron-size)`,transform:e===`up`?`rotate(180deg)`:void 0,...t},viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...n,children:(0,R.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var Nee=/^(0\.0*|-0(\.0*)?)$/,_g=/^-?0\d+(\.\d+)?\.?$/,vg=/\.\d*0$/,yg=/^-?\d+\.$/;function bg(e){return typeof e==`string`&&e!==``&&!Number.isNaN(Number(e))}function xg(e){return typeof e==`number`?e<2**53-1:e===``||bg(e)&&Number(e)<2**53-1}function Sg(e){return e.toString().replace(`.`,``).length}function Cg(e,t){return(typeof e==`number`?e<2**53-1:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&Sg(t)<14&&t!==``}function wg(e,t,n){return e===void 0||(t===void 0||e>=t)&&(n===void 0||e<=n)}var Tg={step:1,clampBehavior:`blur`,allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0,allowedDecimalSeparators:[`.`,`,`]},Eg=jn((e,{size:t})=>({controls:{"--ni-chevron-size":_t(t,`ni-chevron-size`)}}));function Dg(e,t,n){let r=e.toString(),i=yg.test(r),a=r.replace(/^0+(?=\d)/,``),o=parseFloat(a);if(Number.isNaN(o))return a;if(o>2**53-1)return t===void 0?a:t;let s=Ot(o,n,t);return i?`${s.toString().replace(/^0+(?=\d)/,``)}.`:s}var Og=Xi((e,t)=>{let n=z(`NumberInput`,Tg,e),{className:r,classNames:i,styles:a,unstyled:o,vars:s,onChange:c,onValueChange:l,value:u,defaultValue:d,max:f,min:p,step:m,hideControls:h,rightSection:g,isAllowed:_,clampBehavior:v,onBlur:y,allowDecimal:b,decimalScale:x,onKeyDown:S,onKeyDownCapture:C,handlersRef:w,startValue:T,disabled:E,rightSectionPointerEvents:O,allowNegative:k,readOnly:A,size:j,rightSectionWidth:M,stepHoldInterval:N,stepHoldDelay:ee,allowLeadingZeros:te,withKeyboardEvents:P,trimLeadingZeroesOnBlur:F,allowedDecimalSeparators:I,attributes:ne,...re}=n,ie=si({name:`NumberInput`,classes:hg,props:n,classNames:i,styles:a,unstyled:o,attributes:ne,vars:s,varsResolver:Eg}),{resolvedClassNames:ae,resolvedStyles:oe}=Wr({classNames:i,styles:a,props:n}),[se,ce]=hn({value:u,defaultValue:d,finalValue:``,onChange:c}),le=ee!==void 0&&N!==void 0,ue=(0,D.useRef)(null),de=(0,D.useRef)(null),fe=(0,D.useRef)(0),pe=(e,t)=>{t.source===`event`&&ce(Cg(e.floatValue,e.value)&&!Nee.test(e.value)&&!(te&&_g.test(e.value))&&!vg.test(e.value)&&!yg.test(e.value)?e.floatValue:e.value),l?.(e,t)},me=e=>{let t=String(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0},he=e=>{ue.current&&e!==void 0&&ue.current.setSelectionRange(e,e)},ge=(0,D.useRef)(ht);ge.current=()=>{if(!xg(se))return;let e,t=me(se),n=me(m),r=Math.max(t,n),i=10**r;if(!bg(se)&&(typeof se!=`number`||Number.isNaN(se)))e=Ot(T,p,f);else if(f!==void 0){let t=(Math.round(Number(se)*i)+Math.round(m*i))/i;e=t<=f?t:f}else e=(Math.round(Number(se)*i)+Math.round(m*i))/i;let a=e.toFixed(r);ce(parseFloat(a)),l?.({floatValue:parseFloat(a),formattedValue:a,value:a},{source:`increment`}),setTimeout(()=>he(ue.current?.value.length),0)};let _e=(0,D.useRef)(ht);_e.current=()=>{if(!xg(se))return;let e,t=p===void 0?k?-(2**53-1):0:p,n=me(se),r=me(m),i=Math.max(n,r),a=10**i;if(!bg(se)&&typeof se!=`number`||Number.isNaN(se))e=Ot(T,t,f);else{let n=(Math.round(Number(se)*a)-Math.round(m*a))/a;e=t!==void 0&&n<t?t:n}let o=e.toFixed(i);ce(parseFloat(o)),l?.({floatValue:parseFloat(o),formattedValue:o,value:o},{source:`decrement`}),setTimeout(()=>he(ue.current?.value.length),0)};let ve=e=>{let t=e.clipboardData.getData(`text`),n=re.decimalSeparator||`.`,r=(I||[`.`,`,`]).filter(e=>e!==n);if(r.some(e=>t.includes(e))){e.preventDefault();let i=t;r.forEach(e=>{i=i.split(e).join(n)});let a=ue.current;if(a){let e=a.selectionStart??0,t=a.selectionEnd??0,n=a.value,r=n.substring(0,e)+i+n.substring(t);(Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set)?.call(a,r),a.dispatchEvent(new Event(`change`,{bubbles:!0}));let o=e+i.length;setTimeout(()=>he(o),0)}}re.onPaste?.(e)},ye=e=>{S?.(e),!(A||!P)&&(e.key===`ArrowUp`&&(e.preventDefault(),ge.current?.()),e.key===`ArrowDown`&&(e.preventDefault(),_e.current?.()))},be=e=>{if(C?.(e),e.key===`Backspace`){let t=ue.current;t&&t.selectionStart===0&&t.selectionStart===t.selectionEnd&&(e.preventDefault(),window.setTimeout(()=>he(0),0))}},xe=e=>{let t=se;v===`blur`&&typeof t==`number`&&(t=Ot(t,p,f)),F&&typeof t==`string`&&me(t)<15&&(t=Dg(t,f,p)),se!==t&&ce(t),y?.(e)};fn(w,{increment:ge.current,decrement:_e.current});let Se=e=>{e?ge.current?.():_e.current?.(),fe.current+=1},Ce=e=>{if(Se(e),le){let t=typeof N==`number`?N:N(fe.current);de.current=window.setTimeout(()=>Ce(e),t)}},we=(e,t)=>{e.preventDefault(),ue.current?.focus(),Se(t),le&&(de.current=window.setTimeout(()=>Ce(t),ee))},Te=()=>{de.current&&window.clearTimeout(de.current),de.current=null,fe.current=0},Ee=(0,R.jsxs)(`div`,{...ie(`controls`),children:[(0,R.jsx)(wl,{...ie(`control`),tabIndex:-1,"aria-hidden":!0,disabled:E||typeof se==`number`&&f!==void 0&&se>=f,mod:{direction:`up`},onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{we(e,!0)},onPointerUp:Te,onPointerLeave:Te,children:(0,R.jsx)(gg,{direction:`up`})}),(0,R.jsx)(wl,{...ie(`control`),tabIndex:-1,"aria-hidden":!0,disabled:E||typeof se==`number`&&p!==void 0&&se<=p,mod:{direction:`down`},onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{we(e,!1)},onPointerUp:Te,onPointerLeave:Te,children:(0,R.jsx)(gg,{direction:`down`})})]});return(0,R.jsx)(wd,{component:Mee,allowNegative:k,className:Nn(hg.root,r),size:j,inputMode:`decimal`,...re,readOnly:A,disabled:E,value:se,getInputRef:mn(t,ue),onValueChange:pe,rightSection:h||A||!xg(se)?g:g||Ee,classNames:ae,styles:oe,unstyled:o,__staticSelector:`NumberInput`,decimalScale:b?x:0,onPaste:ve,onKeyDown:ye,onKeyDownCapture:be,rightSectionPointerEvents:O??(E?`none`:void 0),rightSectionWidth:M??`var(--ni-right-section-width-${j||`sm`})`,allowLeadingZeros:te,allowedDecimalSeparators:I,onBlur:xe,attributes:ne,isAllowed:e=>v===`strict`?_?_(e)&&wg(e.floatValue,p,f):wg(e.floatValue,p,f):!_||_(e)})});Og.classes={...wd.classes,...hg},Og.displayName=`@mantine/core/NumberInput`;var kg={root:`m_db6d6462`,section:`m_2242eb65`,"stripes-animation":`m_81a374bd`,"stripes-animation-vertical":`m_e0fb7a86`,label:`m_91e40b74`},[Ag,jg]=at(`Progress.Root component was not found in tree`),Mg=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=z(`ProgressLabel`,null,e);return(0,R.jsx)(B,{ref:t,...jg().getStyles(`label`,{className:r,style:i,classNames:n,styles:a}),...s})});Mg.classes=kg,Mg.displayName=`@mantine/core/ProgressLabel`;var Ng=jn((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":_t(t,`progress-size`),"--progress-radius":n===void 0?void 0:yt(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Pg=Xi((e,t)=>{let n=z(`ProgressRoot`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,autoContrast:l,transitionDuration:u,orientation:d,attributes:f,mod:p,...m}=n,h=si({name:`Progress`,classes:kg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:f,vars:c,varsResolver:Ng});return(0,R.jsx)(Ag,{value:{getStyles:h,autoContrast:l},children:(0,R.jsx)(B,{ref:t,mod:[{orientation:d},p],...h(`root`),...m})})});Pg.classes=kg,Pg.displayName=`@mantine/core/ProgressRoot`;var Fg={withAria:!0},Ig=Xi((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,value:s,withAria:c,color:l,striped:u,animated:d,mod:f,...p}=z(`ProgressSection`,Fg,e),m=jg(),h=Cr(),g=c?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":s,"aria-valuetext":`${s}%`}:{};return(0,R.jsx)(B,{ref:t,...m.getStyles(`section`,{className:r,classNames:n,styles:a,style:i}),...p,...g,mod:[{striped:u||d,animated:d},f],__vars:{"--progress-section-size":`${s}%`,"--progress-section-color":or(l,h),"--progress-label-color":ci(m.autoContrast,h)?Or({color:l,theme:h,autoContrast:m.autoContrast}):void 0}})});Ig.classes=kg,Ig.displayName=`@mantine/core/ProgressSection`;var Lg=Xi((e,t)=>{let n=z(`Progress`,null,e),{value:r,classNames:i,styles:a,vars:o,color:s,striped:c,animated:l,"aria-label":u,...d}=n,{resolvedClassNames:f,resolvedStyles:p}=Wr({classNames:i,styles:a,props:n});return(0,R.jsx)(Pg,{ref:t,classNames:f,styles:p,vars:o,...d,children:(0,R.jsx)(Ig,{value:r,color:s,striped:c,animated:l,"aria-label":u})})});Lg.classes=kg,Lg.displayName=`@mantine/core/Progress`,Lg.Section=Ig,Lg.Root=Pg,Lg.Label=Mg;var Rg={root:`m_f3f1af94`,inner:`m_89c4f5e4`,icon:`m_f3ed6b2b`,radio:`m_8a3dbb89`,"radio--outline":`m_1bfe9d39`},[zg,Bg]=ot(),[Vg,Hg]=ot(),Ug={card:`m_9dc8ae12`},Wg={withBorder:!0},Gg=jn((e,{radius:t})=>({card:{"--card-radius":yt(t)}})),Kg=Xi((e,t)=>{let n=z(`RadioCard`,Wg,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,checked:l,mod:u,withBorder:d,value:f,onClick:p,name:m,onKeyDown:h,attributes:g,..._}=n,v=si({name:`RadioCard`,classes:Ug,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:Gg,rootSelector:`card`}),{dir:y}=$i(),b=Bg(),x=typeof l==`boolean`?l:b?.value===f||!1,S=m||b?.name,C=e=>{if(h?.(e),[`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`].includes(e.nativeEvent.code)){e.preventDefault();let t=Array.from(document.querySelectorAll(`[role="radio"][name="${S||`__mantine`}"]`)),n=t.findIndex(t=>t===e.target),r=n+1>=t.length?0:n+1,i=n-1<0?t.length-1:n-1;e.nativeEvent.code===`ArrowDown`&&(t[r].focus(),t[r].click()),e.nativeEvent.code===`ArrowUp`&&(t[i].focus(),t[i].click()),e.nativeEvent.code===`ArrowLeft`&&(t[y===`ltr`?i:r].focus(),t[y===`ltr`?i:r].click()),e.nativeEvent.code===`ArrowRight`&&(t[y===`ltr`?r:i].focus(),t[y===`ltr`?r:i].click())}};return(0,R.jsx)(Vg,{value:{checked:x},children:(0,R.jsx)(wl,{ref:t,mod:[{"with-border":d,checked:x},u],...v(`card`),..._,role:`radio`,"aria-checked":x,name:S,onClick:e=>{p?.(e),b?.onChange(f||``)},onKeyDown:C})})});Kg.displayName=`@mantine/core/RadioCard`,Kg.classes=Ug;var qg=Xi((e,t)=>{let{value:n,defaultValue:r,onChange:i,size:a,wrapperProps:o,children:s,name:c,readOnly:l,disabled:u,...d}=z(`RadioGroup`,null,e),f=rn(c),[p,m]=hn({value:n,defaultValue:r,finalValue:``,onChange:i});return(0,R.jsx)(zg,{value:{value:p,onChange:e=>!l&&m(typeof e==`string`?e:e.currentTarget.value),size:a,name:f,disabled:u},children:(0,R.jsx)(xd.Wrapper,{size:a,ref:t,...o,...d,labelElement:`div`,__staticSelector:`RadioGroup`,children:(0,R.jsx)(bp,{role:`radiogroup`,children:s})})})});qg.classes=xd.Wrapper.classes,qg.displayName=`@mantine/core/RadioGroup`;function Jg({size:e,style:t,...n}){return(0,R.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:L(e),height:L(e),...t},"aria-hidden":!0,...n,children:(0,R.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var Yg={indicator:`m_717d7ff6`,icon:`m_3e4da632`,"indicator--outline":`m_2980836c`},Xg={icon:Jg},Zg=jn((e,{radius:t,color:n,size:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:n||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{indicator:{"--radio-size":_t(r,`radio-size`),"--radio-radius":t===void 0?void 0:yt(t),"--radio-color":a===`outline`?c:or(n,e),"--radio-icon-size":_t(r,`radio-icon-size`),"--radio-icon-color":i?or(i,e):ci(o,e)?Or({color:n,theme:e,autoContrast:o}):void 0}}}),Qg=Xi((e,t)=>{let n=z(`RadioIndicator`,Xg,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,icon:l,radius:u,color:d,iconColor:f,autoContrast:p,checked:m,mod:h,variant:g,disabled:_,attributes:v,...y}=n,b=si({name:`RadioIndicator`,classes:Yg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,vars:c,varsResolver:Zg,rootSelector:`indicator`}),x=Hg(),S=typeof m==`boolean`?m:x?.checked||!1;return(0,R.jsx)(B,{ref:t,...b(`indicator`,{variant:g}),variant:g,mod:[{checked:S,disabled:_},h],...y,children:(0,R.jsx)(l,{...b(`icon`)})})});Qg.displayName=`@mantine/core/RadioIndicator`,Qg.classes=Yg;var $g={labelPosition:`right`},e_=jn((e,{size:t,radius:n,color:r,iconColor:i,variant:a,autoContrast:o})=>{let s=ar({color:r||e.primaryColor,theme:e}),c=s.isThemeColor&&s.shade===void 0?`var(--mantine-color-${s.color}-outline)`:s.color;return{root:{"--radio-size":_t(t,`radio-size`),"--radio-radius":n===void 0?void 0:yt(n),"--radio-color":a===`outline`?c:or(r,e),"--radio-icon-color":i?or(i,e):ci(o,e)?Or({color:r,theme:e,autoContrast:o}):void 0,"--radio-icon-size":_t(t,`radio-icon-size`)}}}),t_=Xi((e,t)=>{let n=z(`Radio`,$g,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,id:l,size:u,label:d,labelPosition:f,description:p,error:m,radius:h,color:g,variant:_,disabled:v,wrapperProps:y,icon:b=Jg,rootRef:x,iconColor:S,onChange:C,mod:w,attributes:T,checked:E,...D}=n,O=si({name:`Radio`,classes:Rg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:T,vars:c,varsResolver:e_}),k=Bg(),A=k?.size??u,j=n.size?u:A,{styleProps:M,rest:N}=gi(D),ee=rn(l),te=k?k.value===N.value:void 0,P={checked:te??E,name:k?.name??N.name,onChange:e=>{k?.onChange(e),C?.(e)},disabled:k?.disabled??v};return(0,R.jsx)(lp,{...O(`root`),__staticSelector:`Radio`,__stylesApiProps:n,id:ee,size:j,labelPosition:f,label:d,description:p,error:m,disabled:P.disabled,classNames:r,styles:o,unstyled:s,"data-checked":(te??E)||void 0,variant:_,ref:x,mod:w,...M,...y,children:(0,R.jsxs)(B,{...O(`inner`),mod:{"label-position":f},children:[(0,R.jsx)(B,{...O(`radio`,{focusable:!0,variant:_}),...N,...P,component:`input`,mod:{error:!!m},ref:t,id:ee,type:`radio`}),(0,R.jsx)(b,{...O(`icon`),"aria-hidden":!0})]})})});t_.classes=Rg,t_.displayName=`@mantine/core/Radio`,t_.Group=qg,t_.Card=Kg,t_.Indicator=Qg;var n_={duration:100,transition:`fade`};function r_(e,t){return{...n_,...t,...e}}var i_={tooltip:`m_1b3c8819`,arrow:`m_f898399f`};function a_({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,D.useState)(n),a=(0,D.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Pc({placement:t,middleware:[Ws({crossAxis:!0,padding:5,rootBoundary:`document`})]}),f=d.includes(`right`)?e:t.includes(`left`)?e*-1:0,p=d.includes(`bottom`)?e:t.includes(`top`)?e*-1:0,m=(0,D.useCallback)(({clientX:e,clientY:t})=>{l.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e+f,top:t+p,right:e,bottom:t}}})},[c.reference]);return(0,D.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=Ma(l.floating.current);return t.forEach(e=>{e.addEventListener(`scroll`,u)}),()=>{e.removeEventListener(`mousemove`,m),t.forEach(e=>{e.removeEventListener(`scroll`,u)})}}},[c.reference,l.floating.current,u,m,r]),{handleMouseMove:m,x:o,y:s,opened:r,setOpened:i,boundaryRef:a,floating:l.setFloating}}var o_={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:mt(`popover`)},s_=jn((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:yt(t),"--tooltip-bg":n?or(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),c_=Xi((e,t)=>{let n=z(`TooltipFloating`,o_,e),{children:r,refProp:i,withinPortal:a,style:o,className:s,classNames:c,styles:l,unstyled:u,radius:d,color:f,label:p,offset:m,position:h,multiline:g,zIndex:_,disabled:v,defaultOpened:y,variant:b,vars:x,portalProps:S,attributes:C,...w}=n,T=Cr(),E=si({name:`TooltipFloating`,props:n,classes:i_,className:s,style:o,classNames:c,styles:l,unstyled:u,attributes:C,rootSelector:`tooltip`,vars:x,varsResolver:s_}),{handleMouseMove:O,x:k,y:A,opened:j,boundaryRef:M,floating:N,setOpened:ee}=a_({offset:m,position:h,defaultOpened:y}),te=An(r);if(!te)throw Error(`[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let P=mn(M,En(te),t),F=te.props,I=e=>{F.onMouseEnter?.(e),O(e),ee(!0)},ne=e=>{F.onMouseLeave?.(e),ee(!1)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Wl,{...S,withinPortal:a,children:(0,R.jsx)(B,{...w,...E(`tooltip`,{style:{...Bi(o,T),zIndex:_,display:!v&&j?`block`:`none`,top:(A&&Math.round(A))??``,left:(k&&Math.round(k))??``}}),variant:b,ref:N,mod:{multiline:g},children:p})}),(0,D.cloneElement)(te,{...F,[i]:P,onMouseEnter:I,onMouseLeave:ne})]})});c_.classes=i_,c_.displayName=`@mantine/core/TooltipFloating`;var l_=(0,D.createContext)(!1),u_=l_.Provider,d_=()=>(0,D.useContext)(l_),f_={openDelay:0,closeDelay:0};function p_(e){let{openDelay:t,closeDelay:n,children:r}=z(`TooltipGroup`,f_,e);return(0,R.jsx)(u_,{value:!0,children:(0,R.jsx)(Dc,{delay:{open:t,close:n},children:r})})}p_.displayName=`@mantine/core/TooltipGroup`,p_.extend=e=>e;function m_(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function h_(e){let t=m_(e.middlewares),n=[Us(e.offset)];return t.shift&&n.push(Ws(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?Ks():Ks(t.flip)),n.push(Xs({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?Ys():Ys(t.inline)):e.inline&&n.push(Ys()),n}function g_(e){let[t,n]=(0,D.useState)(e.defaultOpened),r=typeof e.opened==`boolean`?e.opened:t,i=d_(),a=rn(),o=(0,D.useCallback)(e=>{n(e),e&&g(a)},[a]),{x:s,y:c,context:l,refs:u,placement:d,middlewareData:{arrow:{x:f,y:p}={}}}=Pc({strategy:e.strategy,placement:e.position,open:r,onOpenChange:o,middleware:h_(e),whileElementsMounted:Es}),{delay:m,currentId:h,setCurrentId:g}=Oc(l,{id:a}),{getReferenceProps:_,getFloatingProps:v}=Rc([Cc(l,{enabled:e.events?.hover,delay:i?m:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),Ic(l,{enabled:e.events?.focus,visibleOnly:!0}),Bc(l,{role:`tooltip`}),Mc(l,{enabled:e.opened===void 0})]);Vt(()=>{e.onPositionChange?.(d)},[d]);let y=r&&h&&h!==a;return{x:s,y:c,arrowX:f,arrowY:p,reference:u.setReference,floating:u.setFloating,getFloatingProps:v,getReferenceProps:_,isGroupPhase:y,opened:r,placement:d}}var __={position:`top`,refProp:`ref`,withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,offset:5,transitionProps:{duration:100,transition:`fade`},events:{hover:!0,focus:!1,touch:!1},zIndex:mt(`popover`),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},v_=jn((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:i,variant:r||`filled`});return{tooltip:{"--tooltip-radius":t===void 0?void 0:yt(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),y_=Xi((e,t)=>{let n=z(`Tooltip`,__,e),{children:r,position:i,refProp:a,label:o,openDelay:s,closeDelay:c,onPositionChange:l,opened:u,defaultOpened:d,withinPortal:f,radius:p,color:m,classNames:h,styles:g,unstyled:_,style:v,className:y,withArrow:b,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,offset:T,transitionProps:E,multiline:O,events:k,zIndex:A,disabled:j,positionDependencies:M,onClick:N,onMouseEnter:ee,onMouseLeave:te,inline:P,variant:F,keepMounted:I,vars:ne,portalProps:re,mod:ie,floatingStrategy:ae,middlewares:oe,autoContrast:se,attributes:ce,target:le,...ue}=z(`Tooltip`,__,n),{dir:de}=$i(),fe=(0,D.useRef)(null),pe=g_({position:Fl(de,i),closeDelay:c,openDelay:s,onPositionChange:l,opened:u,defaultOpened:d,events:k,arrowRef:fe,arrowOffset:S,offset:typeof T==`number`?T+(b?x/2:0):T,positionDependencies:[...M,le??r],inline:P,strategy:ae,middlewares:oe});(0,D.useEffect)(()=>{let e=le instanceof HTMLElement?le:typeof le==`string`?document.querySelector(le):le?.current||null;e&&pe.reference(e)},[le,pe]);let me=si({name:`Tooltip`,props:n,classes:i_,className:y,style:v,classNames:h,styles:g,unstyled:_,attributes:ce,rootSelector:`tooltip`,vars:ne,varsResolver:v_}),he=An(r);if(!le&&!he)throw Error(`[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);if(le){let e=r_(E,{duration:100,transition:`fade`});return(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(Wl,{...re,withinPortal:f,children:(0,R.jsx)(Xl,{...e,keepMounted:I,mounted:!j&&!!pe.opened,duration:pe.isGroupPhase?10:e.duration,children:e=>(0,R.jsxs)(B,{...ue,"data-fixed":ae===`fixed`||void 0,variant:F,mod:[{multiline:O},ie],...pe.getFloatingProps({ref:pe.floating,className:me(`tooltip`).className,style:{...me(`tooltip`).style,...e,zIndex:A,top:pe.y??0,left:pe.x??0}}),children:[o,(0,R.jsx)(Pl,{ref:fe,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:b,position:pe.placement,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,...me(`arrow`)})]})})})})}let ge=he.props,_e=mn(pe.reference,En(he),t),ve=r_(E,{duration:100,transition:`fade`});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Wl,{...re,withinPortal:f,children:(0,R.jsx)(Xl,{...ve,keepMounted:I,mounted:!j&&!!pe.opened,duration:pe.isGroupPhase?10:ve.duration,children:e=>(0,R.jsxs)(B,{...ue,"data-fixed":ae===`fixed`||void 0,variant:F,mod:[{multiline:O},ie],...pe.getFloatingProps({ref:pe.floating,className:me(`tooltip`).className,style:{...me(`tooltip`).style,...e,zIndex:A,top:pe.y??0,left:pe.x??0}}),children:[o,(0,R.jsx)(Pl,{ref:fe,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:b,position:pe.placement,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,...me(`arrow`)})]})})}),(0,D.cloneElement)(he,pe.getReferenceProps({onClick:N,onMouseEnter:ee,onMouseLeave:te,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...ge,className:Nn(y,ge.className),[a]:_e}))]})});y_.classes=i_,y_.displayName=`@mantine/core/Tooltip`,y_.Floating=c_,y_.Group=p_;var b_={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},x_={withItemsBorders:!0},S_=jn((e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:a})=>({root:{"--sc-radius":t===void 0?void 0:yt(t),"--sc-color":n?or(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":a,"--sc-padding":_t(i,`sc-padding`),"--sc-font-size":bt(i)}})),C_=Xi((e,t)=>{let n=z(`SegmentedControl`,x_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,data:l,value:u,defaultValue:d,onChange:f,size:p,name:m,disabled:h,readOnly:g,fullWidth:_,orientation:v,radius:y,color:b,transitionDuration:x,transitionTimingFunction:S,variant:C,autoContrast:w,withItemsBorders:T,mod:E,attributes:O,...k}=n,A=si({name:`SegmentedControl`,props:n,classes:b_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:O,vars:c,varsResolver:S_}),j=Cr(),M=l.map(e=>typeof e==`string`?{label:e,value:e}:e),N=wn(),[ee,te]=(0,D.useState)(kt()),[P,F]=(0,D.useState)(null),[I,ne]=(0,D.useState)({}),re=(e,t)=>{I[t]=e,ne(I)},[ie,ae]=hn({value:u,defaultValue:d,finalValue:Array.isArray(l)?M.find(e=>!e.disabled)?.value??l[0]?.value??null:null,onChange:f}),oe=rn(m),se=M.map(e=>(0,D.createElement)(B,{...A(`control`),mod:{active:ie===e.value,orientation:v},key:e.value},(0,D.createElement)(`input`,{...A(`input`),disabled:h||e.disabled,type:`radio`,name:oe,value:e.value,id:`${oe}-${e.value}`,checked:ie===e.value,onChange:()=>!g&&ae(e.value),"data-focus-ring":j.focusRing,key:`${e.value}-input`}),(0,D.createElement)(B,{component:`label`,...A(`label`),mod:{active:ie===e.value&&!(h||e.disabled),disabled:h||e.disabled,"read-only":g},htmlFor:`${oe}-${e.value}`,ref:t=>re(t,e.value),__vars:{"--sc-label-color":b===void 0?void 0:Or({color:b,theme:j,autoContrast:w})},key:`${e.value}-label`},(0,R.jsx)(`span`,{...A(`innerLabel`),children:e.label})))),ce=mn(t,e=>F(e));return yn(()=>{te(kt())},[l.length]),l.length===0?null:(0,R.jsxs)(B,{...A(`root`),variant:C,size:p,ref:ce,mod:[{"full-width":_,orientation:v,initialized:N,"with-items-borders":T},E],...k,role:`radiogroup`,"data-disabled":h,children:[typeof ie==`string`&&(0,R.jsx)(Md,{target:I[ie],parent:P,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...A(`indicator`)},ee),se]})});C_.classes=b_,C_.displayName=`@mantine/core/SegmentedControl`;var w_={withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},T_=Xi((e,t)=>{let n=z(`Select`,w_,e),{classNames:r,styles:i,unstyled:a,vars:o,dropdownOpened:s,defaultDropdownOpened:c,onDropdownClose:l,onDropdownOpen:u,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:O,size:k,searchable:A,rightSection:j,checkIconPosition:M,withCheckIcon:N,withAlignedLabels:ee,nothingFoundMessage:te,name:P,form:F,searchValue:I,defaultSearchValue:ne,onSearchChange:re,allowDeselect:ie,error:ae,rightSectionPointerEvents:oe,id:se,clearable:ce,clearButtonProps:le,hiddenInputProps:ue,renderOption:de,onClear:fe,autoComplete:pe,scrollAreaProps:me,__defaultRightSection:he,__clearSection:ge,__clearable:_e,chevronColor:ve,autoSelectOnBlur:ye,openOnFocus:be,attributes:xe,...Se}=n,Ce=(0,D.useMemo)(()=>Of(h),[h]),we=(0,D.useRef)({}),Te=(0,D.useMemo)(()=>kf(Ce),[Ce]),Ee=rn(se),[De,Oe,ke]=hn({value:g,defaultValue:_,finalValue:null,onChange:m}),Ae=typeof De==`string`?De in Te?Te[De]:we.current[De]:void 0,je=Sn(Ae),[Me,Ne,Pe]=hn({value:I,defaultValue:ne,finalValue:Ae?Ae.label:``,onChange:re}),Fe=rp({opened:s,defaultOpened:c,onDropdownOpen:()=>{u?.(),y?Fe.selectFirstOption():Fe.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{l?.(),setTimeout(Fe.resetSelectedOption,0)}}),Ie=e=>{Ne(e),Fe.resetSelectedOption()},{resolvedClassNames:Le,resolvedStyles:Re}=Wr({props:n,styles:i,classNames:r});(0,D.useEffect)(()=>{v&&Fe.selectFirstOption()},[v,Me]),(0,D.useEffect)(()=>{g===null&&Ie(``),typeof g==`string`&&Ae&&(je?.value!==Ae.value||je?.label!==Ae.label)&&Ie(Ae.label)},[g,Ae]),(0,D.useEffect)(()=>{!ke&&!Pe&&Ie(typeof De==`string`?De in Te?Te[De]?.label:we.current[De]?.label||``:``)},[Te,De]),(0,D.useEffect)(()=>{De&&De in Te&&(we.current[De]=Te[De])},[Te,De]);let ze=(0,R.jsx)(op.ClearButton,{...le,onClear:()=>{Oe(null,null),Ie(``),fe?.()}}),Be=ce&&!!De&&!C&&!S;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(op,{store:Fe,__staticSelector:`Select`,classNames:Le,styles:Re,unstyled:a,readOnly:S,size:k,attributes:xe,keepMounted:ye,onOptionSubmit:e=>{b?.(e);let t=ie&&Te[e].value===De?null:Te[e],n=t?t.value:null;n!==De&&Oe(n,t),!ke&&Ie(typeof n==`string`&&t?.label||``),Fe.closeDropdown()},...x,children:[(0,R.jsx)(op.Target,{targetType:A?`input`:`button`,autoComplete:pe,children:(0,R.jsx)(wd,{id:Ee,ref:t,__defaultRightSection:(0,R.jsx)(op.Chevron,{size:k,error:ae,unstyled:a,color:ve}),__clearSection:ze,__clearable:Be,rightSection:j,rightSectionPointerEvents:oe||`none`,...Se,size:k,__staticSelector:`Select`,disabled:C,readOnly:S||!A,value:Me,onChange:e=>{Ie(e.currentTarget.value),Fe.openDropdown(),v&&Fe.selectFirstOption()},onFocus:e=>{be&&A&&Fe.openDropdown(),d?.(e)},onBlur:e=>{ye&&Fe.clickSelectedOption(),A&&Fe.closeDropdown();let t=typeof De==`string`&&(De in Te?Te[De]:we.current[De]);Ie(t&&t.label||``),f?.(e)},onClick:e=>{A?Fe.openDropdown():Fe.toggleDropdown(),p?.(e)},classNames:Le,styles:Re,unstyled:a,pointer:!A,error:ae,attributes:xe})}),(0,R.jsx)(Lp,{data:Ce,hidden:S||C,filter:w,search:Me,limit:T,hiddenWhenEmpty:!te,withScrollArea:E,maxDropdownHeight:O,filterOptions:!!A&&Ae?.label!==Me,value:De,checkIconPosition:M,withCheckIcon:N,withAlignedLabels:ee,nothingFoundMessage:te,unstyled:a,labelId:Se.label?`${Ee}-label`:void 0,"aria-label":Se.label?void 0:Se[`aria-label`],renderOption:de,scrollAreaProps:me})]}),(0,R.jsx)(op.HiddenInput,{value:De,name:P,form:F,disabled:C,...ue})]})});T_.classes={...wd.classes,...op.classes},T_.displayName=`@mantine/core/Select`;var E_={container:`m_925c2d2c`,root:`m_2415a157`};function D_({spacing:e,verticalSpacing:t,cols:n,selector:r}){let i=Cr(),a=t===void 0?e:t,o=tt({"--sg-spacing-x":vt(Et(e)),"--sg-spacing-y":vt(Et(a)),"--sg-cols":Et(n)?.toString()}),s=Ke(i.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=vt(e[r])),typeof a==`object`&&a[r]!==void 0&&(t[r][`--sg-spacing-y`]=vt(a[r])),typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,R.jsx)(hi,{styles:o,media:Tt(Ke(s),i.breakpoints).filter(e=>Ke(s[e.value]).length>0).map(e=>({query:`(min-width: ${i.breakpoints[e.value]})`,styles:s[e.value]})),selector:r})}function O_(e){return typeof e==`object`&&e?Ke(e):[]}function k_(e){return e.sort((e,t)=>Ze(e)-Ze(t))}function A_({spacing:e,verticalSpacing:t,cols:n}){return k_(Array.from(new Set([...O_(e),...O_(t),...O_(n)])))}function j_({spacing:e,verticalSpacing:t,cols:n,selector:r}){let i=t===void 0?e:t,a=tt({"--sg-spacing-x":vt(Et(e)),"--sg-spacing-y":vt(Et(i)),"--sg-cols":Et(n)?.toString()}),o=A_({spacing:e,verticalSpacing:t,cols:n}),s=o.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=vt(e[r])),typeof i==`object`&&i[r]!==void 0&&(t[r][`--sg-spacing-y`]=vt(i[r])),typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,R.jsx)(hi,{styles:a,container:o.map(e=>({query:`simple-grid (min-width: ${e})`,styles:s[e]})),selector:r})}var M_={cols:1,spacing:`md`,type:`media`},N_=Xi((e,t)=>{let n=z(`SimpleGrid`,M_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,cols:l,verticalSpacing:u,spacing:d,type:f,attributes:p,...m}=n,h=si({name:`SimpleGrid`,classes:E_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c}),g=zi();return f===`container`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(j_,{...n,selector:`.${g}`}),(0,R.jsx)(`div`,{...h(`container`),children:(0,R.jsx)(B,{ref:t,...h(`root`,{className:g}),...m})})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(D_,{...n,selector:`.${g}`}),(0,R.jsx)(B,{ref:t,...h(`root`,{className:g}),...m})]})});N_.classes=E_,N_.displayName=`@mantine/core/SimpleGrid`;var P_={root:`m_6d731127`},F_={gap:`md`,align:`stretch`,justify:`flex-start`},I_=jn((e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":vt(t),"--stack-align":n,"--stack-justify":r}})),U=Xi((e,t)=>{let n=z(`Stack`,F_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,align:l,justify:u,gap:d,variant:f,attributes:p,...m}=n;return(0,R.jsx)(B,{ref:t,...si({name:`Stack`,props:n,classes:P_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:I_})(`root`),variant:f,...m})});U.classes=P_,U.displayName=`@mantine/core/Stack`;var L_={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},R_=(0,D.createContext)(null),z_=R_.Provider,B_=()=>(0,D.useContext)(R_),V_=Xi((e,t)=>{let{value:n,defaultValue:r,onChange:i,size:a,wrapperProps:o,children:s,readOnly:c,disabled:l,...u}=z(`SwitchGroup`,null,e),[d,f]=hn({value:n,defaultValue:r,finalValue:[],onChange:i});return(0,R.jsx)(z_,{value:{value:d,onChange:e=>{let t=e.currentTarget.value;!c&&f(d.includes(t)?d.filter(e=>e!==t):[...d,t])},size:a,disabled:l},children:(0,R.jsx)(xd.Wrapper,{size:a,ref:t,...o,...u,labelElement:`div`,__staticSelector:`SwitchGroup`,children:(0,R.jsx)(bp,{role:`group`,children:s})})})});V_.classes=xd.Wrapper.classes,V_.displayName=`@mantine/core/SwitchGroup`;var H_={labelPosition:`right`,withThumbIndicator:!0},U_=jn((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:yt(t),"--switch-height":_t(r,`switch-height`),"--switch-width":_t(r,`switch-width`),"--switch-thumb-size":_t(r,`switch-thumb-size`),"--switch-label-font-size":_t(r,`switch-label-font-size`),"--switch-track-label-padding":_t(r,`switch-track-label-padding`),"--switch-color":n?or(n,e):void 0}})),W_=Xi((e,t)=>{let n=z(`Switch`,H_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,label:u,offLabel:d,onLabel:f,id:p,size:m,radius:h,wrapperProps:g,thumbIcon:_,checked:v,defaultChecked:y,onChange:b,labelPosition:x,description:S,error:C,disabled:w,variant:T,rootRef:E,mod:D,withThumbIndicator:O,attributes:k,...A}=n,j=B_(),M=m||j?.size,N=si({name:`Switch`,props:n,classes:L_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:k,vars:c,varsResolver:U_}),{styleProps:ee,rest:te}=gi(A),P=rn(p),F={checked:j?.value.includes(te.value)??v,onChange:e=>{j?.onChange(e),b?.(e)},disabled:j?.disabled??w},[I,ne]=hn({value:F.checked??v,defaultValue:y,finalValue:!1});return(0,R.jsxs)(lp,{...N(`root`),__staticSelector:`Switch`,__stylesApiProps:n,id:P,size:M,labelPosition:x,label:u,description:S,error:C,disabled:F.disabled,bodyElement:`label`,labelElement:`span`,classNames:r,styles:o,unstyled:s,"data-checked":F.checked,variant:T,ref:E,mod:D,inert:te.inert,...ee,...g,children:[(0,R.jsx)(`input`,{...te,...F,checked:I,"data-checked":F.checked,onChange:e=>{F.onChange?.(e),ne(e.currentTarget.checked)},id:P,ref:t,type:`checkbox`,role:`switch`,inert:te.inert,...N(`input`)}),(0,R.jsxs)(B,{"aria-hidden":`true`,component:`span`,mod:{error:C,"label-position":x,"without-labels":!f&&!d},...N(`track`),children:[(0,R.jsx)(B,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":O&&!_},...N(`thumb`),children:_}),(0,R.jsx)(`span`,{...N(`trackLabel`),children:I?f:d})]})]})});W_.classes={...L_,...cp},W_.displayName=`@mantine/core/Switch`,W_.Group=V_;var[G_,K_]=at(`Table component was not found in the tree`),q_={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`};function J_(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function Y_(e,t){let n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=Xi((r,i)=>{let a=z(n,{},r),{classNames:o,className:s,style:c,styles:l,...u}=a,d=K_();return(0,R.jsx)(B,{component:e,ref:i,...J_(d,t),...d.getStyles(e,{className:s,classNames:o,style:c,styles:l,props:a}),...u})});return r.displayName=`@mantine/core/${n}`,r.classes=q_,r}var X_=Y_(`th`,{columnBorder:!0}),Z_=Y_(`td`,{columnBorder:!0}),Q_=Y_(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),$_=Y_(`thead`,{stickyHeader:!0}),ev=Y_(`tbody`),tv=Y_(`tfoot`),nv=Y_(`caption`,{captionSide:!0});function rv({data:e}){return(0,R.jsxs)(R.Fragment,{children:[e.caption&&(0,R.jsx)(nv,{children:e.caption}),e.head&&(0,R.jsx)($_,{children:(0,R.jsx)(Q_,{children:e.head.map((e,t)=>(0,R.jsx)(X_,{children:e},t))})}),e.body&&(0,R.jsx)(ev,{children:e.body.map((e,t)=>(0,R.jsx)(Q_,{children:e.map((e,t)=>(0,R.jsx)(Z_,{children:e},t))},t))}),e.foot&&(0,R.jsx)(tv,{children:(0,R.jsx)(Q_,{children:e.foot.map((e,t)=>(0,R.jsx)(X_,{children:e},t))})})]})}rv.displayName=`@mantine/core/TableDataRenderer`;var Pee={type:`scrollarea`},Fee=jn((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":L(t),"--table-max-height":L(n),"--table-overflow":r===`native`?`auto`:void 0}})),iv=Xi((e,t)=>{let n=z(`TableScrollContainer`,Pee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,minWidth:u,maxHeight:d,type:f,scrollAreaProps:p,attributes:m,...h}=n,g=si({name:`TableScrollContainer`,classes:q_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:Fee,rootSelector:`scrollContainer`});return(0,R.jsx)(B,{component:f===`scrollarea`?bl:`div`,...f===`scrollarea`?d?{offsetScrollbars:`xy`,...p}:{offsetScrollbars:`x`,...p}:{},ref:t,...g(`scrollContainer`),...h,children:(0,R.jsx)(`div`,{...g(`scrollContainerInner`),children:l})})});iv.classes=q_,iv.displayName=`@mantine/core/TableScrollContainer`;var Iee={withRowBorders:!0,verticalSpacing:7},Lee=jn((e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:a,stripedColor:o,highlightOnHoverColor:s,striped:c,highlightOnHover:l,stickyHeaderOffset:u,stickyHeader:d})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":vt(r),"--table-vertical-spacing":vt(i),"--table-border-color":a?or(a,e):void 0,"--table-striped-color":c&&o?or(o,e):void 0,"--table-highlight-on-hover-color":l&&s?or(s,e):void 0,"--table-sticky-header-offset":d?L(u):void 0}})),av=Xi((e,t)=>{let n=z(`Table`,Iee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,horizontalSpacing:l,verticalSpacing:u,captionSide:d,stripedColor:f,highlightOnHoverColor:p,striped:m,highlightOnHover:h,withColumnBorders:g,withRowBorders:_,withTableBorder:v,borderColor:y,layout:b,variant:x,data:S,children:C,stickyHeader:w,stickyHeaderOffset:T,mod:E,tabularNums:D,attributes:O,...k}=n,A=si({name:`Table`,props:n,className:i,style:a,classes:q_,classNames:r,styles:o,unstyled:s,attributes:O,rootSelector:`table`,vars:c,varsResolver:Lee});return(0,R.jsx)(G_,{value:{getStyles:A,stickyHeader:w,striped:m===!0?`odd`:m||void 0,highlightOnHover:h,withColumnBorders:g,withRowBorders:_,captionSide:d||`bottom`},children:(0,R.jsx)(B,{component:`table`,variant:x,ref:t,mod:[{"data-with-table-border":v,"data-tabular-nums":D},E],...A(`table`),...k,children:C||!!S&&(0,R.jsx)(rv,{data:S})})})});av.classes=q_,av.displayName=`@mantine/core/Table`,av.Td=Z_,av.Th=X_,av.Tr=Q_,av.Thead=$_,av.Tbody=ev,av.Tfoot=tv,av.Caption=nv,av.ScrollContainer=iv,av.DataRenderer=rv;var ov=Xi((e,t)=>(0,R.jsx)(wd,{component:`input`,ref:t,...z(`TextInput`,null,e),__staticSelector:`TextInput`}));ov.classes=wd.classes,ov.displayName=`@mantine/core/TextInput`;var sv={root:`m_7341320d`},Ree=jn((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ti-size":_t(t,`ti-size`),"--ti-radius":n===void 0?void 0:yt(n),"--ti-bg":a||r?s.background:void 0,"--ti-color":a||r?s.color:void 0,"--ti-bd":a||r?s.border:void 0}}}),cv=Xi((e,t)=>{let n=z(`ThemeIcon`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,autoContrast:l,attributes:u,...d}=n;return(0,R.jsx)(B,{ref:t,...si({name:`ThemeIcon`,classes:sv,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:u,vars:c,varsResolver:Ree})(`root`),...d})});cv.classes=sv,cv.displayName=`@mantine/core/ThemeIcon`;var zee=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],Bee=[`xs`,`sm`,`md`,`lg`,`xl`];function Vee(e,t){let n=t===void 0?`h${e}`:t;return zee.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:Bee.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:L(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var lv={root:`m_8a5d1357`},Hee={order:1},Uee=jn((e,{order:t,size:n,lineClamp:r,textWrap:i})=>{let a=Vee(t||1,n);return{root:{"--title-fw":a.fontWeight,"--title-lh":a.lineHeight,"--title-fz":a.fontSize,"--title-line-clamp":typeof r==`number`?r.toString():void 0,"--title-text-wrap":i}}}),uv=Xi((e,t)=>{let n=z(`Title`,Hee,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,order:c,vars:l,size:u,variant:d,lineClamp:f,textWrap:p,mod:m,attributes:h,...g}=n,_=si({name:`Title`,props:n,classes:lv,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:h,vars:l,varsResolver:Uee});return[1,2,3,4,5,6].includes(c)?(0,R.jsx)(B,{..._(`root`),component:`h${c}`,variant:d,ref:t,mod:[{order:c,"data-line-clamp":typeof f==`number`},m],size:u,...g}):null});uv.classes=lv,uv.displayName=`@mantine/core/Title`;function Wee(e){let t=e,n=!1,r=new Set;return{getState(){return t},updateState(e){t=typeof e==`function`?e(t):e},setState(e){this.updateState(e),r.forEach(e=>e(t))},initialize(e){n||=(t=e,!0)},subscribe(e){return r.add(e),()=>r.delete(e)}}}function Gee(e){return(0,D.useSyncExternalStore)(e.subscribe,()=>e.getState(),()=>e.getState())}function Kee(e,t,n){let r=[],i=[],a={};for(let o of e){let e=o.position||t;a[e]=a[e]||0,a[e]+=1,a[e]<=n?i.push(o):r.push(o)}return{notifications:i,queue:r}}var dv=Wee({notifications:[],queue:[],defaultPosition:`bottom-right`,limit:5}),qee=(e=dv)=>Gee(e);function fv(e,t){let n=e.getState(),r=Kee(t([...n.notifications,...n.queue]),n.defaultPosition,n.limit);e.setState({notifications:r.notifications,queue:r.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Jee(e,t=dv){let n=e.id||kt();return fv(t,t=>e.id&&t.some(t=>t.id===e.id)?t:[...t,{...e,id:n}]),n}function pv(e,t=dv){return fv(t,t=>t.filter(t=>t.id===e?(t.onClose?.(t),!1):!0)),e}function Yee(e,t=dv){return fv(t,t=>t.map(t=>t.id===e.id?{...t,...e}:t)),e.id}function Xee(e=dv){fv(e,()=>[])}function Zee(e=dv){fv(e,t=>t.slice(0,e.getState().limit))}var mv={show:Jee,hide:pv,update:Yee,clean:Xee,cleanQueue:Zee,updateState:fv};function hv(e,t){return hv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hv(e,t)}function gv(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,hv(e,t)}var _v={disabled:!1},vv=D.createContext(null),Qee=function(e){return e.scrollTop},yv=`unmounted`,bv=`exited`,xv=`entering`,Sv=`entered`,Cv=`exiting`,wv=function(e){gv(t,e);function t(t,n){var r=e.call(this,t,n)||this,i=n,a=i&&!i.isMounting?t.enter:t.appear,o;return r.appearStatus=null,t.in?a?(o=bv,r.appearStatus=xv):o=Sv:o=t.unmountOnExit||t.mountOnEnter?yv:bv,r.state={status:o},r.nextCallback=null,r}t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===`unmounted`?{status:bv}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==`entering`&&n!==`entered`&&(t=xv):(n===`entering`||n===`entered`)&&(t=Cv)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e=this.props.timeout,t=n=r=e,n,r;return e!=null&&typeof e!=`number`&&(t=e.exit,n=e.enter,r=e.appear===void 0?n:e.appear),{exit:t,enter:n,appear:r}},n.updateStatus=function(e,t){if(e===void 0&&(e=!1),t!==null)if(this.cancelNextCallback(),t===`entering`){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:ea.default.findDOMNode(this);n&&Qee(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===`exited`&&this.setState({status:yv})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[ea.default.findDOMNode(this),r],a=i[0],o=i[1],s=this.getTimeouts(),c=r?s.appear:s.enter;if(!e&&!n||_v.disabled){this.safeSetState({status:Sv},function(){t.props.onEntered(a)});return}this.props.onEnter(a,o),this.safeSetState({status:xv},function(){t.props.onEntering(a,o),t.onTransitionEnd(c,function(){t.safeSetState({status:Sv},function(){t.props.onEntered(a,o)})})})},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:ea.default.findDOMNode(this);if(!t||_v.disabled){this.safeSetState({status:bv},function(){e.props.onExited(r)});return}this.props.onExit(r),this.safeSetState({status:Cv},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:bv},function(){e.props.onExited(r)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:ea.default.findDOMNode(this),r=e==null&&!this.props.addEndListener;if(!n||r){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}e!=null&&setTimeout(this.nextCallback,e)},n.render=function(){var e=this.state.status;if(e===`unmounted`)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=gm(t,[`children`,`in`,`mountOnEnter`,`unmountOnExit`,`appear`,`enter`,`exit`,`timeout`,`addEndListener`,`onEnter`,`onEntering`,`onEntered`,`onExit`,`onExiting`,`onExited`,`nodeRef`]);return D.createElement(vv.Provider,{value:null},typeof n==`function`?n(e,r):D.cloneElement(D.Children.only(n),r))},t}(D.Component);wv.contextType=vv,wv.propTypes={};function Tv(){}wv.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Tv,onEntering:Tv,onEntered:Tv,onExit:Tv,onExiting:Tv,onExited:Tv},wv.UNMOUNTED=yv,wv.EXITED=bv,wv.ENTERING=xv,wv.ENTERED=Sv,wv.EXITING=Cv;function $ee(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Ev(e,t){var n=function(e){return t&&(0,D.isValidElement)(e)?t(e):e},r=Object.create(null);return e&&D.Children.map(e,function(e){return e}).forEach(function(e){r[e.key]=n(e)}),r}function ete(e,t){e||={},t||={};function n(n){return n in t?t[n]:e[n]}var r=Object.create(null),i=[];for(var a in e)a in t?i.length&&(r[a]=i,i=[]):i.push(a);var o,s={};for(var c in t){if(r[c])for(o=0;o<r[c].length;o++){var l=r[c][o];s[r[c][o]]=n(l)}s[c]=n(c)}for(o=0;o<i.length;o++)s[i[o]]=n(i[o]);return s}function Dv(e,t,n){return n[t]==null?e.props[t]:n[t]}function tte(e,t){return Ev(e.children,function(n){return(0,D.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:Dv(n,`appear`,e),enter:Dv(n,`enter`,e),exit:Dv(n,`exit`,e)})})}function nte(e,t,n){var r=Ev(e.children),i=ete(t,r);return Object.keys(i).forEach(function(a){var o=i[a];if((0,D.isValidElement)(o)){var s=a in t,c=a in r,l=t[a],u=(0,D.isValidElement)(l)&&!l.props.in;c&&(!s||u)?i[a]=(0,D.cloneElement)(o,{onExited:n.bind(null,o),in:!0,exit:Dv(o,`exit`,e),enter:Dv(o,`enter`,e)}):!c&&s&&!u?i[a]=(0,D.cloneElement)(o,{in:!1}):c&&s&&(0,D.isValidElement)(l)&&(i[a]=(0,D.cloneElement)(o,{onExited:n.bind(null,o),in:l.props.in,exit:Dv(o,`exit`,e),enter:Dv(o,`enter`,e)}))}}),i}var rte=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},ite={component:`div`,childFactory:function(e){return e}},Ov=function(e){gv(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.state={contextValue:{isMounting:!0},handleExited:r.handleExited.bind($ee(r)),firstRender:!0},r}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?tte(e,r):nte(e,n,r),firstRender:!1}},n.handleExited=function(e,t){var n=Ev(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=hm({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=gm(e,[`component`,`childFactory`]),i=this.state.contextValue,a=rte(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,t===null?D.createElement(vv.Provider,{value:i},a):D.createElement(vv.Provider,{value:i},D.createElement(t,r,a))},t}(D.Component);Ov.propTypes={},Ov.defaultProps=ite;var kv=[`bottom-center`,`bottom-left`,`bottom-right`,`top-center`,`top-left`,`top-right`];function ate(e,t){return e.reduce((e,n)=>(e[n.position||t].push(n),e),kv.reduce((e,t)=>(e[t]=[],e),{}))}var Av={left:`translateX(-100%)`,right:`translateX(100%)`,"top-center":`translateY(-100%)`,"bottom-center":`translateY(100%)`},ote={left:`translateX(0)`,right:`translateX(0)`,"top-center":`translateY(0)`,"bottom-center":`translateY(0)`};function ste({state:e,maxHeight:t,position:n,transitionDuration:r}){let[i,a]=n.split(`-`),o=a===`center`?`${i}-center`:a,s={opacity:0,maxHeight:t,transform:Av[o],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:`cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear`,transitionProperty:`opacity, transform, max-height`},c={opacity:1,transform:ote[o]},l={opacity:0,maxHeight:0,transform:Av[o]},u={entering:c,entered:c,exiting:l,exited:l};return{...s,...u[e]}}function cte(e,t){return typeof t==`number`?t:t===!1||e===!1?!1:e}var jv=(0,D.forwardRef)(({data:e,onHide:t,autoClose:n,...r},i)=>{let{autoClose:a,message:o,...s}=e,c=cte(n,e.autoClose),l=(0,D.useRef)(-1),u=()=>window.clearTimeout(l.current),d=()=>{t(e.id),u()},f=()=>{typeof c==`number`&&(l.current=window.setTimeout(d,c))};return(0,D.useEffect)(()=>{e.onOpen?.(e)},[]),(0,D.useEffect)(()=>(f(),u),[c]),(0,R.jsx)(Wh,{...r,...s,onClose:d,ref:i,onMouseEnter:u,onMouseLeave:f,children:o})});jv.displayName=`@mantine/notifications/NotificationContainer`;var Mv={root:`m_b37d9ac7`,notification:`m_5ed0edd0`},lte=wv,Nv={position:`bottom-right`,autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:mt(`overlay`),store:dv,withinPortal:!0},Pv=jn((e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":L(n)}})),Fv=Xi((e,t)=>{let n=z(`Notifications`,Nv,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,position:l,autoClose:u,transitionDuration:d,containerWidth:f,notificationMaxHeight:p,limit:m,zIndex:h,store:g,portalProps:_,withinPortal:v,...y}=n,b=Cr(),x=qee(g),S=en(),C=gn(),w=(0,D.useRef)({}),T=(0,D.useRef)(0),E=b.respectReducedMotion&&C?1:d,O=si({name:`Notifications`,classes:Mv,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,vars:c,varsResolver:Pv});(0,D.useEffect)(()=>{g?.updateState(e=>({...e,limit:m||5,defaultPosition:l}))},[m,l]),Vt(()=>{x.notifications.length>T.current&&setTimeout(()=>S(),0),T.current=x.notifications.length},[x.notifications]);let k=ate(x.notifications,l),A=kv.reduce((e,t)=>(e[t]=k[t].map(({style:e,...n})=>(0,R.jsx)(lte,{timeout:E,onEnter:()=>w.current[n.id].offsetHeight,nodeRef:{current:w.current[n.id]},children:r=>(0,R.jsx)(jv,{ref:e=>{e&&(w.current[n.id]=e)},data:n,onHide:e=>pv(e,g),autoClose:u,...O(`notification`,{style:{...ste({state:r,position:t,transitionDuration:E,maxHeight:p}),...e}})})},n.id)),e),{});return(0,R.jsxs)(Wl,{withinPortal:v,..._,children:[(0,R.jsx)(B,{...O(`root`),"data-position":`top-center`,ref:t,...y,children:(0,R.jsx)(Ov,{children:A[`top-center`]})}),(0,R.jsx)(B,{...O(`root`),"data-position":`top-left`,...y,children:(0,R.jsx)(Ov,{children:A[`top-left`]})}),(0,R.jsx)(B,{...O(`root`,{className:Ge.classNames.fullWidth}),"data-position":`top-right`,...y,children:(0,R.jsx)(Ov,{children:A[`top-right`]})}),(0,R.jsx)(B,{...O(`root`,{className:Ge.classNames.fullWidth}),"data-position":`bottom-right`,...y,children:(0,R.jsx)(Ov,{children:A[`bottom-right`]})}),(0,R.jsx)(B,{...O(`root`),"data-position":`bottom-left`,...y,children:(0,R.jsx)(Ov,{children:A[`bottom-left`]})}),(0,R.jsx)(B,{...O(`root`),"data-position":`bottom-center`,...y,children:(0,R.jsx)(Ov,{children:A[`bottom-center`]})})]})});Fv.classes=Mv,Fv.displayName=`@mantine/notifications/Notifications`,Fv.show=mv.show,Fv.hide=mv.hide,Fv.update=mv.update,Fv.clean=mv.clean,Fv.cleanQueue=mv.cleanQueue,Fv.updateState=mv.updateState;var Iv=v(),Lv=fi({colors:{inspector:[`#eef3ff`,`#dce6ff`,`#b7ccff`,`#8facfc`,`#6b8ef8`,`#4f78f3`,`#3d68ee`,`#2f59e0`,`#2749b8`,`#16265e`],gray:[`#f7f8fa`,`#eef0f4`,`#e2e5ec`,`#cfd4de`,`#b0b7c5`,`#8d95a6`,`#6c7486`,`#515868`,`#3a3f4b`,`#23272f`],dark:[`#c9cdd6`,`#aeb4c0`,`#8b93a3`,`#6a7284`,`#464c5b`,`#363b47`,`#2b2f3a`,`#23262f`,`#1a1d24`,`#131519`],green:[`#e6f7ee`,`#c6efd7`,`#96e2b8`,`#5fd196`,`#33bd79`,`#1aa864`,`#109655`,`#0d7d47`,`#0a6339`,`#074a2b`],red:[`#ffecec`,`#ffd7d7`,`#ffb3b3`,`#ff8585`,`#f95f60`,`#ef4344`,`#e03236`,`#c62328`,`#a11a1f`,`#7d1418`],yellow:[`#fff7e6`,`#ffecc2`,`#ffdb8a`,`#fbc94f`,`#f5b722`,`#e8a800`,`#d19700`,`#a87800`,`#855f00`,`#634700`],blue:[`#e7f1ff`,`#cfe2ff`,`#a3c8ff`,`#6fa6fb`,`#4589f5`,`#2a75ee`,`#1b66e0`,`#1553bb`,`#124399`,`#0d2f6b`],teal:[`#e2f7f4`,`#bfeee8`,`#8adfd4`,`#4ecabb`,`#23b2a2`,`#109e8f`,`#0d8a7d`,`#0a6f65`,`#08574f`,`#06403a`],violet:[`#faf0ff`,`#f0dcff`,`#e0bbff`,`#cb91fb`,`#b264f5`,`#a03bf5`,`#9127e6`,`#7a1fc4`,`#63189e`,`#3f0f66`]},primaryColor:`inspector`,primaryShade:{light:7,dark:8},autoContrast:!0,defaultRadius:`md`,cursorType:`pointer`,fontFamily:`"Fredoka", sans-serif`,fontFamilyMonospace:`"Roboto Mono", monospace`,headings:{fontFamily:`"Fredoka", sans-serif`,fontWeight:`600`},components:{Accordion:Gd.extend({classNames:(e,t)=>t.variant===`disclosure`?{root:`disclosure-sections`,chevron:`disclosure-chevron`,control:`filter-toggle`}:{}}),ActionIcon:Eu.extend({defaultProps:{variant:`subtle`,color:`gray`,radius:`md`}}),Alert:Jd.extend({defaultProps:{radius:`md`},styles:(e,t)=>t.variant===`warning`?{root:{backgroundColor:`light-dark(var(--mantine-color-yellow-1), var(--mantine-color-yellow-light))`,borderInlineStart:`3px solid var(--mantine-color-yellow-5)`},title:{color:`light-dark(var(--mantine-color-black), var(--mantine-color-yellow-light-color))`},message:{color:`light-dark(var(--mantine-color-black), var(--mantine-color-yellow-light-color))`}}:t.variant===`reauth`?{root:{backgroundColor:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-red-3)`}}:{root:{}}}),AppShell:Ef.extend({defaultProps:{padding:0},styles:{main:{height:`100dvh`,overflow:`hidden`}}}),Autocomplete:Rp.extend({defaultProps:{radius:`md`,clearable:!0,clearButtonProps:{tabIndex:-1}}}),Badge:Vp.extend({defaultProps:{size:`sm`,radius:`sm`,fw:600},styles:(e,t)=>{if(t.variant===`status`&&t.color){let e=t.color;return e===`orange`||e===`yellow`?{root:{backgroundColor:`var(--mantine-color-${e}-5)`,color:`var(--mantine-color-black)`}}:{root:{backgroundColor:`light-dark(var(--mantine-color-${e}-light), var(--mantine-color-${e}-filled))`,color:`light-dark(var(--mantine-color-${e}-light-color), var(--mantine-color-white))`}}}return{root:{}}}}),Button:Xp.extend({defaultProps:{radius:`md`}}),Card:tm.extend({defaultProps:{padding:`lg`,radius:`md`,withBorder:!0},classNames:(e,t)=>t.variant===`responsive`?{root:`card-responsive`}:{},styles:(e,t)=>t.variant===`disabled`?{root:{backgroundColor:`var(--inspector-surface-card)`,opacity:.4,pointerEvents:`none`}}:t.variant===`sidebar`?{root:{backgroundColor:`var(--inspector-surface-card)`,maxHeight:`100%`,display:`flex`,flexDirection:`column`,overflow:`hidden`}}:t.variant===`highlighted`?{root:{backgroundColor:`var(--inspector-surface-card)`,borderColor:`var(--inspector-highlight-border)`,borderWidth:2}}:t.variant===`errored`?{root:{backgroundColor:`var(--inspector-surface-card)`,borderColor:`var(--inspector-error-border)`,borderWidth:2}}:t.variant===`preview`?{root:{backgroundColor:`var(--inspector-surface-card)`,overflow:`hidden`}}:t.variant===`inset`?{root:{backgroundColor:`var(--inspector-surface-inset)`,"--inspector-code-surface":`var(--inspector-surface-code-oncard)`}}:{root:{backgroundColor:`var(--inspector-surface-card)`}}}),Code:im.extend({styles:(e,t)=>{let n={backgroundColor:`var(--inspector-code-surface, var(--inspector-surface-code))`};return t.variant===`wrapping`&&(n.wordBreak=`break-all`,n.whiteSpace=`pre-wrap`),t.block&&(n.margin=`0`),t.variant===`nowrap`&&(n.whiteSpace=`nowrap`,n.overflow=`hidden`,n.textOverflow=`ellipsis`),{root:n}}}),Flex:Dd.extend({styles:(e,t)=>t.variant===`screen`?{root:{overflow:`hidden`}}:{root:{}}}),Group:V.extend({classNames:(e,t)=>t.variant===`sectionHeader`?{root:`filter-toggle`}:{}}),Input:xd.extend({styles:()=>({input:{backgroundColor:`var(--inspector-input-background)`}})}),Modal:_h.extend({defaultProps:{closeButtonProps:{"aria-label":`Close`}}}),ModalRoot:_h.Root.extend({defaultProps:{transitionProps:{transition:`fade-down`,duration:200}}}),Paper:kl.extend({classNames:(e,t)=>t.variant===`code`?{root:`paper-code`}:{},styles:(e,t)=>t.variant===`code`?{root:{padding:`var(--mantine-spacing-md)`,backgroundColor:`var(--inspector-surface-code)`,fontFamily:`var(--mantine-font-family-monospace)`,fontSize:`var(--mantine-font-size-sm)`,overflow:`auto`}}:t.variant===`contained`?{root:{overflow:`hidden`,minWidth:0}}:t.variant===`panel`?{root:{display:`flex`,flexDirection:`column`,overflow:`hidden`,minHeight:0}}:{root:{}}}),ScrollArea:bl.extend({defaultProps:{type:`scroll`}}),ScrollAreaAutosize:bl.Autosize.extend({defaultProps:{type:`scroll`}}),Select:T_.extend({defaultProps:{radius:`md`}}),Switch:W_.extend({defaultProps:{radius:`xl`}}),Text:H.extend({classNames:(e,t)=>t.variant===`tabGlow`?{root:`tab-glow`}:{},styles:(e,t)=>t.variant===`monoBreak`?{root:{wordBreak:`break-all`}}:t.variant===`nowrap`?{root:{whiteSpace:`nowrap`}}:t.variant===`consoleLine`?{root:{whiteSpace:`pre-wrap`,wordBreak:`break-word`}}:t.variant===`versionBadge`||t.variant===`copyrightBadge`?{root:{color:`var(--inspector-text-secondary)`,fontSize:`var(--mantine-font-size-xs)`,whiteSpace:`nowrap`,userSelect:`none`}}:{root:{}}}),TextInput:ov.extend({defaultProps:{radius:`md`}}),Title:uv.extend({styles:(e,t)=>t.variant===`section`?{root:{backgroundColor:`var(--inspector-surface-subtle)`,padding:`0.375rem 0.75rem`,borderRadius:`var(--mantine-radius-sm)`}}:{root:{}}}),UnstyledButton:wl.extend({classNames:(e,t)=>t.variant===`listItem`?{root:`list-item`}:t.variant===`filterToggle`?{root:`filter-toggle`}:{},styles:(e,t)=>t.variant===`listItem`?{root:{borderRadius:`var(--mantine-radius-md)`}}:{root:{}}})}}),Rv=Object.create,zv=Object.defineProperty,Bv=Object.getOwnPropertyDescriptor,Vv=Object.getOwnPropertyNames,Hv=Object.getPrototypeOf,Uv=Object.prototype.hasOwnProperty,Wv=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Gv=(e,t)=>{let n={};for(var r in e)zv(n,r,{get:e[r],enumerable:!0});return t&&zv(n,Symbol.toStringTag,{value:`Module`}),n},Kv=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Vv(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Uv.call(e,s)&&s!==n&&zv(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Bv(t,s))||r.enumerable});return e},qv=(e,t,n)=>(n=e==null?{}:Rv(Hv(e)),Kv(t||!e||!e.__esModule?zv(n,`default`,{value:e,enumerable:!0}):n,e)),Jv=Object.freeze({status:`aborted`});function W(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 Yv=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Xv=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},Zv={};function Qv(e){return e&&Object.assign(Zv,e),Zv}function $v(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 ey(e,t){return typeof t==`bigint`?t.toString():t}function ty(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function ny(e){return e==null}function ry(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function iy(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var ay=Symbol(`evaluating`);function oy(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ay)return r===void 0&&(r=ay,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function sy(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function cy(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ly(e){return JSON.stringify(e)}function uy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var dy=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function fy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var py=ty(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function my(e){if(fy(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(fy(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function hy(e){return my(e)?{...e}:Array.isArray(e)?[...e]:e}var gy=new Set([`string`,`number`,`symbol`]);function _y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function vy(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function yy(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 by(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var xy={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Sy(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 vy(e,cy(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 sy(this,`shape`,e),e},checks:[]}))}function Cy(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 vy(e,cy(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 sy(this,`shape`,r),r},checks:[]}))}function wy(e,t){if(!my(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 vy(e,cy(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return sy(this,`shape`,n),n}}))}function Ty(e,t){if(!my(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return vy(e,cy(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return sy(this,`shape`,n),n}}))}function Ey(e,t){return vy(e,cy(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return sy(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Dy(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 vy(t,cy(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 sy(this,`shape`,i),i},checks:[]}))}function Oy(e,t,n){return vy(t,cy(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 sy(this,`shape`,i),i}}))}function ky(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 Ay(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function jy(e){return typeof e==`string`?e:e?.message}function My(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=jy(e.inst?._zod.def?.error?.(e))??jy(t?.error?.(e))??jy(n.customError?.(e))??jy(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ny(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Py(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Fy=(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,ey,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Iy=W(`$ZodError`,Fy),Ly=W(`$ZodError`,Fy,{Parent:Error});function Ry(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 zy(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var By=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Yv;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>My(e,a,Qv())));throw dy(t,i?.callee),t}return o.value},Vy=e=>async(t,n,r,i)=>{let a=r?Object.assign(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=>My(e,a,Qv())));throw dy(t,i?.callee),t}return o.value},Hy=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 Yv;return a.issues.length?{success:!1,error:new(e??Iy)(a.issues.map(e=>My(e,i,Qv())))}:{success:!0,data:a.value}},Uy=Hy(Ly),Wy=e=>async(t,n,r)=>{let i=r?Object.assign(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=>My(e,i,Qv())))}:{success:!0,data:a.value}},Gy=Wy(Ly),Ky=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return By(e)(t,n,i)},qy=e=>(t,n,r)=>By(e)(t,n,r),Jy=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Vy(e)(t,n,i)},Yy=e=>async(t,n,r)=>Vy(e)(t,n,r),Xy=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Hy(e)(t,n,i)},Zy=e=>(t,n,r)=>Hy(e)(t,n,r),Qy=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Wy(e)(t,n,i)},$y=e=>async(t,n,r)=>Wy(e)(t,n,r),eb=/^[cC][^\s-]{8,}$/,tb=/^[0-9a-z]+$/,nb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rb=/^[0-9a-vA-V]{20}$/,ib=/^[A-Za-z0-9]{27}$/,ab=/^[a-zA-Z0-9_-]{21}$/,ob=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sb=/^([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})$/,cb=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)$/,lb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ub=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function db(){return new RegExp(ub,`u`)}var fb=/^(?:(?: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])$/,pb=/^(([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}|:))$/,mb=/^((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])$/,hb=/^(([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])$/,gb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_b=/^[A-Za-z0-9_-]*$/,vb=/^\+[1-9]\d{6,14}$/,yb=`(?:(?:\\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])))`,bb=RegExp(`^${yb}$`);function xb(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 Sb(e){return RegExp(`^${xb(e)}$`)}function Cb(e){let t=xb({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(`^${yb}T(?:${r})$`)}var wb=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Tb=/^-?\d+$/,Eb=/^-?\d+(?:\.\d+)?$/,Db=/^(?:true|false)$/i,Ob=/^null$/i,kb=/^undefined$/i,Ab=/^[^A-Z]*$/,jb=/^[^a-z]*$/,Mb=W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Nb={number:`number`,bigint:`bigint`,object:`date`},Pb=W(`$ZodCheckLessThan`,(e,t)=>{Mb.init(e,t);let n=Nb[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fb=W(`$ZodCheckGreaterThan`,(e,t)=>{Mb.init(e,t);let n=Nb[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ib=W(`$ZodCheckMultipleOf`,(e,t)=>{Mb.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):iy(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Lb=W(`$ZodCheckNumberFormat`,(e,t)=>{Mb.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xy[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Tb)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Rb=W(`$ZodCheckMaxLength`,(e,t)=>{var n;Mb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ny(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=Ny(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zb=W(`$ZodCheckMinLength`,(e,t)=>{var n;Mb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ny(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=Ny(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bb=W(`$ZodCheckLengthEquals`,(e,t)=>{var n;Mb.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ny(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=Ny(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})}}),Vb=W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Mb.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=()=>{})}),Hb=W(`$ZodCheckRegex`,(e,t)=>{Vb.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})}}),Ub=W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ab,Vb.init(e,t)}),Wb=W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=jb,Vb.init(e,t)}),Gb=W(`$ZodCheckIncludes`,(e,t)=>{Mb.init(e,t);let n=_y(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})}}),Kb=W(`$ZodCheckStartsWith`,(e,t)=>{Mb.init(e,t);let n=RegExp(`^${_y(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})}}),qb=W(`$ZodCheckEndsWith`,(e,t)=>{Mb.init(e,t);let n=RegExp(`.*${_y(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})}}),Jb=W(`$ZodCheckOverwrite`,(e,t)=>{Mb.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Yb=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(`
|
|
63
|
-
`).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(`
|
|
64
|
-
`))}},Xb={major:4,minor:3,patch:6},Zb=W(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Xb;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=ky(e),i;for(let a of t){if(a._zod.def.when){if(!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 Yv;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=ky(e,t))});else{if(e.issues.length===t)continue;r||=ky(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(ky(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Yv;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 Yv;return o.then(e=>t(e,r,a))}return t(o,r,a)}}oy(e,`~standard`,()=>({validate:t=>{try{let n=Uy(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Gy(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Qb=W(`$ZodString`,(e,t)=>{Zb.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wb(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}}),$b=W(`$ZodStringFormat`,(e,t)=>{Vb.init(e,t),Qb.init(e,t)}),ex=W(`$ZodGUID`,(e,t)=>{t.pattern??=sb,$b.init(e,t)}),tx=W(`$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??=cb(e)}else t.pattern??=cb();$b.init(e,t)}),nx=W(`$ZodEmail`,(e,t)=>{t.pattern??=lb,$b.init(e,t)}),rx=W(`$ZodURL`,(e,t)=>{$b.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),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})}}}),ix=W(`$ZodEmoji`,(e,t)=>{t.pattern??=db(),$b.init(e,t)}),ax=W(`$ZodNanoID`,(e,t)=>{t.pattern??=ab,$b.init(e,t)}),ox=W(`$ZodCUID`,(e,t)=>{t.pattern??=eb,$b.init(e,t)}),sx=W(`$ZodCUID2`,(e,t)=>{t.pattern??=tb,$b.init(e,t)}),cx=W(`$ZodULID`,(e,t)=>{t.pattern??=nb,$b.init(e,t)}),lx=W(`$ZodXID`,(e,t)=>{t.pattern??=rb,$b.init(e,t)}),ux=W(`$ZodKSUID`,(e,t)=>{t.pattern??=ib,$b.init(e,t)}),dx=W(`$ZodISODateTime`,(e,t)=>{t.pattern??=Cb(t),$b.init(e,t)}),fx=W(`$ZodISODate`,(e,t)=>{t.pattern??=bb,$b.init(e,t)}),px=W(`$ZodISOTime`,(e,t)=>{t.pattern??=Sb(t),$b.init(e,t)}),mx=W(`$ZodISODuration`,(e,t)=>{t.pattern??=ob,$b.init(e,t)}),hx=W(`$ZodIPv4`,(e,t)=>{t.pattern??=fb,$b.init(e,t),e._zod.bag.format=`ipv4`}),gx=W(`$ZodIPv6`,(e,t)=>{t.pattern??=pb,$b.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})}}}),_x=W(`$ZodCIDRv4`,(e,t)=>{t.pattern??=mb,$b.init(e,t)}),vx=W(`$ZodCIDRv6`,(e,t)=>{t.pattern??=hb,$b.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 yx(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var bx=W(`$ZodBase64`,(e,t)=>{t.pattern??=gb,$b.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{yx(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function xx(e){if(!_b.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return yx(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Sx=W(`$ZodBase64URL`,(e,t)=>{t.pattern??=_b,$b.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{xx(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Cx=W(`$ZodE164`,(e,t)=>{t.pattern??=vb,$b.init(e,t)});function wx(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 Tx=W(`$ZodJWT`,(e,t)=>{$b.init(e,t),e._zod.check=n=>{wx(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Ex=W(`$ZodNumber`,(e,t)=>{Zb.init(e,t),e._zod.pattern=e._zod.bag.pattern??Eb,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Dx=W(`$ZodNumberFormat`,(e,t)=>{Lb.init(e,t),Ex.init(e,t)}),Ox=W(`$ZodBoolean`,(e,t)=>{Zb.init(e,t),e._zod.pattern=Db,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),kx=W(`$ZodUndefined`,(e,t)=>{Zb.init(e,t),e._zod.pattern=kb,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Ax=W(`$ZodNull`,(e,t)=>{Zb.init(e,t),e._zod.pattern=Ob,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),jx=W(`$ZodAny`,(e,t)=>{Zb.init(e,t),e._zod.parse=e=>e}),Mx=W(`$ZodUnknown`,(e,t)=>{Zb.init(e,t),e._zod.parse=e=>e}),Nx=W(`$ZodNever`,(e,t)=>{Zb.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Px(e,t,n){e.issues.length&&t.issues.push(...Ay(n,e.issues)),t.value[n]=e.value}var Fx=W(`$ZodArray`,(e,t)=>{Zb.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=>Px(t,n,e))):Px(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Ix(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Ay(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Lx(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=by(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Rx(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(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=>Ix(e,n,i,t,u))):Ix(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var zx=W(`$ZodObject`,(e,t)=>{if(Zb.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=ty(()=>Lx(t));oy(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=fy,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.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Ix(n,t,e,s,r))):Ix(i,t,e,s,r)}return i?Rx(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Bx=W(`$ZodObjectJIT`,(e,t)=>{zx.init(e,t);let n=e._zod.parse,r=ty(()=>Lx(t)),i=e=>{let t=new Yb([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ly(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=ly(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
65
|
-
if (${n}.issues.length) {
|
|
66
|
-
if (${o} in input) {
|
|
67
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
68
|
-
...iss,
|
|
69
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
70
|
-
})));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (${n}.value === undefined) {
|
|
75
|
-
if (${o} in input) {
|
|
76
|
-
newResult[${o}] = undefined;
|
|
77
|
-
}
|
|
78
|
-
} else {
|
|
79
|
-
newResult[${o}] = ${n}.value;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
`):t.write(`
|
|
83
|
-
if (${n}.issues.length) {
|
|
84
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
85
|
-
...iss,
|
|
86
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
87
|
-
})));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (${n}.value === undefined) {
|
|
91
|
-
if (${o} in input) {
|
|
92
|
-
newResult[${o}] = undefined;
|
|
93
|
-
}
|
|
94
|
-
} else {
|
|
95
|
-
newResult[${o}] = ${n}.value;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=fy,s=!Zv.jitless,c=s&&py.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?Rx([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Vx(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=>!ky(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=>My(e,r,Qv())))}),t)}var Hx=W(`$ZodUnion`,(e,t)=>{Zb.init(e,t),oy(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),oy(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),oy(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),oy(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=>ry(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Vx(t,i,e,a)):Vx(s,i,e,a)}}),Ux=W(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Hx.init(e,t);let n=e._zod.parse;oy(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=ty(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!fy(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Wx=W(`$ZodIntersection`,(e,t)=>{Zb.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])=>Kx(e,t,n)):Kx(e,i,a)}});function Gx(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(my(e)&&my(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=Gx(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=Gx(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 Kx(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}),ky(e))return e;let o=Gx(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var qx=W(`$ZodRecord`,(e,t)=>{Zb.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!my(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...Ay(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Ay(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Eb.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>My(e,r,Qv())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Ay(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Ay(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Jx=W(`$ZodEnum`,(e,t)=>{Zb.init(e,t);let n=$v(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>gy.has(typeof e)).map(e=>typeof e==`string`?_y(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}}),Yx=W(`$ZodLiteral`,(e,t)=>{if(Zb.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?_y(e):e?_y(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Xx=W(`$ZodTransform`,(e,t)=>{Zb.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Xv(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));if(i instanceof Promise)throw new Yv;return n.value=i,n}});function Zx(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Qx=W(`$ZodOptional`,(e,t)=>{Zb.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,oy(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),oy(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ry(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Zx(t,e.value)):Zx(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),$x=W(`$ZodExactOptional`,(e,t)=>{Qx.init(e,t),oy(e._zod,`values`,()=>t.innerType._zod.values),oy(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),eS=W(`$ZodNullable`,(e,t)=>{Zb.init(e,t),oy(e._zod,`optin`,()=>t.innerType._zod.optin),oy(e._zod,`optout`,()=>t.innerType._zod.optout),oy(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ry(e.source)}|null)$`):void 0}),oy(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)}),tS=W(`$ZodDefault`,(e,t)=>{Zb.init(e,t),e._zod.optin=`optional`,oy(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=>nS(e,t)):nS(r,t)}});function nS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var rS=W(`$ZodPrefault`,(e,t)=>{Zb.init(e,t),e._zod.optin=`optional`,oy(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))}),iS=W(`$ZodNonOptional`,(e,t)=>{Zb.init(e,t),oy(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=>aS(t,e)):aS(i,e)}});function aS(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 oS=W(`$ZodCatch`,(e,t)=>{Zb.init(e,t),oy(e._zod,`optin`,()=>t.innerType._zod.optin),oy(e._zod,`optout`,()=>t.innerType._zod.optout),oy(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=>My(e,n,Qv()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>My(e,n,Qv()))},input:e.value}),e.issues=[]),e)}}),sS=W(`$ZodPipe`,(e,t)=>{Zb.init(e,t),oy(e._zod,`values`,()=>t.in._zod.values),oy(e._zod,`optin`,()=>t.in._zod.optin),oy(e._zod,`optout`,()=>t.out._zod.optout),oy(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=>cS(e,t.in,n)):cS(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>cS(e,t.out,n)):cS(r,t.out,n)}});function cS(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var lS=W(`$ZodReadonly`,(e,t)=>{Zb.init(e,t),oy(e._zod,`propValues`,()=>t.innerType._zod.propValues),oy(e._zod,`values`,()=>t.innerType._zod.values),oy(e._zod,`optin`,()=>t.innerType?._zod?.optin),oy(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(uS):uS(r)}});function uS(e){return e.value=Object.freeze(e.value),e}var dS=W(`$ZodLazy`,(e,t)=>{Zb.init(e,t),oy(e._zod,`innerType`,()=>t.getter()),oy(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),oy(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),oy(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),oy(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),fS=W(`$ZodCustom`,(e,t)=>{Mb.init(e,t),Zb.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=>pS(t,n,r,e));pS(i,n,r,e)}});function pS(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(Py(e))}}var mS,hS=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 gS(){return new hS}(mS=globalThis).__zod_globalRegistry??(mS.__zod_globalRegistry=gS());var _S=globalThis.__zod_globalRegistry;function vS(e,t){return new e({type:`string`,...yy(t)})}function yS(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...yy(t)})}function bS(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...yy(t)})}function xS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...yy(t)})}function SS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...yy(t)})}function CS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...yy(t)})}function wS(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...yy(t)})}function TS(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...yy(t)})}function ES(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...yy(t)})}function DS(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...yy(t)})}function OS(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...yy(t)})}function kS(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...yy(t)})}function AS(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...yy(t)})}function jS(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...yy(t)})}function MS(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...yy(t)})}function NS(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...yy(t)})}function PS(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...yy(t)})}function FS(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...yy(t)})}function IS(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...yy(t)})}function LS(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...yy(t)})}function RS(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...yy(t)})}function zS(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...yy(t)})}function BS(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...yy(t)})}function VS(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...yy(t)})}function HS(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...yy(t)})}function US(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...yy(t)})}function WS(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...yy(t)})}function GS(e,t){return new e({type:`number`,checks:[],...yy(t)})}function KS(e,t){return new e({type:`number`,coerce:!0,checks:[],...yy(t)})}function qS(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...yy(t)})}function JS(e,t){return new e({type:`boolean`,...yy(t)})}function YS(e,t){return new e({type:`undefined`,...yy(t)})}function XS(e,t){return new e({type:`null`,...yy(t)})}function ZS(e){return new e({type:`any`})}function QS(e){return new e({type:`unknown`})}function $S(e,t){return new e({type:`never`,...yy(t)})}function eC(e,t){return new Pb({check:`less_than`,...yy(t),value:e,inclusive:!1})}function tC(e,t){return new Pb({check:`less_than`,...yy(t),value:e,inclusive:!0})}function nC(e,t){return new Fb({check:`greater_than`,...yy(t),value:e,inclusive:!1})}function rC(e,t){return new Fb({check:`greater_than`,...yy(t),value:e,inclusive:!0})}function iC(e,t){return new Ib({check:`multiple_of`,...yy(t),value:e})}function aC(e,t){return new Rb({check:`max_length`,...yy(t),maximum:e})}function oC(e,t){return new zb({check:`min_length`,...yy(t),minimum:e})}function sC(e,t){return new Bb({check:`length_equals`,...yy(t),length:e})}function cC(e,t){return new Hb({check:`string_format`,format:`regex`,...yy(t),pattern:e})}function lC(e){return new Ub({check:`string_format`,format:`lowercase`,...yy(e)})}function uC(e){return new Wb({check:`string_format`,format:`uppercase`,...yy(e)})}function dC(e,t){return new Gb({check:`string_format`,format:`includes`,...yy(t),includes:e})}function fC(e,t){return new Kb({check:`string_format`,format:`starts_with`,...yy(t),prefix:e})}function pC(e,t){return new qb({check:`string_format`,format:`ends_with`,...yy(t),suffix:e})}function mC(e){return new Jb({check:`overwrite`,tx:e})}function hC(e){return mC(t=>t.normalize(e))}function gC(){return mC(e=>e.trim())}function _C(){return mC(e=>e.toLowerCase())}function vC(){return mC(e=>e.toUpperCase())}function yC(){return mC(e=>uy(e))}function bC(e,t,n){return new e({type:`array`,element:t,...yy(n)})}function xC(e,t,n){let r=yy(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function SC(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...yy(n)})}function CC(e){let t=wC(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Py(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Py(r))}},e(n.value,n)));return t}function wC(e,t){let n=new Mb({check:`custom`,...yy(t)});return n._zod.check=e,n}function TC(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??_S,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 EC(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,EC(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`&&kC(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function DC(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>
|
|
99
|
-
|
|
100
|
-
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 OC(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.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:jC(t,`input`,e.processors),output:jC(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function kC(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 kC(r.element,n);if(r.type===`set`)return kC(r.valueType,n);if(r.type===`lazy`)return kC(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 kC(r.innerType,n);if(r.type===`intersection`)return kC(r.left,n)||kC(r.right,n);if(r.type===`record`||r.type===`map`)return kC(r.keyType,n)||kC(r.valueType,n);if(r.type===`pipe`)return kC(r.in,n)||kC(r.out,n);if(r.type===`object`){for(let e in r.shape)if(kC(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(kC(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(kC(e,n))return!0;return!!(r.rest&&kC(r.rest,n))}return!1}var AC=(e,t={})=>n=>{let r=TC({...n,processors:t});return EC(e,r),DC(r,e),OC(r,e)},jC=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=TC({...i??{},target:a,io:t,processors:n});return EC(e,o),DC(o,e),OC(o,e)},MC={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},NC=(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=MC[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}))])}},PC=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},FC=(e,t,n,r)=>{n.type=`boolean`},ute=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},dte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},IC=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},LC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},fte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},RC=(e,t,n,r)=>{n.not={}},pte=(e,t,n,r)=>{},mte=(e,t,n,r)=>{},hte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},zC=(e,t,n,r)=>{let i=e._zod.def,a=$v(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},BC=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},gte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},_te=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},vte=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},yte=(e,t,n,r)=>{n.type=`boolean`},VC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},bte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},HC=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},xte=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},Ste=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},UC=(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=EC(a.element,t,{...r,path:[...r.path,`items`]})},WC=(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]=EC(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=EC(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},GC=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>EC(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},KC=(e,t,n,r)=>{let i=e._zod.def,a=EC(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=EC(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]]},Cte=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>EC(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?EC(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},qC=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=EC(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=EC(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=EC(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},JC=(e,t,n,r)=>{let i=e._zod.def,a=EC(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`}]},YC=(e,t,n,r)=>{let i=e._zod.def;EC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},XC=(e,t,n,r)=>{let i=e._zod.def;EC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ZC=(e,t,n,r)=>{let i=e._zod.def;EC(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)))},QC=(e,t,n,r)=>{let i=e._zod.def;EC(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},$C=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;EC(a,t,r);let o=t.seen.get(e);o.ref=a},ew=(e,t,n,r)=>{let i=e._zod.def;EC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},wte=(e,t,n,r)=>{let i=e._zod.def;EC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},tw=(e,t,n,r)=>{let i=e._zod.def;EC(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},nw=(e,t,n,r)=>{let i=e._zod.innerType;EC(i,t,r);let a=t.seen.get(e);a.ref=i},rw={string:NC,number:PC,boolean:FC,bigint:ute,symbol:dte,null:IC,undefined:LC,void:fte,never:RC,any:pte,unknown:mte,date:hte,enum:zC,literal:BC,nan:gte,template_literal:_te,file:vte,success:yte,custom:VC,function:bte,transform:HC,map:xte,set:Ste,array:UC,object:WC,union:GC,intersection:KC,tuple:Cte,record:qC,nullable:JC,nonoptional:YC,default:XC,prefault:ZC,catch:QC,pipe:$C,readonly:ew,promise:wte,optional:tw,lazy:nw};function iw(e,t){if(`_idmap`in e){let n=e,r=TC({...t,processors:rw}),i={};for(let e of n._idmap.entries()){let[t,n]=e;EC(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;DC(r,n),a[t]=OC(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=TC({...t,processors:rw});return EC(e,n),DC(n,e),OC(n,e)}var Tte=W(`ZodISODateTime`,(e,t)=>{dx.init(e,t),fw.init(e,t)});function aw(e){return VS(Tte,e)}var Ete=W(`ZodISODate`,(e,t)=>{fx.init(e,t),fw.init(e,t)});function ow(e){return HS(Ete,e)}var Dte=W(`ZodISOTime`,(e,t)=>{px.init(e,t),fw.init(e,t)});function Ote(e){return US(Dte,e)}var kte=W(`ZodISODuration`,(e,t)=>{mx.init(e,t),fw.init(e,t)});function Ate(e){return WS(kte,e)}var sw=(e,t)=>{Iy.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>zy(e,t)},flatten:{value:t=>Ry(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ey,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ey,2)}},isEmpty:{get(){return e.issues.length===0}}})};W(`ZodError`,sw);var cw=W(`ZodError`,sw,{Parent:Error}),jte=By(cw),Mte=Vy(cw),lw=Hy(cw),Nte=Wy(cw),Pte=Ky(cw),Fte=qy(cw),Ite=Jy(cw),Lte=Yy(cw),Rte=Xy(cw),zte=Zy(cw),Bte=Qy(cw),Vte=$y(cw),uw=W(`ZodType`,(e,t)=>(Zb.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:jC(e,`input`),output:jC(e,`output`)}}),e.toJSONSchema=AC(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(cy(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>vy(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>jte(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>lw(e,t,n),e.parseAsync=async(t,n)=>Mte(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Nte(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Pte(e,t,n),e.decode=(t,n)=>Fte(e,t,n),e.encodeAsync=async(t,n)=>Ite(e,t,n),e.decodeAsync=async(t,n)=>Lte(e,t,n),e.safeEncode=(t,n)=>Rte(e,t,n),e.safeDecode=(t,n)=>zte(e,t,n),e.safeEncodeAsync=async(t,n)=>Bte(e,t,n),e.safeDecodeAsync=async(t,n)=>Vte(e,t,n),e.refine=(t,n)=>e.check(Ww(t,n)),e.superRefine=t=>e.check(Gw(t)),e.overwrite=t=>e.check(mC(t)),e.optional=()=>Iw(e),e.exactOptional=()=>bne(e),e.nullable=()=>Lw(e),e.nullish=()=>Iw(Lw(e)),e.nonoptional=t=>Ene(e,t),e.array=()=>q(e),e.or=t=>Ow([e,t]),e.and=t=>Aw(e,t),e.transform=t=>zw(e,Pw(t)),e.default=t=>Cne(e,t),e.prefault=t=>Tne(e,t),e.catch=t=>One(e,t),e.pipe=t=>zw(e,t),e.readonly=()=>jne(e),e.describe=t=>{let n=e.clone();return _S.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return _S.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return _S.get(e);let n=e.clone();return _S.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),dw=W(`_ZodString`,(e,t)=>{Qb.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NC(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(cC(...t)),e.includes=(...t)=>e.check(dC(...t)),e.startsWith=(...t)=>e.check(fC(...t)),e.endsWith=(...t)=>e.check(pC(...t)),e.min=(...t)=>e.check(oC(...t)),e.max=(...t)=>e.check(aC(...t)),e.length=(...t)=>e.check(sC(...t)),e.nonempty=(...t)=>e.check(oC(1,...t)),e.lowercase=t=>e.check(lC(t)),e.uppercase=t=>e.check(uC(t)),e.trim=()=>e.check(gC()),e.normalize=(...t)=>e.check(hC(...t)),e.toLowerCase=()=>e.check(_C()),e.toUpperCase=()=>e.check(vC()),e.slugify=()=>e.check(yC())}),Hte=W(`ZodString`,(e,t)=>{Qb.init(e,t),dw.init(e,t),e.email=t=>e.check(yS(pw,t)),e.url=t=>e.check(TS(gw,t)),e.jwt=t=>e.check(BS(ine,t)),e.emoji=t=>e.check(ES(Wte,t)),e.guid=t=>e.check(bS(mw,t)),e.uuid=t=>e.check(xS(hw,t)),e.uuidv4=t=>e.check(SS(hw,t)),e.uuidv6=t=>e.check(CS(hw,t)),e.uuidv7=t=>e.check(wS(hw,t)),e.nanoid=t=>e.check(DS(Gte,t)),e.guid=t=>e.check(bS(mw,t)),e.cuid=t=>e.check(OS(Kte,t)),e.cuid2=t=>e.check(kS(qte,t)),e.ulid=t=>e.check(AS(Jte,t)),e.base64=t=>e.check(LS(tne,t)),e.base64url=t=>e.check(RS(nne,t)),e.xid=t=>e.check(jS(Yte,t)),e.ksuid=t=>e.check(MS(Xte,t)),e.ipv4=t=>e.check(NS(Zte,t)),e.ipv6=t=>e.check(PS(Qte,t)),e.cidrv4=t=>e.check(FS($te,t)),e.cidrv6=t=>e.check(IS(ene,t)),e.e164=t=>e.check(zS(rne,t)),e.datetime=t=>e.check(aw(t)),e.date=t=>e.check(ow(t)),e.time=t=>e.check(Ote(t)),e.duration=t=>e.check(Ate(t))});function G(e){return vS(Hte,e)}var fw=W(`ZodStringFormat`,(e,t)=>{$b.init(e,t),dw.init(e,t)}),pw=W(`ZodEmail`,(e,t)=>{nx.init(e,t),fw.init(e,t)});function Ute(e){return yS(pw,e)}var mw=W(`ZodGUID`,(e,t)=>{ex.init(e,t),fw.init(e,t)}),hw=W(`ZodUUID`,(e,t)=>{tx.init(e,t),fw.init(e,t)}),gw=W(`ZodURL`,(e,t)=>{rx.init(e,t),fw.init(e,t)});function _w(e){return TS(gw,e)}var Wte=W(`ZodEmoji`,(e,t)=>{ix.init(e,t),fw.init(e,t)}),Gte=W(`ZodNanoID`,(e,t)=>{ax.init(e,t),fw.init(e,t)}),Kte=W(`ZodCUID`,(e,t)=>{ox.init(e,t),fw.init(e,t)}),qte=W(`ZodCUID2`,(e,t)=>{sx.init(e,t),fw.init(e,t)}),Jte=W(`ZodULID`,(e,t)=>{cx.init(e,t),fw.init(e,t)}),Yte=W(`ZodXID`,(e,t)=>{lx.init(e,t),fw.init(e,t)}),Xte=W(`ZodKSUID`,(e,t)=>{ux.init(e,t),fw.init(e,t)}),Zte=W(`ZodIPv4`,(e,t)=>{hx.init(e,t),fw.init(e,t)}),Qte=W(`ZodIPv6`,(e,t)=>{gx.init(e,t),fw.init(e,t)}),$te=W(`ZodCIDRv4`,(e,t)=>{_x.init(e,t),fw.init(e,t)}),ene=W(`ZodCIDRv6`,(e,t)=>{vx.init(e,t),fw.init(e,t)}),tne=W(`ZodBase64`,(e,t)=>{bx.init(e,t),fw.init(e,t)}),nne=W(`ZodBase64URL`,(e,t)=>{Sx.init(e,t),fw.init(e,t)}),rne=W(`ZodE164`,(e,t)=>{Cx.init(e,t),fw.init(e,t)}),ine=W(`ZodJWT`,(e,t)=>{Tx.init(e,t),fw.init(e,t)}),vw=W(`ZodNumber`,(e,t)=>{Ex.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PC(e,t,n,r),e.gt=(t,n)=>e.check(nC(t,n)),e.gte=(t,n)=>e.check(rC(t,n)),e.min=(t,n)=>e.check(rC(t,n)),e.lt=(t,n)=>e.check(eC(t,n)),e.lte=(t,n)=>e.check(tC(t,n)),e.max=(t,n)=>e.check(tC(t,n)),e.int=t=>e.check(yw(t)),e.safe=t=>e.check(yw(t)),e.positive=t=>e.check(nC(0,t)),e.nonnegative=t=>e.check(rC(0,t)),e.negative=t=>e.check(eC(0,t)),e.nonpositive=t=>e.check(tC(0,t)),e.multipleOf=(t,n)=>e.check(iC(t,n)),e.step=(t,n)=>e.check(iC(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function K(e){return GS(vw,e)}var ane=W(`ZodNumberFormat`,(e,t)=>{Dx.init(e,t),vw.init(e,t)});function yw(e){return qS(ane,e)}var one=W(`ZodBoolean`,(e,t)=>{Ox.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FC(e,t,n,r)});function bw(e){return JS(one,e)}var sne=W(`ZodUndefined`,(e,t)=>{kx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LC(e,t,n,r)});function xw(e){return YS(sne,e)}var cne=W(`ZodNull`,(e,t)=>{Ax.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IC(e,t,n,r)});function Sw(e){return XS(cne,e)}var lne=W(`ZodAny`,(e,t)=>{jx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function une(){return ZS(lne)}var dne=W(`ZodUnknown`,(e,t)=>{Mx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Cw(){return QS(dne)}var fne=W(`ZodNever`,(e,t)=>{Nx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RC(e,t,n,r)});function ww(e){return $S(fne,e)}var pne=W(`ZodArray`,(e,t)=>{Fx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UC(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(oC(t,n)),e.nonempty=t=>e.check(oC(1,t)),e.max=(t,n)=>e.check(aC(t,n)),e.length=(t,n)=>e.check(sC(t,n)),e.unwrap=()=>e.element});function q(e,t){return bC(pne,e,t)}var Tw=W(`ZodObject`,(e,t)=>{Bx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>WC(e,t,n,r),oy(e,`shape`,()=>t.shape),e.keyof=()=>Nw(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Cw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Cw()}),e.strict=()=>e.clone({...e._zod.def,catchall:ww()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>wy(e,t),e.safeExtend=t=>Ty(e,t),e.merge=t=>Ey(e,t),e.pick=t=>Sy(e,t),e.omit=t=>Cy(e,t),e.partial=(...t)=>Dy(Fw,e,t[0]),e.required=(...t)=>Oy(Rw,e,t[0])});function J(e,t){return new Tw({type:`object`,shape:e??{},...yy(t)})}function Ew(e,t){return new Tw({type:`object`,shape:e,catchall:Cw(),...yy(t)})}var Dw=W(`ZodUnion`,(e,t)=>{Hx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GC(e,t,n,r),e.options=t.options});function Ow(e,t){return new Dw({type:`union`,options:e,...yy(t)})}var mne=W(`ZodDiscriminatedUnion`,(e,t)=>{Dw.init(e,t),Ux.init(e,t)});function kw(e,t,n){return new mne({type:`union`,options:t,discriminator:e,...yy(n)})}var hne=W(`ZodIntersection`,(e,t)=>{Wx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>KC(e,t,n,r)});function Aw(e,t){return new hne({type:`intersection`,left:e,right:t})}var gne=W(`ZodRecord`,(e,t)=>{qx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qC(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function jw(e,t,n){return new gne({type:`record`,keyType:e,valueType:t,...yy(n)})}var Mw=W(`ZodEnum`,(e,t)=>{Jx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zC(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 Mw({...t,checks:[],...yy(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 Mw({...t,checks:[],...yy(r),entries:i})}});function Nw(e,t){return new Mw({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...yy(t)})}var _ne=W(`ZodLiteral`,(e,t)=>{Yx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BC(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Y(e,t){return new _ne({type:`literal`,values:Array.isArray(e)?e:[e],...yy(t)})}var vne=W(`ZodTransform`,(e,t)=>{Xx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>HC(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Xv(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Py(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(Py(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Pw(e){return new vne({type:`transform`,transform:e})}var Fw=W(`ZodOptional`,(e,t)=>{Qx.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Iw(e){return new Fw({type:`optional`,innerType:e})}var yne=W(`ZodExactOptional`,(e,t)=>{$x.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tw(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bne(e){return new yne({type:`optional`,innerType:e})}var xne=W(`ZodNullable`,(e,t)=>{eS.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Lw(e){return new xne({type:`nullable`,innerType:e})}var Sne=W(`ZodDefault`,(e,t)=>{tS.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Cne(e,t){return new Sne({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():hy(t)}})}var wne=W(`ZodPrefault`,(e,t)=>{rS.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ZC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tne(e,t){return new wne({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():hy(t)}})}var Rw=W(`ZodNonOptional`,(e,t)=>{iS.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ene(e,t){return new Rw({type:`nonoptional`,innerType:e,...yy(t)})}var Dne=W(`ZodCatch`,(e,t)=>{oS.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>QC(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function One(e,t){return new Dne({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var kne=W(`ZodPipe`,(e,t)=>{sS.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$C(e,t,n,r),e.in=t.in,e.out=t.out});function zw(e,t){return new kne({type:`pipe`,in:e,out:t})}var Ane=W(`ZodReadonly`,(e,t)=>{lS.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ew(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jne(e){return new Ane({type:`readonly`,innerType:e})}var Bw=W(`ZodLazy`,(e,t)=>{dS.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nw(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Vw(e){return new Bw({type:`lazy`,getter:e})}var Hw=W(`ZodCustom`,(e,t)=>{fS.init(e,t),uw.init(e,t),e._zod.processJSONSchema=(t,n,r)=>VC(e,t,n,r)});function Uw(e,t){return xC(Hw,e??(()=>!0),t)}function Ww(e,t={}){return SC(Hw,e,t)}function Gw(e){return CC(e)}function Kw(e,t){return zw(Pw(e),t)}var qw={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},Jw;Jw||={};function Yw(e){return KS(vw,e)}var Xw=`2025-11-25`,Zw=[Xw,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Qw=`io.modelcontextprotocol/related-task`,$w=`io.modelcontextprotocol/protocolVersion`,eT=`io.modelcontextprotocol/clientInfo`,tT=`io.modelcontextprotocol/serverInfo`,nT=`io.modelcontextprotocol/clientCapabilities`,rT=`io.modelcontextprotocol/subscriptionId`,iT=`io.modelcontextprotocol/logLevel`,aT=Vw(()=>Ow([G(),K(),bw(),Sw(),jw(G(),aT),q(aT)])),oT=jw(G(),aT),sT=q(aT),cT=Ow([G(),K().int()]),lT=G(),uT=J({ttl:K().optional()}),dT=J({taskId:G()}),fT=Ew({progressToken:cT.optional(),[Qw]:dT.optional()}),pT=J({_meta:fT.optional()}),mT=pT.extend({task:uT.optional()}),hT=J({method:G(),params:pT.loose().optional()}),gT=J({_meta:fT.optional()}),_T=J({method:G(),params:gT.loose().optional()}),vT=Ew({get[tT](){return NT.optional().catch(void 0)}}),yT=Ew({_meta:vT.optional()}),bT=Ow([G(),K().int()]),xT=J({jsonrpc:Y(`2.0`),id:bT,...hT.shape}).strict(),ST=J({jsonrpc:Y(`2.0`),..._T.shape}).strict(),CT=J({jsonrpc:Y(`2.0`),id:bT,result:yT}).strict(),wT=J({jsonrpc:Y(`2.0`),id:bT.optional(),error:J({code:K().int(),message:G(),data:Cw().optional()})}).strict(),TT=Ow([xT,ST,CT,wT]),ET=Ow([CT,wT]),DT=yT.strict(),OT=gT.extend({requestId:bT.optional(),reason:G().optional()}),kT=_T.extend({method:Y(`notifications/cancelled`),params:OT}),AT=J({src:G(),mimeType:G().optional(),sizes:q(G()).optional(),theme:Nw([`light`,`dark`]).optional()}),jT=J({icons:q(AT).optional()}),MT=J({name:G(),title:G().optional()}),NT=MT.extend({...MT.shape,...jT.shape,version:G(),websiteUrl:G().optional(),description:G().optional()}),PT=Kw(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Aw(J({form:Aw(J({applyDefaults:bw().optional()}),oT).optional(),url:oT.optional()}),oT.optional())),FT=Ew({list:oT.optional(),cancel:oT.optional(),requests:Ew({sampling:Ew({createMessage:oT.optional()}).optional(),elicitation:Ew({create:oT.optional()}).optional()}).optional()}),IT=Ew({list:oT.optional(),cancel:oT.optional(),requests:Ew({tools:Ew({call:oT.optional()}).optional()}).optional()}),LT=J({experimental:jw(G(),oT).optional(),sampling:J({context:oT.optional(),tools:oT.optional()}).optional(),elicitation:PT.optional(),roots:J({listChanged:bw().optional()}).optional(),tasks:FT.optional(),extensions:jw(G(),oT).optional()}),RT=pT.extend({protocolVersion:G(),capabilities:LT,clientInfo:NT}),zT=hT.extend({method:Y(`initialize`),params:RT}),BT=J({experimental:jw(G(),oT).optional(),logging:oT.optional(),completions:oT.optional(),prompts:J({listChanged:bw().optional()}).optional(),resources:J({subscribe:bw().optional(),listChanged:bw().optional()}).optional(),tools:J({listChanged:bw().optional()}).optional(),tasks:IT.optional(),extensions:jw(G(),oT).optional()}),VT=yT.extend({protocolVersion:G(),capabilities:BT,serverInfo:NT,instructions:G().optional()}),HT=_T.extend({method:Y(`notifications/initialized`),params:gT.optional()}),UT=hT.extend({method:Y(`server/discover`),params:pT.optional()}),WT=yT.extend({supportedVersions:q(G()),capabilities:BT,instructions:G().optional()}),GT=hT.extend({method:Y(`ping`),params:pT.optional()}),KT=J({progress:K(),total:Iw(K()),message:Iw(G())}),qT=J({...gT.shape,...KT.shape,progressToken:cT}),JT=_T.extend({method:Y(`notifications/progress`),params:qT}),YT=pT.extend({cursor:lT.optional()}),XT=hT.extend({params:YT.optional()}),ZT=yT.extend({nextCursor:lT.optional()}),QT=J({uri:G(),mimeType:Iw(G()),_meta:jw(G(),Cw()).optional()}),$T=QT.extend({text:G()}),eE=G().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),tE=QT.extend({blob:eE}),nE=Nw([`user`,`assistant`]),rE=J({audience:q(nE).optional(),priority:K().min(0).max(1).optional(),lastModified:aw({offset:!0}).optional()}),iE=J({...MT.shape,...jT.shape,uri:G(),description:Iw(G()),mimeType:Iw(G()),size:Iw(K()),annotations:rE.optional(),_meta:Iw(Ew({}))}),aE=J({...MT.shape,...jT.shape,uriTemplate:G(),description:Iw(G()),mimeType:Iw(G()),annotations:rE.optional(),_meta:Iw(Ew({}))}),oE=XT.extend({method:Y(`resources/list`)}),sE=ZT.extend({resources:q(iE)}),cE=XT.extend({method:Y(`resources/templates/list`)}),lE=ZT.extend({resourceTemplates:q(aE)}),uE=pT.extend({uri:G()}),dE=uE,fE=hT.extend({method:Y(`resources/read`),params:dE}),pE=yT.extend({contents:q(Ow([$T,tE]))}),mE=_T.extend({method:Y(`notifications/resources/list_changed`),params:gT.optional()}),hE=uE,gE=hT.extend({method:Y(`resources/subscribe`),params:hE}),_E=uE,vE=hT.extend({method:Y(`resources/unsubscribe`),params:_E}),yE=J({toolsListChanged:bw().optional(),promptsListChanged:bw().optional(),resourcesListChanged:bw().optional(),resourceSubscriptions:q(G()).optional()}),bE=pT.extend({notifications:yE}),xE=hT.extend({method:Y(`subscriptions/listen`),params:bE}),SE=gT.extend({notifications:yE}),CE=_T.extend({method:Y(`notifications/subscriptions/acknowledged`),params:SE}),wE=vT.extend({[rT]:bT}),TE=yT.extend({_meta:wE}),EE=gT.extend({uri:G()}),DE=_T.extend({method:Y(`notifications/resources/updated`),params:EE}),OE=J({name:G(),description:Iw(G()),required:Iw(bw())}),kE=J({...MT.shape,...jT.shape,description:Iw(G()),arguments:Iw(q(OE)),_meta:Iw(Ew({}))}),AE=XT.extend({method:Y(`prompts/list`)}),jE=ZT.extend({prompts:q(kE)}),ME=pT.extend({name:G(),arguments:jw(G(),G()).optional()}),NE=hT.extend({method:Y(`prompts/get`),params:ME}),PE=J({type:Y(`text`),text:G(),annotations:rE.optional(),_meta:jw(G(),Cw()).optional()}),FE=J({type:Y(`image`),data:eE,mimeType:G(),annotations:rE.optional(),_meta:jw(G(),Cw()).optional()}),IE=J({type:Y(`audio`),data:eE,mimeType:G(),annotations:rE.optional(),_meta:jw(G(),Cw()).optional()}),LE=J({type:Y(`tool_use`),name:G(),id:G(),input:jw(G(),Cw()),_meta:jw(G(),Cw()).optional()}),RE=J({type:Y(`resource`),resource:Ow([$T,tE]),annotations:rE.optional(),_meta:jw(G(),Cw()).optional()}),zE=iE.extend({type:Y(`resource_link`)}),BE=Ow([PE,FE,IE,zE,RE]),VE=J({role:nE,content:BE}),HE=yT.extend({description:G().optional(),messages:q(VE)}),UE=_T.extend({method:Y(`notifications/prompts/list_changed`),params:gT.optional()}),WE=J({title:G().optional(),readOnlyHint:bw().optional(),destructiveHint:bw().optional(),idempotentHint:bw().optional(),openWorldHint:bw().optional()}),GE=J({taskSupport:Nw([`required`,`optional`,`forbidden`]).optional()}),KE=J({...MT.shape,...jT.shape,description:G().optional(),inputSchema:J({type:Y(`object`),properties:jw(G(),aT).optional(),required:q(G()).optional()}).catchall(Cw()),outputSchema:Ew({$schema:G().optional()}).optional(),annotations:WE.optional(),execution:GE.optional(),_meta:jw(G(),Cw()).optional()}),qE=XT.extend({method:Y(`tools/list`)}),JE=ZT.extend({tools:q(KE)}),YE=yT.extend({content:q(BE).default([]),structuredContent:Cw().optional(),isError:bw().optional()}),XE=YE.or(yT.extend({toolResult:Cw()})),ZE=mT.extend({name:G(),arguments:jw(G(),Cw()).optional()}),QE=hT.extend({method:Y(`tools/call`),params:ZE}),$E=_T.extend({method:Y(`notifications/tools/list_changed`),params:gT.optional()}),eD=J({autoRefresh:bw().default(!0),debounceMs:K().int().nonnegative().default(300)}),tD=Nw([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),nD=pT.extend({level:tD}),rD=hT.extend({method:Y(`logging/setLevel`),params:nD}),iD=gT.extend({level:tD,logger:G().optional(),data:Cw()}),aD=_T.extend({method:Y(`notifications/message`),params:iD}),oD=J({name:G().optional()}),sD=J({hints:q(oD).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),cD=J({mode:Nw([`auto`,`required`,`none`]).optional()}),lD=J({type:Y(`tool_result`),toolUseId:G().describe(`The unique identifier for the corresponding tool call.`),content:q(BE),structuredContent:Cw().optional(),isError:bw().optional(),_meta:jw(G(),Cw()).optional()}),uD=kw(`type`,[PE,FE,IE]),dD=kw(`type`,[PE,FE,IE,LE,lD]),fD=J({role:nE,content:Ow([dD,q(dD)]),_meta:jw(G(),Cw()).optional()}),pD=mT.extend({messages:q(fD),modelPreferences:sD.optional(),systemPrompt:G().optional(),includeContext:Nw([`none`,`thisServer`,`allServers`]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:q(G()).optional(),metadata:oT.optional(),tools:q(KE).optional(),toolChoice:cD.optional()}),mD=hT.extend({method:Y(`sampling/createMessage`),params:pD}),hD=yT.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`]).or(G())),role:nE,content:uD}),gD=yT.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(G())),role:nE,content:Ow([dD,q(dD)])}),_D=J({type:Y(`boolean`),title:G().optional(),description:G().optional(),default:bw().optional()}),vD=J({type:Y(`string`),title:G().optional(),description:G().optional(),minLength:K().optional(),maxLength:K().optional(),format:Nw([`email`,`uri`,`date`,`date-time`]).optional(),default:G().optional()}),yD=J({type:Nw([`number`,`integer`]),title:G().optional(),description:G().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),bD=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),default:G().optional()}),xD=J({type:Y(`string`),title:G().optional(),description:G().optional(),oneOf:q(J({const:G(),title:G()})),default:G().optional()}),SD=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),enumNames:q(G()).optional(),default:G().optional()}),CD=Ow([bD,xD]),wD=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({type:Y(`string`),enum:q(G())}),default:q(G()).optional()}),TD=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({anyOf:q(J({const:G(),title:G()}))}),default:q(G()).optional()}),ED=Ow([wD,TD]),DD=Ow([SD,CD,ED]),OD=Ow([DD,_D,vD,yD]),kD=mT.extend({mode:Y(`form`).optional(),message:G(),requestedSchema:J({type:Y(`object`),properties:jw(G(),OD),required:q(G()).optional()}).catchall(Cw())}),AD=mT.extend({mode:Y(`url`),message:G(),elicitationId:G(),url:G().url()}),jD=Ow([kD,AD]),MD=hT.extend({method:Y(`elicitation/create`),params:jD}),ND=gT.extend({elicitationId:G()}),PD=_T.extend({method:Y(`notifications/elicitation/complete`),params:ND}),FD=yT.extend({action:Nw([`accept`,`decline`,`cancel`]),content:Kw(e=>e===null?void 0:e,jw(G(),Ow([G(),K(),bw(),q(G())])).optional())}),ID=J({type:Y(`ref/resource`),uri:G()}),LD=J({type:Y(`ref/prompt`),name:G()}),RD=pT.extend({ref:Ow([LD,ID]),argument:J({name:G(),value:G()}),context:J({arguments:jw(G(),G()).optional()}).optional()}),zD=hT.extend({method:Y(`completion/complete`),params:RD}),BD=yT.extend({completion:Ew({values:q(G()).max(100),total:Iw(K().int()),hasMore:Iw(bw())})}),VD=J({uri:G().startsWith(`file://`),name:G().optional(),_meta:jw(G(),Cw()).optional()}),HD=hT.extend({method:Y(`roots/list`),params:pT.optional()}),UD=yT.extend({roots:q(VD)}),WD=_T.extend({method:Y(`notifications/roots/list_changed`),params:gT.optional()}),GD=Ew({ttl:K().optional(),pollInterval:K().optional()}),KD=Nw([`working`,`input_required`,`completed`,`failed`,`cancelled`]),qD=J({taskId:G(),status:KD,ttl:Ow([K(),Sw()]),createdAt:G(),lastUpdatedAt:G(),pollInterval:Iw(K()),statusMessage:Iw(G())}),JD=yT.extend({task:qD}),YD=gT.merge(qD),XD=_T.extend({method:Y(`notifications/tasks/status`),params:YD}),ZD=hT.extend({method:Y(`tasks/get`),params:pT.extend({taskId:G()})}),QD=yT.merge(qD),$D=hT.extend({method:Y(`tasks/result`),params:pT.extend({taskId:G()})}),eO=yT.loose(),tO=XT.extend({method:Y(`tasks/list`)}),nO=ZT.extend({tasks:q(qD)}),rO=hT.extend({method:Y(`tasks/cancel`),params:pT.extend({taskId:G()})}),iO=yT.merge(qD),aO=Ow([GT,zT,UT,zD,rD,NE,AE,oE,cE,fE,gE,vE,xE,QE,qE]),oO=Ow([kT,JT,HT,WD]),sO=Ow([DT,hD,gD,FD,UD]),cO=Ow([GT,mD,MD,HD]),lO=Ow([kT,JT,aD,DE,mE,$E,UE,CE,PD]),uO=Ow([DT,VT,WT,BD,HE,jE,sE,lE,pE,YE,JE,TE]),dO=_w().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:qw.custom,message:`URL must be parseable`,fatal:!0}),Jv}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),fO=Ew({resource:G().url(),authorization_servers:q(dO).optional(),jwks_uri:G().url().optional(),scopes_supported:q(G()).optional(),bearer_methods_supported:q(G()).optional(),resource_signing_alg_values_supported:q(G()).optional(),resource_name:G().optional(),resource_documentation:G().optional(),resource_policy_uri:G().url().optional(),resource_tos_uri:G().url().optional(),tls_client_certificate_bound_access_tokens:bw().optional(),authorization_details_types_supported:q(G()).optional(),dpop_signing_alg_values_supported:q(G()).optional(),dpop_bound_access_tokens_required:bw().optional()}),pO=Ew({issuer:G(),authorization_endpoint:dO,token_endpoint:dO,registration_endpoint:dO.optional(),scopes_supported:q(G()).optional(),response_types_supported:q(G()),response_modes_supported:q(G()).optional(),grant_types_supported:q(G()).optional(),token_endpoint_auth_methods_supported:q(G()).optional(),token_endpoint_auth_signing_alg_values_supported:q(G()).optional(),service_documentation:dO.optional(),revocation_endpoint:dO.optional(),revocation_endpoint_auth_methods_supported:q(G()).optional(),revocation_endpoint_auth_signing_alg_values_supported:q(G()).optional(),introspection_endpoint:G().optional(),introspection_endpoint_auth_methods_supported:q(G()).optional(),introspection_endpoint_auth_signing_alg_values_supported:q(G()).optional(),code_challenge_methods_supported:q(G()).optional(),client_id_metadata_document_supported:bw().optional(),authorization_response_iss_parameter_supported:bw().optional().catch(void 0)}),mO=Ew({issuer:G(),authorization_endpoint:dO,token_endpoint:dO,userinfo_endpoint:dO.optional(),jwks_uri:dO,registration_endpoint:dO.optional(),scopes_supported:q(G()).optional(),response_types_supported:q(G()),response_modes_supported:q(G()).optional(),grant_types_supported:q(G()).optional(),acr_values_supported:q(G()).optional(),subject_types_supported:q(G()),id_token_signing_alg_values_supported:q(G()),id_token_encryption_alg_values_supported:q(G()).optional(),id_token_encryption_enc_values_supported:q(G()).optional(),userinfo_signing_alg_values_supported:q(G()).optional(),userinfo_encryption_alg_values_supported:q(G()).optional(),userinfo_encryption_enc_values_supported:q(G()).optional(),request_object_signing_alg_values_supported:q(G()).optional(),request_object_encryption_alg_values_supported:q(G()).optional(),request_object_encryption_enc_values_supported:q(G()).optional(),token_endpoint_auth_methods_supported:q(G()).optional(),token_endpoint_auth_signing_alg_values_supported:q(G()).optional(),display_values_supported:q(G()).optional(),claim_types_supported:q(G()).optional(),claims_supported:q(G()).optional(),service_documentation:G().optional(),claims_locales_supported:q(G()).optional(),ui_locales_supported:q(G()).optional(),claims_parameter_supported:bw().optional(),request_parameter_supported:bw().optional(),request_uri_parameter_supported:bw().optional(),require_request_uri_registration:bw().optional(),op_policy_uri:dO.optional(),op_tos_uri:dO.optional(),client_id_metadata_document_supported:bw().optional(),authorization_response_iss_parameter_supported:bw().optional().catch(void 0)}),hO=J({...mO.shape,...pO.pick({code_challenge_methods_supported:!0}).shape}),gO=J({access_token:G(),id_token:G().optional(),token_type:G(),expires_in:Yw().optional(),scope:G().optional(),refresh_token:G().optional()}).strip(),_O=J({issued_token_type:Y(`urn:ietf:params:oauth:token-type:id-jag`),access_token:G(),token_type:G().optional(),expires_in:K().optional(),scope:G().optional()}).strip(),vO=J({error:G(),error_description:G().optional(),error_uri:G().optional()}),yO=dO.optional().or(Y(``).transform(()=>void 0)),bO=J({redirect_uris:q(dO),token_endpoint_auth_method:G().optional(),grant_types:q(G()).optional(),response_types:q(G()).optional(),application_type:G().optional(),client_name:G().optional(),client_uri:dO.optional(),logo_uri:yO,scope:G().optional(),contacts:q(G()).optional(),tos_uri:yO,policy_uri:G().optional(),jwks_uri:dO.optional(),jwks:une().optional(),software_id:G().optional(),software_version:G().optional(),software_statement:G().optional()}).strip(),xO=J({client_id:G(),client_secret:G().optional(),client_id_issued_at:K().optional(),client_secret_expires_at:K().optional()}).strip(),SO=bO.merge(xO),CO=J({error:G(),error_description:G().optional()}).strip(),wO=J({token:G(),token_type_hint:G().optional()}).strip(),TO=Symbol.for(`mcp.sdk.errorBrands`);function EO(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,TO,{value:n,enumerable:!1,configurable:!0})}function DO(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,TO)){let n=t[TO];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var OO=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e}({}),kO=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return DO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return DO(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,EO(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},AO=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),jO=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return DO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return DO(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`SdkError`,EO(this,new.target)}},MO=class extends jO{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n){super(e,t,n),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function NO(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function PO({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;let i=n.pathname.endsWith(`/`)?n.pathname:n.pathname+`/`,a=r.pathname.endsWith(`/`)?r.pathname:r.pathname+`/`;return i.startsWith(a)}var FO=`2026-07-28`,IO=[FO];function LO(e){return e>=FO}function RO(e){return e.filter(e=>!LO(e))}function zO(e){return e.filter(e=>LO(e))}function BO(e){let t=e.structuredContent;return t===void 0||!(typeof t!=`object`||!t||Array.isArray(t))||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var VO=[`task`,`inputRequests`,`requestState`];function HO(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||VO.some(t=>t in e)?e:{...e,content:[]}}function UO(){let e=Vw(()=>Ow([G(),K(),bw(),Sw(),jw(G(),e),q(e)])),t=jw(G(),e),n=Ow([G(),K().int()]),r=G(),i=J({ttl:K().optional()}),a=J({taskId:G()}),o=Ew({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=J({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=J({method:G(),params:s.loose().optional()}),u=J({_meta:o.optional()}),d=J({method:G(),params:u.loose().optional()}),f=Ew({_meta:o.optional()}),p=Ow([G(),K().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:G().optional()}),g=d.extend({method:Y(`notifications/cancelled`),params:h}),_=J({src:G(),mimeType:G().optional(),sizes:q(G()).optional(),theme:Nw([`light`,`dark`]).optional()}),v=J({icons:q(_).optional()}),y=J({name:G(),title:G().optional()}),b=y.extend({...y.shape,...v.shape,version:G(),websiteUrl:G().optional(),description:G().optional()}),x=Kw(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Aw(J({form:Aw(J({applyDefaults:bw().optional()}),t).optional(),url:t.optional()}),t.optional())),S=Ew({list:t.optional(),cancel:t.optional(),requests:Ew({sampling:Ew({createMessage:t.optional()}).optional(),elicitation:Ew({create:t.optional()}).optional()}).optional()}),C=Ew({list:t.optional(),cancel:t.optional(),requests:Ew({tools:Ew({call:t.optional()}).optional()}).optional()}),w=J({experimental:jw(G(),t).optional(),sampling:J({context:t.optional(),tools:t.optional()}).optional(),elicitation:x.optional(),roots:J({listChanged:bw().optional()}).optional(),tasks:S.optional(),extensions:jw(G(),t).optional()}),T=s.extend({protocolVersion:G(),capabilities:w,clientInfo:b}),E=l.extend({method:Y(`initialize`),params:T}),D=J({experimental:jw(G(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:J({listChanged:bw().optional()}).optional(),resources:J({subscribe:bw().optional(),listChanged:bw().optional()}).optional(),tools:J({listChanged:bw().optional()}).optional(),tasks:C.optional(),extensions:jw(G(),t).optional()}),O=f.extend({protocolVersion:G(),capabilities:D,serverInfo:b,instructions:G().optional()}),k=d.extend({method:Y(`notifications/initialized`),params:u.optional()}),A=l.extend({method:Y(`ping`),params:s.optional()}),j=J({progress:K(),total:Iw(K()),message:Iw(G())}),M=J({...u.shape,...j.shape,progressToken:n}),N=d.extend({method:Y(`notifications/progress`),params:M}),ee=s.extend({cursor:r.optional()}),te=l.extend({params:ee.optional()}),P=f.extend({nextCursor:r.optional()}),F=J({uri:G(),mimeType:Iw(G()),_meta:jw(G(),Cw()).optional()}),I=F.extend({text:G()}),ne=G().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),re=F.extend({blob:ne}),ie=Nw([`user`,`assistant`]),ae=J({audience:q(ie).optional(),priority:K().min(0).max(1).optional(),lastModified:aw({offset:!0}).optional()}),oe=J({...y.shape,...v.shape,uri:G(),description:Iw(G()),mimeType:Iw(G()),size:Iw(K()),annotations:ae.optional(),_meta:Iw(Ew({}))}),se=J({...y.shape,...v.shape,uriTemplate:G(),description:Iw(G()),mimeType:Iw(G()),annotations:ae.optional(),_meta:Iw(Ew({}))}),ce=te.extend({method:Y(`resources/list`)}),le=P.extend({resources:q(oe)}),ue=te.extend({method:Y(`resources/templates/list`)}),de=P.extend({resourceTemplates:q(se)}),fe=s.extend({uri:G()}),pe=fe,me=l.extend({method:Y(`resources/read`),params:pe}),he=f.extend({contents:q(Ow([I,re]))}),ge=d.extend({method:Y(`notifications/resources/list_changed`),params:u.optional()}),_e=fe,ve=l.extend({method:Y(`resources/subscribe`),params:_e}),ye=fe,be=l.extend({method:Y(`resources/unsubscribe`),params:ye}),xe=u.extend({uri:G()}),Se=d.extend({method:Y(`notifications/resources/updated`),params:xe}),Ce=J({name:G(),description:Iw(G()),required:Iw(bw())}),we=J({...y.shape,...v.shape,description:Iw(G()),arguments:Iw(q(Ce)),_meta:Iw(Ew({}))}),Te=te.extend({method:Y(`prompts/list`)}),Ee=P.extend({prompts:q(we)}),De=s.extend({name:G(),arguments:jw(G(),G()).optional()}),Oe=l.extend({method:Y(`prompts/get`),params:De}),ke=J({type:Y(`text`),text:G(),annotations:ae.optional(),_meta:jw(G(),Cw()).optional()}),Ae=J({type:Y(`image`),data:ne,mimeType:G(),annotations:ae.optional(),_meta:jw(G(),Cw()).optional()}),je=J({type:Y(`audio`),data:ne,mimeType:G(),annotations:ae.optional(),_meta:jw(G(),Cw()).optional()}),Me=J({type:Y(`tool_use`),name:G(),id:G(),input:jw(G(),Cw()),_meta:jw(G(),Cw()).optional()}),Ne=J({type:Y(`resource`),resource:Ow([I,re]),annotations:ae.optional(),_meta:jw(G(),Cw()).optional()}),Pe=oe.extend({type:Y(`resource_link`)}),Fe=Ow([ke,Ae,je,Pe,Ne]),Ie=J({role:ie,content:Fe}),Le=f.extend({description:G().optional(),messages:q(Ie)}),Re=d.extend({method:Y(`notifications/prompts/list_changed`),params:u.optional()}),ze=J({title:G().optional(),readOnlyHint:bw().optional(),destructiveHint:bw().optional(),idempotentHint:bw().optional(),openWorldHint:bw().optional()}),Be=J({taskSupport:Nw([`required`,`optional`,`forbidden`]).optional()}),Ve=J({...y.shape,...v.shape,description:G().optional(),inputSchema:J({type:Y(`object`),properties:jw(G(),e).optional(),required:q(G()).optional()}).catchall(Cw()),outputSchema:J({type:Y(`object`),properties:jw(G(),e).optional(),required:q(G()).optional()}).catchall(Cw()).optional(),annotations:ze.optional(),execution:Be.optional(),_meta:jw(G(),Cw()).optional()}),He=te.extend({method:Y(`tools/list`)}),Ue=P.extend({tools:q(Ve)}),We=f.extend({content:q(Fe),structuredContent:jw(G(),Cw()).optional(),isError:bw().optional()}),Ge=c.extend({name:G(),arguments:jw(G(),Cw()).optional()}),Ke=l.extend({method:Y(`tools/call`),params:Ge}),qe=d.extend({method:Y(`notifications/tools/list_changed`),params:u.optional()}),Je=Nw([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Ye=s.extend({level:Je}),Xe=l.extend({method:Y(`logging/setLevel`),params:Ye}),Ze=u.extend({level:Je,logger:G().optional(),data:Cw()}),Qe=d.extend({method:Y(`notifications/message`),params:Ze}),$e=J({name:G().optional()}),L=J({hints:q($e).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),et=J({mode:Nw([`auto`,`required`,`none`]).optional()}),tt=J({type:Y(`tool_result`),toolUseId:G().describe(`The unique identifier for the corresponding tool call.`),content:q(Fe),structuredContent:J({}).loose().optional(),isError:bw().optional(),_meta:jw(G(),Cw()).optional()}),nt=kw(`type`,[ke,Ae,je]),rt=kw(`type`,[ke,Ae,je,Me,tt]),it=J({role:ie,content:Ow([rt,q(rt)]),_meta:jw(G(),Cw()).optional()}),R=c.extend({messages:q(it),modelPreferences:L.optional(),systemPrompt:G().optional(),includeContext:Nw([`none`,`thisServer`,`allServers`]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:q(G()).optional(),metadata:t.optional(),tools:q(Ve).optional(),toolChoice:et.optional()}),at=l.extend({method:Y(`sampling/createMessage`),params:R}),ot=f.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`]).or(G())),role:ie,content:nt}),st=f.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(G())),role:ie,content:Ow([rt,q(rt)])}),ct=J({type:Y(`boolean`),title:G().optional(),description:G().optional(),default:bw().optional()}),lt=J({type:Y(`string`),title:G().optional(),description:G().optional(),minLength:K().optional(),maxLength:K().optional(),format:Nw([`email`,`uri`,`date`,`date-time`]).optional(),default:G().optional()}),ut=J({type:Nw([`number`,`integer`]),title:G().optional(),description:G().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),dt=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),default:G().optional()}),ft=J({type:Y(`string`),title:G().optional(),description:G().optional(),oneOf:q(J({const:G(),title:G()})),default:G().optional()}),pt=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),enumNames:q(G()).optional(),default:G().optional()}),mt=Ow([dt,ft]),ht=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({type:Y(`string`),enum:q(G())}),default:q(G()).optional()}),gt=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({anyOf:q(J({const:G(),title:G()}))}),default:q(G()).optional()}),_t=Ow([ht,gt]),vt=Ow([pt,mt,_t]),yt=Ow([vt,ct,lt,ut]),bt=c.extend({mode:Y(`form`).optional(),message:G(),requestedSchema:J({type:Y(`object`),properties:jw(G(),yt),required:q(G()).optional()}).catchall(Cw())}),xt=c.extend({mode:Y(`url`),message:G(),elicitationId:G(),url:G().url()}),St=Ow([bt,xt]),Ct=l.extend({method:Y(`elicitation/create`),params:St}),wt=u.extend({elicitationId:G()}),Tt=d.extend({method:Y(`notifications/elicitation/complete`),params:wt}),Et=f.extend({action:Nw([`accept`,`decline`,`cancel`]),content:Kw(e=>e===null?void 0:e,jw(G(),Ow([G(),K(),bw(),q(G())])).optional())}),Dt=J({type:Y(`ref/resource`),uri:G()}),Ot=J({type:Y(`ref/prompt`),name:G()}),kt=s.extend({ref:Ow([Ot,Dt]),argument:J({name:G(),value:G()}),context:J({arguments:jw(G(),G()).optional()}).optional()}),At=l.extend({method:Y(`completion/complete`),params:kt}),jt=f.extend({completion:Ew({values:q(G()).max(100),total:Iw(K().int()),hasMore:Iw(bw())})}),Mt=J({uri:G().startsWith(`file://`),name:G().optional(),_meta:jw(G(),Cw()).optional()}),Nt=l.extend({method:Y(`roots/list`),params:s.optional()}),Pt=f.extend({roots:q(Mt)}),Ft=d.extend({method:Y(`notifications/roots/list_changed`),params:u.optional()}),It=Ew({ttl:K().optional(),pollInterval:K().optional()}),Lt=Nw([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Rt=J({taskId:G(),status:Lt,ttl:Ow([K(),Sw()]),createdAt:G(),lastUpdatedAt:G(),pollInterval:Iw(K()),statusMessage:Iw(G())}),zt=f.extend({task:Rt}),Bt=u.merge(Rt),Vt=d.extend({method:Y(`notifications/tasks/status`),params:Bt}),Ht=l.extend({method:Y(`tasks/get`),params:s.extend({taskId:G()})}),Ut=f.merge(Rt),Wt=l.extend({method:Y(`tasks/result`),params:s.extend({taskId:G()})}),Gt=f.loose(),Kt=te.extend({method:Y(`tasks/list`)}),qt=P.extend({tasks:q(Rt)}),Jt=l.extend({method:Y(`tasks/cancel`),params:s.extend({taskId:G()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:m,CancelledNotificationParamsSchema:h,CancelledNotificationSchema:g,IconSchema:_,IconsSchema:v,BaseMetadataSchema:y,ImplementationSchema:b,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:C,ClientCapabilitiesSchema:w,InitializeRequestParamsSchema:T,InitializeRequestSchema:E,ServerCapabilitiesSchema:D,InitializeResultSchema:O,InitializedNotificationSchema:k,PingRequestSchema:A,ProgressSchema:j,ProgressNotificationParamsSchema:M,ProgressNotificationSchema:N,PaginatedRequestParamsSchema:ee,PaginatedRequestSchema:te,PaginatedResultSchema:P,ResourceContentsSchema:F,TextResourceContentsSchema:I,BlobResourceContentsSchema:re,RoleSchema:ie,AnnotationsSchema:ae,ResourceSchema:oe,ResourceTemplateSchema:se,ListResourcesRequestSchema:ce,ListResourcesResultSchema:le,ListResourceTemplatesRequestSchema:ue,ListResourceTemplatesResultSchema:de,ResourceRequestParamsSchema:fe,ReadResourceRequestParamsSchema:pe,ReadResourceRequestSchema:me,ReadResourceResultSchema:he,ResourceListChangedNotificationSchema:ge,SubscribeRequestParamsSchema:_e,SubscribeRequestSchema:ve,UnsubscribeRequestParamsSchema:ye,UnsubscribeRequestSchema:be,ResourceUpdatedNotificationParamsSchema:xe,ResourceUpdatedNotificationSchema:Se,PromptArgumentSchema:Ce,PromptSchema:we,ListPromptsRequestSchema:Te,ListPromptsResultSchema:Ee,GetPromptRequestParamsSchema:De,GetPromptRequestSchema:Oe,TextContentSchema:ke,ImageContentSchema:Ae,AudioContentSchema:je,ToolUseContentSchema:Me,EmbeddedResourceSchema:Ne,ResourceLinkSchema:Pe,ContentBlockSchema:Fe,PromptMessageSchema:Ie,GetPromptResultSchema:Le,PromptListChangedNotificationSchema:Re,ToolAnnotationsSchema:ze,ToolExecutionSchema:Be,ToolSchema:Ve,ListToolsRequestSchema:He,ListToolsResultSchema:Ue,CallToolResultSchema:We,CallToolRequestParamsSchema:Ge,CallToolRequestSchema:Ke,ToolListChangedNotificationSchema:qe,LoggingLevelSchema:Je,SetLevelRequestParamsSchema:Ye,SetLevelRequestSchema:Xe,LoggingMessageNotificationParamsSchema:Ze,LoggingMessageNotificationSchema:Qe,ModelHintSchema:$e,ModelPreferencesSchema:L,ToolChoiceSchema:et,ToolResultContentSchema:tt,SamplingContentSchema:nt,SamplingMessageContentBlockSchema:rt,SamplingMessageSchema:it,CreateMessageRequestParamsSchema:R,CreateMessageRequestSchema:at,CreateMessageResultSchema:ot,CreateMessageResultWithToolsSchema:st,BooleanSchemaSchema:ct,StringSchemaSchema:lt,NumberSchemaSchema:ut,UntitledSingleSelectEnumSchemaSchema:dt,TitledSingleSelectEnumSchemaSchema:ft,LegacyTitledEnumSchemaSchema:pt,SingleSelectEnumSchemaSchema:mt,UntitledMultiSelectEnumSchemaSchema:ht,TitledMultiSelectEnumSchemaSchema:gt,MultiSelectEnumSchemaSchema:_t,EnumSchemaSchema:vt,PrimitiveSchemaDefinitionSchema:yt,ElicitRequestFormParamsSchema:bt,ElicitRequestURLParamsSchema:xt,ElicitRequestParamsSchema:St,ElicitRequestSchema:Ct,ElicitationCompleteNotificationParamsSchema:wt,ElicitationCompleteNotificationSchema:Tt,ElicitResultSchema:Et,ResourceTemplateReferenceSchema:Dt,PromptReferenceSchema:Ot,CompleteRequestParamsSchema:kt,CompleteRequestSchema:At,CompleteResultSchema:jt,RootSchema:Mt,ListRootsRequestSchema:Nt,ListRootsResultSchema:Pt,RootsListChangedNotificationSchema:Ft,TaskCreationParamsSchema:It,TaskStatusSchema:Lt,TaskSchema:Rt,CreateTaskResultSchema:zt,TaskStatusNotificationParamsSchema:Bt,TaskStatusNotificationSchema:Vt,GetTaskRequestSchema:Ht,GetTaskResultSchema:Ut,GetTaskPayloadRequestSchema:Wt,GetTaskPayloadResultSchema:Gt,ListTasksRequestSchema:Kt,ListTasksResultSchema:qt,CancelTaskRequestSchema:Jt,CancelTaskResultSchema:f.merge(Rt),ClientRequestSchema:Ow([A,E,At,Xe,Oe,Te,ce,ue,me,ve,be,Ke,He,Ht,Wt,Kt,Jt]),ClientNotificationSchema:Ow([g,N,k,Ft,Vt]),ClientResultSchema:Ow([m,ot,st,Et,Pt,Ut,qt,zt]),ServerRequestSchema:Ow([A,at,Ct,Nt,Ht,Wt,Kt,Jt]),ServerNotificationSchema:Ow([g,N,Qe,Se,ge,qe,Re,Vt,Tt]),ServerResultSchema:Ow([m,O,jt,Le,Ee,le,de,he,We,Ue,Ut,qt,zt]),CallToolResultWireSchema:Cw().superRefine((e,t)=>{if(!(typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0)){for(let n of VO)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(HO).pipe(We)}}var WO;function GO(){return WO??=UO()}function KO(e){return e.type!==`object`}var qO=new Set([`const`,`enum`,`default`,`examples`]),JO=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`]);function YO(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(e.$id!==void 0)return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=(e,t)=>{if(Array.isArray(e))return e.map(e=>n(e,!1));if(typeof e!=`object`||!e||!t&&e.$id!==void 0)return e;let r={};for(let[i,a]of Object.entries(e))t?r[i]=n(a,!1):(i===`$ref`||i===`$dynamicRef`)&&typeof a==`string`?r[i]=a===`#`?`#/properties/result`:a.startsWith(`#/`)?`#/properties/result${a.slice(1)}`:a:qO.has(i)?r[i]=a:JO.has(i)?r[i]=n(a,!0):r[i]=n(a,!1);return r};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:n(e,!1)},required:[`result`]}}var XO={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},ZO={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},QO={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},$O;function ek(){if($O)return $O;let e=GO();return $O={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},$O}function tk(e){return Object.prototype.hasOwnProperty.call(XO,e)}function nk(e){return Object.prototype.hasOwnProperty.call(ZO,e)}function rk(e){return Object.prototype.hasOwnProperty.call(QO,e)}function ik(e){return rk(e)?ek().resultSchemas[e]:void 0}function ak(e){return tk(e)?ek().requestSchemas[e]:void 0}function ok(e){return nk(e)?ek().notificationSchemas[e]:void 0}Object.keys(XO),Object.keys(ZO);function sk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ck(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var lk={ok:!1,reason:`not-in-era`};function uk(e){return sk(e)&&sk(e.outputSchema)&&KO(e.outputSchema)}function dk(e){return e}var fk={era:`2025-11-25`,hasRequestMethod:tk,hasNotificationMethod:nk,validateRequest:(e,t)=>ck(ak(e),t),validateResult:(e,t)=>ck(ik(e),t),validateNotification:(e,t)=>ck(ok(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>lk,validateInputResponse:()=>lk,samplingResultVariant:((e,t)=>{let n=GO();return ck(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=BO(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&KO(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(sk(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:dk(e)}}return{kind:`complete`,result:dk(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>uk(e))?t:{...t,tools:n.map(e=>uk(e)?{...e,outputSchema:YO(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function pk(){let e=Vw(()=>Ow([G(),K(),bw(),Sw(),jw(G(),e),q(e)])),t=jw(G(),e),n=Ow([G(),K().int()]),r=G(),i=Ow([G(),K().int()]),a=Nw([`user`,`assistant`]),o=Nw([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=G().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=J({ttl:K().optional()}),l=J({taskId:G()}),u=Ew({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=J({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=J({_meta:u.optional()}),m=J({method:G(),params:p.loose().optional()}),h=J({src:G(),mimeType:G().optional(),sizes:q(G()).optional(),theme:Nw([`light`,`dark`]).optional()}),g=J({icons:q(h).optional()}),_=J({name:G(),title:G().optional()}),v=_.extend({..._.shape,...g.shape,version:G(),websiteUrl:G().optional(),description:G().optional()}),y=Kw(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Aw(J({form:Aw(J({applyDefaults:bw().optional()}),t).optional(),url:t.optional()}),t.optional())),b=Ew({list:t.optional(),cancel:t.optional(),requests:Ew({sampling:Ew({createMessage:t.optional()}).optional(),elicitation:Ew({create:t.optional()}).optional()}).optional()}),x=Ew({list:t.optional(),cancel:t.optional(),requests:Ew({tools:Ew({call:t.optional()}).optional()}).optional()}),S=J({experimental:jw(G(),t).optional(),sampling:J({context:t.optional(),tools:t.optional()}).optional(),elicitation:y.optional(),roots:J({listChanged:bw().optional()}).optional(),tasks:b.optional(),extensions:jw(G(),t).optional()}),C=J({experimental:jw(G(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:J({listChanged:bw().optional()}).optional(),resources:J({subscribe:bw().optional(),listChanged:bw().optional()}).optional(),tools:J({listChanged:bw().optional()}).optional(),tasks:x.optional(),extensions:jw(G(),t).optional()}),w=J({progress:K(),total:Iw(K()),message:Iw(G())}),T=J({...p.shape,...w.shape,progressToken:n}),E=m.extend({method:Y(`notifications/progress`),params:T}),D=p.extend({level:o,logger:G().optional(),data:Cw()}),O=m.extend({method:Y(`notifications/message`),params:D}),k=J({uri:G(),mimeType:Iw(G()),_meta:jw(G(),Cw()).optional()}),A=k.extend({text:G()}),j=k.extend({blob:s}),M=J({audience:q(a).optional(),priority:K().min(0).max(1).optional(),lastModified:aw({offset:!0}).optional()}),N=J({..._.shape,...g.shape,uri:G(),description:Iw(G()),mimeType:Iw(G()),size:Iw(K()),annotations:M.optional(),_meta:Iw(Ew({}))}),ee=J({..._.shape,...g.shape,uriTemplate:G(),description:Iw(G()),mimeType:Iw(G()),annotations:M.optional(),_meta:Iw(Ew({}))}),te=m.extend({method:Y(`notifications/resources/list_changed`),params:p.optional()}),P=p.extend({uri:G()}),F=m.extend({method:Y(`notifications/resources/updated`),params:P}),I=J({name:G(),description:Iw(G()),required:Iw(bw())}),ne=J({..._.shape,...g.shape,description:Iw(G()),arguments:Iw(q(I)),_meta:Iw(Ew({}))}),re=m.extend({method:Y(`notifications/prompts/list_changed`),params:p.optional()}),ie=J({type:Y(`text`),text:G(),annotations:M.optional(),_meta:jw(G(),Cw()).optional()}),ae=J({type:Y(`image`),data:s,mimeType:G(),annotations:M.optional(),_meta:jw(G(),Cw()).optional()}),oe=J({type:Y(`audio`),data:s,mimeType:G(),annotations:M.optional(),_meta:jw(G(),Cw()).optional()}),se=J({type:Y(`tool_use`),name:G(),id:G(),input:jw(G(),Cw()),_meta:jw(G(),Cw()).optional()}),ce=J({type:Y(`resource`),resource:Ow([A,j]),annotations:M.optional(),_meta:jw(G(),Cw()).optional()}),le=N.extend({type:Y(`resource_link`)}),ue=Ow([ie,ae,oe,le,ce]),de=J({role:a,content:ue}),fe=J({title:G().optional(),readOnlyHint:bw().optional(),destructiveHint:bw().optional(),idempotentHint:bw().optional(),openWorldHint:bw().optional()}),pe=m.extend({method:Y(`notifications/tools/list_changed`),params:p.optional()}),me=J({name:G().optional()}),he=J({hints:q(me).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),ge=J({mode:Nw([`auto`,`required`,`none`]).optional()}),_e=J({type:Y(`boolean`),title:G().optional(),description:G().optional(),default:bw().optional()}),ve=J({type:Y(`string`),title:G().optional(),description:G().optional(),minLength:K().optional(),maxLength:K().optional(),format:Nw([`email`,`uri`,`date`,`date-time`]).optional(),default:G().optional()}),ye=J({type:Nw([`number`,`integer`]),title:G().optional(),description:G().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),be=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),default:G().optional()}),xe=J({type:Y(`string`),title:G().optional(),description:G().optional(),oneOf:q(J({const:G(),title:G()})),default:G().optional()}),Se=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),enumNames:q(G()).optional(),default:G().optional()}),Ce=Ow([be,xe]),we=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({type:Y(`string`),enum:q(G())}),default:q(G()).optional()}),Te=J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({anyOf:q(J({const:G(),title:G()}))}),default:q(G()).optional()}),Ee=Ow([we,Te]),De=Ow([Se,Ce,Ee]),Oe=Ow([De,_e,ve,ye]),ke=f.extend({mode:Y(`form`).optional(),message:G(),requestedSchema:J({type:Y(`object`),properties:jw(G(),Oe),required:q(G()).optional()}).catchall(Cw())}),Ae=J({type:Y(`ref/resource`),uri:G()}),je=J({type:Y(`ref/prompt`),name:G()}),Me=J({uri:G().startsWith(`file://`),name:G().optional(),_meta:jw(G(),Cw()).optional()}),Ne=S.shape,Pe=J({experimental:Ne.experimental,sampling:Ne.sampling,elicitation:Ne.elicitation,roots:Ne.roots,extensions:Ne.extensions}),Fe=C.shape,Ie=J({experimental:Fe.experimental,logging:Fe.logging,completions:Fe.completions,prompts:Fe.prompts,resources:Fe.resources,tools:Fe.tools,extensions:Fe.extensions}),Le=Ew({progressToken:n.optional(),[$w]:G(),[eT]:v.optional(),[nT]:Pe,[iT]:o.optional()}),Re=J({..._.shape,...g.shape,description:G().optional(),inputSchema:Ew({$schema:G().optional(),type:Y(`object`)}),outputSchema:Ew({$schema:G().optional()}).optional(),annotations:fe.optional(),_meta:jw(G(),Cw()).optional()}),ze=J({type:Y(`tool_result`),toolUseId:G(),content:q(ue),structuredContent:Cw().optional(),isError:bw().optional(),_meta:jw(G(),Cw()).optional()}),Be=Ow([ie,ae,oe,se,ze]),Ve=J({role:a,content:Ow([Be,q(Be)]),_meta:jw(G(),Cw()).optional()}),He=G(),Ue=Ew({[tT]:v.optional().catch(void 0)}),We=Ue.optional();function Ge(e){return Ew({_meta:We,resultType:He.default(`complete`),...e})}let Ke=Ge({}),qe=Ge({nextCursor:r.optional()}),Je=Ge({content:q(ue),structuredContent:Cw().optional(),isError:bw().optional()}),Ye=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),tools:q(Re),nextCursor:r.optional()}),Xe=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),prompts:q(ne),nextCursor:r.optional()}),Ze=Ge({description:G().optional(),messages:q(de)}),Qe=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),resources:q(N),nextCursor:r.optional()}),$e=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),resourceTemplates:q(ee),nextCursor:r.optional()}),L=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),contents:q(Ow([A,j]))}),et=Ge({completion:J({values:q(G()).max(100),total:K().int().optional(),hasMore:bw().optional()}).loose()}),tt=Ge({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`])}),nt=Ge({ttlMs:K().int().min(0).catch(0),cacheScope:Nw([`public`,`private`]).catch(`private`),supportedVersions:q(G()),capabilities:Ie,instructions:G().optional()}),rt=J({messages:q(Ve),modelPreferences:he.optional(),systemPrompt:G().optional(),includeContext:Nw([`none`,`thisServer`,`allServers`]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:q(G()).optional(),metadata:t.optional(),tools:q(Re).optional(),toolChoice:ge.optional()}),it=J({method:Y(`sampling/createMessage`),params:rt}),R=J({method:Y(`roots/list`),params:J({_meta:jw(G(),Cw()).optional()}).optional()}),at=J({...Ve.shape,model:G(),stopReason:G().optional()}),ot=J({roots:q(Me)}),st=J({action:Nw([`accept`,`decline`,`cancel`]),content:jw(G(),Ow([G(),K(),bw(),q(G())])).optional()}),ct=J({mode:Y(`url`),message:G(),url:G().url()}),lt=Ow([ke,ct]),ut=J({method:Y(`elicitation/create`),params:lt}),dt=Ow([it,R,ut]),ft=Ow([at,ot,st]),pt=jw(G(),dt),mt=jw(G(),ft),ht=Ge({inputRequests:pt.optional(),requestState:G().optional()}),gt={inputResponses:mt.optional(),requestState:G().optional()},_t=J({_meta:Le,...gt}),vt=Ew({progressToken:n.optional()});function yt(e,t){return J({method:Y(e),params:J({_meta:Le,...t})})}function bt(e,t){return J({method:Y(e),params:J({_meta:vt.optional(),...t}).optional()})}let xt={name:G(),arguments:jw(G(),Cw()).optional(),...gt},St={cursor:r.optional()},Ct=yt(`tools/call`,xt),wt=yt(`tools/list`,St),Tt=yt(`prompts/list`,St),Et=yt(`prompts/get`,{name:G(),arguments:jw(G(),G()).optional(),...gt}),Dt=yt(`resources/list`,St),Ot=yt(`resources/templates/list`,St),kt=yt(`resources/read`,{uri:G(),...gt}),At={ref:Ow([je,Ae]),argument:J({name:G(),value:G()}),context:J({arguments:jw(G(),G()).optional()}).optional()},jt=yt(`completion/complete`,At),Mt=yt(`server/discover`,{}),Nt=J({toolsListChanged:bw().optional(),promptsListChanged:bw().optional(),resourcesListChanged:bw().optional(),resourceSubscriptions:q(G()).optional()}),Pt={notifications:Nt},Ft=yt(`subscriptions/listen`,Pt),It=Ue.extend({"io.modelcontextprotocol/subscriptionId":i}),Lt=Ew({_meta:It,resultType:He.default(`complete`)}),Rt={"tools/call":bt(`tools/call`,xt),"tools/list":bt(`tools/list`,St),"prompts/get":bt(`prompts/get`,{name:G(),arguments:jw(G(),G()).optional()}),"prompts/list":bt(`prompts/list`,St),"resources/list":bt(`resources/list`,St),"resources/templates/list":bt(`resources/templates/list`,St),"resources/read":bt(`resources/read`,{uri:G()}),"completion/complete":bt(`completion/complete`,At),"server/discover":bt(`server/discover`,{}),"subscriptions/listen":bt(`subscriptions/listen`,Pt)};function zt(e){return Ew({_meta:We,...e})}let Bt={"tools/call":zt({content:q(ue),structuredContent:Cw().optional(),isError:bw().optional()}),"tools/list":zt({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),tools:q(Re),nextCursor:r.optional()}),"prompts/get":zt({description:G().optional(),messages:q(de)}),"prompts/list":zt({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),prompts:q(ne),nextCursor:r.optional()}),"resources/list":zt({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),resources:q(N),nextCursor:r.optional()}),"resources/templates/list":zt({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),resourceTemplates:q(ee),nextCursor:r.optional()}),"resources/read":zt({ttlMs:K().int().min(0),cacheScope:Nw([`public`,`private`]),contents:q(Ow([A,j]))}),"completion/complete":zt({completion:J({values:q(G()).max(100),total:K().int().optional(),hasMore:bw().optional()}).loose()}),"server/discover":zt({ttlMs:K().int().min(0).catch(0),cacheScope:Nw([`public`,`private`]).catch(`private`),supportedVersions:q(G()),capabilities:Ie,instructions:G().optional()}),"subscriptions/listen":zt({})},Vt=Ew({"io.modelcontextprotocol/subscriptionId":i.optional()}),Ht=J({method:Y(`notifications/subscriptions/acknowledged`),params:J({_meta:Vt.optional(),notifications:Nt})}),Ut=J({_meta:Vt.optional(),requestId:i,reason:G().optional()}),Wt=J({method:Y(`notifications/cancelled`),params:Ut}),Gt={"notifications/cancelled":Wt,"notifications/progress":E,"notifications/message":O,"notifications/resources/updated":F,"notifications/resources/list_changed":te,"notifications/tools/list_changed":pe,"notifications/prompts/list_changed":re,"notifications/subscriptions/acknowledged":Ht},Kt=e=>J({jsonrpc:Y(`2.0`),id:Ow([G(),K().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:m,IconSchema:h,IconsSchema:g,BaseMetadataSchema:_,ImplementationSchema:v,ClientTasksCapabilitySchema:b,ServerTasksCapabilitySchema:x,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:C,ProgressSchema:w,ProgressNotificationParamsSchema:T,ProgressNotificationSchema:E,LoggingMessageNotificationParamsSchema:D,LoggingMessageNotificationSchema:O,ResourceContentsSchema:k,TextResourceContentsSchema:A,BlobResourceContentsSchema:j,AnnotationsSchema:M,ResourceSchema:N,ResourceTemplateSchema:ee,ResourceListChangedNotificationSchema:te,ResourceUpdatedNotificationParamsSchema:P,ResourceUpdatedNotificationSchema:F,PromptArgumentSchema:I,PromptSchema:ne,PromptListChangedNotificationSchema:re,TextContentSchema:ie,ImageContentSchema:ae,AudioContentSchema:oe,ToolUseContentSchema:se,EmbeddedResourceSchema:ce,ResourceLinkSchema:le,ContentBlockSchema:ue,PromptMessageSchema:de,ToolAnnotationsSchema:fe,ToolListChangedNotificationSchema:pe,ModelHintSchema:me,ModelPreferencesSchema:he,ToolChoiceSchema:ge,BooleanSchemaSchema:_e,StringSchemaSchema:ve,NumberSchemaSchema:ye,UntitledSingleSelectEnumSchemaSchema:be,TitledSingleSelectEnumSchemaSchema:xe,LegacyTitledEnumSchemaSchema:Se,SingleSelectEnumSchemaSchema:Ce,UntitledMultiSelectEnumSchemaSchema:we,TitledMultiSelectEnumSchemaSchema:Te,MultiSelectEnumSchemaSchema:Ee,EnumSchemaSchema:De,PrimitiveSchemaDefinitionSchema:Oe,ElicitRequestFormParamsSchema:ke,ResourceTemplateReferenceSchema:Ae,PromptReferenceSchema:je,RootSchema:Me,ClientCapabilities2026Schema:Pe,ServerCapabilities2026Schema:Ie,RequestMetaEnvelopeSchema:Le,ToolSchema:Re,ToolResultContentSchema:ze,SamplingMessageContentBlockSchema:Be,SamplingMessageSchema:Ve,ResultTypeSchema:He,ResultMetaSchema:Ue,ResultSchema:Ke,PaginatedResultSchema:qe,CallToolResultSchema:Je,ListToolsResultSchema:Ye,ListPromptsResultSchema:Xe,GetPromptResultSchema:Ze,ListResourcesResultSchema:Qe,ListResourceTemplatesResultSchema:$e,ReadResourceResultSchema:L,CompleteResultSchema:et,CacheableResultSchema:tt,DiscoverResultSchema:nt,CreateMessageRequestParamsSchema:rt,CreateMessageRequestSchema:it,ListRootsRequestSchema:R,CreateMessageResultSchema:at,ListRootsResultSchema:ot,ElicitResultSchema:st,ElicitRequestURLParamsSchema:ct,ElicitRequestParamsSchema:lt,ElicitRequestSchema:ut,InputRequestSchema:dt,InputResponseSchema:ft,InputRequestsSchema:pt,InputResponsesSchema:mt,InputRequiredResultSchema:ht,InputResponseRequestParamsSchema:_t,CallToolRequestSchema:Ct,ListToolsRequestSchema:wt,ListPromptsRequestSchema:Tt,GetPromptRequestSchema:Et,ListResourcesRequestSchema:Dt,ListResourceTemplatesRequestSchema:Ot,ReadResourceRequestSchema:kt,CompleteRequestSchema:jt,DiscoverRequestSchema:Mt,SubscriptionFilterSchema:Nt,SubscriptionsListenRequestSchema:Ft,SubscriptionsListenResultMetaSchema:It,SubscriptionsListenResultSchema:Lt,dispatchRequestSchemas:Rt,dispatchResultSchemas:Bt,NotificationMetaSchema:Vt,SubscriptionsAcknowledgedNotificationSchema:Ht,CancelledNotificationParamsSchema:Ut,CancelledNotificationSchema:Wt,notificationSchemas2026:Gt,JSONRPCResultResponseSchema:Kt(Ke),CallToolResultResponseSchema:Kt(Ow([Je,ht])),ListToolsResultResponseSchema:Kt(Ye),ListPromptsResultResponseSchema:Kt(Xe),GetPromptResultResponseSchema:Kt(Ow([Ze,ht])),ListResourcesResultResponseSchema:Kt(Qe),ListResourceTemplatesResultResponseSchema:Kt($e),ReadResourceResultResponseSchema:Kt(Ow([L,ht])),CompleteResultResponseSchema:Kt(et),DiscoverResultResponseSchema:Kt(nt)}}var mk;function hk(){return mk??=pk()}var gk=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function _k(e){return gk.includes(e)}var vk=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function yk(e){return e[vk]}function bk(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function xk(e){return e===`public`||e===`private`}var Sk=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Ck=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return DO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return DO(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,EO(this,new.target)}static fromError(t,n,r){if(t===Sk.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Tk(e.elicitations,n)}if(t===Sk.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Ek({supported:e.supported,requested:e.requested},n)}if(t===Sk.InvalidParams||t===Sk.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===Sk.ResourceNotFound||Object.keys(e).length===1))return new wk(e.uri,n)}if(t===Sk.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Dk({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},wk=class extends Ck{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(Sk.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Tk=class extends Ck{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(Sk.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Ek=class extends Ck{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(Sk.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Dk=class extends Ck{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(Sk.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Ok=0,kk=`private`,Ak=[`tools/call`,`prompts/get`,`resources/read`];function jk(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||Ak.includes(e))return t;throw new Ck(Sk.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function Mk(e,t){let n=yk(t);if(t.resultType!==`complete`||!_k(e))return n===void 0?t:Lk(t);let r=t,i=bk(r.ttlMs)?r.ttlMs:Fk(n),a=xk(r.cacheScope)?r.cacheScope:Ik(n),o={...r,ttlMs:i,cacheScope:a};return delete o[vk],o}function Nk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pk(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[tT]:t}}:!Nk(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[tT]:t}}}function Fk(e){return e!==void 0&&bk(e.ttlMs)?e.ttlMs:Ok}function Ik(e){return e!==void 0&&xk(e.cacheScope)?e.cacheScope:kk}function Lk(e){let t={...e};return delete t[vk],t}var Rk=[`elicitation/create`,`sampling/createMessage`,`roots/list`],zk;function Bk(){if(zk)return zk;let e=hk();return zk={request:{"elicitation/create":J({method:Y(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":J({method:Y(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":J({method:Y(`roots/list`),params:Ew({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},zk}function Vk(e){return Rk.includes(e)}function Hk(e){return Vk(e)?Bk().request[e]:void 0}function Uk(e){return Vk(e)?Bk().response[e]:void 0}var Wk={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},Gk={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function Kk(e){return Object.prototype.hasOwnProperty.call(Wk,e)}function qk(e){return Object.prototype.hasOwnProperty.call(Gk,e)}function Jk(e){return Object.prototype.hasOwnProperty.call(Wk,e)}function Yk(e){return Kk(e)?hk().dispatchRequestSchemas[e]:void 0}function Xk(e){return Jk(e)?hk().dispatchResultSchemas[e]:void 0}function Zk(e){return qk(e)?hk().notificationSchemas2026[e]:void 0}Object.keys(Wk),Object.keys(Gk);function Qk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $k(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var eA={ok:!1,reason:`not-in-era`},tA=[$w,nT];function nA(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Qk(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Qk(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Qk(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var rA={era:`2026-07-28`,hasRequestMethod:Kk,hasNotificationMethod:qk,hasInputRequestMethod:e=>Hk(e)!==void 0,validateRequest:(e,t)=>$k(Yk(e),t),validateResult:(e,t)=>$k(Xk(e),t),validateNotification:(e,t)=>$k(Zk(e),t),validateInputRequest:(e,t)=>$k(Hk(e),t),validateInputResponse:(e,t)=>$k(Uk(e),t),samplingResultVariant:()=>eA,outboundEnvelope(e){return{[$w]:e.protocolVersion,[eT]:e.clientInfo,[nT]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of tA)n in e||t.push({key:n,problem:`missing`});let n=hk().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>BO(e),inputRequestSchema:Hk,decodeResult(e,t){if(!Qk(t))return{kind:`invalid`,error:new jO(AO.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new jO(AO.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new jO(AO.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Qk(n)?n:{},i=t.requestState;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new jO(AO.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i}}}if(n!==`complete`)return{kind:`invalid`,error:new jO(AO.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=aA(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new jO(AO.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return Pk(Mk(e,jk(e,nA(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=hk().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},iA;function aA(){if(iA)return iA;let e=hk();return iA={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},iA}var oA=`2026-07-28`;function sA(e){return e!==void 0&&LO(e)?rA:fk}function cA(e){return e.revision===void 0?e.era===`modern`?rA.era:fk.era:sA(e.revision).era}function lA(e){return dA.some(t=>t.hasRequestMethod(e))}function uA(e){return dA.some(t=>t.hasNotificationMethod(e))}var dA=[fk,rA],fA=Gv({AnnotationsSchema:()=>rE,AudioContentSchema:()=>IE,BaseMetadataSchema:()=>MT,BaseRequestParamsSchema:()=>pT,BlobResourceContentsSchema:()=>tE,BooleanSchemaSchema:()=>_D,CallToolRequestParamsSchema:()=>ZE,CallToolRequestSchema:()=>QE,CallToolResultSchema:()=>YE,CancelTaskRequestSchema:()=>rO,CancelTaskResultSchema:()=>iO,CancelledNotificationParamsSchema:()=>OT,CancelledNotificationSchema:()=>kT,ClientCapabilitiesSchema:()=>LT,ClientNotificationSchema:()=>oO,ClientRequestSchema:()=>aO,ClientResultSchema:()=>sO,ClientTasksCapabilitySchema:()=>FT,CompatibilityCallToolResultSchema:()=>XE,CompleteRequestParamsSchema:()=>RD,CompleteRequestSchema:()=>zD,CompleteResultSchema:()=>BD,ContentBlockSchema:()=>BE,CreateMessageRequestParamsSchema:()=>pD,CreateMessageRequestSchema:()=>mD,CreateMessageResultSchema:()=>hD,CreateMessageResultWithToolsSchema:()=>gD,CreateTaskResultSchema:()=>JD,CursorSchema:()=>lT,DiscoverRequestSchema:()=>UT,DiscoverResultSchema:()=>WT,ElicitRequestFormParamsSchema:()=>kD,ElicitRequestParamsSchema:()=>jD,ElicitRequestSchema:()=>MD,ElicitRequestURLParamsSchema:()=>AD,ElicitResultSchema:()=>FD,ElicitationCompleteNotificationParamsSchema:()=>ND,ElicitationCompleteNotificationSchema:()=>PD,EmbeddedResourceSchema:()=>RE,EmptyResultSchema:()=>DT,EnumSchemaSchema:()=>DD,GetPromptRequestParamsSchema:()=>ME,GetPromptRequestSchema:()=>NE,GetPromptResultSchema:()=>HE,GetTaskPayloadRequestSchema:()=>$D,GetTaskPayloadResultSchema:()=>eO,GetTaskRequestSchema:()=>ZD,GetTaskResultSchema:()=>QD,IconSchema:()=>AT,IconsSchema:()=>jT,ImageContentSchema:()=>FE,ImplementationSchema:()=>NT,InitializeRequestParamsSchema:()=>RT,InitializeRequestSchema:()=>zT,InitializeResultSchema:()=>VT,InitializedNotificationSchema:()=>HT,JSONArraySchema:()=>sT,JSONObjectSchema:()=>oT,JSONRPCErrorResponseSchema:()=>wT,JSONRPCMessageSchema:()=>TT,JSONRPCNotificationSchema:()=>ST,JSONRPCRequestSchema:()=>xT,JSONRPCResponseSchema:()=>ET,JSONRPCResultResponseSchema:()=>CT,JSONValueSchema:()=>aT,LegacyTitledEnumSchemaSchema:()=>SD,ListChangedOptionsBaseSchema:()=>eD,ListPromptsRequestSchema:()=>AE,ListPromptsResultSchema:()=>jE,ListResourceTemplatesRequestSchema:()=>cE,ListResourceTemplatesResultSchema:()=>lE,ListResourcesRequestSchema:()=>oE,ListResourcesResultSchema:()=>sE,ListRootsRequestSchema:()=>HD,ListRootsResultSchema:()=>UD,ListTasksRequestSchema:()=>tO,ListTasksResultSchema:()=>nO,ListToolsRequestSchema:()=>qE,ListToolsResultSchema:()=>JE,LoggingLevelSchema:()=>tD,LoggingMessageNotificationParamsSchema:()=>iD,LoggingMessageNotificationSchema:()=>aD,ModelHintSchema:()=>oD,ModelPreferencesSchema:()=>sD,MultiSelectEnumSchemaSchema:()=>ED,NotificationSchema:()=>_T,NotificationsParamsSchema:()=>gT,NumberSchemaSchema:()=>yD,PaginatedRequestParamsSchema:()=>YT,PaginatedRequestSchema:()=>XT,PaginatedResultSchema:()=>ZT,PingRequestSchema:()=>GT,PrimitiveSchemaDefinitionSchema:()=>OD,ProgressNotificationParamsSchema:()=>qT,ProgressNotificationSchema:()=>JT,ProgressSchema:()=>KT,ProgressTokenSchema:()=>cT,PromptArgumentSchema:()=>OE,PromptListChangedNotificationSchema:()=>UE,PromptMessageSchema:()=>VE,PromptReferenceSchema:()=>LD,PromptSchema:()=>kE,ReadResourceRequestParamsSchema:()=>dE,ReadResourceRequestSchema:()=>fE,ReadResourceResultSchema:()=>pE,RelatedTaskMetadataSchema:()=>dT,RequestIdSchema:()=>bT,RequestMetaSchema:()=>fT,RequestSchema:()=>hT,ResourceContentsSchema:()=>QT,ResourceLinkSchema:()=>zE,ResourceListChangedNotificationSchema:()=>mE,ResourceRequestParamsSchema:()=>uE,ResourceSchema:()=>iE,ResourceTemplateReferenceSchema:()=>ID,ResourceTemplateSchema:()=>aE,ResourceUpdatedNotificationParamsSchema:()=>EE,ResourceUpdatedNotificationSchema:()=>DE,ResultMetaObjectSchema:()=>vT,ResultSchema:()=>yT,RoleSchema:()=>nE,RootSchema:()=>VD,RootsListChangedNotificationSchema:()=>WD,SamplingContentSchema:()=>uD,SamplingMessageContentBlockSchema:()=>dD,SamplingMessageSchema:()=>fD,ServerCapabilitiesSchema:()=>BT,ServerNotificationSchema:()=>lO,ServerRequestSchema:()=>cO,ServerResultSchema:()=>uO,ServerTasksCapabilitySchema:()=>IT,SetLevelRequestParamsSchema:()=>nD,SetLevelRequestSchema:()=>rD,SingleSelectEnumSchemaSchema:()=>CD,StringSchemaSchema:()=>vD,SubscribeRequestParamsSchema:()=>hE,SubscribeRequestSchema:()=>gE,SubscriptionFilterSchema:()=>yE,SubscriptionsAcknowledgedNotificationParamsSchema:()=>SE,SubscriptionsAcknowledgedNotificationSchema:()=>CE,SubscriptionsListenRequestParamsSchema:()=>bE,SubscriptionsListenRequestSchema:()=>xE,SubscriptionsListenResultMetaSchema:()=>wE,SubscriptionsListenResultSchema:()=>TE,TaskAugmentedRequestParamsSchema:()=>mT,TaskCreationParamsSchema:()=>GD,TaskMetadataSchema:()=>uT,TaskSchema:()=>qD,TaskStatusNotificationParamsSchema:()=>YD,TaskStatusNotificationSchema:()=>XD,TaskStatusSchema:()=>KD,TextContentSchema:()=>PE,TextResourceContentsSchema:()=>$T,TitledMultiSelectEnumSchemaSchema:()=>TD,TitledSingleSelectEnumSchemaSchema:()=>xD,ToolAnnotationsSchema:()=>WE,ToolChoiceSchema:()=>cD,ToolExecutionSchema:()=>GE,ToolListChangedNotificationSchema:()=>$E,ToolResultContentSchema:()=>lD,ToolSchema:()=>KE,ToolUseContentSchema:()=>LE,UnsubscribeRequestParamsSchema:()=>_E,UnsubscribeRequestSchema:()=>vE,UntitledMultiSelectEnumSchemaSchema:()=>wD,UntitledSingleSelectEnumSchemaSchema:()=>bD}),pA=e=>xT.safeParse(e).success,mA=e=>ST.safeParse(e).success,hA=e=>CT.safeParse(e).success,gA=e=>wT.safeParse(e).success,_A=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,vA=`Mcp-Param-`,yA=`x-mcp-header`,bA=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,xA=new Set([`string`,`integer`,`boolean`,`number`]);function SA(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(yA in o){if(!a||i.length===0)return`${TA(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[yA];if(typeof e!=`string`||e.length===0)return`${TA(i)}: x-mcp-header MUST be a non-empty string`;if(!bA.test(e))return`${TA(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!xA.has(r))return`${TA(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??`<none>`}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of CA){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&wA.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var CA=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],wA=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function TA(e){return e.length===0?`<root>`:e.join(`.`)}var EA=`=?base64?`,DA=`?=`;function OA(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function kA(e){if(e.length===0||e.startsWith(EA)&&e.endsWith(DA)||e!==e.trim())return!0;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(!(n===9||n>=32&&n<=126))return!0}return!1}function AA(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function jA(e){return kA(e)?`${EA}${AA(e)}${DA}`:e}function MA(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function NA(e,t){let n={};for(let r of e){let e=MA(t,r.path);if(e==null)continue;let i=OA(e);i!==void 0&&(n[`${vA}${r.headerName}`]=jA(i))}return n}Sk.InvalidRequest,Sk.UnsupportedProtocolVersion,Sk.InvalidParams,Sk.MethodNotFound,Sk.InvalidParams,Sk.MissingRequiredClientCapability,Sk.ParseError,Sk.InvalidRequest,Sk.MethodNotFound,Sk.UnsupportedProtocolVersion,Sk.MissingRequiredClientCapability;function PA(e,t){return lw(e,t)}function FA(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function IA(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var LA=!1,RA=`draft-2020-12`;function zA(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:RA});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);LA||(LA=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=iw(e,{target:RA,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&BA(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function BA(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||BA(e)))}return!1}function VA(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function HA(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>VA(e)).join(`, `)}:{success:!0,data:n.value}}function UA(e){let t=iw(e,{target:RA,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var WA=/\\\.\\d\{(\d+)\}/;function GA(e){let t=WA.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>aw({local:e,offset:t,precision:n}))))}function KA(e,t){let n;switch(e){case`email`:n=[Ute()];break;case`uri`:n=[_w()];break;case`date`:n=[ow()];break;case`date-time`:n=GA(t);break}return new Set(n.map(e=>UA(e)).filter(e=>e!==void 0))}function qA(e,t,n){return n!==`zod`||KA(e,t).has(t)}function JA(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function YA(e){try{return zA(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Ck(Sk.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var XA=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function ZA(e){return XA.has(e)||e.startsWith(`x-`)}var QA=new Set([`$schema`,...Object.keys(kD.shape.requestedSchema.shape)]),$A={string:FA([vD,bD,xD,SD]),number:FA([yD]),integer:FA([yD]),boolean:FA([_D]),array:FA([wD,TD])},ej=new Set(vD.shape.format.unwrap().options);function tj(e,t,n,r){if(!JA(e))return e;let i=typeof e.type==`string`&&Object.hasOwn($A,e.type)?$A[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||ZA(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?ej.has(e.format)?(typeof s!=`string`||!qA(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function nj(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&JA(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,tj(n,`properties.${e}`,t,r)])):QA.has(i)?n[i]=a:ZA(i)||r.push(i);if(r.length>0)throw new Ck(Sk.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function rj(e,t){if(!JA(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!PA(OD,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function ij(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>ij(e,t[r],`${n}[${r}]`)):!JA(e)||!JA(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?ij(r,t[e],i):ZA(e)?[]:[i]})}function aj(e){if(!IA(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=nj(YA(e.requestedSchema),t),r=PA(kD.shape.requestedSchema,n);if(!r.success)throw new Ck(Sk.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${rj(n,r.error.message)}`);let i=ij(n,r.data);if(i.length>0)throw new Ck(Sk.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Ck(Sk.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function oj(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(oj,{elicit(e){try{return{method:`elicitation/create`,params:aj(e)}}catch(e){throw e instanceof Ck?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});function sj(e){return{"~standard":{version:1,vendor:`modelcontextprotocol`,validate:(t,n)=>_A(t)?{value:t}:e[`~standard`].validate(t,n)}}}var cj=!0,lj=10,uj=250;function dj(e){return{autoFulfill:e?.autoFulfill??cj,maxRounds:e?.maxRounds??lj}}function fj(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function pj(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function mj(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof jO?t.reason:new jO(AO.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof jO?t.reason:new jO(AO.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function hj(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function gj(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new jO(AO.InputRequiredRoundsExceeded,pj(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=hj(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await mj(uj,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new jO(AO.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(fj(r,u,c.requestState),d);if(_A(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var _j=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),vj={IdJagTokenExchangeResponseSchema:_O,OAuthClientInformationFullSchema:SO,OAuthClientInformationSchema:xO,OAuthClientMetadataSchema:bO,OAuthClientRegistrationErrorSchema:CO,OAuthErrorResponseSchema:vO,OAuthMetadataSchema:pO,OAuthProtectedResourceMetadataSchema:fO,OAuthTokenRevocationRequestSchema:wO,OAuthTokensSchema:gO,OpenIdProviderDiscoveryMetadataSchema:hO,OpenIdProviderMetadataSchema:mO},yj={},bj={};function xj(e,t){let n=e.slice(0,-6);yj[n]=t,bj[n]=e=>t.safeParse(e).success}for(let e of _j)xj(e,fA[e]);for(let[e,t]of Object.entries(vj))xj(e,t);Object.freeze(yj);var Sj=Object.freeze(bj);function Cj(e){switch(e){case`initialize`:case`notifications/initialized`:return sA(void 0);case`server/discover`:return sA(oA);default:return}}var wj=[$w,eT,nT,iT],Tj=[`inputResponses`,`requestState`];function Ej(e,t){let n=e.params;if(!jj(n))return{message:e,lifted:{}};let r=n._meta,i=jj(r)?wj.filter(e=>e in r):[],a=t===`request`?Tj.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&jj(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function Dj(e,t){let n=e.validateResult(t,void 0);if(!(!n.ok&&n.reason===`not-in-era`))return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function Oj(e){return()=>e}var kj=Oj(void 0),Aj=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Zw,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new jO(AO.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new jO(AO.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),hA(e)||gA(e)?this._onresponse(e):pA(e)?this._onrequest(e,t):mA(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new jO(AO.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=Ej(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=cA(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(uA(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;i===void 0&&a===void 0||Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=Ej(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=cA(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(Sk.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(lA(n.method)&&!i.hasRequestMethod(n.method)){o(Sk.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(Sk.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(Sk.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:Pj(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?kj:Oj(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),IA(t))return u(e,t,n);let i=Dj(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(Sk.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:Sk.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),hA(e)?n(e):n(Ck.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),IA(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=Dj(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return sA(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Cj(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(lA(t)&&!e.hasRequestMethod(t))throw new jO(AO.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof jO?e:new jO(AO.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof jO?e:new jO(AO.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(Bj(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;HA(n,o).then(e=>{e.success?d(e.data):f(new jO(AO.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new jO(AO.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new jO(AO.NotConnected,`Not connected`);if(uA(t.method)&&!e.hasNotificationMethod(t.method))throw new jO(AO.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!lA(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Ck(Sk.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await HA(t.params,{...r.params});if(!a.success)throw new Ck(Sk.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!uA(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Ck(Sk.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await HA(t.params,{...r.params});if(!i.success)throw new Ck(Sk.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function jj(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Mj(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=jj(a)&&jj(i)?{...a,...i}:i}return n}function Nj(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pj(e){let t={},n=[];if(!Nj(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!Nj(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function Fj(e){throw new jO(AO.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function Ij(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:Oj(void 0),signal:r,send:(()=>Fj(`send`)),notify:()=>Fj(`notify`)}}}async function Lj(e,t,n,r,i){if(!Nj(r)||typeof r.method!=`string`)throw new jO(AO.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new jO(AO.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new jO(AO.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=Nj(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(Ij(n,a,s,i,e.sessionId)))}function Rj(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function zj(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>Lj(e,i,t,n,r),retry:(e,t)=>r.retry(e,Rj(o,t))};return gj({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function Bj(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}Wv((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))();var Vj=1e6,Hj=1e6,Uj=1e4,Wj=1e6,Gj=class e{static isTemplate(e){return/\{[^}\s]+\}/.test(e)}static validateLength(e,t,n){if(e.length>t)throw Error(`${n} exceeds maximum length of ${t} characters (got ${e.length})`)}template;parts;get variableNames(){return this.parts.flatMap(e=>typeof e==`string`?[]:e.names)}constructor(t){e.validateLength(t,Vj,`Template`),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){let n=[],r=``,i=0,a=0;for(;i<t.length;)if(t[i]===`{`){r&&=(n.push(r),``);let o=t.indexOf(`}`,i);if(o===-1)throw Error(`Unclosed template expression`);if(a++,a>Uj)throw Error(`Template contains too many expressions (max ${Uj})`);let s=t.slice(i+1,o),c=this.getOperator(s),l=s.includes(`*`),u=this.getNames(s),d=u[0];for(let t of u)e.validateLength(t,Hj,`Variable name`);n.push({name:d,operator:c,names:u,exploded:l}),i=o+1}else r+=t[i],i++;return r&&n.push(r),n}getOperator(e){return[`+`,`#`,`.`,`/`,`?`,`&`].find(t=>e.startsWith(t))||``}getNames(e){let t=this.getOperator(e);return e.slice(t.length).split(`,`).map(e=>e.replace(`*`,``).trim()).filter(e=>e.length>0)}encodeValue(t,n){return e.validateLength(t,Hj,`Variable value`),n===`+`||n===`#`?encodeURI(t):encodeURIComponent(t)}expandPart(e,t){if(e.operator===`?`||e.operator===`&`){let n=e.names.map(n=>{let r=t[n];return r===void 0?``:`${n}=${Array.isArray(r)?r.map(t=>this.encodeValue(t,e.operator)).join(`,`):this.encodeValue(r.toString(),e.operator)}`}).filter(e=>e.length>0);return n.length===0?``:(e.operator===`?`?`?`:`&`)+n.join(`&`)}if(e.names.length>1){let n=e.names.map(e=>t[e]).filter(e=>e!==void 0);return n.length===0?``:n.map(e=>Array.isArray(e)?e[0]:e).join(`,`)}let n=t[e.name];if(n===void 0)return``;let r=(Array.isArray(n)?n:[n]).map(t=>this.encodeValue(t,e.operator));switch(e.operator){case``:return r.join(`,`);case`+`:return r.join(`,`);case`#`:return`#`+r.join(`,`);case`.`:return`.`+r.join(`.`);case`/`:return`/`+r.join(`/`);default:return r.join(`,`)}}expand(e){let t=``,n=!1;for(let r of this.parts){if(typeof r==`string`){t+=r;continue}let i=this.expandPart(r,e);i&&(t+=(r.operator===`?`||r.operator===`&`)&&n?i.replace(`?`,`&`):i,(r.operator===`?`||r.operator===`&`)&&(n=!0))}return t}escapeRegExp(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}partToRegExp(t){let n=[];for(let n of t.names)e.validateLength(n,Hj,`Variable name`);if(t.operator===`?`||t.operator===`&`){for(let e=0;e<t.names.length;e++){let r=t.names[e],i=e===0?`\\`+t.operator:`&`;n.push({pattern:i+this.escapeRegExp(r)+`=([^&]+)`,name:r})}return n}let r,i=t.name;switch(t.operator){case``:r=t.exploded?`([^/,]+(?:,[^/,]+)*)`:`([^/,]+)`;break;case`+`:case`#`:r=`(.+)`;break;case`.`:r=String.raw`\.([^/,]+)`;break;case`/`:r=`/`+(t.exploded?`([^/,]+(?:,[^/,]+)*)`:`([^/,]+)`);break;default:r=`([^/]+)`}return n.push({pattern:r,name:i}),n}match(t){e.validateLength(t,Vj,`URI`);let n=`^`,r=[];for(let e of this.parts)if(typeof e==`string`)n+=this.escapeRegExp(e);else{let t=this.partToRegExp(e);for(let{pattern:i,name:a}of t)n+=i,r.push({name:a,exploded:e.exploded})}n+=`$`,e.validateLength(n,Wj,`Generated regex pattern`);let i=new RegExp(n),a=t.match(i);if(!a)return null;let o={};for(let[e,t]of r.entries()){let{name:n,exploded:r}=t,i=a[e+1],s=n.replace(`*`,``);o[s]=r&&i.includes(`,`)?i.split(`,`):i}return o}};function Kj(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!Kj(e[r],t[r]))return!1;return!0}if(n===`object`){if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Kj(e[r],t[r]))return!1;return!0}return e===t}function qj(e){return encodeURI(Jj(e))}function Jj(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}var Yj={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},Xj={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},Zj={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},Qj=typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);function $j(e,t=Object.create(null),n=Qj,r=``){if(e&&typeof e==`object`&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=new URL(i,n.href);a.hash.length>1?t[a.href]=e:(a.hash=``,r===``?n=a:$j(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Zj[i])continue;let a=`${r}/${qj(i)}`,o=e[i];if(Array.isArray(o)){if(Yj[i]){let e=o.length;for(let r=0;r<e;r++)$j(o[r],t,n,`${a}/${r}`)}}else if(Xj[i])for(let e in o)$j(o[e],t,n,`${a}/${qj(e)}`);else $j(o,t,n,a)}return t}var eM=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,tM=[0,31,28,31,30,31,30,31,31,30,31,30,31],nM=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,rM=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,iM=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,aM=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,oM=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,sM=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,cM=/^(?:\/(?:[^~/]|~0|~1)*)*$/,lM=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,uM=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,dM=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},fM=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,pM=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,mM=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function hM(e){return e.test.bind(e)}var gM={date:vM,time:yM.bind(void 0,!1),"date-time":xM,duration:mM,uri:wM,"uri-reference":hM(iM),"uri-template":hM(aM),url:hM(oM),email:dM,hostname:hM(rM),ipv4:hM(fM),ipv6:hM(pM),regex:EM,uuid:hM(sM),"json-pointer":hM(cM),"json-pointer-uri-fragment":hM(lM),"relative-json-pointer":hM(uM)};function _M(e){return e%4==0&&(e%100!=0||e%400==0)}function vM(e){let t=e.match(eM);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&_M(n)?29:tM[r])}function yM(e,t){let n=t.match(nM);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var bM=/t|\s/i;function xM(e){let t=e.split(bM);return t.length==2&&vM(t[0])&&yM(!0,t[1])}var SM=/\/|:/,CM=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function wM(e){return SM.test(e)&&CM.test(e)}var TM=/[^\\]\\Z/;function EM(e){if(TM.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function DM(e){let t=0,n=e.length,r=0,i;for(;r<n;)t++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return t}function OM(e,t,n=`2019-09`,r=$j(t),i=!0,a=null,o=`#`,s=`#`,c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:o,keyword:`false`,keywordLocation:o,error:`False boolean schema.`}]};let l=typeof e,u;switch(l){case`boolean`:case`number`:case`string`:u=l;break;case`object`:u=e===null?`null`:Array.isArray(e)?`array`:`object`;break;default:throw Error(`Instances of "${l}" type are not supported.`)}let{$ref:d,$recursiveRef:f,$recursiveAnchor:p,type:m,const:h,enum:g,required:_,not:v,anyOf:y,allOf:b,oneOf:x,if:S,then:C,else:w,format:T,properties:E,patternProperties:D,additionalProperties:O,unevaluatedProperties:k,minProperties:A,maxProperties:j,propertyNames:M,dependentRequired:N,dependentSchemas:ee,dependencies:te,prefixItems:P,items:F,additionalItems:I,unevaluatedItems:ne,contains:re,minContains:ie,maxContains:ae,minItems:oe,maxItems:se,uniqueItems:ce,minimum:le,maximum:ue,exclusiveMinimum:de,exclusiveMaximum:fe,multipleOf:pe,minLength:me,maxLength:he,pattern:ge,__absolute_ref__:_e,__absolute_recursive_ref__:ve}=t,ye=[];if(p===!0&&a===null&&(a=t),f===`#`){let l=a===null?r[ve]:a,u=`${s}/$recursiveRef`,d=OM(e,a===null?t:a,n,r,i,l,o,u,c);d.valid||ye.push({instanceLocation:o,keyword:`$recursiveRef`,keywordLocation:u,error:`A subschema had errors.`},...d.errors)}if(d!==void 0){let t=r[_e||d];if(t===void 0){let e=`Unresolved $ref "${d}".`;throw _e&&_e!==d&&(e+=` Absolute URI "${_e}".`),e+=`\nKnown schemas:\n- ${Object.keys(r).join(`
|
|
101
|
-
- `)}`,Error(e)}let l=`${s}/$ref`,u=OM(e,t,n,r,i,a,o,l,c);if(u.valid||ye.push({instanceLocation:o,keyword:`$ref`,keywordLocation:l,error:`A subschema had errors.`},...u.errors),n===`4`||n===`7`)return{valid:ye.length===0,errors:ye}}if(Array.isArray(m)){let t=m.length,n=!1;for(let r=0;r<t;r++)if(u===m[r]||m[r]===`integer`&&u===`number`&&e%1==0&&e===e){n=!0;break}n||ye.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m.join(`", "`)}".`})}else m===`integer`?(u!==`number`||e%1||e!==e)&&ye.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`}):m!==void 0&&u!==m&&ye.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`});if(h!==void 0&&(u===`object`||u===`array`?Kj(e,h)||ye.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`}):e!==h&&ye.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})),g!==void 0&&(u===`object`||u===`array`?g.some(t=>Kj(e,t))||ye.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||ye.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;OM(e,v,n,r,i,a,o,t).valid&&ye.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let be=[];if(y!==void 0){let t=`${s}/anyOf`,l=ye.length,u=!1;for(let s=0;s<y.length;s++){let l=y[s],d=Object.create(c),f=OM(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);ye.push(...f.errors),u||=f.valid,f.valid&&be.push(d)}u?ye.length=l:ye.splice(l,0,{instanceLocation:o,keyword:`anyOf`,keywordLocation:t,error:`Instance does not match any subschemas.`})}if(b!==void 0){let t=`${s}/allOf`,l=ye.length,u=!0;for(let s=0;s<b.length;s++){let l=b[s],d=Object.create(c),f=OM(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);ye.push(...f.errors),u&&=f.valid,f.valid&&be.push(d)}u?ye.length=l:ye.splice(l,0,{instanceLocation:o,keyword:`allOf`,keywordLocation:t,error:`Instance does not match every subschema.`})}if(x!==void 0){let t=`${s}/oneOf`,l=ye.length,u=x.filter((s,l)=>{let u=Object.create(c),d=OM(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return ye.push(...d.errors),d.valid&&be.push(u),d.valid}).length;u===1?ye.length=l:ye.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...be),S!==void 0){let t=`${s}/if`;if(OM(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=OM(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||ye.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(w!==void 0){let l=OM(e,w,n,r,i,a,o,`${s}/else`,c);l.valid||ye.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||ye.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(A!==void 0&&t.length<A&&ye.push({instanceLocation:o,keyword:`minProperties`,keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${A} properties.`}),j!==void 0&&t.length>j&&ye.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${j} properties.`}),M!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${qj(s)}`,c=OM(s,M,n,r,i,a,e,t);c.valid||ye.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(N!==void 0){let t=`${s}/dependantRequired`;for(let n in N)if(n in e){let r=N[n];for(let i of r)i in e||ye.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(ee!==void 0)for(let t in ee){let l=`${s}/dependentSchemas`;if(t in e){let s=OM(e,ee[t],n,r,i,a,o,`${l}/${qj(t)}`,c);s.valid||ye.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(te!==void 0){let t=`${s}/dependencies`;for(let s in te)if(s in e){let c=te[s];if(Array.isArray(c))for(let n of c)n in e||ye.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=OM(e,c,n,r,i,a,o,`${t}/${qj(s)}`);l.valid||ye.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(E!==void 0){let t=`${s}/properties`;for(let s in E){if(!(s in e))continue;let d=`${o}/${qj(s)}`,f=OM(e[s],E[s],n,r,i,a,d,`${t}/${qj(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,ye.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&D!==void 0){let t=`${s}/patternProperties`;for(let s in D){let d=new RegExp(s,`u`),f=D[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${qj(p)}`,h=OM(e[p],f,n,r,i,a,m,`${t}/${qj(s)}`);h.valid?c[p]=l[p]=!0:(u=i,ye.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&O!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${qj(s)}`,f=OM(e[s],O,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,ye.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&k!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${qj(s)}`,u=OM(e[s],k,n,r,i,a,l,t);u.valid?c[s]=!0:ye.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){se!==void 0&&e.length>se&&ye.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${se}).`}),oe!==void 0&&e.length<oe&&ye.push({instanceLocation:o,keyword:`minItems`,keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${oe}).`});let t=e.length,l=0,u=!1;if(P!==void 0){let d=`${s}/prefixItems`,f=Math.min(P.length,t);for(;l<f;l++){let t=OM(e[l],P[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,ye.push({instanceLocation:o,keyword:`prefixItems`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}if(F!==void 0){let d=`${s}/items`;if(Array.isArray(F)){let s=Math.min(F.length,t);for(;l<s;l++){let t=OM(e[l],F[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,ye.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}else for(;l<t;l++){let t=OM(e[l],F,n,r,i,a,`${o}/${l}`,d);if(c[l]=!0,!t.valid&&(u=i,ye.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}if(!u&&I!==void 0){let d=`${s}/additionalItems`;for(;l<t;l++){let t=OM(e[l],I,n,r,i,a,`${o}/${l}`,d);c[l]=!0,t.valid||(u=i,ye.push({instanceLocation:o,keyword:`additionalItems`,keywordLocation:d,error:`Items did not match additional items schema.`},...t.errors))}}}if(re!==void 0)if(t===0&&ie===void 0)ye.push({instanceLocation:o,keyword:`contains`,keywordLocation:`${s}/contains`,error:`Array is empty. It must contain at least one item matching the schema.`});else if(ie!==void 0&&t<ie)ye.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array has less items (${t}) than minContains (${ie}).`});else{let l=`${s}/contains`,u=ye.length,d=0;for(let s=0;s<t;s++){let t=OM(e[s],re,n,r,i,a,`${o}/${s}`,l);t.valid?(c[s]=!0,d++):ye.push(...t.errors)}d>=(ie||0)&&(ye.length=u),ie===void 0&&ae===void 0&&d===0?ye.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):ie!==void 0&&d<ie?ye.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array must contain at least ${ie} items matching schema. Only ${d} items were found.`}):ae!==void 0&&d>ae&&ye.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${ae} items matching schema. ${d} items were found.`})}if(!u&&ne!==void 0){let u=`${s}/unevaluatedItems`;for(;l<t;l++){if(c[l])continue;let t=OM(e[l],ne,n,r,i,a,`${o}/${l}`,u);c[l]=!0,t.valid||ye.push({instanceLocation:o,keyword:`unevaluatedItems`,keywordLocation:u,error:`Items did not match unevaluated items schema.`},...t.errors)}}if(ce)for(let n=0;n<t;n++){let r=e[n],i=typeof r==`object`&&!!r;for(let a=0;a<t;a++){if(n===a)continue;let t=e[a];(r===t||i&&typeof t==`object`&&t&&Kj(r,t))&&(ye.push({instanceLocation:o,keyword:`uniqueItems`,keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${n} and ${a}.`}),n=2**53-1,a=2**53-1)}}}else if(u===`number`){if(n===`4`?(le!==void 0&&(de===!0&&e<=le||e<le)&&ye.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${de?`or equal to `:``} ${le}.`}),ue!==void 0&&(fe===!0&&e>=ue||e>ue)&&ye.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${fe?`or equal to `:``} ${ue}.`})):(le!==void 0&&e<le&&ye.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${le}.`}),ue!==void 0&&e>ue&&ye.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${ue}.`}),de!==void 0&&e<=de&&ye.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${de}.`}),fe!==void 0&&e>=fe&&ye.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${fe}.`})),pe!==void 0){let t=e%pe;Math.abs(0-t)>=1.1920929e-7&&Math.abs(pe-t)>=1.1920929e-7&&ye.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${pe}.`})}}else if(u===`string`){let t=me===void 0&&he===void 0?0:DM(e);me!==void 0&&t<me&&ye.push({instanceLocation:o,keyword:`minLength`,keywordLocation:`${s}/minLength`,error:`String is too short (${t} < ${me}).`}),he!==void 0&&t>he&&ye.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${he}).`}),ge!==void 0&&!new RegExp(ge,`u`).test(e)&&ye.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),T!==void 0&&gM[T]&&!gM[T](e)&&ye.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${T}".`})}return{valid:ye.length===0,errors:ye}}var kM=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=$j(e)}validate(e){return OM(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),$j(e,this.lookup)}},AM=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),jM=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}getValidator(e){if(this.draft===void 0&&`$schema`in e&&typeof e.$schema==`string`&&!AM.has(e.$schema.replace(/#$/,``))){let t=e.$schema.slice(0,200);throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${t}"). The default validator supports JSON Schema 2020-12 only; pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.`)}let t=new kM(e,this.draft??`2020-12`,this.shortcircuit);return e=>{let n=t.validate(e);return n.valid?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:n.errors.map(e=>`${e.instanceLocation}: ${e.error}`).join(`; `)}}}},MM=globalThis.crypto;async function Mne(e){return(await MM).getRandomValues(new Uint8Array(e))}async function Nne(e){let t=``;for(;t.length<e;){let n=await Mne(e-t.length);for(let e of n)e<198&&(t+=`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~`[e%66])}return t}async function Pne(e){return await Nne(e)}async function Fne(e){let t=await(await MM).subtle.digest(`SHA-256`,new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,`_`).replace(/\+/g,`-`).replace(/=/g,``)}async function Ine(e){if(e||=43,e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await Pne(e);return{code_verifier:t,code_challenge:await Fne(t)}}var Lne=`modulepreload`,Rne=function(e){return`/`+e},NM={},PM=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Rne(t,n),t=s(t),t in NM)return;NM[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Lne,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},FM=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return DO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return DO(this,e)}constructor(e){super(e),this.name=new.target.name,EO(this,new.target)}},IM=class extends FM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}},zne=class extends FM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},LM=class extends FM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},RM=class extends FM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=e,this.currentIssuer=t}};(class extends FM{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}});function zM(e,t,n){if(e!==void 0)return e.issuer===void 0?(n?.canPersistStamp!==!1&&console.warn(`[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field.`),e):BM(e.issuer,t)?e:void 0}function BM(e,t){return e===t||e.endsWith(`/`)&&e.slice(0,-1)===t||t.endsWith(`/`)&&t.slice(0,-1)===e}var VM=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return DO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return DO(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,EO(this,new.target)}};function HM(e){return e?.authorization_response_iss_parameter_supported===!0}function UM({iss:e,expectedIssuer:t,issParameterSupported:n}){if(t!==void 0){if(e===void 0){if(n)throw new IM(`authorization_response`,t,void 0);return}if(e!==t)throw new IM(`authorization_response`,t,e)}}function Bne(...e){let t=new Set;for(let n of e)if(n)for(let e of n.split(/\s+/))e&&t.add(e);return t.size>0?[...t].join(` `):void 0}function Vne(e,t){if(!e)return!1;let n=new Set((t??``).split(/\s+/).filter(Boolean));for(let t of e.split(/\s+/))if(t&&!n.has(t))return!0;return!1}function Hne(e){return[`client_secret_basic`,`client_secret_post`,`none`].includes(e)}var WM=`code`,GM=`S256`;function KM(e,t){let n=e.client_secret!==void 0;return`token_endpoint_auth_method`in e&&e.token_endpoint_auth_method&&Hne(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?`client_secret_basic`:`none`:n&&t.includes(`client_secret_basic`)?`client_secret_basic`:n&&t.includes(`client_secret_post`)?`client_secret_post`:t.includes(`none`)?`none`:n?`client_secret_post`:`none`}function Une(e,t,n,r){let{client_id:i,client_secret:a}=t;switch(e){case`client_secret_basic`:Wne(i,a,n);return;case`client_secret_post`:Gne(i,a,r);return;case`none`:Kne(i,r);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}function Wne(e,t,n){if(!t)throw Error(`client_secret_basic authentication requires a client_secret`);let r=btoa(`${e}:${t}`);n.set(`Authorization`,`Basic ${r}`)}function Gne(e,t,n){n.set(`client_id`,e),t&&n.set(`client_secret`,t)}function Kne(e,t){t.set(`client_id`,e)}function qM(e){return e===`localhost`||e===`127.0.0.1`||e===`[::1]`||e===`::1`}function JM(e){let t=new URL(String(e));if(t.protocol!==`https:`&&!qM(t.hostname))throw new LM(t.href);return t}function qne(e){for(let t of e??[]){let e;try{e=new URL(t)}catch{continue}if(e.protocol!==`http:`&&e.protocol!==`https:`||qM(e.hostname))return`native`}return`web`}function Jne(e){let t=e.clientMetadata;return{...t,grant_types:t.grant_types??(e.redirectUrl===void 0?void 0:[`authorization_code`,`refresh_token`]),application_type:t.application_type??qne(t.redirect_uris)}}async function YM(e){let t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{let e=vO.parse(JSON.parse(n));return kO.fromResponse(e)}catch(e){let r=`${t?`HTTP ${t}: `:``}Invalid OAuth error response: ${e}. Raw body: ${n}`;return new kO(OO.ServerError,r)}}async function Yne(e,t){try{return await XM(e,t)}catch(n){if(n instanceof kO){if(n.code===OO.InvalidClient||n.code===OO.UnauthorizedClient)return await e.invalidateCredentials?.(`client`),await e.invalidateCredentials?.(`tokens`),await XM(e,t);if(n.code===OO.InvalidGrant)return await e.invalidateCredentials?.(`tokens`),await XM(e,t)}throw n}}function Xne(e){let{requestedScope:t,resourceMetadata:n,authServerMetadata:r,clientMetadata:i}=e,a=t||n?.scopes_supported?.join(` `)||i.scope;return a&&r?.scopes_supported?.includes(`offline_access`)&&!a.split(` `).includes(`offline_access`)&&i.grant_types?.includes(`refresh_token`)&&(a=`${a} offline_access`),a}async function XM(e,{serverUrl:t,authorizationCode:n,iss:r,scope:i,resourceMetadataUrl:a,fetchFn:o,skipIssuerMetadataValidation:s,forceReauthorization:c}){let l=Jne(e),u=await e.discoveryState?.(),d,f,p,m,h=a;if(!h&&u?.resourceMetadataUrl&&(h=new URL(u.resourceMetadataUrl)),u?.authorizationServerUrl){if(f=u.authorizationServerUrl,d=u.resourceMetadata,p=u.authorizationServerMetadata??await tN(f,{fetchFn:o,skipIssuerValidation:s}),!d)try{d=await QM(t,{resourceMetadataUrl:h},o)}catch(e){if(e instanceof TypeError)throw e}(p!==u.authorizationServerMetadata||d!==u.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p})}else{let e=await nre(t,{resourceMetadataUrl:h,fetchFn:o,skipIssuerMetadataValidation:s});f=e.authorizationServerUrl,p=e.authorizationServerMetadata,d=e.resourceMetadata,m={authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p}}let g=p?.issuer??String(f),_={issuer:g};if(await e.saveAuthorizationServerUrl?.(g),n!==void 0){let t=u?.authorizationServerMetadata?.issuer??u?.authorizationServerUrl;if(t===void 0){if(e.saveDiscoveryState!==void 0)throw new RM(`discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier`,g);console.warn(`[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md §SEP-2352.`)}else if(!BM(t,g))throw new RM(t,g)}m&&await e.saveDiscoveryState?.(m);let v=await ZM(t,e,d);v&&await e.saveResourceUrl?.(String(v));let y=Xne({requestedScope:i,resourceMetadata:d,authServerMetadata:p,clientMetadata:e.clientMetadata}),b=await Promise.resolve(e.clientInformation(_)),x=zM(b,g,{canPersistStamp:e.saveClientInformation!==void 0});if(x===void 0&&b?.issuer&&e.saveClientInformation===void 0)throw new RM(b.issuer,g);if(x&&x.issuer===void 0&&(x={...x,issuer:g},await e.saveClientInformation?.(x,_)),!x){if(n!==void 0)throw Error(`Existing OAuth client information is required when exchanging an authorization code`);let t=p?.client_id_metadata_document_supported===!0,r=e.clientMetadataUrl;if(r&&!Zne(r))throw new kO(OO.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${r}`);if(t&&r)x={client_id:r,issuer:g},await e.saveClientInformation?.(x,_);else{if(!e.saveClientInformation)throw Error(`OAuth client information must be saveable for dynamic registration`);x={...await ore(f,{metadata:p,clientMetadata:l,scope:y,fetchFn:o}),issuer:g},await e.saveClientInformation(x,_)}}let S=!e.redirectUrl;if(n!==void 0||S){n!==void 0&&UM({iss:r,expectedIssuer:p?.issuer,issParameterSupported:HM(p)});let t=await are(e,f,{metadata:p,resource:v,authorizationCode:n,iss:r,scope:y,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}let C=zM(await e.tokens(_),g);if(C&&C.issuer===void 0&&(C={...C,issuer:g},await e.saveTokens(C,_)),C?.refresh_token&&!c)try{let t=await ire(f,{metadata:p,clientInformation:x,refreshToken:C.refresh_token,resource:v,addClientAuthentication:e.addClientAuthentication,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}catch(e){if(e instanceof LM||!(!(e instanceof kO)||e.code===OO.ServerError))throw e}let w=e.state?await e.state():void 0,{authorizationUrl:T,codeVerifier:E}=await nN(f,{metadata:p,clientInformation:x,state:w,redirectUrl:e.redirectUrl,scope:y,resource:v});return await e.saveCodeVerifier(E),await e.redirectToAuthorization(T),`REDIRECT`}function Zne(e){if(!e)return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.pathname!==`/`}catch{return!1}}async function ZM(e,t,n){let r=NO(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!PO({requestedResource:r,configuredResource:n.resource}))throw Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}async function QM(e,t,n=fetch){let r=await ere(e,`oauth-protected-resource`,n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.text?.().catch(()=>{}),Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);if(!r.ok)throw await r.text?.().catch(()=>{}),Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return fO.parse(await r.json())}async function $M(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(!(r instanceof TypeError))throw r;if(t)try{return await n(e,{})}catch(e){if(!(e instanceof TypeError))throw e;return}return}}function Qne(e,t=``,n={}){return t.endsWith(`/`)&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function eN(e,t,n=fetch){return await $M(e,{"MCP-Protocol-Version":t},n)}function $ne(e,t){return e?t===`/`?!1:e.status>=400&&e.status<500||e.status===502:!0}async function ere(e,t,n,r){let i=new URL(e),a=r?.protocolVersion??`2025-11-25`,o;if(r?.metadataUrl)o=new URL(r.metadataUrl);else{let e=Qne(t,i.pathname);o=new URL(e,r?.metadataServerUrl??i),o.search=i.search}let s=await eN(o,a,n);return!r?.metadataUrl&&$ne(s,i.pathname)&&(s=await eN(new URL(`/.well-known/${t}`,i),a,n)),s}function tre(e){let t=typeof e==`string`?new URL(e):e,n=t.pathname!==`/`,r=[];if(!n)return r.push({url:new URL(`/.well-known/oauth-authorization-server`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration`,t.origin),type:`oidc`}),r;let i=t.pathname;return i.endsWith(`/`)&&(i=i.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration${i}`,t.origin),type:`oidc`},{url:new URL(`${i}/.well-known/openid-configuration`,t.origin),type:`oidc`}),r}async function tN(e,{fetchFn:t=fetch,protocolVersion:n=Xw,skipIssuerValidation:r=!1}={}){let i={"MCP-Protocol-Version":n,Accept:`application/json`},a=tre(e);for(let{url:n,type:o}of a){let a=await $M(n,i,t);if(!a)continue;if(!a.ok){if(await a.text?.().catch(()=>{}),a.status>=400&&a.status<500||a.status===502)continue;throw Error(`HTTP ${a.status} trying to load ${o===`oauth`?`OAuth`:`OpenID provider`} metadata from ${n}`)}let s=o===`oauth`?pO.parse(await a.json()):hO.parse(await a.json());if(!r){let t=typeof e==`string`?e:e.href;if(!(s.issuer===t||t.endsWith(`/`)&&s.issuer===t.slice(0,-1)))throw new IM(`metadata`,t,s.issuer)}return s}}async function nre(e,t){let n,r;try{n=await QM(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch(e){if(e instanceof TypeError)throw e}r||=String(new URL(`/`,e));let i=await tN(r,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:r,authorizationServerMetadata:i,resourceMetadata:n}}async function nN(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:i,state:a,resource:o}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(WM))throw Error(`Incompatible auth server: does not support response type ${WM}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(GM))throw Error(`Incompatible auth server: does not support code challenge method ${GM}`)}else s=new URL(`/authorize`,e);let c=await Ine(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set(`response_type`,WM),s.searchParams.set(`client_id`,n.client_id),s.searchParams.set(`code_challenge`,u),s.searchParams.set(`code_challenge_method`,GM),s.searchParams.set(`redirect_uri`,String(r)),a&&s.searchParams.set(`state`,a),i&&s.searchParams.set(`scope`,i),i?.split(` `).includes(`offline_access`)&&s.searchParams.append(`prompt`,`consent`),o&&s.searchParams.set(`resource`,o.href),{authorizationUrl:s,codeVerifier:l}}function rN(e,t,n){return new URLSearchParams({grant_type:`authorization_code`,code:e,code_verifier:t,redirect_uri:String(n)})}async function iN(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:i,resource:a,fetchFn:o}){let s=JM(t?.token_endpoint??new URL(`/token`,e)),c=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});a&&n.set(`resource`,a.href),i?await i(c,n,s,t):r&&Une(KM(r,t?.token_endpoint_auth_methods_supported??[]),r,c,n);let l=await(o??fetch)(s,{method:`POST`,headers:c,body:n});if(!l.ok)throw await YM(l);let u=await l.json();try{return gO.parse(u)}catch(e){throw typeof u==`object`&&u&&`error`in u?await YM(JSON.stringify(u)):e}}async function rre(e,{metadata:t,clientInformation:n,authorizationCode:r,iss:i,codeVerifier:a,redirectUri:o,resource:s,addClientAuthentication:c,fetchFn:l}){return UM({iss:i,expectedIssuer:t?.issuer,issParameterSupported:HM(t)}),iN(e,{metadata:t,tokenRequestParams:rN(r,a,o),clientInformation:n,addClientAuthentication:c,resource:s,fetchFn:l})}async function ire(e,{metadata:t,clientInformation:n,refreshToken:r,resource:i,addClientAuthentication:a,fetchFn:o}){return{refresh_token:r,...await iN(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:`refresh_token`,refresh_token:r}),clientInformation:n,addClientAuthentication:a,resource:i,fetchFn:o})}}async function are(e,t,{metadata:n,resource:r,authorizationCode:i,iss:a,scope:o,fetchFn:s}={}){i!==void 0&&UM({iss:a,expectedIssuer:n?.issuer,issParameterSupported:HM(n)});let c=o??e.clientMetadata.scope,l;if(e.prepareTokenRequest&&(l=await e.prepareTokenRequest(c)),!l){if(!i)throw Error(`Either provider.prepareTokenRequest() or authorizationCode is required`);if(!e.redirectUrl)throw Error(`redirectUrl is required for authorization_code flow`);l=rN(i,await e.codeVerifier(),e.redirectUrl)}let u=await e.clientInformation({issuer:n?.issuer??String(t)});return iN(t,{metadata:n,tokenRequestParams:l,clientInformation:u??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:s})}async function ore(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:i}){let a;if(t){if(!t.registration_endpoint)throw Error(`Incompatible auth server: does not support dynamic client registration`);a=new URL(t.registration_endpoint)}else a=new URL(`/register`,e);let o={...n,...r===void 0?{}:{scope:r}},s=await(i??fetch)(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(!s.ok)throw new zne({status:s.status,body:await s.text(),submittedMetadata:o});return SO.parse(await s.json())}var aN=new Set([`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`server/discover`]),sre=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(oN(e))}set(e,t){let n=oN(e),r=aN.has(e.method),i=!this._entries.has(n);if(!r&&i&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let e of this._entries.keys())if(!aN.has(e.slice(0,e.indexOf(`\0`)))){this._entries.delete(e),this._cappedSize--;break}}let a=++this._stamp;return this._entries.set(n,{...t,stamp:a}),i&&!r&&this._cappedSize++,a}delete(e){this._entries.delete(oN(e))&&!aN.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,n=aN.has(e);for(let e of this._entries.keys())e.startsWith(t)&&(this._entries.delete(e),n||this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function oN(e){return`${e.method}\0${JSON.stringify([e.partition??``,e.params??``])}`}function sN(e,t){return t===void 0?e:`${e}\0${t}`}var cre=864e5,lre=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity=``;constructor(e,t,n=()=>{},r=``,i=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=n,this._cachePartition=r,this._now=i}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,e===`public`?``:this._cachePartition])}async _probe(e,t){let n={method:e,params:t??``},r=this._partitionFor(`private`),i=await this._store.get({...n,partition:r});if(i!==void 0)return i;let a=this._partitionFor(`public`);if(a===r)return;let o=await this._store.get({...n,partition:a});return o?.scope===`public`?o:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,``)}async _deleteBoth(e,t){let n=this._partitionFor(`private`),r=this._partitionFor(`public`);try{await this._store.delete({method:e,params:t,partition:n})}catch(e){this._reportError(e)}if(r!==n)try{await this._store.delete({method:e,params:t,partition:r})}catch(e){this._reportError(e)}}async evictKey(e,t){let n=sN(e,t),r=this._evictionGeneration.get(n);r!==void 0&&this._evictionGeneration.set(n,r+1),await this._deleteBoth(e,t)}captureGeneration(e,t){let n=sN(e,t),r=this._evictionGeneration.get(n)??0;return this._evictionGeneration.set(n,r),r}async write(e,t,n,r){if((this._evictionGeneration.get(sN(e,r?.params))??0)!==n)return;let i=r?.params??``,a=this._partitionFor(`private`),o=this._partitionFor(`public`),s=(r?.scope??`private`)===`public`?o:a;try{await this._store.set({method:e,params:i,partition:s},{value:ure(t),expiresAt:r?.expiresAt,scope:r?.scope})}catch(e){this._reportError(e)}if(o!==a)try{await this._store.delete({method:e,params:i,partition:s===a?o:a})}catch(e){this._reportError(e)}}async read(e,t){let n=await this._probe(e,t);if(!(n?.expiresAt===void 0||!(n.expiresAt>this.now())))try{let e=JSON.parse(n.value);if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`cached document is not an object`);return{value:e}}catch(n){this._reportError(n),await this._deleteBoth(e,t??``);return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=``}async toolDefinition(e){let t=await this._probe(`tools/list`);if(t===void 0){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let e=this._decodeListTools(t),n=new Map;if(e!==void 0)for(let t of e.tools)n.set(t.name,t);this._toolIndex={stamp:t.stamp,byName:n}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let n=await this._probe(`tools/list`);if(n===void 0){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==n.stamp){let e=this._decodeListTools(n)??{tools:[]},r=new Map;for(let n of e.tools){let e=t(n);e!==void 0&&r.set(n.name,e)}this._toolOutputValidatorIndex={stamp:n.stamp,byName:r}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every(e=>typeof e==`object`&&!!e))throw TypeError(`cached tools/list document has a malformed tools array`);return t}catch(e){this._reportError(e);return}}};function ure(e){let t;try{t=JSON.stringify(e)}catch(e){throw TypeError(`cache value is not JSON-serializable: ${e instanceof Error?e.message:String(e)}`)}if(typeof t!=`string`)throw TypeError(`cache value is not JSON-serializable: it has no JSON representation`);return t}var dre=-32022,fre=new Set([-32001,-32020,-32021]);function pre(e,t){switch(e.kind){case`result`:return mre(e.result,t);case`rpc-error`:return cN(e,t);case`http-error`:return hre(e,t);case`network-error`:return lN(e.error,t);case`auth-required`:return{kind:`error`,error:e.error};case`closed`:return t.transportKind===`stdio`?{kind:`legacy`}:lN(Error(`Connection closed during the version negotiation probe`),t);case`timeout`:return t.transportKind===`stdio`?{kind:`legacy`}:{kind:`error`,error:new jO(AO.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}function mre(e,t){let n=sA(oA).validateResult(`server/discover`,e);if(!n.ok)return{kind:`legacy`};let r=n.value.supportedVersions,i=t.clientModernVersions.find(e=>r.includes(e));return i===void 0?t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:new Ek({supported:[...r],requested:t.requestedVersion})}:{kind:`modern`,version:i,discover:n.value}}function cN(e,t){let{code:n,message:r,data:i}=e;if(n===dre){let e=vre(i);if(e===void 0)return{kind:`legacy`};let n=new Ek({supported:e,requested:yre(i)??t.requestedVersion},r),a=zO(e),o=t.clientModernVersions.find(e=>a.includes(e));return o===void 0?a.length>0?{kind:`error`,error:n}:t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:n}:{kind:`corrective`,version:o,error:n}}return fre.has(n),{kind:`legacy`}}function hre(e,t){let n=bre(e.body);return n===void 0?{kind:`legacy`}:cN(n,t)}function lN(e,t){return t.environment===`browser`&&gre(e)?{kind:`legacy`}:{kind:`error`,error:new jO(AO.EraNegotiationFailed,`Version negotiation probe failed: ${_re(e)}`,{cause:e})}}function gre(e){return e instanceof TypeError||e instanceof Error&&e.name===`TypeError`}function _re(e){return e instanceof Error?e.message:String(e)}function vre(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(!(!Array.isArray(t)||t.length===0||!t.every(e=>typeof e==`string`)))return t}function yre(e){if(typeof e!=`object`||!e)return;let t=e.requested;return typeof t==`string`?t:void 0}function bre(e){if(e===void 0||e===``)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t)return;let n=t.error;if(typeof n!=`object`||!n)return;let{code:r,message:i,data:a}=n;if(typeof r==`number`)return{code:r,message:typeof i==`string`?i:``,data:a}}var xre=`legacy`;function Sre(e,t){let n=e?.mode??xre;if(n===`legacy`)return{kind:`legacy`};let r=e?.probe??{};if(typeof n==`object`){if(!LO(n.pin))throw TypeError(`versionNegotiation: { pin: '${n.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:`pin`,version:n.pin,probe:r}}let i=t?zO(t):[];return{kind:`auto`,modernVersions:i.length>0?i:[...IO],fallbackAvailable:!t||RO(t).length>0,probe:r}}function uN(){let e=globalThis;return e.window!==void 0&&e.document!==void 0?`browser`:`node`}function dN(e){return`stderr`in e&&`pid`in e?`stdio`:`http`}var Cre=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(e){this._transport=e,this._savedOnMessage=e.onmessage,this._savedOnError=e.onerror,this._savedOnClose=e.onclose}static async open(t){let n=new e(t);t.onmessage=e=>{let t=n._pending;if(t!==void 0&&(hA(e)||gA(e))&&e.id===t.id){n._pending=void 0,hA(e)?t.resolve({kind:`response`,result:e.result}):t.resolve({kind:`response`,error:e.error});return}},t.onerror=e=>{n._savedOnError?.(e)},t.onclose=()=>{let e=n._pending;e!==void 0&&(n._pending=void 0,e.resolve({kind:`closed`})),n._closeDelivered=!0,n._savedOnClose?.()};try{await t.start()}catch(e){throw n.detach(),e}return n}async exchange(e,t){let n=`server-discover-probe-${++this._probeCounter}`;return new Promise(r=>{let i=!1,a=e=>{i||(i=!0,clearTimeout(o),this._pending?.id===n&&(this._pending=void 0),r(e))},o=setTimeout(()=>a({kind:`timeout`}),t);this._pending={id:n,resolve:a},this._transport.send(e(n)).catch(e=>a({kind:`send-error`,error:e}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&this._savedOnClose!==void 0){let e=this._savedOnClose,t=this._transport,n=!1,r=()=>{if(!n){n=!0;return}e()};t.onclose=r,fN.set(t,()=>{t.onclose===r&&(t.onclose=e)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let e=this._transport,t=e.start,n=!0;e.start=async function(){if(n){n=!1,e.start=t;return}return t.call(e)}}},fN=new WeakMap;function pN(e){let t=fN.get(e);fN.delete(e),t?.()}function wre(e,t,n,r){return{jsonrpc:`2.0`,id:e,method:`server/discover`,params:{_meta:sA(t).outboundEnvelope({protocolVersion:t,clientInfo:n,clientCapabilities:r})}}}function Tre(e,t){switch(e.kind){case`response`:return e.error===void 0?{kind:`result`,result:e.result}:{kind:`rpc-error`,...e.error};case`send-error`:{let t=e.error;if(t instanceof MO){let e=t.data?.text;return{kind:`http-error`,status:t.data.status,body:typeof e==`string`?e:void 0}}return t instanceof VM||t instanceof Error&&t.name===`UnauthorizedError`?{kind:`auth-required`,error:t}:{kind:`network-error`,error:t}}case`closed`:return{kind:`closed`};case`timeout`:return{kind:`timeout`,timeoutMs:t}}}async function mN(e,t){let n=e.probe.timeoutMs??t.defaultTimeoutMs,r=Math.max(0,e.probe.maxRetries??0),i=e.kind===`pin`?[e.version]:e.modernVersions,a=e.kind===`auto`&&e.fallbackAvailable,o=await Cre.open(t.transport),s=async()=>{let s=i[0],c=!1,l=r;for(;;){let r=await o.exchange(e=>wre(e,s,t.clientInfo,t.capabilities),n);if(r.kind===`timeout`&&l>0){l--;continue}let u=Tre(r,n),d=pre(u,{clientModernVersions:i,requestedVersion:s,fallbackAvailable:a,environment:t.environment,transportKind:t.transportKind});switch(d.kind){case`modern`:return{era:`modern`,version:d.version,discover:d.discover};case`corrective`:if(c)throw d.error;c=!0,s=d.version;continue;case`legacy`:{let n=u.kind===`closed`?`the connection closed during the server/discover probe`:void 0;if(e.kind===`pin`)throw new jO(AO.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${n} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new jO(AO.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to`:`Version negotiation failed: ${n} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(n!==void 0&&t.disposableProbe!==!0)throw new jO(AO.EraNegotiationFailed,`Version negotiation failed: ${n} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:`legacy`}}case`error`:throw d.error}}},c;try{c=await s()}catch(e){throw o.detach(),e}return o.release(),c}function Ere(e){let t=Object.getPrototypeOf(e);if(t===null||!Object.prototype.hasOwnProperty.call(t,`_dispose`))return;let n=e._serverParams;return typeof n==`object`&&n&&typeof n.command==`string`?n:void 0}async function Dre(e,t,n,r){let i=t.constructor,a=new i({...n,stderr:`ignore`}),o=t.close,s=!1,c,l=new Promise((e,t)=>{c=()=>t(hN())});t.close=async function(){return s=!0,c?.(),o.call(t)};let u;try{let t=mN(e,{...r,transport:a,transportKind:`stdio`,disposableProbe:!0});t.catch(()=>{}),u=await Promise.race([t,l])}finally{await Ore(a),t.close=o}if(s)throw hN();return u}function hN(){return new jO(AO.EraNegotiationFailed,`Version negotiation failed: the transport was closed during the server/discover probe`)}async function Ore(e){try{let t=e._dispose;await(typeof t==`function`?t.call(e):e.close())}catch{}}function gN(e){let t=e._meta?.[tT];return Sj.Implementation(t)?t:void 0}function _N(e,t){if(!(!e||typeof t!=`object`||!t)){if(e.type===`object`&&e.properties&&typeof e.properties==`object`){let n=t,r=e.properties;for(let e of Object.keys(r)){let t=r[e];n[e]===void 0&&Object.prototype.hasOwnProperty.call(t,`default`)&&(n[e]=t.default),n[e]!==void 0&&_N(t,n[e])}}if(Array.isArray(e.anyOf))for(let n of e.anyOf)typeof n!=`boolean`&&_N(n,t);if(Array.isArray(e.oneOf))for(let n of e.oneOf)typeof n!=`boolean`&&_N(n,t)}}function kre(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,n=e.url!==void 0;return{supportsFormMode:t||!t&&!n,supportsUrlMode:n}}function Are(e){if(typeof e==`object`&&e&&(e.kind===`legacy`&&!(`supportedVersions`in e)&&!(`discover`in e)||e.kind===`modern`&&WT.safeParse(e.discover).success))return e;throw new jO(AO.EraNegotiationFailed,`connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }`)}var vN={"notifications/tools/list_changed":[`tools/list`],"notifications/prompts/list_changed":[`prompts/list`],"notifications/resources/list_changed":[`resources/list`,`resources/templates/list`]},jre=64,Mre=class extends Aj{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new jO(AO.ConnectionClosed,`subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e})}this._listenState.clear();for(let e of this._listChangedDebounceTimers.values())clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new jM,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=dj(t?.inputRequired),this._cache=new lre(t?.responseCacheStore??new sre,t?.responseCacheStore!==void 0,e=>this._reportStoreError(e),t?.cachePartition??``),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??jre,t?.listChanged&&(this._listChangedConfig=t.listChanged)}buildContext(e,t){return e}_shouldDropInbound(e){if(this._negotiatedProtocolVersion!==void 0&&LO(this._negotiatedProtocolVersion)&&pA(e))return`drop`}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){return this._inputRequiredDriverConfig.autoFulfill?zj({getRequestHandler:e=>this._getRequestHandler(e),buildContext:e=>this.buildContext(e,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t):Promise.reject(new jO(AO.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:`input_required`,method:t.request.method}))}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler(`tools`,`notifications/tools/list_changed`,e.tools,async()=>(await this.listTools(void 0,{cacheMode:`refresh`})).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler(`prompts`,`notifications/prompts/list_changed`,e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:`refresh`})).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler(`resources`,`notifications/resources/list_changed`,e.resources,async()=>(await this.listResources(void 0,{cacheMode:`refresh`})).resources)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=Mj(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error(`Cannot configure version negotiation after connecting to transport`);this._versionNegotiation=e}_wrapHandler(e,t){return e===`elicitation/create`?async(e,n)=>{let r=sA(this._negotiatedProtocolVersion),i=r.validateRequest(`elicitation/create`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`elicitation/create`,e)),!i.ok)throw new Ck(i.reason===`not-in-era`?Sk.InternalError:Sk.InvalidParams,i.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation request: ${i.message}`);let{params:a}=i.value;a.mode=a.mode??`form`;let{supportsFormMode:o,supportsUrlMode:s}=kre(this._capabilities.elicitation);if(a.mode===`form`&&!o)throw new Ck(Sk.InvalidParams,`Client does not support form-mode elicitation requests`);if(a.mode===`url`&&!s)throw new Ck(Sk.InvalidParams,`Client does not support URL-mode elicitation requests`);let c=await t(e,n),l=r.validateResult(`elicitation/create`,c);if(!l.ok&&l.reason===`not-in-era`&&(l=r.validateInputResponse(`elicitation/create`,c)),!l.ok)throw new Ck(l.reason===`not-in-era`?Sk.InternalError:Sk.InvalidParams,l.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation result: ${l.message}`);let u=l.value,d=a.mode===`form`?a.requestedSchema:void 0;if(a.mode===`form`&&u.action===`accept`&&u.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{_N(d,u.content)}catch{}return u}:e===`sampling/createMessage`?async(e,n)=>{let r=sA(this._negotiatedProtocolVersion),i=r.validateRequest(`sampling/createMessage`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`sampling/createMessage`,e)),!i.ok)throw new Ck(i.reason===`not-in-era`?Sk.InternalError:Sk.InvalidParams,i.reason===`not-in-era`?`No wire schema for sampling/createMessage in the resolved era`:`Invalid sampling request: ${i.message}`);let{params:a}=i.value,o=await t(e,n),s=!!(a.tools||a.toolChoice),c=r.samplingResultVariant(s,o);if(!c.ok&&c.reason===`not-in-era`&&(c=r.validateInputResponse(`sampling/createMessage`,o)),!c.ok)throw new Ck(c.reason===`not-in-era`?Sk.InternalError:Sk.InvalidParams,c.reason===`not-in-era`?`No result schema for sampling/createMessage in the resolved era`:`Invalid sampling result: ${c.message}`);return c.value}:t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new jO(AO.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,Are(t.prior),t);let n=Sre(this._versionNegotiation,this._supportedProtocolVersionsOption);return n.kind===`legacy`?this._connectPlainLegacy(e,t):this._connectNegotiated(e,n,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),e.sessionId!==void 0){let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion?.(t);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let n=RO(this._supportedProtocolVersions);try{let r=n[0];if(r===void 0)throw new jO(AO.EraNegotiationFailed,`Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version`);let i=await this.request({method:`initialize`,params:{protocolVersion:r,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);if(!n.includes(i.protocolVersion))throw Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion&&e.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:`notifications/initialized`}),this._negotiatedProtocolVersion=i.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(e){throw this.close(),e}}async _connectNegotiated(e,t,n){if(e.sessionId!==void 0){await super.connect(e);let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion&&e.setProtocolVersion(t);return}this._resetConnectionState();let r;try{let i=dN(e),a={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:uN(),defaultTimeoutMs:n?.timeout??6e4},o=i===`stdio`?Ere(e):void 0;r=o===void 0?await mN(t,{...a,transport:e,transportKind:i}):await Dre(t,e,o,a)}catch(t){throw await e.close().catch(()=>{}),pN(e),t}if(pN(e),await super.connect(e),r.era===`legacy`){await this._legacyHandshake(e,n);return}if(this._serverCapabilities=r.discover.capabilities,this._serverVersion=gN(r.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.discover.instructions,this._discoverResult=r.discover,this._negotiatedProtocolVersion=r.version,e.setProtocolVersion&&e.setProtocolVersion(r.version),this._listChangedConfig){let e=this._listChangedConfig,t=this._serverCapabilities,r={...e.tools&&t?.tools?.listChanged&&{tools:e.tools},...e.prompts&&t?.prompts?.listChanged&&{prompts:e.prompts},...e.resources&&t?.resources?.listChanged&&{resources:e.resources}},i=!0;try{this._setupListChangedHandlers(r)}catch(e){i=!1,this.onerror?.(e instanceof Error?e:Error(String(e)))}let a=i?{...r.tools&&{toolsListChanged:!0},...r.prompts&&{promptsListChanged:!0},...r.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(a).length>0){let e=new AbortController,t=()=>e.abort(n?.signal?.reason);n?.signal?.aborted&&t(),n?.signal?.addEventListener(`abort`,t);try{this._autoOpenedSubscription=await this.listen(a,{timeout:n?.timeout,signal:e.signal})}catch(e){if(n?.signal?.aborted)throw await this.close().catch(()=>{}),e;this.onerror?.(e instanceof Error?e:Error(String(e)))}finally{n?.signal?.removeEventListener(`abort`,t)}}}}async _connectFromPrior(e,t,n){if(t.kind===`legacy`)return this._connectPlainLegacy(e,n);let r=t.discover;this._resetConnectionState();let i=this._supportedProtocolVersionsOption,a=(i&&zO(i).length>0?zO(i):IO).find(e=>r.supportedVersions.includes(e));if(a===void 0)throw new jO(AO.EraNegotiationFailed,`connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.`);if(await super.connect(e),this._discoverResult=r,this._serverCapabilities=r.capabilities,this._serverVersion=gN(r),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.instructions,this._negotiatedProtocolVersion=a,e.setProtocolVersion?.(a),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;return t===void 0?e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`:`${t.name}@${t.version}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return LO(e)?`modern`:`legacy`}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case`logging/setLevel`:if(!this._serverCapabilities?.logging)throw new jO(AO.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._serverCapabilities?.prompts)throw new jO(AO.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:case`resources/subscribe`:case`resources/unsubscribe`:if(!this._serverCapabilities?.resources)throw new jO(AO.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if(e===`resources/subscribe`&&!this._serverCapabilities.resources.subscribe)throw new jO(AO.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._serverCapabilities?.tools)throw new jO(AO.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case`completion/complete`:if(!this._serverCapabilities?.completions)throw new jO(AO.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case`initialize`:break;case`server/discover`:break;case`ping`:break}}assertNotificationCapability(e){switch(e){case`notifications/roots/list_changed`:if(!this._capabilities.roots?.listChanged)throw new jO(AO.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`);break;case`notifications/initialized`:break;case`notifications/cancelled`:break;case`notifications/progress`:break}}assertRequestHandlerCapability(e){switch(e){case`sampling/createMessage`:if(!this._capabilities.sampling)throw new jO(AO.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case`elicitation/create`:if(!this._capabilities.elicitation)throw new jO(AO.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case`roots/list`:if(!this._capabilities.roots)throw new jO(AO.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`);break;case`ping`:break}}async ping(e){return this.request({method:`ping`},e)}async discover(e){let t=await this._requestWithSchema({method:`server/discover`},WT,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:`completion/complete`,params:e},t)}async setLoggingLevel(e,t){return this.request({method:`logging/setLevel`,params:{level:e}},t)}async getPrompt(e,t){return this.request({method:`prompts/get`,params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug(`Client.listPrompts() called but server does not advertise prompts capability - returning empty list`),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:`prompts/list`,params:e},t);let n=await this._serveFromCache(`prompts/list`,void 0,t);return n===void 0?this._listAllPages(`prompts/list`,e,t,(e,t)=>e.prompts.push(...t.prompts)):n}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResources() called but server does not advertise resources capability - returning empty list`),{resources:[]};if(e?.cursor!==void 0)return this.request({method:`resources/list`,params:e},t);let n=await this._serveFromCache(`resources/list`,void 0,t);return n===void 0?this._listAllPages(`resources/list`,e,t,(e,t)=>e.resources.push(...t.resources)):n}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list`),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:`resources/templates/list`,params:e},t);let n=await this._serveFromCache(`resources/templates/list`,void 0,t);return n===void 0?this._listAllPages(`resources/templates/list`,e,t,(e,t)=>e.resourceTemplates.push(...t.resourceTemplates)):n}async _listAllPages(e,t,n,r,i){let a=n?.cacheMode===`bypass`,o=this._cache.captureGeneration(e),s=await this.request({method:e,...t&&{params:{...t}}},n),c=s.nextCursor,l=new Set,u=1;for(;c!==void 0&&!l.has(c);){if(this._listMaxPages!==0&&u>=this._listMaxPages)throw new jO(AO.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});l.add(c);let i=await this.request({method:e,params:{...t,cursor:c}},n);r(s,i),c=i.nextCursor,u++}return delete s.nextCursor,i?.(s),a||await this._cache.write(e,s,o,this._freshness(s)),s}_freshness(e,t){let n=e,r=typeof n.ttlMs==`number`?n.ttlMs:this._defaultCacheTtlMs,i=n.cacheScope===`public`?`public`:`private`;return{expiresAt:this._cache.now()+Math.min(Math.max(0,r),cre),scope:i,params:t}}async _serveFromCache(e,t,n){if(n?.cacheMode===`bypass`||n?.cacheMode===`refresh`)return;let r=await this._cache.read(e,t).catch(e=>void this._reportStoreError(e));if(r!==void 0){if(n?.signal?.aborted){let e=n.signal.reason;throw e instanceof jO?e:new jO(AO.RequestTimeout,String(e))}return r.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(e.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(e){return{ok:!1,compileError:e}}}async _resolveXMcpHeaderScan(e,t){let n=t??await this._cache.toolDefinition(e);return n===void 0?void 0:SA(n.inputSchema)}async readResource(e,t){let n=await this._serveFromCache(`resources/read`,e.uri,t);if(n!==void 0)return n;let r=this._cache.captureGeneration(`resources/read`,e.uri),i=await this.request({method:`resources/read`,params:e},t);if(t?.cacheMode!==`bypass`){let n=this._freshness(i,e.uri);n.expiresAt>this._cache.now()?await this._cache.write(`resources/read`,i,r,n):t?.cacheMode===`refresh`&&await this._cache.evictKey(`resources/read`,e.uri)}return i}async subscribeResource(e,t){return this.request({method:`resources/subscribe`,params:e},t)}async unsubscribeResource(e,t){return this.request({method:`resources/unsubscribe`,params:e},t)}async listen(e,t){if(this.transport===void 0)throw new jO(AO.NotConnected,`Not connected`);let n=this._negotiatedProtocolVersion;if(n===void 0||!LO(n))throw new jO(AO.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${n??`none`}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:`subscriptions/listen`,protocolVersion:n});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof jO?e:new jO(AO.RequestTimeout,String(e))}let r=new AbortController,i=`listen:${this._nextListenId++}`,a=`opening`,o,s,c,l,u=new Promise((e,t)=>{c=e,l=t}),d,f=new Promise(e=>{d=e}),p=e=>{if(a===`closed`)return;let n=a===`opening`;if(o!==void 0&&(clearTimeout(o),o=void 0),`ack`in e){a=`open`,c(e.ack);return}a=`closed`,s!==void 0&&t?.signal?.removeEventListener(`abort`,s),this._listenState.delete(i),r.abort(),d(e.cause),n&&l(e.error??new jO(AO.ConnectionClosed,`subscriptions/listen closed before the server acknowledged`))},m=async()=>{r.abort(),await this.notification({method:`notifications/cancelled`,params:{requestId:i}}).catch(()=>{})},h=async()=>{a!==`closed`&&(p({cause:`local`}),await m())};this._listenState.set(i,{settle:p});let g=t?.timeout??6e4;if(o=setTimeout(()=>{p({cause:`remote`,error:new jO(AO.RequestTimeout,`subscriptions/listen ack timed out`,{timeout:g})}),m().catch(()=>{})},g),t?.signal){let e=t.signal;s=()=>{if(a===`closed`)return;let t=e.reason;p({cause:`local`,error:t instanceof Error?t:Error(String(t??`Aborted`))}),m().catch(()=>{})},e.addEventListener(`abort`,s,{once:!0})}let _={jsonrpc:`2.0`,id:i,method:`subscriptions/listen`,params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}};try{await this.transport.send(_,{requestSignal:r.signal,onRequestStreamEnd:()=>p({cause:`remote`,error:Error(`subscriptions/listen: stream ended`)})})}catch(e){p({cause:`remote`,error:e instanceof Error?e:Error(String(e))})}return{honoredFilter:await u,close:h,closed:f}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let n=Object.hasOwn(vN,e.method)?vN[e.method]:void 0;if(e.method===`notifications/resources/updated`){let t=e.params?.uri;typeof t==`string`&&this._cache.evictKey(`resources/read`,t)}else if(n!==void 0)for(let e of n)this._cache.evict(e);if(e.method===`notifications/subscriptions/acknowledged`){let t=e.params?._meta?.[rT],n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){let t=this._wireCodec().validateNotification(`notifications/subscriptions/acknowledged`,e);n.settle({ack:t.ok?t.value.params.notifications:{}});return}}if(e.method===`notifications/cancelled`){let t=e.params?.requestId,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){n.settle({cause:`remote`,error:Error(`subscriptions/listen: server cancelled the subscription`)});return}}super._onnotification(e,t)}_onresponse(e){let t=e.id,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){gA(e)?n.settle({cause:`remote`,error:Ck.fromError(e.error.code,e.error.message,e.error.data)}):n.settle({cause:`graceful`,error:new jO(AO.ConnectionClosed,`subscriptions/listen: server closed the subscription gracefully before acknowledging`)});return}super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new jO(AO.ConnectionClosed,`Connection closed`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let n=this.getProtocolEra()===`modern`&&uN()!==`browser`,r=async()=>{if(!n)return t;let r;try{r=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(e){this._reportStoreError(e)}if(!r?.valid||r.declarations.length===0)return t;let i=NA(r.declarations,e.arguments);return Object.keys(i).length===0?t:{...t,headers:{...t?.headers,...i}}},i=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)):this._compileOutputValidator(t.toolDefinition),a=()=>{if(i===void 0||i.ok)return;let t=i.compileError,n=(t instanceof Error?t.message:String(t)).slice(0,200);throw new Ck(Sk.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${n}`)};a();let o;try{o=await this.request({method:`tools/call`,params:e},await r())}catch(s){let c=s instanceof Ck&&s.code===-32020;if(!n||!c||t?.toolDefinition!==void 0)throw s;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:`refresh`};await this._cache.evict(`tools/list`),await this.listTools(void 0,l).catch(e=>this._reportStoreError(e)),i=await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)),a(),o=await this.request({method:`tools/call`,params:e},await r())}let s=i!==void 0&&i.ok?i.validator:void 0;if(s){if(o.structuredContent===void 0&&!o.isError)throw new Ck(Sk.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent!==void 0&&!o.isError)try{let e=s(o.structuredContent);if(!e.valid)throw new Ck(Sk.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){throw e instanceof Ck?e:new Ck(Sk.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return o}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug(`Client.listTools() called but server does not advertise tools capability - returning empty list`),{tools:[]};if(e?.cursor!==void 0){let n=await this.request({method:`tools/list`,params:e},t);return this._excludeInvalidXMcpHeaderTools(n),n}let n=await this._serveFromCache(`tools/list`,void 0,t);return n===void 0?this._listAllPages(`tools/list`,e,t,(e,t)=>e.tools.push(...t.tools),e=>this._excludeInvalidXMcpHeaderTools(e)):n}_excludeInvalidXMcpHeaderTools(e){if(this.getProtocolEra()!==`modern`||!this.transport||dN(this.transport)===`stdio`)return;let t=e.tools.filter(e=>{let t=SA(e.inputSchema);return t.valid?!0:(console.warn(`[mcp-sdk] excluding tool '${e.name}' from tools/list: invalid x-mcp-header declaration — ${t.reason}`),!1)});t.length!==e.tools.length&&(e.tools=t)}_setupListChangedHandler(e,t,n,r){let i=PA(eD,n);if(!i.success)throw Error(`Invalid ${e} listChanged options: ${i.error.message}`);if(typeof n.onChanged!=`function`)throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:a,debounceMs:o}=i.data,{onChanged:s}=n,c=async()=>{if(!a){s(null,null);return}try{s(null,await r())}catch(e){s(e instanceof Error?e:Error(String(e)),null)}};this.setNotificationHandler(t,()=>{if(o){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let n=setTimeout(c,o);this._listChangedDebounceTimers.set(e,n)}else c()})}async sendRootsListChanged(){return this.notification({method:`notifications/roots/list_changed`})}};async function Nre(e){let{tokenEndpoint:t,audience:n,resource:r,idToken:i,clientId:a,clientSecret:o,scope:s,fetchFn:c=fetch}=e,l=JM(t),u=new URLSearchParams({grant_type:`urn:ietf:params:oauth:grant-type:token-exchange`,requested_token_type:`urn:ietf:params:oauth:token-type:id-jag`,audience:String(n),resource:String(r),subject_token:i,subject_token_type:`urn:ietf:params:oauth:token-type:id_token`,client_id:a});o&&u.set(`client_secret`,o),s&&u.set(`scope`,s);let d=await c(l,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:u.toString()});if(!d.ok){let e=await d.json().catch(()=>({})),t=vO.safeParse(e);if(t.success){let{error:e,error_description:n}=t.data;throw Error(`Token exchange failed: ${e}${n?` - ${n}`:``}`)}throw Error(`Token exchange failed with status ${d.status}: ${JSON.stringify(e)}`)}let f=_O.safeParse(await d.json());if(!f.success)throw Error(`Invalid token exchange response: ${f.error.message}`);return{jwtAuthGrant:f.data.access_token,expiresIn:f.data.expires_in,scope:f.data.scope}}async function Pre(e){let{idpUrl:t,fetchFn:n=fetch,...r}=e,i=await tN(String(t),{fetchFn:n});if(!i?.token_endpoint)throw Error(`Failed to discover token endpoint for IdP: ${t}`);return Nre({...r,tokenEndpoint:i.token_endpoint,fetchFn:n})}(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return DO(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return DO(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,EO(this,new.target)}});var Fre=`x-mcp-header`,Ire=`Mcp-Param-`,Lre=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Rre=new Set([`string`,`integer`,`boolean`,`number`]),zre=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Bre=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function yN(e){return e.length===0?`<root>`:e.join(`.`)}function bN(e){return typeof e==`object`&&!!e}function xN(e){let t=[],n=new Map,r=(e,i,a)=>{if(!bN(e))return;let o=e;if(`x-mcp-header`in o){if(!a||i.length===0)return`${yN(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Fre];if(typeof e!=`string`||e.length===0)return`${yN(i)}: x-mcp-header MUST be a non-empty string`;if(!Lre.test(e))return`${yN(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!Rre.has(r))return`${yN(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??`<none>`}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(bN(s))for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of zre){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:bN(t)&&Bre.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}function Vre(e){let t=xN(e.inputSchema);return t.valid?t.declarations.map(e=>({path:e.path.join(`.`),header:`${Ire}${e.headerName}`,headerName:e.headerName,type:e.type})):[]}function SN(e){if(!(`type`in e)||e.type===void 0)return`stdio`;let t=e.type;if(t===`stdio`)return`stdio`;if(t===`sse`)return`sse`;if(t===`streamable-http`)return`streamable-http`;throw Error(`Invalid server type: ${t}. Valid types are: stdio, sse, streamable-http`)}function CN(e){return e===`sse`||e===`streamable-http`}function Hre(e){if(e.type===`sse`||e.type===`streamable-http`)return e.url}function wN(e){return e===`disconnected`||e===`error`}var TN={active:!1,status:`ended`,honoredUris:[]},Ure=6e4,Wre=1e3;function EN(e){let t=e?.modernLogLevel??`debug`;return t===`off`?void 0:t}var DN=[`off`,`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`];function Gre(e){return typeof e==`string`&&DN.includes(e)}var Kre=`2026-07-28`;function qre(e){switch(e){case`auto`:return{mode:`auto`};case`modern`:return{mode:{pin:Kre}};case`legacy`:return{mode:`legacy`}}}function ON(e){return e}function Jre(e,t){if(!e)return e;if(t.type===`number`||t.type===`integer`)return Number(e);if(t.type===`boolean`)return e.toLowerCase()===`true`;if(t.type===`object`||t.type===`array`)try{return JSON.parse(e)}catch{return e}return e}function kN(e,t){let n={},r=e.inputSchema?.properties||{};for(let[e,i]of Object.entries(t)){let t=r[e];t?n[e]=Jre(i,t):n[e]=i}return n}function Yre(e){let t={};for(let[n,r]of Object.entries(e))typeof r==`string`?t[n]=r:r==null?t[n]=String(r):t[n]=JSON.stringify(r);return t}var Xre=new Set([`stdio`,`sse`,`streamable-http`]),Zre=new Set([`legacy`,`auto`,`modern`]);function Qre(e){return typeof e==`string`&&Zre.has(e)}function AN(e){let t=e.type,n;return n=typeof t==`string`?t===`http`?`streamable-http`:Xre.has(t)?t:`stdio`:`stdio`,{...e,type:n}}function jN(e){return Array.isArray(e)?e.filter(e=>typeof e?.uri==`string`?e.uri.trim()!==``:(console.warn("Dropping root without a string `uri`:",e),!1)).map(e=>{let t=e.name;t!==void 0&&typeof t!=`string`&&console.warn("Dropping non-string `name` on root:",e);let n=typeof t==`string`?t.trim():void 0,{name:r,...i}=e;return n?{...i,name:n}:i}):(console.warn("Ignoring `roots`: expected an array, got",typeof e),[])}function $re(e){return e?Object.entries(e).map(([e,t])=>({key:e,value:t})):[]}function eie(e){if(!(e.headers!==void 0||e.metadata!==void 0||e.connectionTimeout!==void 0||e.requestTimeout!==void 0||e.taskTtl!==void 0||e.autoRefreshOnListChanged!==void 0||e.paginatedLists!==void 0||e.advertisedExtensions!==void 0||e.maxFetchRequests!==void 0||e.oauth!==void 0||e.roots!==void 0||e.protocolEra!==void 0||e.modernLogLevel!==void 0||e.env!==void 0||e.cwd!==void 0))return;let t={headers:e.headers?Object.entries(e.headers).map(([e,t])=>({key:e,value:t})):[],env:$re(e.env),metadata:e.metadata??[],connectionTimeout:e.connectionTimeout??0,requestTimeout:e.requestTimeout??0,taskTtl:e.taskTtl??6e4,autoRefreshOnListChanged:e.autoRefreshOnListChanged??!1,paginatedLists:e.paginatedLists??!1,maxFetchRequests:e.maxFetchRequests??1e3,roots:e.roots??[]};return Qre(e.protocolEra)&&(t.protocolEra=e.protocolEra),Gre(e.modernLogLevel)&&(t.modernLogLevel=e.modernLogLevel),e.advertisedExtensions&&Object.keys(e.advertisedExtensions).length>0&&(t.advertisedExtensions={...e.advertisedExtensions}),e.oauth?.clientId&&(t.oauthClientId=e.oauth.clientId),e.oauth?.clientSecret&&(t.oauthClientSecret=e.oauth.clientSecret),e.oauth?.scopes&&(t.oauthScopes=e.oauth.scopes),e.oauth?.onInsufficientScope&&(t.oauthOnInsufficientScope=e.oauth.onInsufficientScope),e.oauth?.enterpriseManaged===!0&&(t.enterpriseManaged=!0),e.cwd&&(t.cwd=e.cwd),t}function tie(e){let t={},n={};for(let{key:t,value:r}of e.headers)t.trim()!==``&&(n[t]=r);Object.keys(n).length>0&&(t.headers=n);let r=e.metadata.filter(e=>e.key.trim()!==``);r.length>0&&(t.metadata=r),e.connectionTimeout>0&&(t.connectionTimeout=e.connectionTimeout),e.requestTimeout>0&&(t.requestTimeout=e.requestTimeout),e.taskTtl>0&&e.taskTtl!==6e4&&(t.taskTtl=e.taskTtl),e.autoRefreshOnListChanged&&(t.autoRefreshOnListChanged=!0),e.paginatedLists&&(t.paginatedLists=!0),e.advertisedExtensions&&Object.keys(e.advertisedExtensions).length>0&&(t.advertisedExtensions={...e.advertisedExtensions}),e.protocolEra!==void 0&&e.protocolEra!==`legacy`&&(t.protocolEra=e.protocolEra),e.modernLogLevel!==void 0&&e.modernLogLevel!==`debug`&&(t.modernLogLevel=e.modernLogLevel),e.maxFetchRequests!==1e3&&(t.maxFetchRequests=e.maxFetchRequests);let i={};e.oauthClientId&&(i.clientId=e.oauthClientId),e.oauthClientSecret&&(i.clientSecret=e.oauthClientSecret),e.oauthScopes&&(i.scopes=e.oauthScopes),e.oauthOnInsufficientScope&&(i.onInsufficientScope=e.oauthOnInsufficientScope),e.enterpriseManaged===!0&&(i.enterpriseManaged=!0),Object.keys(i).length>0&&(t.oauth=i);let a=jN(e.roots);return a.length>0&&(t.roots=a),t}var nie=new Set(Object.keys({headers:!0,metadata:!0,protocolEra:!0,modernLogLevel:!0,connectionTimeout:!0,requestTimeout:!0,taskTtl:!0,autoRefreshOnListChanged:!0,paginatedLists:!0,advertisedExtensions:!0,maxFetchRequests:!0,oauth:!0,roots:!0}));function rie(e){return Object.entries(e.mcpServers).map(([e,t])=>{let n={},r={},i=ON(n);for(let[e,n]of Object.entries(ON(t)))nie.has(e)?i[e]=n:r[e]=n;let a=AN(r),o={id:e,name:e,config:a,connection:{status:`disconnected`}},s=a.type===`stdio`||a.type===void 0?a:void 0,c=eie({...n,env:s?.env,cwd:s?.cwd});return c!==void 0&&(o.settings=c),o})}function iie(e){let t={};for(let n of e){let e={...n.config};n.settings!==void 0&&Object.assign(e,tie(n.settings)),t[n.id]=e}return{mcpServers:t}}function aie(e){return JSON.stringify(iie(e),null,2)}var oie=class{baseTransport;callbacks;negotiatedProtocolVersion;hooks;constructor(e,t,n={}){this.baseTransport=e,this.callbacks=t,this.hooks=n}async start(){return this.baseTransport.start()}async send(e,t){return`id`in e&&e.id!==null&&e.id!==void 0?`result`in e||`error`in e?this.callbacks.trackResponse?.(e,`client`):`method`in e&&this.callbacks.trackRequest?.(e,`client`):`method`in e&&this.callbacks.trackNotification?.(e,`client`),this.baseTransport.send(e,t)}async close(){return this.baseTransport.close()}get onclose(){return this.baseTransport.onclose}set onclose(e){this.baseTransport.onclose=e}get onerror(){return this.baseTransport.onerror}set onerror(e){this.baseTransport.onerror=e}get onmessage(){return this.baseTransport.onmessage}set onmessage(e){e?this.baseTransport.onmessage=(t,n)=>{if(`id`in t&&t.id!==null&&t.id!==void 0)if(`result`in t||`error`in t){if(this.callbacks.trackResponse?.(t,`server`),this.hooks.consumeIncomingResponse?.(t))return;if(this.hooks.rewriteIncomingResult&&`result`in t){let r=this.hooks.rewriteIncomingResult(t);if(r!==t){e(r,n);return}}}else`method`in t&&this.callbacks.trackRequest?.(t,`server`);else`method`in t&&this.callbacks.trackNotification?.(t,`server`);e(t,n)}:this.baseTransport.onmessage=void 0}get sessionId(){return this.baseTransport.sessionId}setProtocolVersion(e){this.negotiatedProtocolVersion=e,this.baseTransport.setProtocolVersion?.(e)}get protocolVersion(){return this.negotiatedProtocolVersion}};Object.freeze({status:`aborted`});function X(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 MN=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},NN=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},PN={};function FN(e){return e&&Object.assign(PN,e),PN}function IN(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 LN(e,t){return typeof t==`bigint`?t.toString():t}function RN(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function zN(e){return e==null}function BN(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function sie(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var VN=Symbol(`evaluating`);function HN(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==VN)return r===void 0&&(r=VN,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function UN(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function WN(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function GN(e){return JSON.stringify(e)}function cie(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var KN=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function qN(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var lie=RN(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function JN(e){if(qN(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(qN(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function YN(e){return JN(e)?{...e}:Array.isArray(e)?[...e]:e}var uie=new Set([`string`,`number`,`symbol`]);function XN(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ZN(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function QN(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 die(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var fie={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function pie(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 ZN(e,WN(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 UN(this,`shape`,e),e},checks:[]}))}function mie(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 ZN(e,WN(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 UN(this,`shape`,r),r},checks:[]}))}function hie(e,t){if(!JN(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 ZN(e,WN(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return UN(this,`shape`,n),n}}))}function gie(e,t){if(!JN(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return ZN(e,WN(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return UN(this,`shape`,n),n}}))}function _ie(e,t){return ZN(e,WN(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return UN(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function vie(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 ZN(t,WN(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 UN(this,`shape`,i),i},checks:[]}))}function yie(e,t,n){return ZN(t,WN(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 UN(this,`shape`,i),i}}))}function $N(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 eP(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function tP(e){return typeof e==`string`?e:e?.message}function nP(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=tP(e.inst?._zod.def?.error?.(e))??tP(t?.error?.(e))??tP(n.customError?.(e))??tP(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function rP(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function iP(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var aP=(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,LN,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},oP=X(`$ZodError`,aP),sP=X(`$ZodError`,aP,{Parent:Error});function bie(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 xie(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var cP=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new MN;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>nP(e,a,FN())));throw KN(t,i?.callee),t}return o.value},lP=e=>async(t,n,r,i)=>{let a=r?Object.assign(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=>nP(e,a,FN())));throw KN(t,i?.callee),t}return o.value},uP=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 MN;return a.issues.length?{success:!1,error:new(e??oP)(a.issues.map(e=>nP(e,i,FN())))}:{success:!0,data:a.value}},Sie=uP(sP),dP=e=>async(t,n,r)=>{let i=r?Object.assign(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=>nP(e,i,FN())))}:{success:!0,data:a.value}},Cie=dP(sP),wie=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return cP(e)(t,n,i)},Tie=e=>(t,n,r)=>cP(e)(t,n,r),Eie=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return lP(e)(t,n,i)},Die=e=>async(t,n,r)=>lP(e)(t,n,r),Oie=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return uP(e)(t,n,i)},kie=e=>(t,n,r)=>uP(e)(t,n,r),Aie=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return dP(e)(t,n,i)},jie=e=>async(t,n,r)=>dP(e)(t,n,r),Mie=/^[cC][^\s-]{8,}$/,Nie=/^[0-9a-z]+$/,Pie=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Fie=/^[0-9a-vA-V]{20}$/,Iie=/^[A-Za-z0-9]{27}$/,Lie=/^[a-zA-Z0-9_-]{21}$/,Rie=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zie=/^([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})$/,fP=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)$/,Bie=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vie=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Hie(){return new RegExp(Vie,`u`)}var Uie=/^(?:(?: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])$/,Wie=/^(([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}|:))$/,Gie=/^((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])$/,Kie=/^(([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])$/,qie=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pP=/^[A-Za-z0-9_-]*$/,Jie=/^\+[1-9]\d{6,14}$/,mP=`(?:(?:\\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])))`,Yie=RegExp(`^${mP}$`);function hP(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 Xie(e){return RegExp(`^${hP(e)}$`)}function Zie(e){let t=hP({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(`^${mP}T(?:${r})$`)}var Qie=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},$ie=/^-?\d+$/,gP=/^-?\d+(?:\.\d+)?$/,eae=/^(?:true|false)$/i,tae=/^null$/i,nae=/^undefined$/i,rae=/^[^A-Z]*$/,iae=/^[^a-z]*$/,_P=X(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vP={number:`number`,bigint:`bigint`,object:`date`},yP=X(`$ZodCheckLessThan`,(e,t)=>{_P.init(e,t);let n=vP[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bP=X(`$ZodCheckGreaterThan`,(e,t)=>{_P.init(e,t);let n=vP[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),aae=X(`$ZodCheckMultipleOf`,(e,t)=>{_P.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):sie(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),oae=X(`$ZodCheckNumberFormat`,(e,t)=>{_P.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=fie[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=$ie)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),sae=X(`$ZodCheckMaxLength`,(e,t)=>{var n;_P.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!zN(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=rP(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),cae=X(`$ZodCheckMinLength`,(e,t)=>{var n;_P.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!zN(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=rP(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),lae=X(`$ZodCheckLengthEquals`,(e,t)=>{var n;_P.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!zN(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=rP(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})}}),xP=X(`$ZodCheckStringFormat`,(e,t)=>{var n,r;_P.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=()=>{})}),uae=X(`$ZodCheckRegex`,(e,t)=>{xP.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})}}),dae=X(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=rae,xP.init(e,t)}),fae=X(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=iae,xP.init(e,t)}),pae=X(`$ZodCheckIncludes`,(e,t)=>{_P.init(e,t);let n=XN(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})}}),mae=X(`$ZodCheckStartsWith`,(e,t)=>{_P.init(e,t);let n=RegExp(`^${XN(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})}}),hae=X(`$ZodCheckEndsWith`,(e,t)=>{_P.init(e,t);let n=RegExp(`.*${XN(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})}}),gae=X(`$ZodCheckOverwrite`,(e,t)=>{_P.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),_ae=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(`
|
|
102
|
-
`).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(`
|
|
103
|
-
`))}},vae={major:4,minor:3,patch:6},SP=X(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=vae;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=$N(e),i;for(let a of t){if(a._zod.def.when){if(!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 MN;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=$N(e,t))});else{if(e.issues.length===t)continue;r||=$N(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if($N(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new MN;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 MN;return o.then(e=>t(e,r,a))}return t(o,r,a)}}HN(e,`~standard`,()=>({validate:t=>{try{let n=Sie(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Cie(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),CP=X(`$ZodString`,(e,t)=>{SP.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qie(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}}),wP=X(`$ZodStringFormat`,(e,t)=>{xP.init(e,t),CP.init(e,t)}),yae=X(`$ZodGUID`,(e,t)=>{t.pattern??=zie,wP.init(e,t)}),bae=X(`$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??=fP(e)}else t.pattern??=fP();wP.init(e,t)}),xae=X(`$ZodEmail`,(e,t)=>{t.pattern??=Bie,wP.init(e,t)}),Sae=X(`$ZodURL`,(e,t)=>{wP.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),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})}}}),Cae=X(`$ZodEmoji`,(e,t)=>{t.pattern??=Hie(),wP.init(e,t)}),wae=X(`$ZodNanoID`,(e,t)=>{t.pattern??=Lie,wP.init(e,t)}),Tae=X(`$ZodCUID`,(e,t)=>{t.pattern??=Mie,wP.init(e,t)}),Eae=X(`$ZodCUID2`,(e,t)=>{t.pattern??=Nie,wP.init(e,t)}),Dae=X(`$ZodULID`,(e,t)=>{t.pattern??=Pie,wP.init(e,t)}),Oae=X(`$ZodXID`,(e,t)=>{t.pattern??=Fie,wP.init(e,t)}),kae=X(`$ZodKSUID`,(e,t)=>{t.pattern??=Iie,wP.init(e,t)}),Aae=X(`$ZodISODateTime`,(e,t)=>{t.pattern??=Zie(t),wP.init(e,t)}),jae=X(`$ZodISODate`,(e,t)=>{t.pattern??=Yie,wP.init(e,t)}),Mae=X(`$ZodISOTime`,(e,t)=>{t.pattern??=Xie(t),wP.init(e,t)}),Nae=X(`$ZodISODuration`,(e,t)=>{t.pattern??=Rie,wP.init(e,t)}),Pae=X(`$ZodIPv4`,(e,t)=>{t.pattern??=Uie,wP.init(e,t),e._zod.bag.format=`ipv4`}),Fae=X(`$ZodIPv6`,(e,t)=>{t.pattern??=Wie,wP.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})}}}),Iae=X(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Gie,wP.init(e,t)}),Lae=X(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Kie,wP.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 TP(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Rae=X(`$ZodBase64`,(e,t)=>{t.pattern??=qie,wP.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{TP(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function zae(e){if(!pP.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return TP(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Bae=X(`$ZodBase64URL`,(e,t)=>{t.pattern??=pP,wP.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{zae(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Vae=X(`$ZodE164`,(e,t)=>{t.pattern??=Jie,wP.init(e,t)});function Hae(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 Uae=X(`$ZodJWT`,(e,t)=>{wP.init(e,t),e._zod.check=n=>{Hae(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),EP=X(`$ZodNumber`,(e,t)=>{SP.init(e,t),e._zod.pattern=e._zod.bag.pattern??gP,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Wae=X(`$ZodNumberFormat`,(e,t)=>{oae.init(e,t),EP.init(e,t)}),Gae=X(`$ZodBoolean`,(e,t)=>{SP.init(e,t),e._zod.pattern=eae,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Kae=X(`$ZodUndefined`,(e,t)=>{SP.init(e,t),e._zod.pattern=nae,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),qae=X(`$ZodNull`,(e,t)=>{SP.init(e,t),e._zod.pattern=tae,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Jae=X(`$ZodUnknown`,(e,t)=>{SP.init(e,t),e._zod.parse=e=>e}),Yae=X(`$ZodNever`,(e,t)=>{SP.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function DP(e,t,n){e.issues.length&&t.issues.push(...eP(n,e.issues)),t.value[n]=e.value}var Xae=X(`$ZodArray`,(e,t)=>{SP.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=>DP(t,n,e))):DP(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function OP(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...eP(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function kP(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=die(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function AP(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(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=>OP(e,n,i,t,u))):OP(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Zae=X(`$ZodObject`,(e,t)=>{if(SP.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=RN(()=>kP(t));HN(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=qN,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.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>OP(n,t,e,s,r))):OP(i,t,e,s,r)}return i?AP(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Qae=X(`$ZodObjectJIT`,(e,t)=>{Zae.init(e,t);let n=e._zod.parse,r=RN(()=>kP(t)),i=e=>{let t=new _ae([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=GN(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=GN(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
104
|
-
if (${n}.issues.length) {
|
|
105
|
-
if (${o} in input) {
|
|
106
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
107
|
-
...iss,
|
|
108
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
109
|
-
})));
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (${n}.value === undefined) {
|
|
114
|
-
if (${o} in input) {
|
|
115
|
-
newResult[${o}] = undefined;
|
|
116
|
-
}
|
|
117
|
-
} else {
|
|
118
|
-
newResult[${o}] = ${n}.value;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
`):t.write(`
|
|
122
|
-
if (${n}.issues.length) {
|
|
123
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
124
|
-
...iss,
|
|
125
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
126
|
-
})));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (${n}.value === undefined) {
|
|
130
|
-
if (${o} in input) {
|
|
131
|
-
newResult[${o}] = undefined;
|
|
132
|
-
}
|
|
133
|
-
} else {
|
|
134
|
-
newResult[${o}] = ${n}.value;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=qN,s=!PN.jitless,c=s&&lie.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?AP([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function jP(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=>!$N(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=>nP(e,r,FN())))}),t)}var MP=X(`$ZodUnion`,(e,t)=>{SP.init(e,t),HN(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),HN(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),HN(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),HN(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=>BN(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>jP(t,i,e,a)):jP(s,i,e,a)}}),$ae=X(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,MP.init(e,t);let n=e._zod.parse;HN(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=RN(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!qN(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),eoe=X(`$ZodIntersection`,(e,t)=>{SP.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])=>PP(e,t,n)):PP(e,i,a)}});function NP(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(JN(e)&&JN(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=NP(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=NP(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 PP(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}),$N(e))return e;let o=NP(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var toe=X(`$ZodRecord`,(e,t)=>{SP.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!JN(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...eP(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...eP(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&gP.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>nP(e,r,FN())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...eP(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...eP(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),noe=X(`$ZodEnum`,(e,t)=>{SP.init(e,t);let n=IN(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>uie.has(typeof e)).map(e=>typeof e==`string`?XN(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}}),roe=X(`$ZodLiteral`,(e,t)=>{if(SP.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?XN(e):e?XN(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ioe=X(`$ZodTransform`,(e,t)=>{SP.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new NN(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));if(i instanceof Promise)throw new MN;return n.value=i,n}});function FP(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var IP=X(`$ZodOptional`,(e,t)=>{SP.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,HN(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),HN(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${BN(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>FP(t,e.value)):FP(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),aoe=X(`$ZodExactOptional`,(e,t)=>{IP.init(e,t),HN(e._zod,`values`,()=>t.innerType._zod.values),HN(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ooe=X(`$ZodNullable`,(e,t)=>{SP.init(e,t),HN(e._zod,`optin`,()=>t.innerType._zod.optin),HN(e._zod,`optout`,()=>t.innerType._zod.optout),HN(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${BN(e.source)}|null)$`):void 0}),HN(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)}),soe=X(`$ZodDefault`,(e,t)=>{SP.init(e,t),e._zod.optin=`optional`,HN(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=>LP(e,t)):LP(r,t)}});function LP(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var coe=X(`$ZodPrefault`,(e,t)=>{SP.init(e,t),e._zod.optin=`optional`,HN(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))}),loe=X(`$ZodNonOptional`,(e,t)=>{SP.init(e,t),HN(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=>RP(t,e)):RP(i,e)}});function RP(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 uoe=X(`$ZodCatch`,(e,t)=>{SP.init(e,t),HN(e._zod,`optin`,()=>t.innerType._zod.optin),HN(e._zod,`optout`,()=>t.innerType._zod.optout),HN(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=>nP(e,n,FN()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>nP(e,n,FN()))},input:e.value}),e.issues=[]),e)}}),doe=X(`$ZodPipe`,(e,t)=>{SP.init(e,t),HN(e._zod,`values`,()=>t.in._zod.values),HN(e._zod,`optin`,()=>t.in._zod.optin),HN(e._zod,`optout`,()=>t.out._zod.optout),HN(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=>zP(e,t.in,n)):zP(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>zP(e,t.out,n)):zP(r,t.out,n)}});function zP(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var foe=X(`$ZodReadonly`,(e,t)=>{SP.init(e,t),HN(e._zod,`propValues`,()=>t.innerType._zod.propValues),HN(e._zod,`values`,()=>t.innerType._zod.values),HN(e._zod,`optin`,()=>t.innerType?._zod?.optin),HN(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(BP):BP(r)}});function BP(e){return e.value=Object.freeze(e.value),e}var poe=X(`$ZodCustom`,(e,t)=>{_P.init(e,t),SP.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=>VP(t,n,r,e));VP(i,n,r,e)}});function VP(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(iP(e))}}var HP,moe=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 hoe(){return new moe}(HP=globalThis).__zod_globalRegistry??(HP.__zod_globalRegistry=hoe());var UP=globalThis.__zod_globalRegistry;function goe(e,t){return new e({type:`string`,...QN(t)})}function _oe(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...QN(t)})}function WP(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...QN(t)})}function voe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...QN(t)})}function yoe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...QN(t)})}function boe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...QN(t)})}function xoe(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...QN(t)})}function Soe(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...QN(t)})}function Coe(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...QN(t)})}function woe(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...QN(t)})}function Toe(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...QN(t)})}function Eoe(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...QN(t)})}function Doe(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...QN(t)})}function Ooe(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...QN(t)})}function koe(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...QN(t)})}function Aoe(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...QN(t)})}function joe(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...QN(t)})}function Moe(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...QN(t)})}function Noe(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...QN(t)})}function Poe(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...QN(t)})}function Foe(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...QN(t)})}function Ioe(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...QN(t)})}function Loe(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...QN(t)})}function Roe(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...QN(t)})}function zoe(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...QN(t)})}function Boe(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...QN(t)})}function Voe(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...QN(t)})}function Hoe(e,t){return new e({type:`number`,checks:[],...QN(t)})}function Uoe(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...QN(t)})}function Woe(e,t){return new e({type:`boolean`,...QN(t)})}function Goe(e,t){return new e({type:`undefined`,...QN(t)})}function Koe(e,t){return new e({type:`null`,...QN(t)})}function qoe(e){return new e({type:`unknown`})}function Joe(e,t){return new e({type:`never`,...QN(t)})}function GP(e,t){return new yP({check:`less_than`,...QN(t),value:e,inclusive:!1})}function KP(e,t){return new yP({check:`less_than`,...QN(t),value:e,inclusive:!0})}function qP(e,t){return new bP({check:`greater_than`,...QN(t),value:e,inclusive:!1})}function JP(e,t){return new bP({check:`greater_than`,...QN(t),value:e,inclusive:!0})}function YP(e,t){return new aae({check:`multiple_of`,...QN(t),value:e})}function XP(e,t){return new sae({check:`max_length`,...QN(t),maximum:e})}function ZP(e,t){return new cae({check:`min_length`,...QN(t),minimum:e})}function QP(e,t){return new lae({check:`length_equals`,...QN(t),length:e})}function Yoe(e,t){return new uae({check:`string_format`,format:`regex`,...QN(t),pattern:e})}function Xoe(e){return new dae({check:`string_format`,format:`lowercase`,...QN(e)})}function Zoe(e){return new fae({check:`string_format`,format:`uppercase`,...QN(e)})}function Qoe(e,t){return new pae({check:`string_format`,format:`includes`,...QN(t),includes:e})}function $oe(e,t){return new mae({check:`string_format`,format:`starts_with`,...QN(t),prefix:e})}function ese(e,t){return new hae({check:`string_format`,format:`ends_with`,...QN(t),suffix:e})}function $P(e){return new gae({check:`overwrite`,tx:e})}function tse(e){return $P(t=>t.normalize(e))}function nse(){return $P(e=>e.trim())}function rse(){return $P(e=>e.toLowerCase())}function ise(){return $P(e=>e.toUpperCase())}function ase(){return $P(e=>cie(e))}function ose(e,t,n){return new e({type:`array`,element:t,...QN(n)})}function sse(e,t,n){let r=QN(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function cse(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...QN(n)})}function lse(e){let t=use(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(iP(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(iP(r))}},e(n.value,n)));return t}function use(e,t){let n=new _P({check:`custom`,...QN(t)});return n._zod.check=e,n}function eF(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??UP,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 tF(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,tF(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`&&iF(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function nF(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>
|
|
138
|
-
|
|
139
|
-
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 rF(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.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:aF(t,`input`,e.processors),output:aF(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function iF(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 iF(r.element,n);if(r.type===`set`)return iF(r.valueType,n);if(r.type===`lazy`)return iF(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 iF(r.innerType,n);if(r.type===`intersection`)return iF(r.left,n)||iF(r.right,n);if(r.type===`record`||r.type===`map`)return iF(r.keyType,n)||iF(r.valueType,n);if(r.type===`pipe`)return iF(r.in,n)||iF(r.out,n);if(r.type===`object`){for(let e in r.shape)if(iF(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(iF(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(iF(e,n))return!0;return!!(r.rest&&iF(r.rest,n))}return!1}var dse=(e,t={})=>n=>{let r=eF({...n,processors:t});return tF(e,r),nF(r,e),rF(r,e)},aF=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=eF({...i??{},target:a,io:t,processors:n});return tF(e,o),nF(o,e),rF(o,e)},fse={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},pse=(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=fse[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}))])}},mse=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},hse=(e,t,n,r)=>{n.type=`boolean`},gse=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},_se=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},vse=(e,t,n,r)=>{n.not={}},yse=(e,t,n,r)=>{let i=e._zod.def,a=IN(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},bse=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},xse=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Sse=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Cse=(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=tF(a.element,t,{...r,path:[...r.path,`items`]})},wse=(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]=tF(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=tF(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Tse=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>tF(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ese=(e,t,n,r)=>{let i=e._zod.def,a=tF(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=tF(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]]},Dse=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=tF(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=tF(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=tF(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ose=(e,t,n,r)=>{let i=e._zod.def,a=tF(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`}]},kse=(e,t,n,r)=>{let i=e._zod.def;tF(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ase=(e,t,n,r)=>{let i=e._zod.def;tF(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},jse=(e,t,n,r)=>{let i=e._zod.def;tF(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)))},Mse=(e,t,n,r)=>{let i=e._zod.def;tF(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},Nse=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;tF(a,t,r);let o=t.seen.get(e);o.ref=a},Pse=(e,t,n,r)=>{let i=e._zod.def;tF(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},oF=(e,t,n,r)=>{let i=e._zod.def;tF(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Fse=X(`ZodISODateTime`,(e,t)=>{Aae.init(e,t),EF.init(e,t)});function sF(e){return Roe(Fse,e)}var Ise=X(`ZodISODate`,(e,t)=>{jae.init(e,t),EF.init(e,t)});function Lse(e){return zoe(Ise,e)}var Rse=X(`ZodISOTime`,(e,t)=>{Mae.init(e,t),EF.init(e,t)});function zse(e){return Boe(Rse,e)}var Bse=X(`ZodISODuration`,(e,t)=>{Nae.init(e,t),EF.init(e,t)});function Vse(e){return Voe(Bse,e)}var cF=(e,t)=>{oP.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>xie(e,t)},flatten:{value:t=>bie(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,LN,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,LN,2)}},isEmpty:{get(){return e.issues.length===0}}})},lF=X(`ZodError`,cF),uF=X(`ZodError`,cF,{Parent:Error}),dF=cP(uF),fF=lP(uF),pF=uP(uF),mF=dP(uF),hF=wie(uF),gF=Tie(uF),_F=Eie(uF),vF=Die(uF),yF=Oie(uF),bF=kie(uF),xF=Aie(uF),SF=jie(uF),CF=X(`ZodType`,(e,t)=>(SP.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:aF(e,`input`),output:aF(e,`output`)}}),e.toJSONSchema=dse(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(WN(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>ZN(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>dF(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>pF(e,t,n),e.parseAsync=async(t,n)=>fF(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>mF(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>hF(e,t,n),e.decode=(t,n)=>gF(e,t,n),e.encodeAsync=async(t,n)=>_F(e,t,n),e.decodeAsync=async(t,n)=>vF(e,t,n),e.safeEncode=(t,n)=>yF(e,t,n),e.safeDecode=(t,n)=>bF(e,t,n),e.safeEncodeAsync=async(t,n)=>xF(e,t,n),e.safeDecodeAsync=async(t,n)=>SF(e,t,n),e.refine=(t,n)=>e.check(UI(t,n)),e.superRefine=t=>e.check(WI(t)),e.overwrite=t=>e.check($P(t)),e.optional=()=>wI(e),e.exactOptional=()=>EI(e),e.nullable=()=>OI(e),e.nullish=()=>wI(OI(e)),e.nonoptional=t=>PI(e,t),e.array=()=>sI(e),e.or=t=>dI([e,t]),e.and=t=>hI(e,t),e.transform=t=>RI(e,SI(t)),e.default=t=>AI(e,t),e.prefault=t=>MI(e,t),e.catch=t=>II(e,t),e.pipe=t=>RI(e,t),e.readonly=()=>BI(e),e.describe=t=>{let n=e.clone();return UP.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return UP.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return UP.get(e);let n=e.clone();return UP.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),wF=X(`_ZodString`,(e,t)=>{CP.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pse(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Yoe(...t)),e.includes=(...t)=>e.check(Qoe(...t)),e.startsWith=(...t)=>e.check($oe(...t)),e.endsWith=(...t)=>e.check(ese(...t)),e.min=(...t)=>e.check(ZP(...t)),e.max=(...t)=>e.check(XP(...t)),e.length=(...t)=>e.check(QP(...t)),e.nonempty=(...t)=>e.check(ZP(1,...t)),e.lowercase=t=>e.check(Xoe(t)),e.uppercase=t=>e.check(Zoe(t)),e.trim=()=>e.check(nse()),e.normalize=(...t)=>e.check(tse(...t)),e.toLowerCase=()=>e.check(rse()),e.toUpperCase=()=>e.check(ise()),e.slugify=()=>e.check(ase())}),TF=X(`ZodString`,(e,t)=>{CP.init(e,t),wF.init(e,t),e.email=t=>e.check(_oe(DF,t)),e.url=t=>e.check(Soe(AF,t)),e.jwt=t=>e.check(Loe(GF,t)),e.emoji=t=>e.check(Coe(jF,t)),e.guid=t=>e.check(WP(OF,t)),e.uuid=t=>e.check(voe(kF,t)),e.uuidv4=t=>e.check(yoe(kF,t)),e.uuidv6=t=>e.check(boe(kF,t)),e.uuidv7=t=>e.check(xoe(kF,t)),e.nanoid=t=>e.check(woe(MF,t)),e.guid=t=>e.check(WP(OF,t)),e.cuid=t=>e.check(Toe(NF,t)),e.cuid2=t=>e.check(Eoe(PF,t)),e.ulid=t=>e.check(Doe(FF,t)),e.base64=t=>e.check(Poe(HF,t)),e.base64url=t=>e.check(Foe(UF,t)),e.xid=t=>e.check(Ooe(IF,t)),e.ksuid=t=>e.check(koe(LF,t)),e.ipv4=t=>e.check(Aoe(RF,t)),e.ipv6=t=>e.check(joe(zF,t)),e.cidrv4=t=>e.check(Moe(BF,t)),e.cidrv6=t=>e.check(Noe(VF,t)),e.e164=t=>e.check(Ioe(WF,t)),e.datetime=t=>e.check(sF(t)),e.date=t=>e.check(Lse(t)),e.time=t=>e.check(zse(t)),e.duration=t=>e.check(Vse(t))});function Z(e){return goe(TF,e)}var EF=X(`ZodStringFormat`,(e,t)=>{wP.init(e,t),wF.init(e,t)}),DF=X(`ZodEmail`,(e,t)=>{xae.init(e,t),EF.init(e,t)}),OF=X(`ZodGUID`,(e,t)=>{yae.init(e,t),EF.init(e,t)}),kF=X(`ZodUUID`,(e,t)=>{bae.init(e,t),EF.init(e,t)}),AF=X(`ZodURL`,(e,t)=>{Sae.init(e,t),EF.init(e,t)}),jF=X(`ZodEmoji`,(e,t)=>{Cae.init(e,t),EF.init(e,t)}),MF=X(`ZodNanoID`,(e,t)=>{wae.init(e,t),EF.init(e,t)}),NF=X(`ZodCUID`,(e,t)=>{Tae.init(e,t),EF.init(e,t)}),PF=X(`ZodCUID2`,(e,t)=>{Eae.init(e,t),EF.init(e,t)}),FF=X(`ZodULID`,(e,t)=>{Dae.init(e,t),EF.init(e,t)}),IF=X(`ZodXID`,(e,t)=>{Oae.init(e,t),EF.init(e,t)}),LF=X(`ZodKSUID`,(e,t)=>{kae.init(e,t),EF.init(e,t)}),RF=X(`ZodIPv4`,(e,t)=>{Pae.init(e,t),EF.init(e,t)}),zF=X(`ZodIPv6`,(e,t)=>{Fae.init(e,t),EF.init(e,t)}),BF=X(`ZodCIDRv4`,(e,t)=>{Iae.init(e,t),EF.init(e,t)}),VF=X(`ZodCIDRv6`,(e,t)=>{Lae.init(e,t),EF.init(e,t)}),HF=X(`ZodBase64`,(e,t)=>{Rae.init(e,t),EF.init(e,t)}),UF=X(`ZodBase64URL`,(e,t)=>{Bae.init(e,t),EF.init(e,t)}),WF=X(`ZodE164`,(e,t)=>{Vae.init(e,t),EF.init(e,t)}),GF=X(`ZodJWT`,(e,t)=>{Uae.init(e,t),EF.init(e,t)}),KF=X(`ZodNumber`,(e,t)=>{EP.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mse(e,t,n,r),e.gt=(t,n)=>e.check(qP(t,n)),e.gte=(t,n)=>e.check(JP(t,n)),e.min=(t,n)=>e.check(JP(t,n)),e.lt=(t,n)=>e.check(GP(t,n)),e.lte=(t,n)=>e.check(KP(t,n)),e.max=(t,n)=>e.check(KP(t,n)),e.int=t=>e.check(YF(t)),e.safe=t=>e.check(YF(t)),e.positive=t=>e.check(qP(0,t)),e.nonnegative=t=>e.check(JP(0,t)),e.negative=t=>e.check(GP(0,t)),e.nonpositive=t=>e.check(KP(0,t)),e.multipleOf=(t,n)=>e.check(YP(t,n)),e.step=(t,n)=>e.check(YP(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function qF(e){return Hoe(KF,e)}var JF=X(`ZodNumberFormat`,(e,t)=>{Wae.init(e,t),KF.init(e,t)});function YF(e){return Uoe(JF,e)}var XF=X(`ZodBoolean`,(e,t)=>{Gae.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hse(e,t,n,r)});function ZF(e){return Woe(XF,e)}var QF=X(`ZodUndefined`,(e,t)=>{Kae.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_se(e,t,n,r)});function $F(e){return Goe(QF,e)}var eI=X(`ZodNull`,(e,t)=>{qae.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gse(e,t,n,r)});function tI(e){return Koe(eI,e)}var nI=X(`ZodUnknown`,(e,t)=>{Jae.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function rI(){return qoe(nI)}var iI=X(`ZodNever`,(e,t)=>{Yae.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vse(e,t,n,r)});function aI(e){return Joe(iI,e)}var oI=X(`ZodArray`,(e,t)=>{Xae.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cse(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(ZP(t,n)),e.nonempty=t=>e.check(ZP(1,t)),e.max=(t,n)=>e.check(XP(t,n)),e.length=(t,n)=>e.check(QP(t,n)),e.unwrap=()=>e.element});function sI(e,t){return ose(oI,e,t)}var cI=X(`ZodObject`,(e,t)=>{Qae.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wse(e,t,n,r),HN(e,`shape`,()=>t.shape),e.keyof=()=>yI(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:rI()}),e.loose=()=>e.clone({...e._zod.def,catchall:rI()}),e.strict=()=>e.clone({...e._zod.def,catchall:aI()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>hie(e,t),e.safeExtend=t=>gie(e,t),e.merge=t=>_ie(e,t),e.pick=t=>pie(e,t),e.omit=t=>mie(e,t),e.partial=(...t)=>vie(CI,e,t[0]),e.required=(...t)=>yie(NI,e,t[0])});function Q(e,t){return new cI({type:`object`,shape:e??{},...QN(t)})}function lI(e,t){return new cI({type:`object`,shape:e,catchall:rI(),...QN(t)})}var uI=X(`ZodUnion`,(e,t)=>{MP.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tse(e,t,n,r),e.options=t.options});function dI(e,t){return new uI({type:`union`,options:e,...QN(t)})}var fI=X(`ZodDiscriminatedUnion`,(e,t)=>{uI.init(e,t),$ae.init(e,t)});function pI(e,t,n){return new fI({type:`union`,options:t,discriminator:e,...QN(n)})}var mI=X(`ZodIntersection`,(e,t)=>{eoe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ese(e,t,n,r)});function hI(e,t){return new mI({type:`intersection`,left:e,right:t})}var gI=X(`ZodRecord`,(e,t)=>{toe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dse(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function _I(e,t,n){return new gI({type:`record`,keyType:e,valueType:t,...QN(n)})}var vI=X(`ZodEnum`,(e,t)=>{noe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yse(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 vI({...t,checks:[],...QN(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 vI({...t,checks:[],...QN(r),entries:i})}});function yI(e,t){return new vI({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...QN(t)})}var bI=X(`ZodLiteral`,(e,t)=>{roe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bse(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $(e,t){return new bI({type:`literal`,values:Array.isArray(e)?e:[e],...QN(t)})}var xI=X(`ZodTransform`,(e,t)=>{ioe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sse(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new NN(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(iP(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(iP(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function SI(e){return new xI({type:`transform`,transform:e})}var CI=X(`ZodOptional`,(e,t)=>{IP.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oF(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wI(e){return new CI({type:`optional`,innerType:e})}var TI=X(`ZodExactOptional`,(e,t)=>{aoe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oF(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function EI(e){return new TI({type:`optional`,innerType:e})}var DI=X(`ZodNullable`,(e,t)=>{ooe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ose(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function OI(e){return new DI({type:`nullable`,innerType:e})}var kI=X(`ZodDefault`,(e,t)=>{soe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ase(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function AI(e,t){return new kI({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():YN(t)}})}var jI=X(`ZodPrefault`,(e,t)=>{coe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jse(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function MI(e,t){return new jI({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():YN(t)}})}var NI=X(`ZodNonOptional`,(e,t)=>{loe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kse(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function PI(e,t){return new NI({type:`nonoptional`,innerType:e,...QN(t)})}var FI=X(`ZodCatch`,(e,t)=>{uoe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mse(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function II(e,t){return new FI({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var LI=X(`ZodPipe`,(e,t)=>{doe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nse(e,t,n,r),e.in=t.in,e.out=t.out});function RI(e,t){return new LI({type:`pipe`,in:e,out:t})}var zI=X(`ZodReadonly`,(e,t)=>{foe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pse(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function BI(e){return new zI({type:`readonly`,innerType:e})}var VI=X(`ZodCustom`,(e,t)=>{poe.init(e,t),CF.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xse(e,t,n,r)});function HI(e,t){return sse(VI,e??(()=>!0),t)}function UI(e,t={}){return cse(VI,e,t)}function WI(e){return lse(e)}function GI(e,t){return RI(SI(e),t)}var KI={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},qI;qI||={};var JI=`io.modelcontextprotocol/tasks`,YI=`io.modelcontextprotocol/inspector/modernTaskHandle`;function XI(e){return typeof e==`object`&&!!e&&e.resultType===`task`&&typeof e.taskId==`string`}var ZI=yI([`working`,`input_required`,`completed`,`failed`,`cancelled`]),QI=lI({taskId:Z(),status:ZI,statusMessage:Z().optional(),createdAt:Z(),lastUpdatedAt:Z(),ttlMs:qF().nullable().optional(),pollIntervalMs:qF().optional(),result:_I(Z(),rI()).optional(),error:_I(Z(),rI()).optional(),inputRequests:_I(Z(),rI()).optional()}),$I=lI({}),eL=lI({});function tL(e){let{ttlMs:t,pollIntervalMs:n,...r}=e,i={...r};return i.ttl=t??null,n!=null&&(i.pollInterval=n),i}function nL(e){return e.inputRequests}var rL=`io.modelcontextprotocol/enterprise-managed-authorization`,iL=[{key:JI,label:`Tasks (io.modelcontextprotocol/tasks)`,defaultAdvertised:!0},{key:`io.modelcontextprotocol/ui`,label:`MCP Apps UI (io.modelcontextprotocol/ui)`,defaultAdvertised:!0,advertisement:{mimeTypes:[`text/html;profile=mcp-app`]}}];function aL(e){let t={};for(let n of iL)(e.advertised?.[n.key]??n.defaultAdvertised)&&(t[n.key]=n.advertisement?structuredClone(n.advertisement):{});return e.enterpriseManaged&&(t[rL]={}),t}var oL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i<t.length;)s(n,t[i]),n.push(e[++i]);return new r(n)}e._=i;let a=new r(`+`);function o(e,...t){let n=[p(e[0])],i=0;for(;i<t.length;)n.push(a),s(n,t[i]),n.push(a,p(e[++i]));return c(n),new r(n)}e.str=o;function s(e,t){t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push(d(t))}e.addCodeArg=s;function c(e){let t=1;for(;t<e.length-1;){if(e[t]===a){let n=l(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]=`+`}t++}}function l(e,t){if(t===`""`)return e;if(e===`""`)return t;if(typeof e==`string`)return t instanceof n||e[e.length-1]!==`"`?void 0:typeof t==`string`?t[0]===`"`?e.slice(0,-1)+t.slice(1):void 0:`${e.slice(0,-1)}${t}"`;if(typeof t==`string`&&t[0]===`"`&&!(e instanceof n))return`"${e}${t.slice(1)}`}function u(e,t){return t.emptyStr()?e:e.emptyStr()?t:o`${e}${t}`}e.strConcat=u;function d(e){return typeof e==`number`||typeof e==`boolean`||e===null?e:p(Array.isArray(e)?e.join(`,`):e)}function f(e){return new r(p(e))}e.stringify=f;function p(e){return JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`)}e.safeStringify=p;function m(t){return typeof t==`string`&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`}e.getProperty=m;function h(t){if(typeof t==`string`&&e.IDENTIFIER.test(t))return new r(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}e.getEsmExportName=h;function g(e){return new r(e.toString())}e.regexpCode=g})),sL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=oL();var n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;let o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),cL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=oL(),n=sL();var r=oL();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=sL();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=k(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=k(this.rhs,e,n),this}get names(){return O(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(A(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>D(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(j(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){let e=super.names;return O(e,this.condition),this.else&&D(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return O(O(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var w=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}},T=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};T.kind=`catch`;var E=class extends m{render(e){return`finally`+super.render(e)}};E.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
140
|
-
`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new w;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new T(e),t(e)}return n&&(this._currNode=r.finally=new E,this.code(n)),this._endBlockNode(T,E)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-->0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function D(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function O(e,n){return n instanceof t._CodeOrName?D(e,n.names):e}function k(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function A(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function j(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${F(e)}`}e.not=j;let M=P(e.operators.AND);function N(...e){return e.reduce(M)}e.and=N;let ee=P(e.operators.OR);function te(...e){return e.reduce(ee)}e.or=te;function P(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${F(n)} ${e} ${F(r)}`}function F(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),lL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=cL(),n=oL();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0?!0:(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0||{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0||(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0||Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;let _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),uL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),dL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=cL(),n=lL(),r=uL();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}let u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),fL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=dL(),n=cL(),r=uL(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),pL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),mL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),hL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=pL(),n=mL(),r=dL(),i=cL(),a=lL();var o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;let u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null
|
|
141
|
-
|| (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null
|
|
142
|
-
|| (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number"
|
|
143
|
-
|| ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;let g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),gL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=cL(),n=lL();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),_L=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=cL(),n=lL(),r=uL(),i=lL();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;let h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),vL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=cL(),n=uL(),r=_L(),i=dL();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),yL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=cL(),n=lL();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),bL=Wv(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),xL=Wv(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h<m.length;h++)r(e,t,a,m[h],s+`/`+p+`/`+h,c,s,p,o,h)}else if(p in n.propsKeywords){if(m&&typeof m==`object`)for(var g in m)r(e,t,a,m[g],s+`/`+p+`/`+i(g),c,s,p,o,g)}else(p in n.keywords||e.allKeys&&!(p in n.skipKeywords))&&r(e,t,a,m,s+`/`+p,c,s,p,o)}a(o,s,c,l,u,d,f)}}function i(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}})),SL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=lL(),n=bL(),r=xL(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;let o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;let d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;let m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),CL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=fL(),n=hL(),r=mL(),i=hL(),a=gL(),o=vL(),s=yL(),c=cL(),l=uL(),u=SL(),d=lL(),f=dL();function p(e){if(S(e)&&(w(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&A(e),D(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),T(e),j(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(w(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&A(e),O(e),k(e);let a=r.const(`_errs`,l.default.errors);T(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function w(e){(0,d.checkUnknownRules)(e),E(e)}function T(e,t){if(e.opts.jtd)return N(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);N(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function E(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function D(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function O(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function k(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function A({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function j(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&M(e),t.return((0,c._)`${l.default.errors} === 0`))}function M({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function N(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>se(e,`$ref`,h.all.$ref.definition));return}p.jtd||te(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),ee(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):ee(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function ee(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&se(e,n.keyword,n.definition,t.type)})}function te(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(P(e,t),e.opts.allowUnionTypes||F(e,t),I(e,e.dataTypes))}function P(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{re(e.dataTypes,t)||ae(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),ie(e,t)}}function F(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&ae(e,`use allowUnionTypes to allow union type keyword`)}function I(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>ne(t,e))&&ae(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function ne(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function re(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function ie(e,t){let n=[];for(let r of e.dataTypes)re(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function ae(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var oe=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,ue(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=oe;function se(e,t,n,r){let i=new oe(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}let ce=/^\/(?:[^~]|~0|~1)*$/,le=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ue(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!ce.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=le.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=ue})),wL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),TL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=SL();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),EL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=cL(),n=wL(),r=uL(),i=SL(),a=lL(),o=CL();var s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;let h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),DL=Wv(((e,t)=>{t.exports={$id:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,description:`Meta-schema for $data reference (JSON AnySchema extension proposal)`,type:`object`,required:[`$data`],properties:{$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},additionalProperties:!1}})),OL=Wv(((e,t)=>{let n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function i(e){let t=``,n=0,r=0;for(r=0;r<e.length;r++)if(n=e[r].charCodeAt(0),n!==48){if(!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r<e.length;r++){if(n=e[r].charCodeAt(0),!(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}let a=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(e){return e.length=0,!0}function s(e,t,n){if(e.length){let r=i(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function c(e){let t=0,n={error:!1,address:``,zone:``},r=[],a=[],c=!1,l=!1,u=s;for(let i=0;i<e.length;i++){let s=e[i];if(!(s===`[`||s===`]`))if(s===`:`){if(c===!0&&(l=!0),!u(a,r,n))break;if(++t>7){n.error=!0;break}i>0&&e[i-1]===`:`&&(c=!0),r.push(`:`);continue}else if(s===`%`){if(!u(a,r,n))break;u=o}else{a.push(s);continue}}return a.length&&(u===o?n.zone=a.join(``):l?r.push(a.join(``)):r.push(i(a))),n.address=r.join(``),n}function l(e){if(u(e,`:`)<2)return{host:e,isIPV6:!1};let t=c(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function u(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function d(e){let t=e,n=[],r=-1,i=0;for(;i=t.length;){if(i===1){if(t===`.`)break;if(t===`/`){n.push(`/`);break}else{n.push(t);break}}else if(i===2){if(t[0]===`.`){if(t[1]===`.`)break;if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&(t[1]===`.`||t[1]===`/`)){n.push(`/`);break}}else if(i===3&&t===`/..`){n.length!==0&&n.pop(),n.push(`/`);break}if(t[0]===`.`){if(t[1]===`.`){if(t[2]===`/`){t=t.slice(3);continue}}else if(t[1]===`/`){t=t.slice(2);continue}}else if(t[0]===`/`&&t[1]===`.`){if(t[2]===`/`){t=t.slice(2);continue}else if(t[2]===`.`&&t[3]===`/`){t=t.slice(3),n.length!==0&&n.pop();continue}}if((r=t.indexOf(`/`,1))===-1){n.push(t);break}else n.push(t.slice(0,r)),t=t.slice(r)}return n.join(``)}function f(e,t){let n=t===!0?unescape:escape;return e.scheme!==void 0&&(e.scheme=n(e.scheme)),e.userinfo!==void 0&&(e.userinfo=n(e.userinfo)),e.host!==void 0&&(e.host=n(e.host)),e.path!==void 0&&(e.path=n(e.path)),e.query!==void 0&&(e.query=n(e.query)),e.fragment!==void 0&&(e.fragment=n(e.fragment)),e}function p(e){let t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push(`@`)),e.host!==void 0){let n=unescape(e.host);if(!r(n)){let t=l(n);n=t.isIPV6===!0?`[${t.escapedHost}]`:e.host}t.push(n)}return(typeof e.port==`number`||typeof e.port==`string`)&&(t.push(`:`),t.push(String(e.port))),t.length?t.join(``):void 0}t.exports={nonSimpleDomain:a,recomposeAuthority:p,normalizeComponentEncoding:f,removeDotSegments:d,isIPv4:r,isUUID:n,normalizeIPv6:l,stringArrayToHexStripped:i}})),kL=Wv(((e,t)=>{let{isUUID:n}=OL(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}let h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),AL=Wv(((e,t)=>{let{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizeComponentEncoding:a,isIPv4:o,nonSimpleDomain:s}=OL(),{SCHEMES:c,getSchemeHandler:l}=kL();function u(e,t){return typeof e==`string`?e=m(g(e,t),t):typeof e==`object`&&(e=g(m(e,t),t)),e}function d(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},i=f(g(e,r),g(t,r),r,!0);return r.skipEscape=!0,m(i,r)}function f(e,t,n,i){let a={};return i||(e=g(m(e,n),n),t=g(m(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?a.path=`/`+t.path:e.path?a.path=e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:a.path=t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,t.query===void 0?a.query=e.query:a.query=t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function p(e,t,n){return typeof e==`string`?(e=unescape(e),e=m(a(g(e,n),!0),{...n,skipEscape:!0})):typeof e==`object`&&(e=m(a(e,!0),{...n,skipEscape:!0})),typeof t==`string`?(t=unescape(t),t=m(a(g(t,n),!0),{...n,skipEscape:!0})):typeof t==`object`&&(t=m(a(t,!0),{...n,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function m(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},a=Object.assign({},t),o=[],s=l(a.scheme||n.scheme);s&&s.serialize&&s.serialize(n,a),n.path!==void 0&&(a.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),a.reference!==`suffix`&&n.scheme&&o.push(n.scheme,`:`);let c=i(n);if(c!==void 0&&(a.reference!==`suffix`&&o.push(`//`),o.push(c),n.path&&n.path[0]!==`/`&&o.push(`/`)),n.path!==void 0){let e=n.path;!a.absolutePath&&(!s||!s.absolutePath)&&(e=r(e)),c===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),o.push(e)}return n.query!==void 0&&o.push(`?`,n.query),n.fragment!==void 0&&o.push(`#`,n.fragment),o.join(``)}let h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let c=e.match(h);if(c){if(i.scheme=c[1],i.userinfo=c[3],i.host=c[4],i.port=parseInt(c[5],10),i.path=c[6]||``,i.query=c[7],i.fragment=c[8],isNaN(i.port)&&(i.port=c[5]),i.host)if(o(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),a=e.isIPV6}else a=!0;i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?i.reference=`same-document`:i.scheme===void 0?i.reference=`relative`:i.fragment===void 0?i.reference=`absolute`:i.reference=`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let t=l(r.scheme||i.scheme);if(!r.unicodeSupport&&(!t||!t.unicodeSupport)&&i.host&&(r.domainHost||t&&t.domainHost)&&a===!1&&s(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}(!t||t&&!t.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=unescape(i.host))),i.path&&=escape(unescape(i.path)),i.fragment&&=encodeURI(decodeURIComponent(i.fragment))),t&&t.parse&&t.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return i}let _={SCHEMES:c,normalize:u,resolve:d,resolveComponent:f,equal:p,serialize:m,parse:g};t.exports=_,t.exports.default=_,t.exports.fastUri=_})),jL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=AL();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),ML=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=CL();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=cL();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});let r=wL(),i=TL(),a=pL(),o=EL(),s=cL(),c=SL(),l=hL(),u=lL(),d=DL(),f=jL(),p=(e,t)=>new RegExp(e,t);p.code=`new RegExp`;let m=[`removeAdditional`,`useDefaults`,`coerceTypes`],h=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),g={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},_={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`};function v(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??p,a=e.uriResolver??f.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??200,loopEnum:e.loopEnum??200,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var y=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:h,es5:t,lines:n}),this.logger=D(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,g,e,`NOT SUPPORTED`),b.call(this,_,e,`DEPRECATED`,`warn`),this._metaOpts=T.call(this),e.formats&&C.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&w.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=d;n===`id`&&(r={...d},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await a.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function a(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await a.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=x.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new o.SchemaEnv({schema:{},schemaId:n});if(t=o.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=x.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,c.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(k.call(this,n,t),!t)return(0,u.eachItem)(n,e=>A.call(this,e)),this;M.call(this,t);let r={...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(n,r.type.length===0?e=>A.call(this,e,r):e=>r.type.forEach(t=>A.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=ee(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:s}=this.opts;if(typeof e==`object`)a=e[s];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let l=this._cache.get(e);if(l!==void 0)return l;n=(0,c.normalizeId)(a||n);let u=c.getSchemaRefs.call(this,e,n);return l=new o.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:n,localRefs:u}),this._cache.set(l.schema,l),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=l),r&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):o.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,e)}finally{this.opts=t}}};y.ValidationError=r.default,y.MissingRefError=i.default,e.default=y;function b(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function x(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function C(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function w(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function T(){let e={...this.opts};for(let t of m)delete e[t];return e}let E={log(){},warn(){},error(){}};function D(e){if(e===!1)return E;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}let O=/^[a-z_$][a-z0-9_$:-]*$/i;function k(e,t){let{RULES:n}=this;if((0,u.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!O.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function A(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)}};t.before?j.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function j(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function M(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=ee(t)),e.validateSchema=this.compile(t,!0))}let N={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function ee(e){return{anyOf:[e,N]}}})),NL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),PL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=TL(),n=_L(),r=cL(),i=uL(),a=EL(),o=lL(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0)if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(l.items!==!0)if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}e.callRef=l,e.default=s})),FL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=NL(),n=PL();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),IL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),LL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),RL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r<t;)n++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<t&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return n}e.default=t,t.code=`require("ajv/dist/runtime/ucs2length").default`})),zL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=lL(),r=RL();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),BL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_L(),n=lL(),r=cL();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),VL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),HL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_L(),n=cL(),r=lL();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),UL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),WL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bL();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),GL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=hL(),n=cL(),r=lL(),i=WL();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),KL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=lL(),r=WL();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),qL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=lL(),r=WL();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),JL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=IL(),n=LL(),r=zL(),i=BL(),a=VL(),o=HL(),s=UL(),c=GL(),l=KL(),u=qL();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),YL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=cL(),n=lL(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),XL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=cL(),n=lL(),r=_L(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),ZL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=XL();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),QL=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=lL(),r=_L(),i=YL();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),$L=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=lL();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),eR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=cL(),n=lL(),r=_L();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e},
|
|
144
|
-
missingProperty: ${i},
|
|
145
|
-
depsCount: ${n},
|
|
146
|
-
deps: ${r}}`};let i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),tR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=lL();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),nR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_L(),n=cL(),r=uL(),i=lL();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),rR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=CL(),n=_L(),r=lL(),i=nR();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),iR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=_L(),n=cL(),r=lL(),i=lL();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),aR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lL();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),oR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:_L().validateUnion,error:{message:`must match a schema in anyOf`}}})),sR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=lL();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),cR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lL();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),lR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=lL(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),uR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lL();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),dR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=YL(),n=ZL(),r=XL(),i=QL(),a=$L(),o=eR(),s=tR(),c=nR(),l=rR(),u=iR(),d=aR(),f=oR(),p=sR(),m=cR(),h=lR(),g=uR();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),fR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),pR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[fR().default]})),mR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),hR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=FL(),n=JL(),r=dR(),i=pR(),a=mR();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),gR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),_R=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=gR(),r=EL(),i=TL(),a=lL();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;e<d.length;e++){let c=d[e];if(c?.$ref&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if(c=r.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof r.SchemaEnv&&(c=c.schema),c===void 0)throw new i.default(u.opts.uriResolver,u.baseId,e)}let l=c?.properties?.[f];if(typeof l!=`object`)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n&&=t||o(c),s(l,e)}if(!n)throw Error(`discriminator: "${f}" must be required`);return e;function o({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,t){if(e.const)c(e.const,t);else if(e.enum)for(let n of e.enum)c(n,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function c(t,n){if(typeof t!=`string`||t in e)throw Error(`discriminator: "${f}" values must be unique strings`);e[t]=n}}}}})),vR=Wv(((e,t)=>{t.exports={$schema:`http://json-schema.org/draft-07/schema#`,$id:`http://json-schema.org/draft-07/schema#`,title:`Core schema meta-schema`,definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},default:!0}})),yR=Wv(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let n=ML(),r=hR(),i=_R(),a=vR(),o=[`/properties`],s=`http://json-schema.org/draft-07/schema`;var c=class extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(a,o):a;this.addMetaSchema(e,s,!1),this.refs[`http://json-schema.org/schema`]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var l=CL();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=cL();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var d=wL();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var f=TL();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})})),bR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=cL(),n=uL(),r=EL(),i=PL(),a={keyword:`$dynamicAnchor`,schemaType:`string`,code:e=>o(e,e.schema)};function o(e,r){let{gen:i,it:a}=e;a.schemaEnv.root.dynamicAnchors[r]=!0;let o=(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(r)}`,c=a.errSchemaPath===`#`?a.validateName:s(e);i.if((0,t._)`!${o}`,()=>i.assign(o,c))}e.dynamicAnchor=o;function s(e){let{schemaEnv:t,schema:n,self:a}=e.it,{root:o,baseId:s,localRefs:c,meta:l}=t.root,{schemaId:u}=a.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:o,baseId:s,localRefs:c,meta:l});return r.compileSchema.call(a,d),(0,i.getValidate)(e,d)}e.default=a})),xR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=cL(),n=uL(),r=PL(),i={keyword:`$dynamicRef`,schemaType:`string`,code:e=>a(e,e.schema)};function a(e,i){let{gen:a,keyword:o,it:s}=e;if(i[0]!==`#`)throw Error(`"${o}" only supports hash fragment reference`);let c=i.slice(1);if(s.allErrors)l();else{let t=a.let(`valid`,!1);l(t),e.ok(t)}function l(e){if(s.schemaEnv.root.dynamicAnchors[c]){let r=a.let(`_v`,(0,t._)`${n.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if(r,u(r,e),u(s.validateName,e))}else u(s.validateName,e)()}function u(t,n){return n?()=>a.block(()=>{(0,r.callRef)(e,t),a.let(n,!0)}):()=>(0,r.callRef)(e,t)}}e.dynamicRef=a,e.default=i})),SR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bR(),n=lL();e.default={keyword:`$recursiveAnchor`,schemaType:`boolean`,code(e){e.schema?(0,t.dynamicAnchor)(e,``):(0,n.checkStrictMode)(e.it,`$recursiveAnchor: false is ignored`)}}})),CR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xR();e.default={keyword:`$recursiveRef`,schemaType:`string`,code:e=>(0,t.dynamicRef)(e,e.schema)}})),wR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bR(),n=xR(),r=SR(),i=CR();e.default=[t.default,n.default,r.default,i.default]})),TR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eR();e.default={keyword:`dependentRequired`,type:`object`,schemaType:`object`,error:t.error,code:e=>(0,t.validatePropertyDeps)(e)}})),ER=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=eR();e.default={keyword:`dependentSchemas`,type:`object`,schemaType:`object`,code:e=>(0,t.validateSchemaDeps)(e)}})),DR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lL();e.default={keyword:[`maxContains`,`minContains`],type:`array`,schemaType:`number`,code({keyword:e,parentSchema:n,it:r}){n.contains===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}}})),OR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=TR(),n=ER(),r=DR();e.default=[t.default,n.default,r.default]})),kR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=lL(),r=uL();e.default={keyword:`unevaluatedProperties`,type:`object`,schemaType:[`boolean`,`object`],trackErrors:!0,error:{message:`must NOT have unevaluated properties`,params:({params:e})=>(0,t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){let{gen:i,schema:a,data:o,errsCount:s,it:c}=e;if(!s)throw Error(`ajv implementation error`);let{allErrors:l,props:u}=c;u instanceof t.Name?i.if((0,t._)`${u} !== true`,()=>i.forIn(`key`,o,e=>i.if(f(u,e),()=>d(e)))):u!==!0&&i.forIn(`key`,o,e=>u===void 0?d(e):i.if(p(u,e),()=>d(e))),c.props=!0,e.ok((0,t._)`${s} === ${r.default.errors}`);function d(r){if(a===!1){e.setParams({unevaluatedProperty:r}),e.error(),l||i.break();return}if(!(0,n.alwaysValidSchema)(c,a)){let a=i.name(`valid`);e.subschema({keyword:`unevaluatedProperties`,dataProp:r,dataPropType:n.Type.Str},a),l||i.if((0,t.not)(a),()=>i.break())}}function f(e,n){return(0,t._)`!${e} || !${e}[${n}]`}function p(e,n){let r=[];for(let i in e)e[i]===!0&&r.push((0,t._)`${n} !== ${i}`);return(0,t.and)(...r)}}}})),AR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cL(),n=lL();e.default={keyword:`unevaluatedItems`,type:`array`,schemaType:[`boolean`,`object`],error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e,s=o.items||0;if(s===!0)return;let c=r.const(`len`,(0,t._)`${a}.length`);if(i===!1)e.setParams({len:s}),e.fail((0,t._)`${c} > ${s}`);else if(typeof i==`object`&&!(0,n.alwaysValidSchema)(o,i)){let n=r.var(`valid`,(0,t._)`${c} <= ${s}`);r.if((0,t.not)(n),()=>l(n,s)),e.ok(n)}o.items=!0;function l(i,a){r.forRange(`i`,a,c,a=>{e.subschema({keyword:`unevaluatedItems`,dataProp:a,dataPropType:n.Type.Num},i),o.allErrors||r.if((0,t.not)(i),()=>r.break())})}}}})),jR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=kR(),n=AR();e.default=[t.default,n.default]})),MR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=FL(),n=JL(),r=dR(),i=wR(),a=OR(),o=jR(),s=pR(),c=mR();e.default=[i.default,t.default,n.default,(0,r.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,a.default,o.default]})),NR=Wv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/schema`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Core and Validation specifications meta-schema`,allOf:[{$ref:`meta/core`},{$ref:`meta/applicator`},{$ref:`meta/unevaluated`},{$ref:`meta/validation`},{$ref:`meta/meta-data`},{$ref:`meta/format-annotation`},{$ref:`meta/content`}],type:[`object`,`boolean`],$comment:`This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.`,properties:{definitions:{$comment:`"definitions" has been replaced by "$defs".`,type:`object`,additionalProperties:{$dynamicRef:`#meta`},deprecated:!0,default:{}},dependencies:{$comment:`"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.`,type:`object`,additionalProperties:{anyOf:[{$dynamicRef:`#meta`},{$ref:`meta/validation#/$defs/stringArray`}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:`"$recursiveAnchor" has been replaced by "$dynamicAnchor".`,$ref:`meta/core#/$defs/anchorString`,deprecated:!0},$recursiveRef:{$comment:`"$recursiveRef" has been replaced by "$dynamicRef".`,$ref:`meta/core#/$defs/uriReferenceString`,deprecated:!0}}}})),PR=Wv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/applicator`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:`meta`,title:`Applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{prefixItems:{$ref:`#/$defs/schemaArray`},items:{$dynamicRef:`#meta`},contains:{$dynamicRef:`#meta`},additionalProperties:{$dynamicRef:`#meta`},properties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},patternProperties:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},propertyNames:{format:`regex`},default:{}},dependentSchemas:{type:`object`,additionalProperties:{$dynamicRef:`#meta`},default:{}},propertyNames:{$dynamicRef:`#meta`},if:{$dynamicRef:`#meta`},then:{$dynamicRef:`#meta`},else:{$dynamicRef:`#meta`},allOf:{$ref:`#/$defs/schemaArray`},anyOf:{$ref:`#/$defs/schemaArray`},oneOf:{$ref:`#/$defs/schemaArray`},not:{$dynamicRef:`#meta`}},$defs:{schemaArray:{type:`array`,minItems:1,items:{$dynamicRef:`#meta`}}}}})),FR=Wv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/unevaluated`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:`meta`,title:`Unevaluated applicator vocabulary meta-schema`,type:[`object`,`boolean`],properties:{unevaluatedItems:{$dynamicRef:`#meta`},unevaluatedProperties:{$dynamicRef:`#meta`}}}})),IR=Wv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/content`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:`meta`,title:`Content vocabulary meta-schema`,type:[`object`,`boolean`],properties:{contentEncoding:{type:`string`},contentMediaType:{type:`string`},contentSchema:{$dynamicRef:`#meta`}}}})),LR=Wv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/core`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:`meta`,title:`Core vocabulary meta-schema`,type:[`object`,`boolean`],properties:{$id:{$ref:`#/$defs/uriReferenceString`,$comment:`Non-empty fragments not allowed.`,pattern:`^[^#]*#?$`},$schema:{$ref:`#/$defs/uriString`},$ref:{$ref:`#/$defs/uriReferenceString`},$anchor:{$ref:`#/$defs/anchorString`},$dynamicRef:{$ref:`#/$defs/uriReferenceString`},$dynamicAnchor:{$ref:`#/$defs/anchorString`},$vocabulary:{type:`object`,propertyNames:{$ref:`#/$defs/uriString`},additionalProperties:{type:`boolean`}},$comment:{type:`string`},$defs:{type:`object`,additionalProperties:{$dynamicRef:`#meta`}}},$defs:{anchorString:{type:`string`,pattern:`^[A-Za-z_][-A-Za-z0-9._]*$`},uriString:{type:`string`,format:`uri`},uriReferenceString:{type:`string`,format:`uri-reference`}}}})),RR=Wv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/format-annotation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:`meta`,title:`Format vocabulary meta-schema for annotation results`,type:[`object`,`boolean`],properties:{format:{type:`string`}}}})),zR=Wv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/meta-data`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:`meta`,title:`Meta-data vocabulary meta-schema`,type:[`object`,`boolean`],properties:{title:{type:`string`},description:{type:`string`},default:!0,deprecated:{type:`boolean`,default:!1},readOnly:{type:`boolean`,default:!1},writeOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0}}}})),BR=Wv(((e,t)=>{t.exports={$schema:`https://json-schema.org/draft/2020-12/schema`,$id:`https://json-schema.org/draft/2020-12/meta/validation`,$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:`meta`,title:`Validation vocabulary meta-schema`,type:[`object`,`boolean`],properties:{type:{anyOf:[{$ref:`#/$defs/simpleTypes`},{type:`array`,items:{$ref:`#/$defs/simpleTypes`},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/$defs/nonNegativeInteger`},minLength:{$ref:`#/$defs/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},maxItems:{$ref:`#/$defs/nonNegativeInteger`},minItems:{$ref:`#/$defs/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},maxContains:{$ref:`#/$defs/nonNegativeInteger`},minContains:{$ref:`#/$defs/nonNegativeInteger`,default:1},maxProperties:{$ref:`#/$defs/nonNegativeInteger`},minProperties:{$ref:`#/$defs/nonNegativeIntegerDefault0`},required:{$ref:`#/$defs/stringArray`},dependentRequired:{type:`object`,additionalProperties:{$ref:`#/$defs/stringArray`}}},$defs:{nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{$ref:`#/$defs/nonNegativeInteger`,default:0},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}}}})),VR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=NR(),n=PR(),r=FR(),i=IR(),a=LR(),o=RR(),s=zR(),c=BR(),l=[`/properties`];function u(e){return[t,n,r,i,a,u(this,o),s,u(this,c)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function u(t,n){return e?t.$dataMetaSchema(n,l):n}}e.default=u})),HR=Wv(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let n=ML(),r=MR(),i=_R(),a=VR(),o=`https://json-schema.org/draft/2020-12/schema`;var s=class extends n.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;t&&(a.default.call(this,e),this.refs[`http://json-schema.org/schema`]=o)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};e.Ajv2020=s,t.exports=e=s,t.exports.Ajv2020=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s;var c=CL();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=cL();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var u=wL();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return u.default}});var d=TL();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})})),UR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:E,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:w},double:{type:`number`,validate:w},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}let r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e<t?-1:0}let s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(e){return function(t){let n=s.exec(t);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=n[4],c=n[5]===`-`?-1:1,l=+(n[6]||0),u=+(n[7]||0);if(l>23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e<t?-1:0}let d=/t|\s/i;function f(e){let t=c(e);return function(e){let n=e.split(d);return n.length===2&&a(n[0])&&t(n[1])}}function p(e,t){if(!(e&&t))return;let n=new Date(e).valueOf(),r=new Date(t).valueOf();if(n&&r)return n-r}function m(e,t){if(!(e&&t))return;let[n,r]=e.split(d),[i,a]=t.split(d),s=o(n,i);if(s!==void 0)return s||l(r,a)}let h=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function _(e){return h.test(e)&&g.test(e)}let v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y(e){return v.lastIndex=0,v.test(e)}let b=-(2**31),x=2**31-1;function S(e){return Number.isInteger(e)&&e<=x&&e>=b}function C(e){return Number.isInteger(e)}function w(){return!0}let T=/[^\\]\\Z/;function E(e){if(T.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),WR=Wv((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=yR(),n=cL(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),GR=Wv(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let n=UR(),r=WR(),i=cL(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s})),KR=yR(),qR=HR(),JR=qv(GR(),1),YR=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),XR=JR.default;function ZR(){let e=new qR.Ajv2020({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return XR(e),e}var QR=class{_ajv;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=ZR()}getValidator(e){if(!this._userAjv&&`$schema`in e&&typeof e.$schema==`string`&&!YR.has(e.$schema.replace(/#$/,``))){let t=e.$schema.slice(0,200);throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${t}"). The default validator supports JSON Schema 2020-12 only; pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.`)}let t=this.ajv,n=`$id`in e&&typeof e.$id==`string`?t.getSchema(e.$id)??t.compile(e):t.compile(e);return e=>n(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(n.errors)}}};KR.Ajv;function $R(e,t,n){if(!t.outputSchema)return;let r=n.structuredContent;if(r==null)return n.isError?void 0:`Tool "${t.name}" declares an output schema but returned no structured content`;try{let n=e.getValidator(t.outputSchema)(r);return n.valid?void 0:n.errorMessage}catch{return}}var ez=_T.extend({method:$(`notifications/tasks/list_changed`),params:_I(Z(),rI()).optional()}),tz=class extends CustomEvent{constructor(e,t){super(e,{detail:t})}},nz=class extends EventTarget{dispatchTypedEvent(e,...t){let n=t[0]??void 0;this.dispatchEvent(new tz(e,n))}addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}},rz=class extends nz{},iz=class{id;timestamp;request;taskId;origin;resolvePromise;rejectPromise;onRemove;constructor(e,t,n,r,i=`server-request`){this.onRemove=r,this.id=`sampling-${crypto.randomUUID()}`,this.timestamp=new Date,this.request=e;let a=e.params?._meta?.[Qw];this.taskId=a?.taskId,this.origin=i,this.resolvePromise=t,this.rejectPromise=n}async respond(e){if(!this.resolvePromise)throw Error(`Request already resolved or rejected`);this.resolvePromise(e),this.resolvePromise=void 0,this.rejectPromise=void 0,this.remove()}async reject(e){if(!this.rejectPromise)throw Error(`Request already resolved or rejected`);this.rejectPromise(e),this.resolvePromise=void 0,this.rejectPromise=void 0,this.remove()}cancel(){this.rejectPromise&&this.rejectPromise(Error(`Connection torn down`)),this.resolvePromise=void 0,this.rejectPromise=void 0}remove(){this.onRemove(this.id)}},az=class{id;timestamp;request;taskId;origin;resolvePromise;rejectCallback;onRemove;constructor(e,t,n,r,i=`server-request`){this.onRemove=n,this.id=`elicitation-${crypto.randomUUID()}`,this.timestamp=new Date,this.request=e;let a=e.params?._meta?.[Qw];this.taskId=a?.taskId,this.origin=i,this.resolvePromise=t,this.rejectCallback=r}reject(e){this.rejectCallback&&=(this.rejectCallback(e),void 0)}async respond(e){if(!this.resolvePromise)throw Error(`Request already resolved`);this.resolvePromise(e),this.resolvePromise=void 0,this.remove()}completeIfPending(){this.resolvePromise&&this.respond({action:`accept`})}cancel(){this.resolvePromise&&=(this.resolvePromise({action:`cancel`}),void 0),this.rejectCallback=void 0}remove(){this.onRemove(this.id)}},oz=class extends Error{url;constructor(e){super(`The server asked for the same URL elicitation again (${e}); cancelling the call to avoid a loop.`),this.name=`UrlElicitationLoopError`,this.url=e}};function sz(e){return e instanceof Tk?e.elicitations??[]:e instanceof Ck&&e.code===Sk.UrlElicitationRequired?e.data?.elicitations??[]:null}var cz=class extends Error{toolName;constructor(e){super(e?`Tool call "${e}" was cancelled.`:`Tool call was cancelled.`),this.name=`ToolCallCancelledError`,this.toolName=e}};function lz(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`object`&&e[0]!==null&&`code`in e[0]}function uz(e){return e.some(e=>Array.isArray(e.path)&&(e.path.includes(`access_token`)||e.path.includes(`token_type`)))?`The authorization server did not return valid tokens. Check your OAuth client ID and secret, then try again.`:e.map(e=>`${Array.isArray(e.path)&&e.path.length?e.path.join(`.`):`input`}: ${e.message??`invalid`}`).join(` `)}function dz(e){if(e instanceof lF)return uz(e.issues);let t=e instanceof Error?e.message:typeof e==`string`?e:String(e),n=t.trim();if(n.startsWith(`[`))try{let e=JSON.parse(n);if(lz(e))return uz(e)}catch{}return t}function fz(e,t){let n=e.trim();try{return new URL(n)}catch(e){let r=e instanceof Error?e.message:String(e);throw Error(`Invalid ${t}: "${n}" (${r})`)}}var pz=e=>{let t=new URLSearchParams(e),n=t.get(`code`);if(n){let e=t.get(`iss`);return e===null?{successful:!0,code:n}:{successful:!0,code:n,iss:e}}let r=t.get(`error`),i=t.get(`error_description`),a=t.get(`error_uri`);return r?{successful:!1,error:r,error_description:i,error_uri:a}:{successful:!1,error:`invalid_request`,error_description:`Missing code or error in response`,error_uri:null}},mz=()=>{if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues is not available; refusing to generate an OAuth state with a non-cryptographic RNG.`);let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)},hz=e=>!e||typeof e!=`string`?null:/^[a-f0-9]{64}$/i.test(e)?{authId:e}:null,gz=e=>{let t=e.error,n=e.error_description,r=e.error_uri;return[`Error: ${t}.`,n?`Details: ${n}.`:``,r?`More info: ${r}.`:``].filter(Boolean).join(`
|
|
147
|
-
`)};function _z(e){return vz(e,new Set)}function vz(e,t){if(e==null)return!1;if(typeof e!=`object`)return/\bfailed\b[^\n]*\(401\)/i.test(String(e));if(t.has(e))return!1;if(t.add(e),VM.isInstance(e))return!0;let n=e.status,r=e.code;if(n===401||r===401||e instanceof Error&&/\bfailed\b[^\n]*\(401\)/i.test(e.message)||`cause`in e&&vz(e.cause,t))return!0;let i=e.data;return!!(typeof i==`object`&&i&&`cause`in i&&vz(i.cause,t))}var yz=new URL(`mcp-inspector:ema-step-up`),bz=class extends Error{authChallenge;status;constructor(e,t,n){super(n??`Auth challenge: ${e.reason}`),this.name=`AuthChallengeError`,this.authChallenge=e,this.status=t}},xz=class extends Error{authorizationUrl;authChallenge;emaStepUpConfirm;constructor(e,t,n){super(`Interactive auth recovery required`),this.name=`AuthRecoveryRequiredError`,this.authorizationUrl=e,this.authChallenge=t,this.emaStepUpConfirm=n?.emaStepUpConfirm}};function Sz(e){return e instanceof xz||_z(e)}function Cz(e){return wz(e,new Set)}function wz(e,t){if(typeof e!=`object`||!e||t.has(e))return;if(t.add(e),e instanceof xz||e instanceof bz)return e;let n=wz(e.cause,t);if(n)return n;let r=e.data;if(typeof r==`object`&&r)return wz(r.cause,t)}function Tz(e){let t=e.match(/Bearer\s+(.+)/i);if(!t)return{};let n={},r=/([\w-]+)(?:="([^"]*)"|=([^\s,]+))?/g,i;for(;(i=r.exec(t[1]))!==null;){let e=i[2]??i[3];e!==void 0&&(n[i[1].toLowerCase()]=e)}return{error:n.error,scope:n.scope,resourceMetadata:n.resource_metadata,errorDescription:n.error_description}}function Ez(e){return e?.trim()?e.trim().split(/\s+/).filter(Boolean):[]}function Dz(e,t){let n=new Set,r=[];for(let i of[...Ez(e),...t.filter(Boolean)])n.has(i)||(n.add(i),r.push(i));return r}function Oz(e,t){return e===403?t.error===`insufficient_scope`?`insufficient_scope`:`unauthorized`:t.error===`insufficient_scope`?`insufficient_scope`:t.error===`invalid_token`?`invalid_token`:e===401?`token_expired`:`unauthorized`}function kz(e,t){if(e instanceof bz)return e.authChallenge;if(typeof e!=`object`||!e)return;let n=e.authChallenge;if(n?.reason)return{...n,...t?{context:{...n.context,...t}}:{}};let r=e.status??e.code;if(r!==401&&r!==403)return;let i=n?.raw?.wwwAuthenticate??e.wwwAuthenticate??e.headers?.get?.(`WWW-Authenticate`)??void 0;if(!i?.length)return;let a=Tz(i),o=Ez(a.scope);return{reason:Oz(r,a),...o.length>0?{requiredScopes:o}:{},...t?{context:t}:{},raw:{httpStatus:r,wwwAuthenticate:i}}}function Az(e){if(e instanceof bz)return!0;if(typeof e!=`object`||!e)return!1;let t=e.authChallenge;if(t?.reason)return!0;let n=e.status??e.code;if(n!==401&&n!==403)return!1;let r=t?.raw?.wwwAuthenticate??e.wwwAuthenticate??e.headers?.get?.(`WWW-Authenticate`)??void 0;return r!==void 0&&r.length>0}var jz=()=>{};function Mz(){let e={level:`silent`,fatal:jz,error:jz,warn:jz,info:jz,debug:jz,trace:jz,silent:jz,child:()=>e};return e}var Nz=Mz(),Pz=new Set([`authorization`,`cookie`,`set-cookie`,`proxy-authorization`,`x-api-key`,`x-mcp-remote-auth`]),Fz=`[REDACTED]`,Iz=new Set([`client_secret`,`code`,`refresh_token`,`access_token`,`id_token`,`code_verifier`,`client_assertion`,`assertion`,`password`,`token`]),Lz=`[REDACTED]`;function Rz(e){return Iz.has(e.toLowerCase())}function zz(e){let t={};for(let[n,r]of Object.entries(e))t[n]=Pz.has(n.toLowerCase())?Fz:r;return t}function Bz(e){let t=e.indexOf(`?`);if(t===-1)return e;let n=e.slice(0,t),r=e.slice(t+1),i=r.indexOf(`#`),a=i===-1?r:r.slice(0,i),o=i===-1?``:r.slice(i);try{let t=new URLSearchParams(a),r=!1;for(let e of new Set(t.keys()))Rz(e)&&(r=!0,t.set(e,Lz));return r?`${n}?${t.toString()}${o}`:e}catch{return e}}function Vz(e){if(Array.isArray(e))return e.map(Vz);if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=Rz(n)&&typeof r==`string`?Lz:Vz(r);return t}return e}function Hz(e,t){if(!e)return e;if((t??``).toLowerCase().includes(`application/x-www-form-urlencoded`))try{let t=new URLSearchParams(e),n=!1;for(let e of new Set(t.keys()))Rz(e)&&(n=!0,t.set(e,Lz));return n?t.toString():e}catch{return e}try{let t=JSON.parse(e);if(typeof t==`object`&&t)return JSON.stringify(Vz(t))}catch{}return e}function Uz(e,t){let n=t.toLowerCase();for(let[t,r]of Object.entries(e))if(t.toLowerCase()===n)return r}function Wz(e,t){return e!==`GET`||!t?!1:t.includes(`text/event-stream`)||t.includes(`application/x-ndjson`)}function Gz(e,t){return async(n,r)=>{let i=Date.now(),a=new Date,o=`${a.getTime()}-${Math.random().toString(36).slice(2,11)}`,s=typeof n==`string`?n:n instanceof URL?n.toString():n.url,c=r?.method||`GET`,l={};n instanceof Request&&n.headers.forEach((e,t)=>{l[t]=e}),r?.headers&&new Headers(r.headers).forEach((e,t)=>{l[t]=e});let u=zz(l),d=Uz(l,`content-type`),f=Bz(s),p;if(r?.body)if(typeof r.body==`string`)p=r.body;else try{p=String(r.body)}catch{p=void 0}else if(n instanceof Request&&n.body)try{p=await n.clone().text()}catch{p=void 0}let m=Hz(p,d),h,g;try{h=await e(n,r)}catch(e){g=e instanceof Error?e.message:String(e);let n={id:o,timestamp:a,method:c,url:f,requestHeaders:u,requestBody:m,error:g,duration:Date.now()-i};throw t.trackRequest?.(n),e}let _=h.status,v=h.statusText,y={};h.headers.forEach((e,t)=>{y[t]=e});let b=zz(y),x=Wz(c,h.headers.get(`content-type`)),S={id:o,timestamp:a,method:c,url:f,requestHeaders:u,requestBody:m,responseStatus:_,responseStatusText:v,responseHeaders:b,responseBody:void 0,duration:Date.now()-i};if(t.trackRequest?.(S),!x&&h.body&&!h.bodyUsed){let e=h.headers.get(`content-type`);try{h.clone().text().then(n=>{t.updateResponseBody?.(o,Hz(n,e)??n)}).catch(()=>{})}catch{}}return h}}var Kz=class{authorizationUrl=null;callback;constructor(e){this.callback=e}navigateToAuthorization(e){this.authorizationUrl=e,this.callback(e)instanceof Promise}getAuthorizationUrl(){return this.authorizationUrl}},qz=class{capturedAuthUrl=null;eventTarget=null;suppressAuthorizationNavigation=!1;cachedScope;serverUrl;storage;redirectUrlProvider;navigation;clientMetadataUrl;constructor(e,t){this.serverUrl=e,this.storage=t.storage,this.redirectUrlProvider=t.redirectUrlProvider,this.navigation=t.navigation,this.clientMetadataUrl=t.clientMetadataUrl}async prepareForAuth(){this.cachedScope=await this.storage.getScope(this.serverUrl)}setEventTarget(e){this.eventTarget=e}getCapturedAuthUrl(){return this.capturedAuthUrl}clearCapturedAuthUrl(){this.capturedAuthUrl=null}setSuppressAuthorizationNavigation(e){this.suppressAuthorizationNavigation=e}get scope(){return this.cachedScope}get redirectUrl(){return this.redirectUrlProvider.getRedirectUrl()}get redirect_uris(){return[this.redirectUrl]}get clientMetadata(){return{redirect_uris:this.redirect_uris,token_endpoint_auth_method:`none`,grant_types:[`authorization_code`,`refresh_token`],response_types:[`code`],client_name:`MCP Inspector`,client_uri:`https://github.com/modelcontextprotocol/inspector`,scope:this.scope??``,application_type:`native`}}state(){return mz()}async clientInformation(e){return await this.storage.getClientInformation(this.serverUrl,!0)||await this.storage.getClientInformation(this.serverUrl,!1,e?.issuer)}async saveClientInformation(e,t){let n=t&&`registrationKind`in t?t.registrationKind:`dcr`,r=t&&`issuer`in t?t.issuer:void 0;await this.storage.saveClientInformation(this.serverUrl,e,{registrationKind:n,issuer:r})}async saveScope(e){await this.storage.saveScope(this.serverUrl,e),this.cachedScope=e}async savePreregisteredClientInformation(e){await this.storage.savePreregisteredClientInformation(this.serverUrl,e)}async tokens(e){return await this.storage.getTokens(this.serverUrl,e?.issuer)}async saveTokens(e,t){await this.storage.saveTokens(this.serverUrl,e,{issuer:t?.issuer})}redirectToAuthorization(e){this.capturedAuthUrl=e,this.suppressAuthorizationNavigation||(this.eventTarget&&this.eventTarget.dispatchEvent(new CustomEvent(`oauthAuthorizationRequired`,{detail:{url:e}})),this.navigation.navigateToAuthorization(e))}async saveCodeVerifier(e){await this.storage.saveCodeVerifier(this.serverUrl,e)}async codeVerifier(){let e=await this.storage.getCodeVerifier(this.serverUrl);if(!e)throw Error(`No code verifier saved for session`);return e}async clear(){await this.storage.clear(this.serverUrl)}async getServerMetadata(){return this.storage.getServerMetadata(this.serverUrl)}async saveServerMetadata(e){await this.storage.saveServerMetadata(this.serverUrl,e)}async saveDiscoveryState(e){await this.storage.saveDiscoveryState(this.serverUrl,e)}async discoveryState(){return this.storage.getDiscoveryState(this.serverUrl)}async invalidateCredentials(e){switch(e){case`all`:await this.storage.clear(this.serverUrl);return;case`client`:await this.storage.clearClientInformation(this.serverUrl);return;case`tokens`:await this.storage.clearTokens(this.serverUrl);return;case`verifier`:await this.storage.clearCodeVerifier(this.serverUrl);return;case`discovery`:await this.storage.clearDiscoveryState(this.serverUrl);return}}};function Jz(e){return e?`ema`:`standard`}var Yz={completedAt:null,isInitiatingAuth:!1,oauthTokens:null,oauthStep:`authorization_code`,oauthMetadata:null,resourceMetadata:null,resourceMetadataError:null,resource:null,authServerUrl:null,oauthClientInfo:null,authorizationUrl:null,authorizationCode:``,latestError:null,statusMessage:null,validationError:null};async function Xz(e,t){if(t.forceReauthorization&&t.authorizationCode!==void 0)throw Error(`forceReauthorization cannot be combined with authorizationCode`);return Yne(e,{serverUrl:t.serverUrl,authorizationCode:t.authorizationCode,iss:t.iss,scope:t.scope,resourceMetadataUrl:t.resourceMetadataUrl,fetchFn:t.fetchFn,skipIssuerMetadataValidation:t.skipIssuerMetadataValidation,forceReauthorization:t.forceReauthorization})}function Zz(e){return e===`disabled`?`This server uses enterprise-managed authorization, but Enterprise IdP is turned off in Client Settings. Open Client Settings, enable "Enterprise IdP configuration", then try connecting again.`:`This server uses enterprise-managed authorization, but the Inspector client IdP is not configured. Open Client Settings, enable Enterprise IdP, and set issuer, client ID, and client secret.`}var Qz=class extends Error{reason;constructor(e){super(Zz(e)),this.name=`EmaClientNotConfiguredError`,this.reason=e}};function $z(e){return e instanceof Qz}var eB=`urn:ietf:params:oauth:grant-type:jwt-bearer`,tB=`openid offline_access`;function nB(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t.padEnd(t.length+(4-t.length%4)%4,`=`),r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));return new TextDecoder().decode(i)}function rB(e){let t=e.split(`.`);if(!(t.length<2))try{let e=JSON.parse(nB(t[1]));if(typeof e.exp==`number`&&Number.isFinite(e.exp))return e.exp*1e3}catch{return}}function iB(e,t=6e4,n=Date.now()){let r=rB(e);return r!==void 0&&n>=r-t}function aB(e){let t=e.split(`.`);return t.length===3&&t[0].length>0&&t[1].length>0&&t[2]!==void 0}function oB(e){if(!aB(e))return;let t=e.split(`.`);try{return{header:JSON.parse(nB(t[0])),payload:JSON.parse(nB(t[1]))}}catch{return}}function sB(e){return e.replace(/\/$/,``)}function cB(e){return`ema-idp:${sB(e)}`}async function lB(e,t){let n;try{n=await e.json()}catch{return Error(`${t}: token request failed (HTTP ${e.status})`)}if(typeof n==`object`&&n){let e=n,r=[t];if(e.error&&r.push(`error=${e.error}`),e.error_description&&r.push(e.error_description),r.length>1)return Error(r.join(`: `))}return Error(`${t}: token request failed (HTTP ${e.status})`)}function uB(e,t,n,r){let i=KM(t,e?.token_endpoint_auth_methods_supported??[]);if(i===`client_secret_basic`&&t.client_secret){let e=btoa(`${t.client_id}:${t.client_secret}`);n.set(`Authorization`,`Basic ${e}`);return}if(i===`client_secret_post`&&t.client_secret){r.set(`client_id`,t.client_id),r.set(`client_secret`,t.client_secret);return}r.set(`client_id`,t.client_id)}async function dB(e,t,n,r,i){let a=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});return uB(n,r,a,t),(i??fetch)(e,{method:`POST`,headers:a,body:t})}function fB(e){return{client_id:e.clientId,client_secret:e.clientSecret,token_endpoint_auth_method:`client_secret_post`}}async function pB(e,t,n){let r=cB(e),i=await t.getServerMetadata(r);return i?.token_endpoint?i:mB(e,n)}async function mB(e,t){let n=await tN(fz(e,`EMA IdP issuer (Client Settings)`),{fetchFn:t});if(!n)throw Error(`Failed to discover OIDC metadata for IdP issuer ${e}`);return pO.parse(n)}async function hB(e){let t=sB(e.idp.issuer),n=await pB(t,e.storage,e.fetchFn),r=fB(e.idp),i=cB(t),a=mz(),{authorizationUrl:o,codeVerifier:s}=await nN(fz(t,`EMA IdP issuer (Client Settings)`),{metadata:n,clientInformation:r,redirectUrl:e.redirectUrl,scope:tB,state:a});return await e.storage.saveCodeVerifier(i,s),await e.storage.savePreregisteredClientInformation(i,r),await e.storage.saveServerMetadata(i,n),{authorizationUrl:o}}async function gB(e){let t=sB(e.idp.issuer),n=cB(t),r=await e.storage.getServerMetadata(n);if(!r)throw Error(`IdP OAuth metadata not found — restart EMA IdP login`);let i=await e.storage.getClientInformation(n,!0)??await e.storage.getClientInformation(n);if(!i)throw Error(`IdP client information not found — restart EMA IdP login`);let a=await e.storage.getCodeVerifier(n);if(!a)throw Error(`IdP PKCE verifier not found — restart EMA IdP login`);let o=await rre(fz(t,`EMA IdP issuer (Client Settings)`),{metadata:r,clientInformation:i,authorizationCode:e.authorizationCode,iss:e.iss,codeVerifier:a,redirectUri:e.redirectUrl,fetchFn:e.fetchFn}),s=o.id_token;if(!s)throw Error(`IdP token response did not include an ID Token`);await e.storage.clearCodeVerifier(n);let c=rB(s);return await e.storage.saveIdpSession(t,{idToken:s,refreshToken:o.refresh_token,idTokenExpiresAt:c}),{idToken:s,refreshToken:o.refresh_token,idTokenExpiresAt:c}}async function _B(e){let t=sB(e.idp.issuer),n=await e.storage.getIdpSession(t);if(!n?.refreshToken)throw Error(`IdP refresh token not available`);let r=await pB(t,e.storage,e.fetchFn);if(!r.token_endpoint)throw Error(`IdP metadata missing token_endpoint`);let i=new URLSearchParams({grant_type:`refresh_token`,refresh_token:n.refreshToken}),a=await dB(fz(r.token_endpoint,`IdP token_endpoint (from OIDC discovery)`),i,r,fB(e.idp),e.fetchFn);if(!a.ok)throw await lB(a,`EMA IdP refresh (OIDC refresh_token grant)`);let o=await a.json(),s=o.id_token;if(!s)throw Error(`IdP refresh did not return an ID Token`);return await e.storage.saveIdpSession(t,{idToken:s,refreshToken:o.refresh_token??n.refreshToken,idTokenExpiresAt:rB(s)}),s}async function vB(e){let t=sB(e.idp.issuer),n=await e.storage.getIdpSession(t);if(n?.idToken){if(!iB(n.idToken))return n.idToken;if(n.refreshToken)try{return await _B(e)}catch{return}}}function yB(e,t){let n=t?.authorization_servers?.[0];if(n)return fz(n,`protected resource authorization_servers[0]`);try{return new URL(`/`,e)}catch(t){let n=t instanceof Error?t.message:String(t);throw Error(`Invalid MCP server URL: "${e}" (${n})`)}}function bB(e,t){let n=t?.trim();if(n)return n;let r=e?.scopes_supported;if(r&&r.length>0)return r.join(` `)}async function xB(e,t,n){let r=await QM(e,void 0,n);if(!r.resource)throw Error(`EMA requires protected resource metadata with a resource identifier`);let i=yB(e,r),a=await ZM(e,{clientMetadata:{scope:t??``,redirect_uris:[]}},r),o=bB(r,t);return{resourceMetadata:r,resourceAsUrl:i,resourceUrl:a??void 0,scope:o}}async function SB(e,t){let n=await tN(e,{fetchFn:t});if(!n)throw Error(`Failed to discover resource authorization server metadata`);return n}async function CB(e){let t=sB(e.idp.issuer),n=e.resource.trim();if(!n)throw Error(`EMA leg 2 requires a resource identifier`);let r;try{r=await Pre({idpUrl:t,audience:e.audience,resource:n,idToken:e.idToken,clientId:e.idp.clientId,clientSecret:e.idp.clientSecret,scope:e.scope,fetchFn:e.fetchFn})}catch(e){let t=e instanceof Error?e.message:String(e);throw/Failed to discover token endpoint/i.test(t)?Error(`IdP metadata missing token_endpoint`,{cause:e}):/Invalid token exchange response/i.test(t)?Error(`IdP token exchange did not return an ID-JAG`,{cause:e}):Error(`EMA leg 2 (IdP token exchange for ID-JAG): ${t}`,{cause:e})}if(!r.jwtAuthGrant)throw Error(`IdP token exchange did not return an ID-JAG`);return r.jwtAuthGrant}async function wB(e){let t=await SB(e.resourceAsUrl,e.fetchFn);if(!t.token_endpoint)throw Error(`Resource AS metadata missing token_endpoint`);let n={client_id:e.resourceClientId,...e.resourceClientSecret&&{client_secret:e.resourceClientSecret},token_endpoint_auth_method:e.resourceClientSecret?`client_secret_post`:`none`},r=new URLSearchParams({grant_type:eB,assertion:e.idJag});e.scope&&r.set(`scope`,e.scope),e.resource&&r.set(`resource`,e.resource);let i=await dB(fz(t.token_endpoint,`resource authorization server token_endpoint (from AS discovery)`),r,t,n,e.fetchFn);if(!i.ok)throw await lB(i,`EMA leg 3 (resource AS JWT bearer grant)`);return gO.parse(await i.json())}function TB(e){let t=e instanceof Error?e.message:String(e);return Error(`EMA legs 2–3 (resource token mint): ${t}`,{cause:e})}async function EB(e,t){let n=t??await xB(e.serverUrl,e.scope,e.fetchFn);if(!e.resourceClientId)throw Error(`EMA requires resource authorization server clientId (per-server oauth.clientId)`);if(!e.resourceClientSecret?.trim())throw Error(`EMA requires resource authorization server client secret in server OAuth settings (Test Client secret from xaa.dev resource registration)`);let r=await vB({idp:e.idp,storage:e.storage,fetchFn:e.fetchFn});if(!r)throw Error(`Valid IdP ID Token required for EMA token mint`);let i=n.resourceAsUrl.href.replace(/\/$/,``),a=n.resourceUrl?.href??n.resourceMetadata.resource,o=await CB({idp:e.idp,idToken:r,audience:i,resource:a,scope:n.scope,fetchFn:e.fetchFn});return wB({resourceAsUrl:n.resourceAsUrl,idJag:o,resourceClientId:e.resourceClientId,resourceClientSecret:e.resourceClientSecret,resource:n.resourceUrl?.href,scope:n.scope,fetchFn:e.fetchFn})}async function DB(e){if(!await vB({idp:e.idp,storage:e.storage,fetchFn:e.fetchFn}))return{status:`no_idp_session`};try{let t=await EB(e);return await e.storage.saveTokens(e.serverUrl,t,{enterpriseManaged:!0}),{status:`success`}}catch(e){return{status:`mint_failed`,error:TB(e)}}}async function OB(e){let{authorizationUrl:t}=await hB({idp:e.idp,redirectUrl:e.redirectUrl,storage:e.storage,fetchFn:e.fetchFn});return t}async function kB(e,t,n){try{await gB({idp:e.idp,authorizationCode:t,iss:n,redirectUrl:e.redirectUrl,storage:e.storage,fetchFn:e.fetchFn})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`EMA leg 1 (IdP authorization code exchange): ${t}`,{cause:e})}let r;try{r=await EB(e)}catch(e){throw TB(e)}return await e.storage.saveTokens(e.serverUrl,r,{enterpriseManaged:!0}),r}async function AB(e){if(!await vB({idp:e.idp,storage:e.storage,fetchFn:e.fetchFn}))return;let t=await EB(e);return await e.storage.saveTokens(e.serverUrl,t,{enterpriseManaged:!0}),t}async function jB(e,t){let n=sB(t);if(!n)return`none`;let r=await e.getIdpSession(n);return r?.idToken?!iB(r.idToken)||r.refreshToken?`logged_in`:`expired`:`none`}async function MB(e,t){let n=sB(t);n&&(await e.clearIdpSession(n),await e.clear(cB(n)),await e.clearEnterpriseManagedResourceServers())}function NB(e){return e?.access_token?!iB(e.access_token):!1}function PB(e,t,n){if(e?.client_id)return{registrationKind:`static`,clientId:e.client_id,hasClientSecret:e.client_secret!==void 0&&e.client_secret!==``};if(t?.client_id)return{...n&&{registrationKind:n},clientId:t.client_id,hasClientSecret:t.client_secret!==void 0&&t.client_secret!==``}}function FB(e,t){return(typeof e?.scope==`string`?e.scope.trim():void 0)||(typeof t==`string`?t.trim():void 0)||void 0}async function IB(e){let{serverUrl:t,storage:n,flowState:r}=e,i=e.protocol,a=await n.getTokens(t),o=r?.oauthTokens??void 0,s=o&&NB(o)?o:a&&NB(a)?a:o??a,c=await n.getClientInformation(t,!0),l=await n.getClientInformation(t),u=await n.getScope(t),d=await n.getServerMetadata(t),f=NB(s),p=FB(s,u),m=await n.getClientRegistrationKind(t),h=m===`dcr`||m===`cimd`?m:void 0,g=PB(c,l,c?.client_id?void 0:h),_={authorized:f,protocol:i,serverUrl:t,...e.configuredScope?.trim()&&{configuredScope:e.configuredScope.trim()},...p&&{grantedScope:p},...s&&{tokens:s},...g&&{client:g},...d&&{authorizationServerMetadata:d}};if(i===`ema`&&e.enterpriseManagedAuth?.idp){let t=e.enterpriseManagedAuth.idp,r=sB(t.issuer),i=await jB(n,r),a=await n.getServerMetadata(cB(r));_.ema={idpIssuer:r,idpClientId:t.clientId,idpSession:i,...a&&{idpMetadata:a}},_.enterpriseManaged=!0}return _}function LB(e){return e.enterpriseManaged===!0||!!e.clientId?.trim()||!!e.clientSecret?.trim()||!!e.scope?.trim()||!!e.clientMetadataUrl?.trim()}async function RB(e,t){let[n,r,i]=await Promise.all([e.getTokens(t),e.getClientInformation(t,!0),e.getClientInformation(t)]);return!!(n?.access_token||r?.client_id||i?.client_id)}function zB(e){return Jz(e.enterpriseManaged)}async function BB(e){let t=e.provider.clientMetadataUrl?.trim();if(!t||(await e.provider.clientInformation())?.client_id)return;let n;try{n=await QM(e.serverUrl)}catch{n=void 0}if(!(await tN(yB(e.serverUrl,n),{...e.fetchFn&&{fetchFn:e.fetchFn}}))?.client_id_metadata_document_supported)return;let r={client_id:t};await e.provider.saveClientInformation(r,{registrationKind:`cimd`})}function VB(e,t=6e4){return e.access_token?!iB(e.access_token,t):!1}var HB=class{inner;emaConfig;constructor(e,t){this.inner=e,this.emaConfig=t}get redirectUrl(){return this.inner.redirectUrl}get clientMetadataUrl(){return this.inner.clientMetadataUrl}get clientMetadata(){return this.inner.clientMetadata}state(){return this.inner.state()}clientInformation(){return this.inner.clientInformation()}saveClientInformation(e){return this.inner.saveClientInformation(e)}async tokens(){let e=await this.inner.tokens();if(e&&VB(e))return e;let t=await AB(this.emaConfig);if(t)return t}saveTokens(e){return this.emaConfig.storage.saveTokens(this.emaConfig.serverUrl,e,{enterpriseManaged:!0})}async redirectToAuthorization(e){let t=await OB(this.emaConfig);this.inner.clearCapturedAuthUrl(),this.inner.redirectToAuthorization(t)}saveCodeVerifier(e){return this.inner.saveCodeVerifier(e)}codeVerifier(){return this.inner.codeVerifier()}},UB=Bne,WB=Vne;function GB(e,t){return e?.trim()||t?.trim()||void 0}function KB(e,t){return t?.trim()||UB(e,t)}function qB(e){return e===`tool`||e===`prompt`||e===`resource`||e===`app`}function JB(e,t){let n=qB(t?.recoverySource);return e===`step_up`?n?`Step-up authorization succeeded. Retry your action.`:`Step-up authorization succeeded.`:n?`Authentication succeeded. Retry your action.`:`Authentication succeeded.`}function YB(e){return qB(e?.recoverySource)?`Session credentials were updated. Retry your action.`:`Session credentials were updated.`}function XB(e,t){return e===`reauth`?`Sign-in was not completed. Re-authenticate to restore access.`:qB(t?.recoverySource)?`Step-up authorization was not completed. Retry your action.`:`Step-up authorization was not completed.`}function ZB(e,t){return e.reason===`insufficient_scope`&&!t?.enterpriseManaged}function QB(e,t){return e.reason===`insufficient_scope`&&t?.enterpriseManaged===!0}function $B(e,t){return ZB(e,t)||QB(e,t)}function eV(e,t){let n=e.context?.toolName?.trim();if(n)return t?.enterpriseManaged?`Tool "${n}" needs additional permissions from your organization before it can continue.`:`Tool "${n}" needs additional OAuth scopes before it can continue.`;let r=e.requiredScopes?.filter(Boolean);if(r?.length){let e=r.length===1?`scope`:`scopes`;return t?.enterpriseManaged?`This operation needs additional organization ${e}: ${r.join(`, `)}.`:`This operation needs additional ${e}: ${r.join(`, `)}.`}return t?.enterpriseManaged?`This operation needs additional permissions from your organization before it can continue.`:`This operation needs additional OAuth scopes before it can continue.`}function tV(e){return e?.enterpriseManaged?`Inspector will request the additional permissions from your enterprise identity provider. You may be asked to sign in if your organization session expired.`:`You will be redirected to authorize, then returned to the inspector.`}function nV(e){return e?.enterpriseManaged?`Additional organization permissions required`:`Additional permissions required`}function rV(){return`Requesting additional permissions from your organization…`}function iV(e){return qB(e?.recoverySource)?`Organization permissions were updated. Retry your action.`:`Organization permissions were updated.`}function aV(e){return e?.trim()?e:`Could not obtain the additional permissions from your organization.`}function oV(e){return e.requiredScopes?.filter(Boolean)??[]}function sV(e){let t=e.context?.toolName?.trim();if(t)return`Authorization completed, but required permissions for tool "${t}" were not granted. Grant the requested scopes on the authorization server, then retry.`;let n=e.authorizationScopes?.filter(Boolean)??e.requiredScopes?.filter(Boolean);return n?.length?`Authorization completed, but required scopes were not granted (${n.join(`, `)}). Grant the requested permissions on the authorization server, then retry your action.`:`Authorization completed, but the required permissions were not granted. Grant the requested scopes on the authorization server, then retry your action.`}function cV(e,t){if(t.context===`connect`)return;let n=t.serverName;return e===`step_up`?{title:n?`Step-up authorization for "${n}"`:`Step-up authorization`,message:`Redirecting to authorize additional permissions…`}:t.enterpriseManaged?{title:n?`Re-authenticating "${n}"`:`Re-authenticating`,message:`Re-authenticating…`}:{title:n?`Session expired for "${n}"`:`Session expired`,message:`Session expired, re-authenticating…`}}function lV(e){return e===`token_expired`||e===`unauthorized`||e===`invalid_token`}function uV(){return`Authorization state was lost`}function dV(e){return`The stored authorization state for ${e?.serverName?`"${e.serverName}"`:`this server`} was lost before the authorization server sent you back, so the sign-in could not be completed. This usually means a new browser session, a different tab, or authorization state that was cleared while the flow was in progress. Authorize again to reconnect.`}function fV(){return`Authorize again`}function pV(){return`Authorization server mismatch`}var mV=120;function hV(e){return e.length>mV?`${e.slice(0,mV)}…`:e}function gV(e){return`Authorization for ${e.serverName?`"${e.serverName}"`:`this server`} was stopped: the flow started at ${hV(e.recordedIssuer)} but the callback resolved ${hV(e.currentIssuer)}. The authorization code was not exchanged. Verify the server's authorization configuration before trying again.`}function _V(e,t){return e.kind===`lost_authorization_state`?{title:uV(),message:dV(t)}:{title:pV(),message:gV({recordedIssuer:e.recordedIssuer,currentIssuer:e.currentIssuer,serverName:t?.serverName})}}function vV(e){let t=e.serverName?`Authentication for "${e.serverName}" needs attention.`:`Authentication needs attention.`;return e.detail?`${t} ${e.detail}`:t}var yV=class{params;oauthConfig;oauthFlowState=null;pendingAuthorizationScope;authChallengeMutex=Promise.resolve();constructor(e){this.params=e,this.oauthConfig={...e.initialConfig},this.pendingAuthorizationScope=void 0}setOAuthConfig(e){this.oauthConfig={...this.oauthConfig,...e}}getServerUrl(){return this.params.getServerUrl()}requireStorage(){let e=this.oauthConfig.storage;if(!e)throw Error(`OAuth storage is required for this operation.`);return e}async createOAuthProvider(){if(!this.oauthConfig.storage||!this.oauthConfig.redirectUrlProvider||!this.oauthConfig.navigation)throw Error(`OAuth environment components (storage, navigation, redirectUrlProvider) are required.`);let e=new qz(this.getServerUrl(),{storage:this.oauthConfig.storage,redirectUrlProvider:this.oauthConfig.redirectUrlProvider,navigation:this.oauthConfig.navigation,clientMetadataUrl:this.oauthConfig.clientMetadataUrl});if(e.setEventTarget(this.params.getEventTarget()),await e.prepareForAuth(),e.scope===void 0&&this.oauthConfig.scope&&await e.saveScope(this.oauthConfig.scope),this.oauthConfig.clientId){let t={client_id:this.oauthConfig.clientId,...this.oauthConfig.clientSecret&&{client_secret:this.oauthConfig.clientSecret}};await e.savePreregisteredClientInformation(t)}return e}isEnterpriseManaged(){return this.oauthConfig.enterpriseManaged===!0}async getEmaFlowConfig(){if(!this.oauthConfig.storage||!this.oauthConfig.redirectUrlProvider)throw Error(`OAuth environment components (storage, redirectUrlProvider) are required.`);let e=this.params.enterpriseManagedAuth?.idp;if(!e){let e=this.params.installEnterpriseManagedAuth;throw new Qz(e?.enabled===!1&&e.idp?`disabled`:`not_configured`)}let t=await this.oauthConfig.storage.getScope(this.getServerUrl());return{serverUrl:this.getServerUrl(),idp:e,resourceClientId:this.oauthConfig.clientId,resourceClientSecret:this.oauthConfig.clientSecret,scope:UB(this.oauthConfig.scope,t)||this.oauthConfig.scope,redirectUrl:this.oauthConfig.redirectUrlProvider.getRedirectUrl(),storage:this.oauthConfig.storage,fetchFn:this.params.effectiveAuthFetch}}async trySilentEnterpriseManagedAuth(){if(!this.isEnterpriseManaged())return!1;let e=await DB(await this.getEmaFlowConfig());if(e.status===`success`)return!0;if(e.status===`mint_failed`)throw e.error;return!1}async authenticateEnterpriseManaged(){let e=await this.getEmaFlowConfig(),t=await DB(e);if(t.status===`success`)return;if(t.status===`mint_failed`)throw t.error;let n=await OB(e),r=n.searchParams.get(`state`);if(r&&this.params.onBeforeOAuthRedirect){let e=hz(r);e?.authId&&await this.params.onBeforeOAuthRedirect(e.authId)}return this.requireNavigation().navigateToAuthorization(n),await this.recordAuthorizationCodeFlowState(n),n}async authenticate(){if(this.isEnterpriseManaged())return this.authenticateEnterpriseManaged();let e=await this.createOAuthProvider(),t=this.getServerUrl();if(e.clearCapturedAuthUrl(),await BB({serverUrl:t,provider:e,fetchFn:this.params.effectiveAuthFetch}),await Xz(e,{serverUrl:t,scope:e.scope,fetchFn:this.params.effectiveAuthFetch})===`AUTHORIZED`)throw Error(`Unexpected: auth() returned AUTHORIZED without authorization code`);let n=e.getCapturedAuthUrl();if(!n)throw Error(`Failed to capture authorization URL`);let r=n.searchParams.get(`state`);if(r&&this.params.onBeforeOAuthRedirect){let e=hz(r);e?.authId&&await this.params.onBeforeOAuthRedirect(e.authId)}let i=await e.clientInformation();return this.oauthFlowState={...Yz,oauthStep:`authorization_code`,authorizationUrl:n,oauthClientInfo:i??null},n}async completeOAuthFlow(e,t){try{if(this.isEnterpriseManaged()){let n=await this.getEmaFlowConfig(),r=this.pendingAuthorizationScope??n.scope,i=await kB(r?{...n,scope:r}:n,e,t),a=this.pendingAuthorizationScope,o=GB(i.scope,a);o&&await this.requireStorage().saveScope(this.getServerUrl(),o),this.pendingAuthorizationScope=void 0;let s=Date.now();this.oauthFlowState={...Yz,oauthStep:`complete`,oauthTokens:i,completedAt:s},this.params.dispatchOAuthComplete({tokens:i});return}let n=await this.createOAuthProvider(),r=await Xz(n,{serverUrl:this.getServerUrl(),authorizationCode:e,iss:t,fetchFn:this.params.effectiveAuthFetch});if(r!==`AUTHORIZED`)throw Error(`Expected AUTHORIZED after providing authorization code, got: ${r}`);let i=await n.tokens();if(!i)throw Error(`Failed to retrieve tokens after authorization`);let a=this.pendingAuthorizationScope,o=GB(i.scope,a);o&&await n.saveScope(o),this.pendingAuthorizationScope=void 0;let s=await n.clientInformation(),c=Date.now();this.oauthFlowState=this.oauthFlowState?{...this.oauthFlowState,oauthStep:`complete`,oauthTokens:i,oauthClientInfo:s??null,completedAt:c}:{...Yz,oauthStep:`complete`,oauthTokens:i,oauthClientInfo:s??null,completedAt:c},this.params.dispatchOAuthComplete({tokens:i})}catch(e){throw this.pendingAuthorizationScope=void 0,this.params.dispatchOAuthError({error:e instanceof Error?e:Error(String(e))}),e}}async getOAuthTokens(){if(this.oauthFlowState?.oauthTokens)return this.oauthFlowState.oauthTokens;let e=await this.createOAuthProvider();try{return await e.tokens()}catch{return}}async clearOAuthTokens(){if(!this.oauthConfig?.storage)return;let e=this.getServerUrl();await this.oauthConfig.storage.clear(e),this.oauthFlowState=null,this.pendingAuthorizationScope=void 0}async isOAuthAuthorized(){return await this.getOAuthTokens()!==void 0}getOAuthFlowState(){return this.oauthFlowState?{...this.oauthFlowState}:void 0}getOAuthFlowStep(){return this.oauthFlowState?.oauthStep}async getOAuthState(){let e=this.oauthConfig.storage;if(!e)return;let t=this.getServerUrl();if(!(!LB(this.oauthConfig)&&!await RB(e,t)))return IB({serverUrl:this.getServerUrl(),protocol:zB(this.oauthConfig),configuredScope:this.oauthConfig.scope,enterpriseManagedAuth:this.params.enterpriseManagedAuth,storage:e,flowState:this.oauthFlowState??void 0})}async refreshEnterpriseManagedTokens(){return this.isEnterpriseManaged()?await AB(await this.getEmaFlowConfig())!==void 0:!1}async checkAuthChallengeSatisfied(e){let t=this.oauthConfig.storage;if(!t)return!1;let n=this.getServerUrl(),r=await t.getTokens(n);if(!r?.access_token)return!1;if(e.reason!==`insufficient_scope`)return e.reason===`token_expired`&&NB(r);let i=await this.enrichChallengeWithAuthorizationScopes(e,r.scope),a=i.authorizationScopes?.join(` `)??i.requiredScopes?.join(` `);return a?.trim()?!WB(a,KB(await t.getScope(n),r.scope)):!1}async handleAuthChallenge(e,t){if(e.reason===`insufficient_scope`&&await this.checkAuthChallengeSatisfied(e))return{kind:`satisfied`};let n=this.authChallengeMutex,r,i=new Promise(e=>{r=e});this.authChallengeMutex=i,await n;try{return e.reason===`insufficient_scope`&&await this.checkAuthChallengeSatisfied(e)?{kind:`satisfied`}:await this.runHandleAuthChallenge(e,t)}finally{r()}}async runHandleAuthChallenge(e,t){return this.isEnterpriseManaged()?this.handleEnterpriseManagedAuthChallenge(e,t):this.handleStandardAuthChallenge(e)}async enrichChallengeWithAuthorizationScopes(e,t){if(e.reason!==`insufficient_scope`)return e;let n=this.oauthConfig.storage,r=this.getServerUrl();t===void 0&&n&&(t=(await n.getTokens(r))?.scope);let i=UB(n?await n.getScope(r):void 0,t),a=e.requiredScopes?.filter(Boolean)??[],o=new Set(Ez(i)),s=a.filter(e=>!o.has(e)),c=s.length>0?s:a,l=Dz(i,a);return{...e,requiredScopes:c,authorizationScopes:l}}resolveEmaScopeForChallenge(e){if(e.reason===`insufficient_scope`){let t=e.requiredScopes?.join(` `).trim();if(t)return t}return this.oauthConfig.scope?.trim()||void 0}async emaFlowConfigForChallenge(e){let t=await this.getEmaFlowConfig(),n=e.authorizationScopes;if(n&&n.length>0)return{...t,scope:n.join(` `)};let r=this.resolveEmaScopeForChallenge(e);return r?{...t,scope:r}:t}async handleEnterpriseManagedAuthChallenge(e,t){let n=await this.enrichChallengeWithAuthorizationScopes(e);if(n.reason===`insufficient_scope`&&!t?.confirmedStepUp)return{kind:`step_up_confirm`,challenge:n};let r=await this.emaFlowConfigForChallenge(n);if(n.reason===`insufficient_scope`){let e=await DB(r);if(e.status===`success`&&await this.checkAuthChallengeSatisfied(n)){let e=GB((await this.requireStorage().getTokens(this.getServerUrl()))?.scope,n.authorizationScopes?.join(` `));return e&&await this.requireStorage().saveScope(this.getServerUrl(),e),{kind:`satisfied`}}if(e.status===`mint_failed`)return{kind:`failed`,error:e.error}}else if(await AB(r))return{kind:`satisfied`};try{let e=await OB(r);return n.reason===`insufficient_scope`&&n.authorizationScopes?.length&&(this.pendingAuthorizationScope=n.authorizationScopes.join(` `)),{kind:`interactive`,authorizationUrl:e,challenge:n}}catch(e){return{kind:`failed`,error:e instanceof Error?e:Error(String(e))}}}async handleStandardAuthChallenge(e){let t=await this.createOAuthProvider(),n=this.getServerUrl(),r=await t.tokens(),i=await this.enrichChallengeWithAuthorizationScopes(e,r?.scope);t.clearCapturedAuthUrl(),await BB({serverUrl:n,provider:t,fetchFn:this.params.effectiveAuthFetch});let a=i.reason===`insufficient_scope`?i.authorizationScopes?.join(` `):this.oauthConfig.scope?.trim()||(i.requiredScopes?.length?i.requiredScopes.join(` `):void 0);t.setSuppressAuthorizationNavigation(!0);let o;try{o=await Xz(t,{serverUrl:n,scope:a,fetchFn:this.params.effectiveAuthFetch,...i.reason===`insufficient_scope`&&{forceReauthorization:WB(a,r?.scope)}})}finally{t.setSuppressAuthorizationNavigation(!1)}if(o===`AUTHORIZED`)if(i.reason===`insufficient_scope`){if(await this.checkAuthChallengeSatisfied(i)){let e=GB((await t.tokens())?.scope,a);return e&&await t.saveScope(e),{kind:`satisfied`}}return await this.tryForceReauthorizationForStepUp(t,n,a,i)||{kind:`failed`,error:Error(sV(i))}}else return{kind:`satisfied`};let s=t.getCapturedAuthUrl();if(!s)return{kind:`failed`,error:Error(`Failed to capture authorization URL`)};i.reason===`insufficient_scope`&&a&&(this.pendingAuthorizationScope=a);let c=await t.clientInformation();return await this.recordAuthorizationCodeFlowState(s,c,i.reason===`insufficient_scope`?`scope_step_up`:`authorization_code`),{kind:`interactive`,authorizationUrl:s,challenge:i}}async beginInteractiveAuthorization(e){let t=e.searchParams.get(`state`);if(t&&this.params.onBeforeOAuthRedirect){let e=hz(t);e?.authId&&await this.params.onBeforeOAuthRedirect(e.authId)}this.requireNavigation().navigateToAuthorization(e);let n=await(await this.createOAuthProvider()).clientInformation();await this.recordAuthorizationCodeFlowState(e,n),this.params.dispatchOAuthAuthorizationRequired({url:e})}requireNavigation(){let e=this.oauthConfig.navigation;if(!e)throw Error(`OAuth navigation is required.`);return e}async recordAuthorizationCodeFlowState(e,t,n=`authorization_code`){this.oauthFlowState={...Yz,oauthStep:n,authorizationUrl:e,oauthClientInfo:t??null}}async tryForceReauthorizationForStepUp(e,t,n,r){e.clearCapturedAuthUrl(),e.setSuppressAuthorizationNavigation(!0);let i;try{i=await Xz(e,{serverUrl:t,scope:n,fetchFn:this.params.effectiveAuthFetch,forceReauthorization:!0})}finally{e.setSuppressAuthorizationNavigation(!1)}if(i!==`AUTHORIZED`)return null;if(await this.checkAuthChallengeSatisfied(r)){let t=GB((await e.tokens())?.scope,n);return t&&await e.saveScope(t),{kind:`satisfied`}}return null}async createOAuthProviderForTransport(){let e=await this.createOAuthProvider();return this.isEnterpriseManaged()?new HB(e,await this.getEmaFlowConfig()):e}};function bV(e){return{oauthTokens:{access_token:e.access_token,token_type:e.token_type,expires_in:e.expires_in,refresh_token:e.refresh_token,scope:e.scope,id_token:e.id_token}}}var xV=6e4;function SV(e){if(`method`in e&&`id`in e&&e.id!==null&&e.id!==void 0)return e.method===`subscriptions/listen`?void 0:e.id}function CV(e){return typeof e==`object`&&!!e&&`ok`in e&&e.ok===!1&&`kind`in e&&e.kind===`auth_challenge`}function wV(e){return typeof e==`object`&&!!e&&`ok`in e&&e.ok===!1&&`kind`in e&&e.kind===`transport_error`}function TV(e){if(typeof e==`object`&&e&&`sessionId`in e&&typeof e.sessionId==`string`&&!(`ok`in e)||typeof e==`object`&&e&&`ok`in e&&e.ok===!0&&`sessionId`in e)return e.sessionId}async function*EV(e){let t=new TextDecoder,n=``;for(;;){let{done:r,value:i}=await e.read();if(r)break;n+=t.decode(i,{stream:!0});let a=n.split(`
|
|
148
|
-
`);n=a.pop()??``;let o=`message`,s=[];for(let e of a)e.startsWith(`event:`)?o=e.slice(6).trim():e.startsWith(`data:`)?s.push(e.slice(5).trimStart()):e===``&&(s.length>0&&(yield{event:o,data:s.join(`
|
|
149
|
-
`)}),o=`message`,s=[])}if(n.trim()){let e=n.split(`
|
|
150
|
-
`),t=`message`,r=[];for(let n of e)n.startsWith(`event:`)?t=n.slice(6).trim():n.startsWith(`data:`)&&r.push(n.slice(5).trimStart());r.length>0&&(yield{event:t,data:r.join(`
|
|
151
|
-
`)})}}var DV=class{_sessionId=void 0;eventStreamReader=null;eventStreamAbort=null;eventStreamConsumeTask=null;restartingEventStream=!1;closed=!1;sseResponseWaits=new Map;options;config;get sessionId(){}getRemoteBackendSessionId(){return this._sessionId}async attachToSession(e){this.closed&&=!1,await this.stopEventStream(),this._sessionId=e,await this.openEventStream()}constructor(e,t){this.options=e,this.config=t}setAuthRecovery(e){this.options.authRecovery=e}setOnAuthChallenge(e){this.options.onAuthChallenge=e}get fetchFn(){return this.options.fetchFn??globalThis.fetch}get baseUrl(){return this.options.baseUrl.replace(/\/$/,``)}get headers(){let e={"Content-Type":`application/json`};return this.options.authToken&&(e[`x-mcp-remote-auth`]=`Bearer ${this.options.authToken}`),e}async recoverFromAuthChallenge(e,t){let n=this.options.authRecovery;if(!n)throw new bz(e,e.raw?.httpStatus??401);let r=await n.handleAuthChallenge(e);if(r.kind===`satisfied`){await t();return}throw r.kind===`step_up_confirm`?new xz(yz,r.challenge,{emaStepUpConfirm:!0}):r.kind===`interactive`?new xz(r.authorizationUrl,r.challenge):r.error}async start(){if(!(this._sessionId&&!this.closed))return this.startWithRecovery(0)}async startWithRecovery(e){if(this.sessionId)return;if(this.closed)throw Error(`Transport is closed`);let t;if(this.options.authProvider){let e=await this.options.authProvider.tokens();e&&(t=bV(e))}let n={config:this.config,...t&&{authState:t},...this.options.settings&&{settings:this.options.settings}},r=await this.fetchFn(`${this.baseUrl}/api/mcp/connect`,{method:`POST`,headers:this.headers,body:JSON.stringify(n)});if(!r.ok){let e=await r.text(),t=Error(`Remote connect failed (${r.status}): ${e}`);throw t.status=r.status,t}let i=await r.json();if(CV(i)){if(e>=1)throw new bz(i.authChallenge,i.authChallenge.raw?.httpStatus??401);await this.recoverFromAuthChallenge(i.authChallenge,()=>this.startWithRecovery(e+1));return}if(wV(i))throw Error(`Remote connect failed: ${i.error}`);let a=TV(i);if(!a)throw Error(`Remote did not return sessionId`);this._sessionId=a,await this.openEventStream()}async openEventStream(){this.eventStreamAbort=new AbortController;let e=await this.fetchFn(`${this.baseUrl}/api/mcp/events?sessionId=${encodeURIComponent(this._sessionId)}`,{headers:this.options.authToken?{"x-mcp-remote-auth":`Bearer ${this.options.authToken}`}:{},signal:this.eventStreamAbort.signal});if(!e.ok)throw this._sessionId=void 0,Error(`Remote events stream failed (${e.status}): ${await e.text()}`);let t=e.body;if(!t)throw Error(`Remote events stream has no body`);this.eventStreamReader=t.getReader(),this.eventStreamConsumeTask=this.consumeEventStream()}async stopEventStream(){this.restartingEventStream=!0;try{this.eventStreamAbort?.abort();let e=this.eventStreamReader;if(e)try{await e.cancel()}catch{}this.eventStreamReader=null,this.eventStreamConsumeTask&&=(await this.eventStreamConsumeTask,null)}finally{this.restartingEventStream=!1}}async consumeEventStream(){if(this.eventStreamReader)try{for await(let{data:e}of EV(this.eventStreamReader)){if(this.closed)break;try{let t=JSON.parse(e);if(t.type===`message`){let e=t.data;this.settleSseResponseWait(e),this.onmessage?.(e,void 0)}else if(t.type===`fetch_request`&&this.options.onFetchRequest){let e=t.data;this.options.onFetchRequest({...e,timestamp:typeof e.timestamp==`string`?new Date(e.timestamp):e.timestamp})}else if(t.type===`fetch_request_body_update`&&this.options.onFetchResponseBody)this.options.onFetchResponseBody(t.data.id,t.data.responseBody);else if(t.type===`stdio_log`&&this.options.onStderr)this.options.onStderr({timestamp:new Date(t.data.timestamp),message:t.data.message});else if(t.type===`auth_challenge`)this.options.onAuthChallenge?.(t.data);else if(t.type===`transport_error`){let e=Error(t.data.error);t.data.code!==void 0&&(e.code=t.data.code),this.restartingEventStream||(this.onerror?.(e),this.closed||(this.closed=!0,this.onclose?.()))}}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}}catch(e){!this.closed&&e instanceof Error&&e.name!==`AbortError`&&this.onerror?.(e)}finally{this.eventStreamReader=null,!this.closed&&!this.restartingEventStream&&(this.closed=!0,this.onclose?.())}}async send(e,t){return this.postSend(e,t,0)}async pushAuthState(e){if(!this._sessionId)throw Error(`Transport not started`);if(this.closed)throw Error(`Transport is closed`);let t=e??await this.buildAuthStateFromProvider();if(!t.oauthTokens&&!t.oauthClient)throw Error(`No auth state to push`);let n=await this.fetchFn(`${this.baseUrl}/api/mcp/auth-state`,{method:`POST`,headers:this.headers,body:JSON.stringify({sessionId:this._sessionId,authState:t})});if(!n.ok){let e=await n.text();throw Error(`Remote auth-state update failed (${n.status}): ${e}`)}let r=await n.json();if(!r.ok)throw Error(r.error??`Remote auth-state update failed`)}async buildAuthStateFromProvider(){if(!this.options.authProvider)throw Error(`No auth provider configured`);let e=await this.options.authProvider.tokens();if(!e)throw Error(`No OAuth tokens available`);return bV(e)}get sseResponseTimeoutMs(){return this.options.sseResponseTimeoutMs??xV}settleSseResponseWait(e){if(!(`id`in e)||e.id===null||e.id===void 0||!(`result`in e)&&!(`error`in e))return;let t=this.sseResponseWaits.get(e.id);t&&(this.sseResponseWaits.delete(e.id),t.resolve())}cancelSseResponseWait(e){let t=this.sseResponseWaits.get(e);t&&(this.sseResponseWaits.delete(e),t.reject(Error(`SSE response wait cancelled`)))}cancelAllSseWaits(e){for(let t of this.sseResponseWaits.values())t.reject(e);this.sseResponseWaits.clear()}waitForSseResponse(e){return new Promise((t,n)=>{let r=setTimeout(()=>{this.sseResponseWaits.delete(e),n(Error(`Timed out waiting for MCP response on SSE (${this.sseResponseTimeoutMs}ms)`))},this.sseResponseTimeoutMs);this.sseResponseWaits.set(e,{resolve:()=>{clearTimeout(r),t()},reject:e=>{clearTimeout(r),n(e)}})})}async postSend(e,t,n){let r=SV(e),i;r!==void 0&&(i=this.waitForSseResponse(r),i.catch(()=>{}));let a;try{a=await this.requestSend(e,t)}catch(e){throw r!==void 0&&this.cancelSseResponseWait(r),e}if(a.ok){i&&await i;return}if(r!==void 0&&this.cancelSseResponseWait(r),a.kind===`auth_challenge`){if(n>=1||!this.options.authRecovery?.pushAuthState)throw new bz(a.authChallenge,a.authChallenge.raw?.httpStatus??401);await this.recoverFromAuthChallenge(a.authChallenge,async()=>(await this.options.authRecovery.pushAuthState(),this.postSend(e,t,n+1)));return}throw Error(a.error)}async requestSend(e,t){if(!this._sessionId)throw Error(`Transport not started`);if(this.closed)throw Error(`Transport is closed`);let n={sessionId:this._sessionId,message:e,...t?.relatedRequestId!=null&&{relatedRequestId:t.relatedRequestId}},r=await this.fetchFn(`${this.baseUrl}/api/mcp/send`,{method:`POST`,headers:this.headers,body:JSON.stringify(n)});if(!r.ok){let e=await r.text(),t=Error(`Remote send failed (${r.status}): ${e}`);throw t.status=r.status,t}return await r.json()}async close(){if(!this.closed){if(this.closed=!0,this.cancelAllSseWaits(Error(`Transport closed`)),await this.stopEventStream(),this._sessionId){try{await this.fetchFn(`${this.baseUrl}/api/mcp/disconnect`,{method:`POST`,headers:this.headers,body:JSON.stringify({sessionId:this._sessionId})})}catch{}this._sessionId=void 0}this.onclose?.()}}onclose;onerror;onmessage},OV={name:`mcp-inspector`,version:`0.0.0`},kV=5;function AV(){return Error(`Pending request aborted`)}var jV=`Tool call cancelled by user`,MV=500;async function NV(e){try{await e.close()}catch{}}function PV(e){if(typeof e==`object`&&e){let t=e.shape?.method?.value;if(typeof t==`string`)return t}}var FV=500,IV=15e3,LV=8,RV=class e extends rz{static MRTR_MAX_ROUNDS=10;client=null;appRendererClientProxy=null;outputValidator=null;transport=null;baseTransport=null;transportHasAuthProvider=!1;ambientAuthChallengeInFlight=new Map;pipeStderr;initialLoggingLevel;modernLogLevel;sample;elicit;progress;resetTimeoutOnProgress;requestTimeout;defaultMetadata;serverSettings;versionNegotiation;status=`disconnected`;disconnecting=!1;capabilities;serverInfo;instructions;protocolVersion;protocolEra;discoverResult;excludedTools=[];clientCapabilities={};clientInfo;pendingSamples=[];pendingElicitations=[];roots;rootsCapabilityAdvertised;elicitationCapabilityAdvertised;samplingCapabilityAdvertised;tasksCapabilityAdvertised;urlElicitationCapabilityAdvertised;rootsListChangedCapabilityAdvertised;listChangedNotifications;subscribedResources=new Set;modernSubscription=null;modernListenGeneration=0;modernStreamState=TN;modernReconnectAttempts=0;modernReconnectTimer;cancelledTaskIds=new Set;taskInputAbortControllers=new Map;pendingRawWireRequests=new Map;rawWireRequestCounter=0;activeToolCallAbortController;receiverTasks;advertisedExtensions;receiverTaskTtlMs;receiverTaskRecords=new Map;oauthManager=null;logger;transportClientFactory;fetchFn;effectiveAuthFetch;sessionId;transportConfig;directAuthRecoveryActive=null;authRecoveryDepth=0;static MAX_NESTED_AUTH_RECOVERIES=3;directAuthRecovery;constructor(e,t){if(super(),this.transportConfig=e,this.transportClientFactory=t.environment.transport,this.fetchFn=t.environment.fetch,this.logger=t.environment.logger??Nz,this.pipeStderr=t.pipeStderr??!1,this.initialLoggingLevel=t.initialLoggingLevel,this.sample=t.sample??!0,this.elicit=t.elicit??!0,this.receiverTasks=t.receiverTasks??!1,this.advertisedExtensions=t.advertisedExtensions,this.receiverTaskTtlMs=t.receiverTaskTtlMs??6e4,this.progress=t.progress??!0,this.resetTimeoutOnProgress=t.resetTimeoutOnProgress??!0,this.requestTimeout=t.timeout,this.defaultMetadata=t.defaultMetadata&&Object.keys(t.defaultMetadata).length>0?t.defaultMetadata:void 0,this.serverSettings=t.serverSettings,this.modernLogLevel=EN(t.serverSettings),this.versionNegotiation=t.versionNegotiation??{mode:`legacy`},this.directAuthRecovery=t.directAuthRecovery??!1,this.roots=t.roots===void 0?void 0:jN(t.roots),this.listChangedNotifications={tools:t.listChangedNotifications?.tools??!0,resources:t.listChangedNotifications?.resources??!0,prompts:t.listChangedNotifications?.prompts??!0},this.effectiveAuthFetch=this.buildEffectiveAuthFetch(),this.sessionId=t.sessionId,t.oauth||t.environment.oauth){let e={...t.environment.oauth,...t.oauth};this.oauthManager=new yV({getServerUrl:()=>this.getServerUrl(),effectiveAuthFetch:this.effectiveAuthFetch,getEventTarget:()=>this,onBeforeOAuthRedirect:e=>(this.sessionId=e,this.saveSession(),Promise.resolve()),initialConfig:e,enterpriseManagedAuth:t.enterpriseManagedAuth,installEnterpriseManagedAuth:t.installEnterpriseManagedAuth,dispatchOAuthComplete:e=>this.dispatchTypedEvent(`oauthComplete`,e),dispatchOAuthAuthorizationRequired:e=>this.dispatchTypedEvent(`oauthAuthorizationRequired`,e),dispatchOAuthError:e=>this.dispatchTypedEvent(`oauthError`,e)})}let n={versionNegotiation:this.versionNegotiation,inputRequired:{autoFulfill:!1}},r={};if(this.sample&&(r.sampling={}),this.elicit){let e={};this.elicit===!0?e.form={}:(this.elicit.form&&(e.form={}),this.elicit.url&&(e.url={})),Object.keys(e).length>0&&(r.elicitation=e)}if(this.roots!==void 0&&(r.roots={listChanged:!0}),this.receiverTasks){let e={};r.sampling&&(e.sampling={createMessage:{}}),r.elicitation&&(e.elicitation={create:{}}),r.tasks={list:{},cancel:{},...Object.keys(e).length>0&&{requests:e}}}let i=aL({enterpriseManaged:t.oauth?.enterpriseManaged??!1,advertised:this.advertisedExtensions});Object.keys(i).length>0&&(r.extensions={...r.extensions,...i}),n.capabilities=r,this.clientCapabilities=r,this.rootsCapabilityAdvertised=r.roots!==void 0,this.elicitationCapabilityAdvertised=r.elicitation!==void 0,this.samplingCapabilityAdvertised=r.sampling!==void 0,this.tasksCapabilityAdvertised=r.tasks!==void 0,this.urlElicitationCapabilityAdvertised=r.elicitation?.url!==void 0,this.rootsListChangedCapabilityAdvertised=r.roots?.listChanged===!0,this.appRendererClientProxy=null,this.clientInfo=t.clientIdentity??{name:OV.name.split(`/`)[1]??OV.name,version:OV.version},this.client=new Mre(this.clientInfo,Object.keys(n).length>0?n:void 0)}buildEffectiveAuthFetch(){return Gz(this.fetchFn??fetch,{trackRequest:e=>this.dispatchFetchRequest({...e,category:`auth`}),updateResponseBody:(e,t)=>this.dispatchFetchRequestBodyUpdate(e,t)})}createMessageTrackingCallbacks(){return{trackRequest:(e,t)=>{let n={id:crypto.randomUUID(),timestamp:new Date,direction:`request`,origin:t,message:e};this.dispatchTypedEvent(`message`,n)},trackResponse:(e,t)=>{let n={id:crypto.randomUUID(),timestamp:new Date,direction:`response`,origin:t,message:e};this.dispatchTypedEvent(`message`,n)},trackNotification:(e,t)=>{let n={id:crypto.randomUUID(),timestamp:new Date,direction:`notification`,origin:t,message:e};this.dispatchTypedEvent(`message`,n)}}}attachTransportListeners(e){e.onclose=()=>{this.disconnecting||this.status!==`disconnected`&&(this.status!==`error`&&(this.status=`disconnected`,this.dispatchTypedEvent(`statusChange`,this.status)),this.clearAndAnnouncePendingPeerRequests(),this.rejectPendingRawWireRequests(`Connection closed`),this.dispatchTypedEvent(`disconnect`))},e.onerror=e=>{this.status!==`connecting`&&(this.status=`error`,this.dispatchTypedEvent(`statusChange`,this.status),this.dispatchTypedEvent(`error`,e))}}mergeMeta(e){let t=this.defaultMetadata,n=this.protocolEra===`modern`&&this.modernLogLevel?{[iT]:this.modernLogLevel}:void 0,r={...t??{},...n??{},...e??{}};return Object.keys(r).length>0?r:void 0}getRequestOptions(e,t){let n={resetTimeoutOnProgress:this.resetTimeoutOnProgress};if(this.requestTimeout!==void 0&&(n.timeout=this.requestTimeout),t&&(n.signal=t),this.progress){let t=e;n.onprogress=e=>{let n={...e,...t!=null&&{progressToken:t}};this.dispatchTypedEvent(`progressNotification`,n)}}return n}getCacheableRequestOptions(e){let t=this.getRequestOptions();return e!==void 0&&(t.cacheMode=e),t}aggregateListParams(e){let t=this.mergeMeta(e);return t?{_meta:t}:void 0}isHttpOAuthConfig(){let e=SN(this.transportConfig);return(e===`sse`||e===`streamable-http`)&&!!this.oauthManager}static isTerminalTaskStatus(e){return e===`completed`||e===`failed`||e===`cancelled`}installReceiverTaskResponseBypass(e,t){if(!this.client)return;let n=this.client,r=n._requestHandlers.get(e);r&&n._requestHandlers.set(e,(e,n)=>{let i=e?.params?.task;return this.tasksCapabilityAdvertised&&i!=null?t(e):r(e,n)})}createReceiverTask(e){let t=crypto.randomUUID(),n=e.ttl??(typeof this.receiverTaskTtlMs==`function`?this.receiverTaskTtlMs():this.receiverTaskTtlMs),r=new Date().toISOString(),i={taskId:t,status:e.initialStatus,ttl:n,createdAt:r,lastUpdatedAt:r,...e.pollInterval!=null&&{pollInterval:e.pollInterval},...e.statusMessage!=null&&{statusMessage:e.statusMessage}},a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(()=>{});let c={task:i,payloadPromise:s,resolvePayload:a,rejectPayload:o};return c.cleanupTimeoutId=setTimeout(()=>{c.cleanupTimeoutId=void 0,this.receiverTaskRecords.delete(t)},n),this.receiverTaskRecords.set(t,c),c}emitReceiverTaskStatus(e){if(this.client)try{let t=XD.parse({method:`notifications/tasks/status`,params:e});this.client.notification(t).catch(t=>{this.logger.warn({err:t,taskId:e.taskId},`receiver task status notification failed`)})}catch(t){this.logger.warn({err:t,taskId:e.taskId},`receiver task status notification failed`)}}upsertReceiverTask(e){let t=this.receiverTaskRecords.get(e.taskId);t&&(t.task=e,this.emitReceiverTaskStatus(e))}getReceiverTask(e){return this.receiverTaskRecords.get(e)}listReceiverTasks(){return Array.from(this.receiverTaskRecords.values()).map(e=>e.task)}async getReceiverTaskPayload(e){let t=this.receiverTaskRecords.get(e);if(!t)throw new Ck(Sk.InvalidParams,`Unknown taskId: ${e}`);return t.payloadPromise}cancelReceiverTask(t){let n=this.receiverTaskRecords.get(t);if(!n)throw new Ck(Sk.InvalidParams,`Unknown taskId: ${t}`);if(e.isTerminalTaskStatus(n.task.status))return n.task;let r=new Date().toISOString(),i={...n.task,status:`cancelled`,lastUpdatedAt:r};return n.task=i,n.rejectPayload(Error(`Task cancelled`)),n.cleanupTimeoutId!=null&&(clearTimeout(n.cleanupTimeoutId),n.cleanupTimeoutId=void 0),this.emitReceiverTaskStatus(i),i}async dropCachedTransport(){if(!this.baseTransport&&!this.transport){this.transportHasAuthProvider=!1;return}try{await this.client?.close()}catch{}this.baseTransport=null,this.transport=null,this.transportHasAuthProvider=!1}registerPeerRequestHandlers(){if(this.samplingCapabilityAdvertised&&this.client){let e=e=>{let t=e.params?.task;if(this.tasksCapabilityAdvertised&&t!=null){let n=this.createReceiverTask({ttl:t.ttl,initialStatus:`input_required`,statusMessage:`Awaiting user input`});(async()=>{let t=new iz(e,e=>{n.resolvePayload(e);let t=new Date().toISOString(),r={...n.task,status:`completed`,lastUpdatedAt:t};n.task=r,this.upsertReceiverTask(r)},e=>{n.rejectPayload(e);let t=new Date().toISOString(),r={...n.task,status:`failed`,lastUpdatedAt:t,statusMessage:e instanceof Error?e.message:String(e)};n.task=r,this.upsertReceiverTask(r)},e=>this.removePendingSample(e));this.addPendingSample(t)})();let r={task:n.task};return Promise.resolve(r)}return this.enqueuePendingSample(e,`server-request`)};this.client.setRequestHandler(`sampling/createMessage`,e),this.tasksCapabilityAdvertised&&this.installReceiverTaskResponseBypass(`sampling/createMessage`,e)}if(this.elicitationCapabilityAdvertised&&this.client){let e=e=>{let t=e.params?.task;if(this.tasksCapabilityAdvertised&&t!=null){let n=this.createReceiverTask({ttl:t.ttl,initialStatus:`input_required`,statusMessage:`Awaiting user input`});(async()=>{let t=new az(e,e=>{n.resolvePayload(e);let t=new Date().toISOString(),r={...n.task,status:`completed`,lastUpdatedAt:t};n.task=r,this.upsertReceiverTask(r)},e=>this.removePendingElicitation(e),e=>{n.rejectPayload(e);let t=new Date().toISOString(),r={...n.task,status:`failed`,lastUpdatedAt:t,statusMessage:e.message};n.task=r,this.upsertReceiverTask(r)});this.addPendingElicitation(t)})();let r={task:n.task};return Promise.resolve(r)}return this.enqueuePendingElicitation(e,`server-request`)};this.client.setRequestHandler(`elicitation/create`,e),this.tasksCapabilityAdvertised&&this.installReceiverTaskResponseBypass(`elicitation/create`,e)}this.rootsCapabilityAdvertised&&this.client&&this.client.setRequestHandler(`roots/list`,async()=>({roots:this.roots??[]})),this.tasksCapabilityAdvertised&&this.client&&(this.client.setRequestHandler(`tasks/list`,{params:tO.shape.params},async()=>({tasks:this.listReceiverTasks()})),this.client.setRequestHandler(`tasks/get`,{params:ZD.shape.params},async e=>{let t=this.getReceiverTask(e.taskId);if(!t)throw new Ck(Sk.InvalidParams,`Unknown taskId: ${e.taskId}`);return t.task}),this.client.setRequestHandler(`tasks/result`,{params:$D.shape.params},async e=>this.getReceiverTaskPayload(e.taskId)),this.client.setRequestHandler(`tasks/cancel`,{params:rO.shape.params},async e=>this.cancelReceiverTask(e.taskId)))}registerPeerNotificationHandlers(){this.client&&this.client.setNotificationHandler(`notifications/roots/list_changed`,async()=>{this.dispatchTypedEvent(`rootsChange`,[...this.roots??[]])})}clearReceiverTasks(){for(let e of this.receiverTaskRecords.values())e.cleanupTimeoutId!=null&&clearTimeout(e.cleanupTimeoutId);this.receiverTaskRecords.clear()}resetSubscriptionStream(){let e=this.modernSubscription;this.subscribedResources.clear(),this.modernListenGeneration++,this.clearModernReconnectTimer(),this.modernReconnectAttempts=0,this.modernSubscription=null,this.setModernStreamState(TN),this.dispatchSubscriptionsChange(),e&&NV(e)}resetSessionState(){this.clearReceiverTasks(),this.resetSubscriptionStream(),this.cancelledTaskIds.clear();for(let[,e]of this.taskInputAbortControllers)e.abort(Error(`Connection ended`));this.taskInputAbortControllers.clear(),this.modernLogLevel=EN(this.serverSettings)}clearPendingPeerRequests(){for(let e of this.pendingSamples)e.cancel();this.pendingSamples=[];for(let e of this.pendingElicitations)e.cancel();this.pendingElicitations=[]}clearAndAnnouncePendingPeerRequests(){this.pendingSamples.length===0&&this.pendingElicitations.length===0||(this.clearPendingPeerRequests(),this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations))}async connect(){if(!this.client)throw Error(`Client not initialized`);if(this.status===`connected`)return;this.resetSessionState(),this.clearAndAnnouncePendingPeerRequests(),this.rejectPendingRawWireRequests(`Connection ended`);let e=this.oauthManager;if(this.baseTransport&&this.isHttpOAuthConfig()&&e&&!this.transportHasAuthProvider&&!e.isEnterpriseManaged()&&await e.isOAuthAuthorized()&&await this.dropCachedTransport(),!this.baseTransport){let t={fetchFn:this.fetchFn,pipeStderr:this.pipeStderr,onStderr:e=>{this.dispatchStderrLog(e)},onFetchRequest:e=>{this.dispatchFetchRequest({...e,category:`transport`})},onFetchResponseBody:(e,t)=>{this.dispatchFetchRequestBodyUpdate(e,t)},...this.serverSettings&&{settings:this.serverSettings}};if(this.isHttpOAuthConfig()&&e)if(e.isEnterpriseManaged()){await e.trySilentEnterpriseManagedAuth();let n=await e.createOAuthProviderForTransport();if(!(await n.tokens())?.access_token){let e=Error(`Unauthorized: EMA resource access token unavailable`);throw e.status=401,e.code=401,e}t.authProvider=n}else await e.isOAuthAuthorized()&&(t.authProvider=await e.createOAuthProviderForTransport());this.directAuthRecovery&&this.directAuthRecoveryActive!==!1&&this.isHttpOAuthConfig()&&e&&(t.authProvider||this.probesProtocolEra())&&(t.interceptAuthChallenges=!0),this.transportHasAuthProvider=!!t.authProvider;let{transport:n}=this.transportClientFactory(this.transportConfig,t);this.baseTransport=n,this.directAuthRecovery&&(this.directAuthRecoveryActive=!(n instanceof DV)),n instanceof DV&&e&&this.isHttpOAuthConfig()&&(n.setAuthRecovery({handleAuthChallenge:(t,n)=>e.handleAuthChallenge(t,n),pushAuthState:()=>this.pushRemoteAuthState()}),n.setOnAuthChallenge(e=>{this.handleAmbientAuthChallenge(e)}));let r=this.createMessageTrackingCallbacks();this.transport=new oie(n,r,{rewriteIncomingResult:e=>this.rewriteModernTaskResult(e),consumeIncomingResponse:e=>this.consumeRawWireResponse(e)}),this.attachTransportListeners(this.baseTransport)}if(!this.transport)throw Error(`Transport not initialized`);try{this.status=`connecting`,this.dispatchTypedEvent(`statusChange`,this.status),this.registerPeerRequestHandlers(),this.registerPeerNotificationHandlers();let e=this.serverSettings?.connectionTimeout??0,t=this.client.connect(this.transport).catch(e=>{throw Cz(e)??e}),n=!1,r=async r=>{if(r>0){if(n=!0,this.status!==`connected`)throw Error(`Connection closed during authorization recovery, after re-authorizing successfully`);return}if(e>0){t.catch(()=>{});let n,r=new Promise((t,r)=>{n=setTimeout(()=>r(Error(`Connection timed out after ${e} ms`)),e)});try{await Promise.race([t,r])}finally{n&&clearTimeout(n)}}else await t};try{await this.invokeMcpClient(r)}catch(t){throw e>0&&await this.disconnect().catch(()=>{}),t}if(n)return;this.status=`connected`,this.dispatchTypedEvent(`statusChange`,this.status),await this.fetchServerInfo(),this.dispatchTypedEvent(`connect`),this.initialLoggingLevel&&this.capabilities?.logging&&await this.client.setLoggingLevel(this.initialLoggingLevel,this.getRequestOptions()),this.client&&(this.listChangedNotifications.tools&&this.capabilities?.tools?.listChanged&&this.client.setNotificationHandler(`notifications/tools/list_changed`,async()=>{this.dispatchTypedEvent(`toolsListChanged`)}),this.listChangedNotifications.resources&&this.capabilities?.resources?.listChanged&&this.client.setNotificationHandler(`notifications/resources/list_changed`,async()=>{this.dispatchTypedEvent(`resourcesListChanged`),this.dispatchTypedEvent(`resourceTemplatesListChanged`)}),this.listChangedNotifications.prompts&&this.capabilities?.prompts?.listChanged&&this.client.setNotificationHandler(`notifications/prompts/list_changed`,async()=>{this.dispatchTypedEvent(`promptsListChanged`)}),this.capabilities?.tasks&&(this.client.setNotificationHandler(`notifications/tasks/list_changed`,{params:ez.shape.params},async()=>{this.dispatchTypedEvent(`tasksListChanged`)}),this.client.setNotificationHandler(`notifications/tasks/status`,{params:XD.shape.params},async e=>{let t=e;this.dispatchTypedEvent(`taskStatusChange`,{taskId:t.taskId,task:t})})),this.capabilities?.resources?.subscribe===!0&&this.client.setNotificationHandler(`notifications/resources/updated`,async e=>{let t=e.params.uri;this.subscribedResources.has(t)&&this.dispatchTypedEvent(`resourceUpdated`,{uri:t})}),this.urlElicitationCapabilityAdvertised&&this.client.setNotificationHandler(`notifications/elicitation/complete`,async e=>{let{elicitationId:t}=e.params,n=this.pendingElicitations.find(e=>e.request.params?.mode===`url`&&e.request.params?.elicitationId===t);n&&n.completeIfPending()}))}catch(e){throw Sz(e)||(this.status=`error`,this.dispatchTypedEvent(`statusChange`,this.status)),this.baseTransport&&!this.transportHasAuthProvider&&await this.dropCachedTransport(),this.clearAndAnnouncePendingPeerRequests(),e}}async disconnect(e=0){this.disconnecting=!0;try{if(this.client){if(e>0){let t=this.client._responseHandlers,n=Date.now()+e;for(;t?.size!==void 0&&t.size>0&&Date.now()<n;)await new Promise(e=>setTimeout(e,10))}try{await this.client.close()}catch{}}}finally{this.disconnecting=!1}this.baseTransport=null,this.transport=null,this.transportHasAuthProvider=!1,this.clearPendingPeerRequests(),this.status!==`disconnected`&&(this.status=`disconnected`,this.dispatchTypedEvent(`statusChange`,this.status),this.dispatchTypedEvent(`disconnect`)),this.resetSubscriptionStream(),this.cancelledTaskIds.clear(),this.rejectPendingRawWireRequests(`Disconnected`);for(let[,e]of this.taskInputAbortControllers)e.abort(Error(`Disconnected`));this.taskInputAbortControllers.clear(),this.activeToolCallAbortController?.abort(`Disconnected`),this.activeToolCallAbortController=void 0,this.clearReceiverTasks(),this.appRendererClientProxy=null,this.capabilities=void 0,this.serverInfo=void 0,this.instructions=void 0,this.protocolVersion=void 0,this.protocolEra=void 0,this.discoverResult=void 0,this.excludedTools=[],this.modernLogLevel=void 0,this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations),this.dispatchTypedEvent(`capabilitiesChange`,this.capabilities),this.dispatchTypedEvent(`serverInfoChange`,this.serverInfo),this.dispatchTypedEvent(`instructionsChange`,this.instructions),this.dispatchTypedEvent(`protocolVersionChange`,this.protocolVersion),this.dispatchTypedEvent(`protocolEraChange`,this.protocolEra),this.dispatchTypedEvent(`discoverResultChange`,this.discoverResult),this.dispatchTypedEvent(`excludedToolsChange`,this.excludedTools)}getAppRendererClient(){if(!this.client||this.status!==`connected`)return null;if(this.appRendererClientProxy!==null)return this.appRendererClientProxy;let e=this.client;return this.appRendererClientProxy=new Proxy(this.client,{get(t,n,r){let i=Reflect.get(t,n,r);return n===`setNotificationHandler`&&typeof i==`function`?(t,...n)=>{let r=typeof t==`string`?t:PV(t)??t;return i.apply(e,[r,...n])}:i}}),this.appRendererClientProxy}async ping(){if(!this.client)throw Error(`Client not initialized`);await this.client.request({method:`ping`},DT,this.getRequestOptions())}getStatus(){return this.status}getTransportConfig(){return this.transportConfig}getServerType(){return SN(this.transportConfig)}getTaskCapabilities(){if(this.capabilities?.tasks)return{list:!!this.capabilities.tasks.list,cancel:!!this.capabilities.tasks.cancel}}isTasksExtensionNegotiated(){return this.isModernEra()&&this.capabilities?.extensions?.[`io.modelcontextprotocol/tasks`]!==void 0}withModernTaskEnvelope(e){let t=e._meta??{},n={...this.clientCapabilities,extensions:{...this.clientCapabilities.extensions,[JI]:{}}},r=this.getProtocolVersion()??`2026-07-28`;return{...e,_meta:{...t,[$w]:r,[eT]:this.clientInfo,[nT]:n}}}rewriteModernTaskResult(e){if(!XI(e.result))return e;let t=e.result;return{...e,result:{resultType:`complete`,content:[{type:`text`,text:`Modern task ${t.taskId} created`}],_meta:{[YI]:t}}}}async rawWireRequest(e,t,n){let r=this.transport;if(!r)throw Error(`Client is not connected`);let i=`inspector-ext-${this.rawWireRequestCounter+=1}`,a={jsonrpc:`2.0`,id:i,method:e,params:t},o=this.requestTimeout??3e4,s=await new Promise((t,n)=>{let s=setTimeout(()=>{this.pendingRawWireRequests.delete(i),n(Error(`Raw request "${e}" timed out after ${o} ms`))},o);this.pendingRawWireRequests.set(i,{resolve:t,reject:n,timer:s}),r.send(a).catch(e=>{let t=this.pendingRawWireRequests.get(i);t&&(clearTimeout(t.timer),this.pendingRawWireRequests.delete(i)),n(e instanceof Error?e:Error(String(e)))})});return n.parse(s)}consumeRawWireResponse(e){let t=String(e.id),n=this.pendingRawWireRequests.get(t);if(!n)return!1;if(this.pendingRawWireRequests.delete(t),clearTimeout(n.timer),`error`in e){let r=e.error;n.reject(Error(r?.message??`Request ${t} failed`))}else n.resolve(e.result);return!0}rejectPendingRawWireRequests(e){for(let[,t]of this.pendingRawWireRequests)clearTimeout(t.timer),t.reject(Error(e));this.pendingRawWireRequests.clear()}async getRequestorTask(e){if(!this.client)throw Error(`Client is not connected`);if(this.isTasksExtensionNegotiated()){let t=tL(await this.rawWireRequest(`tasks/get`,this.withModernTaskEnvelope({taskId:e}),QI));return this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:t.taskId,task:t}),t}let t=await this.client.request({method:`tasks/get`,params:{taskId:e}},QD,this.getRequestOptions());return this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:t.taskId,task:t}),t}async getRequestorTaskResult(e){if(!this.client)throw Error(`Client is not connected`);return await this.client.request({method:`tasks/result`,params:{taskId:e}},YE,this.getRequestOptions())}async cancelRequestorTask(e){if(!this.client)throw Error(`Client is not connected`);this.cancelledTaskIds.add(e);let t=this.taskInputAbortControllers.get(e);t&&t.abort(Error(`Task ${e} cancelled by user`)),this.isTasksExtensionNegotiated()?await this.rawWireRequest(`tasks/cancel`,this.withModernTaskEnvelope({taskId:e}),eL):await this.client.request({method:`tasks/cancel`,params:{taskId:e}},iO,this.getRequestOptions()),this.dispatchTypedEvent(`taskCancelled`,{taskId:e})}async updateRequestorTask(e,t){if(!this.client)throw Error(`Client is not connected`);await this.rawWireRequest(`tasks/update`,this.withModernTaskEnvelope({taskId:e,inputResponses:t}),$I)}cancelToolCall(){let e=this.activeToolCallAbortController;return e?(this.activeToolCallAbortController=void 0,e.abort(jV),!0):!1}async listRequestorTasks(e){if(!this.client)throw Error(`Client is not connected`);let t=await this.client.request({method:`tasks/list`,params:e?{cursor:e}:{}},nO,this.getRequestOptions());return{tasks:t.tasks,nextCursor:t.nextCursor}}enqueuePendingSample(e,t,n){return new Promise((r,i)=>{let a=new iz(e,r,i,e=>this.removePendingSample(e),t);this.addPendingSample(a),this.wirePendingAbort(n,()=>{this.removePendingSample(a.id),i(AV())})})}enqueuePendingElicitation(e,t,n){return new Promise((r,i)=>{let a=new az(e,r,e=>this.removePendingElicitation(e),i,t);this.addPendingElicitation(a),this.wirePendingAbort(n,()=>{this.removePendingElicitation(a.id),i(AV())})})}wirePendingAbort(e,t){if(e){if(e.aborted){t();return}e.addEventListener(`abort`,t,{once:!0})}}async requestWithInputRequired(t,n,r,i){let a=this.client;if(!a)throw Error(`Client is not connected`);let o=sj(r),s=i.signal,c=0,l=n;for(;;){let r=await a.request({method:t,params:l},o,{...i,allowInputRequired:!0});if(!_A(r))return r;if(c+=1,c>e.MRTR_MAX_ROUNDS)throw Error(`Multi-round-trip "${t}" exceeded ${e.MRTR_MAX_ROUNDS} input_required rounds without completing.`);let u=await this.fulfilInputRequests(r.inputRequests,s);l={...n,...u?{inputResponses:u}:{},...r.requestState===void 0?{}:{requestState:r.requestState}}}}async fulfilInputRequests(e,t,n=`input-required`){if(!e)return;let r={};for(let[i,a]of Object.entries(e))r[i]=await this.fulfilEmbeddedInputRequest(a,t,n);return r}async fulfilEmbeddedInputRequest(e,t,n=`input-required`){switch(e.method){case`roots/list`:return{roots:this.roots??[]};case`elicitation/create`:return this.enqueuePendingElicitation(e,n,t);case`sampling/createMessage`:return this.enqueuePendingSample(e,n,t);default:throw Error(`Unsupported embedded input_required request method: ${e.method}`)}}getPendingSamples(){return[...this.pendingSamples]}addPendingSample(e){this.pendingSamples.push(e),this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples),this.dispatchTypedEvent(`newPendingSample`,e)}removePendingSample(e){let t=this.pendingSamples.findIndex(t=>t.id===e);t!==-1&&(this.pendingSamples.splice(t,1),this.dispatchTypedEvent(`pendingSamplesChange`,this.pendingSamples))}getPendingElicitations(){return[...this.pendingElicitations]}addPendingElicitation(e){this.pendingElicitations.push(e),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations),this.dispatchTypedEvent(`newPendingElicitation`,e)}removePendingElicitation(e){let t=this.pendingElicitations.findIndex(t=>t.id===e);t!==-1&&(this.pendingElicitations.splice(t,1),this.dispatchTypedEvent(`pendingElicitationsChange`,this.pendingElicitations))}getCapabilities(){return this.capabilities}getClientCapabilities(){return this.clientCapabilities}getServerInfo(){return this.serverInfo}getInstructions(){return this.instructions}getProtocolVersion(){return this.protocolVersion}getProtocolEra(){return this.protocolEra}getDiscoverResult(){return this.discoverResult}getServerSettings(){return this.serverSettings}setServerSettings(e){this.serverSettings=e}async setLoggingLevel(e){if(!this.client)throw Error(`Client is not connected`);if(!this.capabilities?.logging)throw Error(`Server does not support logging`);await this.client.setLoggingLevel(e,this.getRequestOptions())}setModernLogLevel(e){this.modernLogLevel=e}getModernLogLevel(){return this.modernLogLevel}async listTools(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`tools/list`,params:r},JE,this.getRequestOptions(t?.progressToken)));return{tools:[...i.tools||[]],nextCursor:i.nextCursor}}async listAllTools(e){if(!this.client)throw Error(`Client is not connected`);let t=await this.invokeMcpClient(()=>this.client.listTools(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)));return await this.refreshExcludedTools(e?.metadata).catch(()=>{}),{tools:[...t.tools]}}excludesInvalidXMcpHeaderTools(){return this.isModernEra()&&this.getServerType()!==`stdio`}getExcludedTools(){return this.excludedTools}async refreshExcludedTools(e){let t=[];if(this.excludesInvalidXMcpHeaderTools()){let n=new Set,r;do{let i=await this.listTools(r,e);for(let e of i.tools){let n=xN(e.inputSchema);n.valid||t.push({tool:e,reason:n.reason})}if(r=i.nextCursor,r!==void 0){if(n.has(r))break;n.add(r)}}while(r!==void 0)}return this.excludedTools=t,this.dispatchTypedEvent(`excludedToolsChange`,t),t}async callTool(e,t,n,r,i,a){if(!this.client)throw Error(`Client is not connected`);if(e.execution?.taskSupport===`required`)throw Error(`Tool "${e.name}" requires task support. Use callToolStream() instead of callTool().`);let o={tool:e,args:t,generalMetadata:n,toolSpecificMetadata:r,taskOptions:i,options:a},s=new AbortController;this.activeToolCallAbortController=s;try{return await this.callToolWithRetries(o,s)}finally{this.activeToolCallAbortController===s&&(this.activeToolCallAbortController=void 0)}}async callToolWithRetries(e,t){let{tool:n,args:r,generalMetadata:i,toolSpecificMetadata:a}=e,o=0,s=new Set;for(;;)try{return await this.attemptToolCall(e,t.signal)}catch(e){if(t.signal.aborted&&t.signal.reason===jV)throw new cz(n.name);let c=sz(e);if(c&&c.length>0&&o<kV){let e=c.find(e=>s.has(e.url));if(e){let t=new oz(e.url);throw this.dispatchFailedToolCall(n,r,i,a,t.message),t}o++;for(let e of c)s.add(e.url);let t=await this.runUrlElicitations(c);if(t===`accept`)continue;let l=Error(`Tool call cancelled: required URL elicitation was ${t===`decline`?`declined`:`cancelled`}.`);throw this.dispatchFailedToolCall(n,r,i,a,l.message),l}throw c&&c.length>0&&this.logger.warn({tool:n.name,attempts:o},`Tool "${n.name}" still required URL elicitations after ${kV} attempts; giving up.`),this.dispatchFailedToolCall(n,r,i,a,e instanceof Error?e.message:String(e)),e}}async attemptToolCall(e,t){let{tool:n,args:r,generalMetadata:i,toolSpecificMetadata:a,taskOptions:o,options:s}=e;if(!this.client)throw Error(`Client is not connected`);let c=r,l={};for(let[e,t]of Object.entries(r))typeof t==`string`&&(l[e]=t);if(Object.keys(l).length>0){let e=kN(n,l);c={...r,...e}}let u=i||a?{...i||{},...a||{}}:void 0,d=new Date,f=this.mergeMeta(u),p={name:n.name,arguments:c,_meta:f};o?.ttl!=null&&(p.task={ttl:o.ttl});let m=this.getRequestOptions(f?.progressToken,t),h=await this.invokeMcpClient(()=>this.requestWithInputRequired(`tools/call`,p,YE,m),{method:`tools/call`,toolName:n.name}),g=h._meta?.[YI],_=g?await this.pollModernTaskToTermination(g):h,v=this.validateToolOutput(n,_);if(v&&!s?.skipOutputValidation)throw new Ck(Sk.InvalidParams,v);let y={toolName:n.name,params:r,result:_,timestamp:d,success:!0,metadata:f,outputValidationError:v};return this.dispatchTypedEvent(`toolCallResultChange`,{toolName:n.name,params:r,result:y.result,timestamp:d,success:!0,metadata:f,outputValidationError:v}),y}dispatchFailedToolCall(e,t,n,r,i){let a=n||r?{...n||{},...r||{}}:void 0,o=this.mergeMeta(a);this.dispatchTypedEvent(`toolCallResultChange`,{toolName:e.name,params:t,result:null,timestamp:new Date,success:!1,error:i,metadata:o})}async runUrlElicitations(e){for(let t of e){let e=await this.awaitUrlElicitation(t);if(e!==`accept`)return e}return`accept`}awaitUrlElicitation(e){return new Promise(t=>{let n=new az({method:`elicitation/create`,params:e},e=>t(e.action),e=>this.removePendingElicitation(e));this.addPendingElicitation(n)})}validateToolOutput(e,t){return this.outputValidator??=new QR,$R(this.outputValidator,e,t)}async submitModernTaskInput(t,n,r,i){if(n.status!==`input_required`)return r;let a=r+1;if(a>e.MRTR_MAX_ROUNDS)throw Error(`Modern task "${n.taskId}" exceeded ${e.MRTR_MAX_ROUNDS} input_required rounds without completing.`);let o=await this.fulfilInputRequests(this.tagInputRequestsWithTask(nL(t),n.taskId),i,`task-input-required`);return o&&await this.updateRequestorTask(n.taskId,o),a}tagInputRequestsWithTask(e,t){if(!e)return e;let n={};for(let[r,i]of Object.entries(e)){let e=i;n[r]={...e,params:{...e.params,_meta:{...e.params?._meta,[Qw]:{taskId:t}}}}}return n}modernTaskTerminalOutcome(e,t){return e.status===`completed`?{type:`result`,result:t.result??{content:[]}}:{type:`error`,error:new Ck(Sk.InternalError,e.statusMessage??`Task ${e.status}`)}}taskPollInterval(e){let t=e.pollInterval;return typeof t==`number`&&t>0?t:MV}registerTaskInputAbort(e){let t=new AbortController;return this.taskInputAbortControllers.set(e,t),{signal:t.signal,release:()=>{this.taskInputAbortControllers.get(e)===t&&this.taskInputAbortControllers.delete(e)}}}async pollModernTaskToTermination(t){let n=t,r=tL(n),i=e=>{this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:e.taskId,task:e}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:e.taskId,task:e})};i(r);let{signal:a,release:o}=this.registerTaskInputAbort(r.taskId);try{let t=0;for(;!e.isTerminalTaskStatus(r.status);)t=await this.submitModernTaskInput(n,r,t,a),await new Promise(e=>setTimeout(e,this.taskPollInterval(r))),n=await this.rawWireRequest(`tasks/get`,this.withModernTaskEnvelope({taskId:r.taskId}),QI),r=tL(n),i(r)}finally{o()}let s=this.modernTaskTerminalOutcome(r,n);if(s.type===`error`)throw s.error;return s.result}async*pollTaskToolCall(t,n){if(!this.client)throw Error(`Client is not connected`);let r=this.client,i=r._progressHandlers,a=new Set(i.keys()),o=this.isTasksExtensionNegotiated(),s=r.request({method:`tools/call`,params:t},o?YE:JD.or(YE),n),c=n.onprogress?[...i.keys()].find(e=>!a.has(e)):void 0,l=await s;if(o){let t=l._meta?.[YI];if(!t){yield{type:`result`,result:l};return}let r=t,a=tL(r);yield{type:`taskCreated`,task:a},c!=null&&n.onprogress&&i.set(c,n.onprogress);let{signal:o,release:s}=this.registerTaskInputAbort(a.taskId),u=0;try{for(;!e.isTerminalTaskStatus(a.status);)u=await this.submitModernTaskInput(r,a,u,o),await new Promise(e=>setTimeout(e,this.taskPollInterval(a))),r=await this.rawWireRequest(`tasks/get`,this.withModernTaskEnvelope({taskId:a.taskId}),QI),a=tL(r),yield{type:`taskStatus`,task:a}}finally{s(),c!=null&&i.delete(c)}yield this.modernTaskTerminalOutcome(a,r);return}if(!(`task`in l)||l.task==null){yield{type:`result`,result:l};return}let u=l.task;yield{type:`taskCreated`,task:u},c!=null&&n.onprogress&&i.set(c,n.onprogress);try{for(;!e.isTerminalTaskStatus(u.status);)await new Promise(e=>setTimeout(e,this.taskPollInterval(u))),u=await r.request({method:`tasks/get`,params:{taskId:u.taskId}},QD,this.getRequestOptions()),yield{type:`taskStatus`,task:u}}finally{c!=null&&i.delete(c)}u.status===`completed`?yield{type:`result`,result:await r.request({method:`tasks/result`,params:{taskId:u.taskId}},YE,this.getRequestOptions())}:yield{type:`error`,error:new Ck(Sk.InternalError,u.statusMessage??`Task ${u.status}`)}}async callToolStream(e,t,n,r,i){if(!this.client)throw Error(`Client is not connected`);try{let a=t,o={};for(let[e,n]of Object.entries(t))typeof n==`string`&&(o[e]=n);if(Object.keys(o).length>0){let n=kN(e,o);a={...t,...n}}let s=n||r?{...n||{},...r||{}}:void 0,c=new Date,l=this.mergeMeta(s),u={name:e.name,arguments:a};l&&(u._meta=l),i?.ttl!=null&&(u.task={ttl:i.ttl});let d,f,p,m=this.getRequestOptions(l?.progressToken);if(this.progress){let e=m.onprogress;m.onprogress=t=>{e?.(t),f&&this.dispatchTypedEvent(`requestorTaskProgress`,{taskId:f,progress:t})}}let h=this.pollTaskToolCall(u,m);for await(let e of h)switch(e.type){case`taskCreated`:f=e.task.taskId,this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:e.task.taskId,task:e.task}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:e.task.taskId,task:e.task});break;case`taskStatus`:f||=e.task.taskId,this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:e.task.taskId,task:e.task}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:e.task.taskId,task:e.task});break;case`result`:if(d=e.result,f){let e={taskId:f,ttl:null,status:`completed`,statusMessage:`Task completed`,lastUpdatedAt:new Date().toISOString()};this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:f,task:e,result:d}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:f,task:e,result:d})}break;case`error`:{let t=e.error.message||`Task execution failed`;if(p=Error(t),f){let n=this.cancelledTaskIds.has(f);this.cancelledTaskIds.delete(f);let r={taskId:f,ttl:null,status:n?`cancelled`:`failed`,statusMessage:n?`Client cancelled task execution.`:t,lastUpdatedAt:new Date().toISOString()};this.dispatchTypedEvent(`toolCallTaskUpdated`,{taskId:f,task:r,error:e.error}),this.dispatchTypedEvent(`requestorTaskUpdated`,{taskId:f,task:r,error:e.error})}break}}if(p)throw p;if(!d&&f)try{d=await this.client.request({method:`tasks/result`,params:{taskId:f}},YE,this.getRequestOptions())}catch(e){throw Error(`Tool call did not return a result: ${e instanceof Error?e.message:String(e)}`)}if(!d)throw Error(`Tool call did not return a result`);let g={toolName:e.name,params:t,result:d,timestamp:c,success:!0,metadata:l};return this.dispatchTypedEvent(`toolCallResultChange`,{toolName:e.name,params:t,result:g.result,timestamp:c,success:!0,metadata:l}),g}catch(i){let a=n||r?{...n||{},...r||{}}:void 0,o=new Date,s=this.mergeMeta(a);throw this.dispatchTypedEvent(`toolCallResultChange`,{toolName:e.name,params:t,result:null,timestamp:o,success:!1,error:i instanceof Error?i.message:String(i),metadata:s}),i}}async listResources(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`resources/list`,params:r},sE,this.getRequestOptions(t?.progressToken)));return{resources:i.resources||[],nextCursor:i.nextCursor}}async listAllResources(e){if(!this.client)throw Error(`Client is not connected`);return{resources:[...(await this.invokeMcpClient(()=>this.client.listResources(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)))).resources]}}async readResource(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={uri:e,...n?{_meta:n}:{}},i={result:await this.invokeMcpClient(()=>this.requestWithInputRequired(`resources/read`,r,pE,this.getRequestOptions(t?.progressToken)),{method:`resources/read`}),timestamp:new Date,uri:e,metadata:n};return this.dispatchTypedEvent(`resourceContentChange`,{uri:e,content:i,timestamp:i.timestamp}),i}async readResourceFromTemplate(e,t,n){if(!this.client)throw Error(`Client is not connected`);let r=e,i;try{i=new Gj(r).expand(t)}catch(t){throw Error(`Failed to expand URI template "${e}": ${t instanceof Error?t.message:String(t)}`)}let a=await this.readResource(i,n),o={uriTemplate:r,expandedUri:i,result:a.result,timestamp:a.timestamp,params:t,metadata:a.metadata};return this.dispatchTypedEvent(`resourceTemplateContentChange`,{uriTemplate:r,content:o,params:t,timestamp:o.timestamp}),o}async listResourceTemplates(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`resources/templates/list`,params:r},lE,this.getRequestOptions(t?.progressToken)),{method:`resources/templates/list`});return{resourceTemplates:i.resourceTemplates||[],nextCursor:i.nextCursor}}async listAllResourceTemplates(e){if(!this.client)throw Error(`Client is not connected`);return{resourceTemplates:[...(await this.invokeMcpClient(()=>this.client.listResourceTemplates(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)),{method:`resources/templates/list`})).resourceTemplates]}}async listPrompts(e,t){if(!this.client)throw Error(`Client is not connected`);let n=this.mergeMeta(t),r={...n?{_meta:n}:{},...e?{cursor:e}:{}},i=await this.invokeMcpClient(()=>this.client.request({method:`prompts/list`,params:r},jE,this.getRequestOptions(t?.progressToken)));return{prompts:i.prompts||[],nextCursor:i.nextCursor}}async listAllPrompts(e){if(!this.client)throw Error(`Client is not connected`);return{prompts:[...(await this.invokeMcpClient(()=>this.client.listPrompts(this.aggregateListParams(e?.metadata),this.getCacheableRequestOptions(e?.cacheMode)))).prompts]}}async getPrompt(e,t,n){if(!this.client)throw Error(`Client is not connected`);let r=t?Yre(t):{},i=this.mergeMeta(n),a={name:e,arguments:r,...i?{_meta:i}:{}},o={result:await this.invokeMcpClient(()=>this.requestWithInputRequired(`prompts/get`,a,HE,this.getRequestOptions(n?.progressToken)),{method:`prompts/get`,toolName:e}),timestamp:new Date,name:e,params:Object.keys(r).length>0?r:void 0,metadata:i};return this.dispatchTypedEvent(`promptContentChange`,{name:e,content:o,timestamp:o.timestamp}),o}async getCompletions(e,t,n,r,i){if(!this.client)return{values:[]};try{let a=this.mergeMeta(i),o={ref:e,argument:{name:t,value:n},...r?{context:{arguments:r}}:{},...a?{_meta:a}:{}},s=await this.invokeMcpClient(()=>this.client.complete(o,this.getRequestOptions(i?.progressToken)),{method:`completion/complete`,toolName:e.type===`ref/prompt`?e.name:e.uri});return{values:s.completion.values||[],total:s.completion.total,hasMore:s.completion.hasMore}}catch(e){if(e instanceof Ck&&e.code===Sk.MethodNotFound||e instanceof Error&&(e.message.includes(`Method not found`)||e.message.includes(`does not support completions`)))return{values:[]};throw Error(`Failed to get completions: ${e instanceof Error?e.message:String(e)}`)}}async fetchServerInfo(){if(this.client)try{this.capabilities=this.client.getServerCapabilities(),this.dispatchTypedEvent(`capabilitiesChange`,this.capabilities),this.serverInfo=this.client.getServerVersion(),this.instructions=this.client.getInstructions(),this.dispatchTypedEvent(`serverInfoChange`,this.serverInfo),this.instructions!==void 0&&this.dispatchTypedEvent(`instructionsChange`,this.instructions),this.protocolEra=this.client.getProtocolEra(),this.dispatchTypedEvent(`protocolEraChange`,this.protocolEra),this.discoverResult=this.client.getDiscoverResult(),this.dispatchTypedEvent(`discoverResultChange`,this.discoverResult),this.protocolVersion=this.client.getNegotiatedProtocolVersion(),this.dispatchTypedEvent(`protocolVersionChange`,this.protocolVersion)}catch{}}dispatchStderrLog(e){this.dispatchTypedEvent(`stderrLog`,e)}dispatchFetchRequest(e){this.logger.info({component:`InspectorClient`,category:e.category,fetchRequest:{url:e.url,method:e.method,headers:e.requestHeaders,body:e.requestBody??`[no body]`},fetchResponse:e.error?{error:e.error}:{status:e.responseStatus,statusText:e.responseStatusText,headers:e.responseHeaders,body:e.responseBody}},`${e.category} fetch`),this.dispatchTypedEvent(`fetchRequest`,e)}dispatchFetchRequestBodyUpdate(e,t){this.dispatchTypedEvent(`fetchRequestBodyUpdate`,{id:e,responseBody:t})}getSessionId(){return this.sessionId}setSessionId(e){this.sessionId=e}saveSession(){this.sessionId&&this.dispatchTypedEvent(`saveSession`,{sessionId:this.sessionId})}getRoots(){return this.roots===void 0?[]:[...this.roots]}async setRoots(e){if(!this.client)throw Error(`Client is not connected`);if(this.roots=jN(e),this.dispatchTypedEvent(`rootsChange`,[...this.roots]),!this.rootsListChangedCapabilityAdvertised){this.logger.warn("setRoots() on a client that did not advertise `roots.listChanged`; roots are stored locally but the change is not announced");return}try{await this.client.notification({method:`notifications/roots/list_changed`})}catch(e){this.logger.error({error:e},`Failed to send roots/list_changed notification`)}}getSubscribedResources(){return Array.from(this.subscribedResources)}isSubscribedToResource(e){return this.subscribedResources.has(e)}supportsResourceSubscriptions(){return this.capabilities?.resources?.subscribe===!0}isModernEra(){return this.protocolEra===`modern`}getResourceSubscriptionStreamState(){return this.modernStreamState}setModernStreamState(e){this.modernStreamState=e,this.dispatchTypedEvent(`resourceSubscriptionStreamChange`,e)}dispatchSubscriptionsChange(){this.dispatchTypedEvent(`resourceSubscriptionsChange`,Array.from(this.subscribedResources))}buildSubscriptionFilter(){let e={resourceSubscriptions:Array.from(this.subscribedResources)};return this.listChangedNotifications.tools&&this.capabilities?.tools?.listChanged&&(e.toolsListChanged=!0),this.listChangedNotifications.resources&&this.capabilities?.resources?.listChanged&&(e.resourcesListChanged=!0),this.listChangedNotifications.prompts&&this.capabilities?.prompts?.listChanged&&(e.promptsListChanged=!0),e}clearModernReconnectTimer(){this.modernReconnectTimer!==void 0&&(clearTimeout(this.modernReconnectTimer),this.modernReconnectTimer=void 0)}async refreshModernSubscription(e=!1){if(!this.client)return;e||(this.clearModernReconnectTimer(),this.modernReconnectAttempts=0);let t=++this.modernListenGeneration,n=this.modernSubscription;if(this.modernSubscription=null,n&&await NV(n),this.subscribedResources.size===0){this.setModernStreamState(TN);return}let r=await this.client.listen(this.buildSubscriptionFilter(),this.getRequestOptions());if(t!==this.modernListenGeneration){await NV(r);return}this.modernSubscription=r,this.modernReconnectAttempts=0,this.setModernStreamState({active:!0,status:`acknowledged`,honoredUris:r.honoredFilter.resourceSubscriptions??[]}),r.closed.then(e=>this.onModernSubscriptionClosed(r,e,t),()=>{})}onModernSubscriptionClosed(e,t,n){if(!(n!==this.modernListenGeneration||this.modernSubscription!==e)){if(this.modernSubscription=null,!(t===`remote`&&!wN(this.status)&&this.subscribedResources.size>0)){this.setModernStreamState({active:this.subscribedResources.size>0,status:`ended`,honoredUris:[]});return}this.scheduleModernReconnect()}}reconcileModernStreamStateAfterFailedRefresh(){if(this.subscribedResources.size===0){this.setModernStreamState(TN);return}this.scheduleModernReconnect()}scheduleModernReconnect(){this.setModernStreamState({active:!0,status:`reconnecting`,honoredUris:[]});let e=Math.min(FV*2**this.modernReconnectAttempts,IV);this.clearModernReconnectTimer(),this.modernReconnectTimer=setTimeout(()=>{this.modernReconnectTimer=void 0,!(wN(this.status)||this.subscribedResources.size===0)&&this.refreshModernSubscription(!0).catch(()=>this.onModernReconnectFailed())},e)}onModernReconnectFailed(){if(this.modernReconnectAttempts+=1,this.modernReconnectAttempts>LV||wN(this.status)||this.subscribedResources.size===0){this.setModernStreamState({active:this.subscribedResources.size>0,status:`ended`,honoredUris:[]});return}this.scheduleModernReconnect()}async subscribeToResource(e){if(!this.client)throw Error(`Client is not connected`);if(!this.supportsResourceSubscriptions())throw Error(`Server does not support resource subscriptions`);try{if(this.isModernEra()){if(this.subscribedResources.has(e))return;this.subscribedResources.add(e),this.dispatchSubscriptionsChange(),this.setModernStreamState({active:!0,status:`connecting`,honoredUris:this.modernStreamState.honoredUris});let t=this.modernListenGeneration;try{await this.refreshModernSubscription()}catch(n){throw this.modernListenGeneration===t+1&&(this.subscribedResources.delete(e),this.reconcileModernStreamStateAfterFailedRefresh(),this.dispatchSubscriptionsChange()),n}return}await this.client.subscribeResource({uri:e},this.getRequestOptions()),this.subscribedResources.add(e),this.dispatchSubscriptionsChange()}catch(e){throw Error(`Failed to subscribe to resource: ${e instanceof Error?e.message:String(e)}`)}}async unsubscribeFromResource(e){if(!this.client)throw Error(`Client is not connected`);try{if(this.isModernEra()){if(!this.subscribedResources.delete(e))return;this.subscribedResources.size===0&&this.setModernStreamState(TN),this.dispatchSubscriptionsChange();let t=this.modernListenGeneration;try{await this.refreshModernSubscription()}catch(e){throw this.modernListenGeneration===t+1&&this.reconcileModernStreamStateAfterFailedRefresh(),e}}else await this.client.unsubscribeResource({uri:e},this.getRequestOptions()),this.subscribedResources.delete(e),this.dispatchSubscriptionsChange()}catch(e){throw Error(`Failed to unsubscribe from resource: ${e instanceof Error?e.message:String(e)}`)}}ensureOAuthManager(){if(!this.oauthManager)throw Error(`OAuth not configured. Call setOAuthConfig() first.`);return this.oauthManager}getServerUrl(){if(this.transportConfig.type===`sse`||this.transportConfig.type===`streamable-http`)return this.transportConfig.url;throw Error(`OAuth is only supported for HTTP-based transports (SSE, streamable-http)`)}setOAuthConfig(e){if(!this.oauthManager)throw Error(`OAuth config must be set at creation. Pass oauth in constructor.`);this.oauthManager.setOAuthConfig(e)}async authenticate(){return this.ensureOAuthManager().authenticate()}async handleAuthChallenge(e,t){return this.ensureOAuthManager().handleAuthChallenge(e,t)}async checkAuthChallengeSatisfied(e){return this.ensureOAuthManager().checkAuthChallengeSatisfied(e)}async pushRemoteAuthState(){this.baseTransport instanceof DV&&await this.baseTransport.pushAuthState()}async handleAmbientAuthChallenge(e){let t=this.ambientAuthChallengeKey(e),n=this.ambientAuthChallengeInFlight.get(t);if(n)return n;let r=this.runAmbientAuthChallenge(e);this.ambientAuthChallengeInFlight.set(t,r);try{await r}finally{this.ambientAuthChallengeInFlight.get(t)===r&&this.ambientAuthChallengeInFlight.delete(t)}}async runAmbientAuthChallenge(e){try{this.dispatchTypedEvent(`authChallengeAmbient`,{challenge:e});let t=this.oauthManager;if(!t)return;let n=await t.handleAuthChallenge(e);n.kind===`satisfied`?(this.baseTransport instanceof DV?await this.pushRemoteAuthState():await this.reconnectAfterAuthRecovery(),this.dispatchTypedEvent(`authChallengeRecovered`,{challenge:e})):n.kind===`step_up_confirm`?this.dispatchTypedEvent(`authChallengeInteractive`,{challenge:n.challenge,authorizationUrl:yz}):n.kind===`interactive`?this.dispatchTypedEvent(`authChallengeInteractive`,{challenge:n.challenge,authorizationUrl:n.authorizationUrl}):this.dispatchTypedEvent(`oauthError`,{error:n.error})}catch(e){this.dispatchTypedEvent(`oauthError`,{error:e instanceof Error?e:Error(String(e))})}}ambientAuthChallengeKey(e){let t=[...e.requiredScopes??[]].sort().join(` `),n=[...e.authorizationScopes??[]].sort().join(` `);return`${e.reason}:${t}:${n}`}async reconnectAfterAuthRecovery(){await this.disconnect().catch(()=>{}),await this.dropCachedTransport(),await this.connect()}usesDirectAuthRecovery(){return this.directAuthRecovery&&this.directAuthRecoveryActive===!0}probesProtocolEra(){let e=this.versionNegotiation.mode;return e!==void 0&&e!==`legacy`}async withDirectAuthRecovery(t,n,r=0){try{return await t(r)}catch(i){if(r>=1||!this.usesDirectAuthRecovery()||!Az(i)||this.authRecoveryDepth>=e.MAX_NESTED_AUTH_RECOVERIES)throw i;let a=kz(i,n);if(!a)throw i;n?.method||n?.toolName?this.dispatchTypedEvent(`authChallengeCommand`,{challenge:a}):this.dispatchTypedEvent(`authChallengeAmbient`,{challenge:a});let o=await this.handleAuthChallenge(a);if(o.kind===`satisfied`){this.activeToolCallAbortController&&=void 0,this.authRecoveryDepth+=1;try{await this.reconnectAfterAuthRecovery()}finally{--this.authRecoveryDepth}return this.dispatchTypedEvent(`authChallengeRecovered`,{challenge:a}),this.withDirectAuthRecovery(t,n,r+1)}throw o.kind===`step_up_confirm`?new xz(yz,o.challenge,{emaStepUpConfirm:!0}):o.kind===`interactive`?new xz(o.authorizationUrl,o.challenge):(this.dispatchTypedEvent(`oauthError`,{error:o.error}),o.error)}}async invokeMcpClient(e,t){return this.usesDirectAuthRecovery()?this.withDirectAuthRecovery(e,t):e(0)}async completeOAuthFlow(e,t){await this.ensureOAuthManager().completeOAuthFlow(e,t),this.usesDirectAuthRecovery()&&await this.reconnectAfterAuthRecovery()}async beginInteractiveAuthorization(e){return this.ensureOAuthManager().beginInteractiveAuthorization(e)}getRemoteBackendSessionId(){if(this.baseTransport instanceof DV)return this.baseTransport.getRemoteBackendSessionId()}async resumeAfterOAuth(e,t){await this.completeOAuthFlow(e,t?.iss);let n=t?.remoteSessionId,r=this.baseTransport;if(n&&r instanceof DV)try{await r.attachToSession(n),await r.pushAuthState(),this.status!==`connected`&&await this.connect();return}catch{}this.status!==`connected`&&await this.connect()}async getOAuthTokens(){if(this.oauthManager)return this.oauthManager.getOAuthTokens()}async clearOAuthTokens(){await this.oauthManager?.clearOAuthTokens()}async isOAuthAuthorized(){return this.oauthManager?this.oauthManager.isOAuthAuthorized():!1}getOAuthFlowState(){return this.oauthManager?.getOAuthFlowState()}getOAuthFlowStep(){return this.oauthManager?.getOAuthFlowStep()}async getOAuthState(){if(!(!this.isHttpOAuthConfig()||!this.oauthManager))return this.oauthManager.getOAuthState()}},zV={AUTH_TOKEN:`MCP_INSPECTOR_API_TOKEN`},BV=`__INSPECTOR_API_TOKEN__`,VV=class extends nz{items=[];client=null;unsubscribe=null;_metadata=void 0;listChanged=!1;config;listChangedTimer=null;running=!1;runQueued=!1;constructor(e,t){super(),this.client=e,this.config=t;let n=()=>{this.config.deferWhenPaginated&&this.client?.getServerSettings()?.paginatedLists||this.refresh()},r=()=>{this.listChangedTimer!==null&&clearTimeout(this.listChangedTimer),this.listChangedTimer=setTimeout(()=>{this.listChangedTimer=null,this.runListChanged()},t.debounceMs)},i=()=>{wN(this.client?.getStatus())&&(this.listChangedTimer!==null&&(clearTimeout(this.listChangedTimer),this.listChangedTimer=null),this.items=[],this.dispatchChange(),this.setListChanged(!1))};this.client.addEventListener(`connect`,n),this.client.addEventListener(t.listChangedEvent,r),this.client.addEventListener(`statusChange`,i),this.unsubscribe=()=>{this.listChangedTimer!==null&&(clearTimeout(this.listChangedTimer),this.listChangedTimer=null),this.client&&(this.client.removeEventListener(`connect`,n),this.client.removeEventListener(t.listChangedEvent,r),this.client.removeEventListener(`statusChange`,i)),this.client=null}}runListChanged(){if(this.running){this.runQueued=!0;return}this.runListChangedOnce()}async runListChangedOnce(){this.running=!0;try{do{this.runQueued=!1;let e=this.client?.getServerSettings();!(this.config.deferWhenPaginated&&e?.paginatedLists)&&e?.autoRefreshOnListChanged?await this.refresh(void 0,`refresh`):this.config.supportsIndicator&&this.setListChanged(!0)}while(this.runQueued)}finally{this.running=!1}}getItems(){return[...this.items]}getListChanged(){return this.listChanged}clearListChanged(){this.setListChanged(!1)}emit(e,t){this.dispatchTypedEvent(e,t)}setListChanged(e){this.listChanged!==e&&(this.listChanged=e,this.emit(`listChangedChange`,e))}setMetadata(e){this._metadata=e}async refresh(e,t){let n=await this.fetchItems(e,t);return n===null||this.applyItems(n),this.getItems()}async fetchItems(e,t){let n=this.client;if(!n||n.getStatus()!==`connected`)return null;if(!n.getCapabilities()?.[this.config.capabilityKey])return[];let r=e??this._metadata;return this.config.fetchAll(n,t,r)}applyItems(e){this.items=e,this.dispatchChange()}dispatchChange(){this.emit(this.config.changeEvent,this.getItems())}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.items=[]}},HV=class extends VV{constructor(e,t=250){super(e,{changeEvent:`toolsChange`,listChangedEvent:`toolsListChanged`,capabilityKey:`tools`,deferWhenPaginated:!0,supportsIndicator:!0,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllTools({cacheMode:t,metadata:n})).tools})}getTools(){return this.getItems()}},UV=class extends VV{constructor(e,t=250){super(e,{changeEvent:`promptsChange`,listChangedEvent:`promptsListChanged`,capabilityKey:`prompts`,deferWhenPaginated:!0,supportsIndicator:!0,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllPrompts({cacheMode:t,metadata:n})).prompts})}getPrompts(){return this.getItems()}},WV=class extends VV{constructor(e,t=250){super(e,{changeEvent:`resourcesChange`,listChangedEvent:`resourcesListChanged`,capabilityKey:`resources`,deferWhenPaginated:!0,supportsIndicator:!0,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllResources({cacheMode:t,metadata:n})).resources})}getResources(){return this.getItems()}},GV=class extends nz{tools=[];nextCursor=void 0;pageCount=0;loading=!1;client=null;unsubscribe=null;constructor(e){super(),this.client=e;let t=()=>{this.client?.getServerSettings()?.paginatedLists&&this.loadPage(void 0)},n=()=>{wN(this.client?.getStatus())&&this.reset()};this.client.addEventListener(`connect`,t),this.client.addEventListener(`statusChange`,n),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`statusChange`,n)),this.client=null}}getTools(){return[...this.tools]}getPagination(){return{nextCursor:this.nextCursor,pageCount:this.pageCount}}clear(){this.reset()}reset(){this.tools=[],this.nextCursor=void 0,this.pageCount=0,this.dispatchTypedEvent(`toolsChange`,this.tools),this.dispatchTypedEvent(`paginationChange`,this.getPagination())}async loadPage(e){let t=this.client;if(!t||t.getStatus()!==`connected`)return{tools:[],nextCursor:void 0};if(this.loading)return{tools:[],nextCursor:this.nextCursor};this.loading=!0;try{let n=await t.listTools(e,void 0);return this.tools=e===void 0?[...n.tools]:[...this.tools,...n.tools],this.pageCount=e===void 0?1:this.pageCount+1,this.nextCursor=n.nextCursor,this.dispatchTypedEvent(`toolsChange`,this.tools),this.dispatchTypedEvent(`paginationChange`,this.getPagination()),{tools:n.tools,nextCursor:n.nextCursor}}finally{this.loading=!1}}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.tools=[],this.nextCursor=void 0,this.pageCount=0}},KV=class extends nz{prompts=[];nextCursor=void 0;pageCount=0;loading=!1;client=null;unsubscribe=null;constructor(e){super(),this.client=e;let t=()=>{this.client?.getServerSettings()?.paginatedLists&&this.loadPage(void 0)},n=()=>{wN(this.client?.getStatus())&&this.reset()};this.client.addEventListener(`connect`,t),this.client.addEventListener(`statusChange`,n),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`statusChange`,n)),this.client=null}}getPrompts(){return[...this.prompts]}getPagination(){return{nextCursor:this.nextCursor,pageCount:this.pageCount}}clear(){this.reset()}reset(){this.prompts=[],this.nextCursor=void 0,this.pageCount=0,this.dispatchTypedEvent(`promptsChange`,this.prompts),this.dispatchTypedEvent(`paginationChange`,this.getPagination())}async loadPage(e,t){let n=this.client;if(!n||n.getStatus()!==`connected`)return{prompts:[],nextCursor:void 0};if(this.loading)return{prompts:[],nextCursor:this.nextCursor};this.loading=!0;try{let r=await n.listPrompts(e,t);return this.prompts=e===void 0?[...r.prompts]:[...this.prompts,...r.prompts],this.pageCount=e===void 0?1:this.pageCount+1,this.nextCursor=r.nextCursor,this.dispatchTypedEvent(`promptsChange`,this.prompts),this.dispatchTypedEvent(`paginationChange`,this.getPagination()),{prompts:r.prompts,nextCursor:r.nextCursor}}finally{this.loading=!1}}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.prompts=[],this.nextCursor=void 0,this.pageCount=0}},qV=class extends nz{resources=[];nextCursor=void 0;pageCount=0;loading=!1;client=null;unsubscribe=null;constructor(e){super(),this.client=e;let t=()=>{this.client?.getServerSettings()?.paginatedLists&&this.loadPage(void 0)},n=()=>{wN(this.client?.getStatus())&&this.reset()};this.client.addEventListener(`connect`,t),this.client.addEventListener(`statusChange`,n),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`statusChange`,n)),this.client=null}}getResources(){return[...this.resources]}getPagination(){return{nextCursor:this.nextCursor,pageCount:this.pageCount}}clear(){this.reset()}reset(){this.resources=[],this.nextCursor=void 0,this.pageCount=0,this.dispatchTypedEvent(`resourcesChange`,this.resources),this.dispatchTypedEvent(`paginationChange`,this.getPagination())}async loadPage(e,t){let n=this.client;if(!n||n.getStatus()!==`connected`)return{resources:[],nextCursor:void 0};if(this.loading)return{resources:[],nextCursor:this.nextCursor};this.loading=!0;try{let r=await n.listResources(e,t);return this.resources=e===void 0?[...r.resources]:[...this.resources,...r.resources],this.pageCount=e===void 0?1:this.pageCount+1,this.nextCursor=r.nextCursor,this.dispatchTypedEvent(`resourcesChange`,this.resources),this.dispatchTypedEvent(`paginationChange`,this.getPagination()),{resources:r.resources,nextCursor:r.nextCursor}}finally{this.loading=!1}}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.resources=[],this.nextCursor=void 0,this.pageCount=0}},JV=class extends VV{constructor(e,t=250){super(e,{changeEvent:`resourceTemplatesChange`,listChangedEvent:`resourceTemplatesListChanged`,capabilityKey:`resources`,deferWhenPaginated:!1,supportsIndicator:!1,debounceMs:t,fetchAll:async(e,t,n)=>(await e.listAllResourceTemplates({cacheMode:t,metadata:n})).resourceTemplates})}getResourceTemplates(){return this.getItems()}};function YV(e,t,n){let r={...n,taskId:t,createdAt:n.createdAt??n.lastUpdatedAt??``},i=e.findIndex(e=>e.taskId===t);if(i<0)return[r,...e];let a=[...e];return a[i]=r,a}var XV=100,ZV=new Set([`completed`,`failed`,`cancelled`]),QV=class extends nz{tasks=[];client=null;unsubscribe=null;dismissedTaskIds=new Set;cancelledTaskIds=new Set;constructor(e){super(),this.client=e;let t=()=>{this.refresh()},n=()=>{this.refresh()},r=()=>{wN(this.client?.getStatus())&&(this.tasks=[],this.dismissedTaskIds.clear(),this.cancelledTaskIds.clear(),this.dispatchTypedEvent(`tasksChange`,[]))},i=(e,t)=>this.dismissedTaskIds.has(e)||this.cancelledTaskIds.has(e)&&t!==`cancelled`,a=e=>{let{taskId:t,task:n}=e.detail;i(t,n.status)||(this.tasks=YV(this.tasks,t,n),this.dispatchTypedEvent(`tasksChange`,this.tasks))},o=e=>{let{taskId:t,task:n}=e.detail;i(t,n.status)||(this.tasks=YV(this.tasks,t,n),this.dispatchTypedEvent(`tasksChange`,this.tasks))},s=e=>{let{taskId:t}=e.detail;if(this.dismissedTaskIds.has(t))return;this.cancelledTaskIds.add(t);let n=this.tasks.findIndex(e=>e.taskId===t);if(n>=0){let e=[...this.tasks];e[n]={...e[n],status:`cancelled`},this.tasks=e,this.dispatchTypedEvent(`tasksChange`,this.tasks)}};this.client.addEventListener(`connect`,t),this.client.addEventListener(`tasksListChanged`,n),this.client.addEventListener(`statusChange`,r),this.client.addEventListener(`taskStatusChange`,a),this.client.addEventListener(`requestorTaskUpdated`,o),this.client.addEventListener(`taskCancelled`,s),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`connect`,t),this.client.removeEventListener(`tasksListChanged`,n),this.client.removeEventListener(`statusChange`,r),this.client.removeEventListener(`taskStatusChange`,a),this.client.removeEventListener(`requestorTaskUpdated`,o),this.client.removeEventListener(`taskCancelled`,s)),this.client=null}}getTasks(){return[...this.tasks]}async refresh(){let e=this.client;if(!e||e.getStatus()!==`connected`)return this.getTasks();if(e.isTasksExtensionNegotiated())return this.refreshModern(e);if(!e.getCapabilities()?.tasks)return this.tasks=[],this.dispatchTypedEvent(`tasksChange`,this.tasks),this.getTasks();this.tasks=[];let t,n=0;do{let r=await e.listRequestorTasks(t),i=r.tasks.filter(e=>!this.dismissedTaskIds.has(e.taskId)).map(e=>this.cancelledTaskIds.has(e.taskId)?{...e,status:`cancelled`}:e);if(this.tasks=t?[...this.tasks,...i]:i,t=r.nextCursor,n++,n>=XV)throw Error(`Maximum pagination limit (${XV} pages) reached while listing requestor tasks`)}while(t);return this.dispatchTypedEvent(`tasksChange`,this.tasks),this.getTasks()}async refreshModern(e){let t=this.tasks.map(e=>e.taskId).filter(e=>!this.dismissedTaskIds.has(e));for(let n of t)try{await e.getRequestorTask(n)}catch{}return this.getTasks()}clearCompleted(){let e=[],t=!1;for(let n of this.tasks)ZV.has(n.status)?(this.dismissedTaskIds.add(n.taskId),t=!0):e.push(n);t&&(this.tasks=e,this.dispatchTypedEvent(`tasksChange`,this.tasks))}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.tasks=[],this.dismissedTaskIds.clear(),this.cancelledTaskIds.clear()}},$V=class extends nz{subscribedUris=[];lastUpdatedByUri=new Map;subscriptions=[];streamState=TN;client=null;resourcesState=null;unsubscribe=null;constructor(e,t=null){super(),this.client=e,this.resourcesState=t,this.streamState=e.getResourceSubscriptionStreamState();let n=e=>{this.streamState=e.detail,this.dispatchTypedEvent(`streamStateChange`,this.streamState)},r=e=>{this.subscribedUris=e.detail;let t=new Set(e.detail);for(let e of this.lastUpdatedByUri.keys())t.has(e)||this.lastUpdatedByUri.delete(e);this.rebuild()},i=e=>{let{uri:t}=e.detail;this.subscribedUris.includes(t)&&(this.lastUpdatedByUri.set(t,new Date),this.rebuild())},a=()=>{wN(this.client?.getStatus())&&(this.subscribedUris=[],this.lastUpdatedByUri.clear(),this.subscriptions=[],this.streamState=TN,this.dispatchTypedEvent(`subscriptionsChange`,this.getSubscriptions()),this.dispatchTypedEvent(`streamStateChange`,this.streamState))},o=e=>{this.subscribedUris.length>0&&this.rebuild()};e.addEventListener(`resourceSubscriptionsChange`,r),e.addEventListener(`resourceSubscriptionStreamChange`,n),e.addEventListener(`resourceUpdated`,i),e.addEventListener(`statusChange`,a),t?.addEventListener(`resourcesChange`,o),this.unsubscribe=()=>{this.client?.removeEventListener(`resourceSubscriptionsChange`,r),this.client?.removeEventListener(`resourceSubscriptionStreamChange`,n),this.client?.removeEventListener(`resourceUpdated`,i),this.client?.removeEventListener(`statusChange`,a),this.resourcesState?.removeEventListener(`resourcesChange`,o),this.client=null,this.resourcesState=null}}getSubscriptions(){return[...this.subscriptions]}getStreamState(){return this.streamState}rebuild(){let e=this.resourcesState?.getResources()??[],t=new Map(e.map(e=>[e.uri,e]));this.subscriptions=this.subscribedUris.map(e=>{let n=t.get(e)??{uri:e,name:e},r=this.lastUpdatedByUri.get(e);return r?{resource:n,lastUpdated:r}:{resource:n}}),this.dispatchTypedEvent(`subscriptionsChange`,this.getSubscriptions())}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.subscribedUris=[],this.lastUpdatedByUri.clear(),this.subscriptions=[],this.streamState=TN}};function eH(e){let t=e.enterpriseManagedAuth;return t?.idp?t.enabled!==!1:!1}function tH(e){if(eH(e))return e.enterpriseManagedAuth.idp}function nH(e){return e.cimd?.enabled===!0}function rH(e){if(nH(e))return e.cimd?.clientMetadataUrl?.trim()||void 0}function iH(e){let t;try{t=new URL(e.trim())}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:aH(t.hostname)}function aH(e){if(e===`localhost`)return!0;if(e.startsWith(`[`))return e.endsWith(`]`);let t=e.split(`.`);return t.length>=2&&t.every(e=>e!==``)}var oH=Z().min(1).superRefine((e,t)=>{let n=e.trim();iH(n)||t.addIssue({code:KI.custom,message:`Invalid URL: "${n}" — must be an http(s) URL (e.g. https://idp.example.com)`})}),sH=`Must be a valid URL, like https://example.com/oauth/client.json`,cH=`CIMD client metadata URL must use HTTPS`,lH=`Must include a path (not the site root), like https://example.com/oauth/client.json`;function uH(e){let t=e.trim();if(t!==``){if(!iH(t))return sH;try{let e=new URL(t);if(e.protocol!==`https:`)return cH;if(e.pathname===`/`||e.pathname===``)return lH}catch{return sH}}}function dH(e,t,n){let r=e.trim();if(r===``){n&&t.addIssue({code:KI.custom,message:`CIMD client metadata URL is required when CIMD is enabled`});return}let i=uH(r);i&&t.addIssue({code:KI.custom,message:i})}var fH=Q({enabled:ZF(),clientMetadataUrl:Z()}).superRefine((e,t)=>{dH(e.clientMetadataUrl,t,e.enabled===!0)}),pH=Q({issuer:oH,clientId:Z().min(1),clientSecret:Z().optional()}),mH=Q({enterpriseManagedAuth:Q({enabled:ZF().optional(),idp:pH}).optional(),cimd:fH.optional()});function hH(e){return mH.parse(e)}function gH(e){return JSON.stringify(e,null,2)}function _H(e){if(e instanceof lF){let t=e.issues[0];return t?`${t.path.length>0?t.path.map(String).join(`.`):`config`}: ${t.message}`:`Invalid client.json shape`}return e instanceof Error?e.message:String(e)}async function vH(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch,r={};e.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let i=await n(`${t}/api/storage/client`,{method:`GET`,headers:r});if(!i.ok){if(i.status===404)return{};throw Error(`Failed to read client config: ${i.status}`)}let a=await i.json();return!a||typeof a!=`object`||Object.keys(a).length===0?{}:hH(a)}async function yH(e,t){let n=hH(e),r=t.baseUrl.replace(/\/$/,``),i=t.fetchFn??globalThis.fetch,a={"Content-Type":`application/json`};t.authToken&&(a[`x-mcp-remote-auth`]=`Bearer ${t.authToken}`);let o=await i(`${r}/api/storage/client`,{method:`POST`,headers:a,body:gH(n)});if(!o.ok)throw Error(`Failed to write client config: ${o.status}`)}var bH=class extends nz{messages=[];pendingRequestEntries=new Map;client=null;unsubscribe=null;maxMessages;constructor(e,t={}){super(),this.maxMessages=t.maxMessages??1e3,this.client=e;let n=e=>{this.maxMessages>0&&this.messages.length>=this.maxMessages&&this.messages.shift(),this.messages.push(e),this.dispatchTypedEvent(`message`,e),this.dispatchTypedEvent(`messagesChange`,this.getMessages())},r=e=>{let t=e.detail;if(t.direction===`request`){let e=`id`in t.message?t.message.id:void 0;e!==void 0&&this.pendingRequestEntries.set(e,t),n(t);return}if(t.direction===`response`){let e=`id`in t.message?t.message.id:void 0,n=e===void 0?void 0:this.pendingRequestEntries.get(e);if(n){this.pendingRequestEntries.delete(e),n.response=t.message,n.duration=t.timestamp.getTime()-n.timestamp.getTime(),this.dispatchTypedEvent(`message`,n),this.dispatchTypedEvent(`messagesChange`,this.getMessages());return}}n(t)},i=()=>{wN(this.client?.getStatus())&&(this.messages=[],this.pendingRequestEntries.clear(),this.dispatchTypedEvent(`messagesChange`,[]))};this.client.addEventListener(`message`,r),this.client.addEventListener(`statusChange`,i),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`message`,r),this.client.removeEventListener(`statusChange`,i)),this.client=null}}getMessages(e){return e?this.messages.filter(e):[...this.messages]}clearMessages(e){let t=this.messages.length;if(this.messages=e?this.messages.filter(t=>!e(t)):[],e){let e=new Set(this.messages);for(let[t,n]of this.pendingRequestEntries)e.has(n)||this.pendingRequestEntries.delete(t)}else this.pendingRequestEntries.clear();this.messages.length!==t&&this.dispatchTypedEvent(`messagesChange`,this.getMessages())}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.messages=[],this.pendingRequestEntries.clear()}},xH=class extends nz{fetchRequests=[];client=null;unsubscribe=null;maxFetchRequests;logger;constructor(e,t={}){super(),this.maxFetchRequests=t.maxFetchRequests??1e3,this.logger=t.logger??Nz,this.client=e;let n=e=>{let t=e.detail;this.maxFetchRequests>0&&this.fetchRequests.length>=this.maxFetchRequests&&this.fetchRequests.shift(),this.fetchRequests.push(t),this.dispatchTypedEvent(`fetchRequest`,t),this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())};this.client.addEventListener(`fetchRequest`,n);let r=e=>{let{id:t,responseBody:n}=e.detail,r=this.fetchRequests.findIndex(e=>e.id===t);if(r===-1){this.maxFetchRequests>0&&this.fetchRequests.length>=this.maxFetchRequests&&(this.logger.warn({fetchRequestId:t,maxFetchRequests:this.maxFetchRequests},`fetchRequestBodyUpdate dropped: entry rotated out before body arrived`),this.dispatchTypedEvent(`fetchRequestBodyDropped`,{id:t,maxFetchRequests:this.maxFetchRequests}));return}this.fetchRequests[r]={...this.fetchRequests[r],responseBody:n},this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())};this.client.addEventListener(`fetchRequestBodyUpdate`,r);let i=t.sessionStorage,a=t.sessionId;if(i){let e=e=>{let{sessionId:t}=e.detail,n={fetchRequests:this.getFetchRequests(),createdAt:Date.now(),updatedAt:Date.now()};i.saveSession(t,n).catch(()=>{})};this.client.addEventListener(`saveSession`,e),this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`fetchRequest`,n),this.client.removeEventListener(`fetchRequestBodyUpdate`,r),this.client.removeEventListener(`saveSession`,e)),this.client=null},a&&i.loadSession(a).then(e=>{this.client&&e?.fetchRequests?.length&&this.hydrateFetchRequests(e.fetchRequests)}).catch(()=>{})}else this.unsubscribe=()=>{this.client&&(this.client.removeEventListener(`fetchRequest`,n),this.client.removeEventListener(`fetchRequestBodyUpdate`,r)),this.client=null}}hydrateFetchRequests(e){if(e.length===0)return;let t=new Set(this.fetchRequests.map(e=>e.id)),n=e.filter(e=>!t.has(e.id));if(n.length===0)return;let r=[...n,...this.fetchRequests];this.fetchRequests=this.maxFetchRequests>0?r.slice(-this.maxFetchRequests):r,this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())}getFetchRequests(){return[...this.fetchRequests]}setMaxFetchRequests(e){e!==this.maxFetchRequests&&(this.maxFetchRequests=e,e>0&&this.fetchRequests.length>e&&(this.fetchRequests=this.fetchRequests.slice(-e),this.dispatchTypedEvent(`fetchRequestsChange`,this.getFetchRequests())))}clearFetchRequests(){this.fetchRequests.length!==0&&(this.fetchRequests=[],this.dispatchTypedEvent(`fetchRequestsChange`,[]))}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.fetchRequests=[]}},SH=class extends nz{stderrLogs=[];client=null;unsubscribe=null;maxStderrLogEvents;constructor(e,t={}){super(),this.maxStderrLogEvents=t.maxStderrLogEvents??1e3,this.client=e;let n=e=>{let t=e.detail;this.maxStderrLogEvents>0&&this.stderrLogs.length>=this.maxStderrLogEvents&&this.stderrLogs.shift(),this.stderrLogs.push(t),this.dispatchTypedEvent(`stderrLog`,t),this.dispatchTypedEvent(`stderrLogsChange`,this.getStderrLogs())};this.client.addEventListener(`stderrLog`,n),this.unsubscribe=()=>{this.client&&this.client.removeEventListener(`stderrLog`,n),this.client=null}}getStderrLogs(){return[...this.stderrLogs]}clearStderrLogs(){this.stderrLogs.length!==0&&(this.stderrLogs=[],this.dispatchTypedEvent(`stderrLogsChange`,[]))}destroy(){this.unsubscribe?.(),this.unsubscribe=null,this.stderrLogs=[]}},CH=`discoveryState was not available`;function wH(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.recordedIssuer!=`string`||typeof t.currentIssuer!=`string`?!1:RM.isInstance(e)||t.name===`AuthorizationServerMismatchError`}function TH(e){if(e.includes(CH))return!0;try{let t=new URL(e);return t.protocol!==`http:`&&t.protocol!==`https:`}catch{return!0}}function EH(e){return DH(e,new Set)}function DH(e,t){if(typeof e!=`object`||!e||t.has(e))return;if(t.add(e),wH(e))return OH(e);let n=DH(e.cause,t);if(n)return n;let r=e.data;if(typeof r==`object`&&r)return DH(r.cause,t)}function OH(e){return TH(e.recordedIssuer)?{kind:`lost_authorization_state`,currentIssuer:e.currentIssuer}:{kind:`issuer_mismatch`,recordedIssuer:e.recordedIssuer,currentIssuer:e.currentIssuer}}function kH(e){return(t,n={})=>({transport:new DV({baseUrl:e.baseUrl,authToken:e.authToken,fetchFn:e.fetchFn,onStderr:n.onStderr,onFetchRequest:n.onFetchRequest,onFetchResponseBody:n.onFetchResponseBody,authProvider:n.authProvider,settings:n.settings},t)})}async function AH(e,t){let n=typeof e==`string`?e:e instanceof URL?e.toString():e.url,r=t?.method??(typeof e==`object`&&`method`in e?e.method:`GET`),i={};e instanceof Request&&e.headers.forEach((e,t)=>{i[t]=e}),t?.headers&&new Headers(t.headers).forEach((e,t)=>{i[t]=e});let a;if(t?.body!==void 0&&t?.body!==null)if(typeof t.body==`string`)a=t.body;else if(t.body instanceof URLSearchParams)a=t.body.toString();else if(t.body instanceof FormData){let e=new URLSearchParams;for(let[n,r]of t.body.entries())typeof r==`string`&&e.set(n,r);a=e.toString()}else a=String(t.body);else e instanceof Request&&e.body&&(a=await e.clone().text());return{url:n,method:r,headers:i,body:a}}function jH(e){return new Response(e.body??null,{status:e.status,statusText:e.statusText,headers:new Headers(e.headers??{})})}function MH(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch;return async(r,i)=>{let{url:a,method:o,headers:s,body:c}=await AH(r,i),l={"Content-Type":`application/json`,...s};e.authToken&&(l[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let u=await n(`${t}/api/fetch`,{method:`POST`,headers:l,body:JSON.stringify({url:a,method:o,headers:s,body:c})});if(!u.ok){let e=await u.text();throw Error(`Remote fetch failed (${u.status}): ${e}`)}return jH(await u.json())}}var NH=o(((e,t)=>{function n(e){try{return JSON.stringify(e)}catch{return`"[Circular]"`}}t.exports=r;function r(e,t,r){var i=r&&r.stringify||n,a=1;if(typeof e==`object`&&e){var o=t.length+a;if(o===1)return e;var s=Array(o);s[0]=i(e);for(var c=1;c<o;c++)s[c]=i(t[c]);return s.join(` `)}if(typeof e!=`string`)return e;var l=t.length;if(l===0)return e;for(var u=``,d=1-a,f=-1,p=e&&e.length||0,m=0;m<p;){if(e.charCodeAt(m)===37&&m+1<p){switch(f=f>-1?f:0,e.charCodeAt(m+1)){case 100:case 102:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Number(t[d]),f=m+2,m++;break;case 105:if(d>=l||t[d]==null)break;f<m&&(u+=e.slice(f,m)),u+=Math.floor(Number(t[d])),f=m+2,m++;break;case 79:case 111:case 106:if(d>=l||t[d]===void 0)break;f<m&&(u+=e.slice(f,m));var h=typeof t[d];if(h===`string`){u+=`'`+t[d]+`'`,f=m+2,m++;break}if(h===`function`){u+=t[d].name||`<anonymous>`,f=m+2,m++;break}u+=i(t[d]),f=m+2,m++;break;case 115:if(d>=l)break;f<m&&(u+=e.slice(f,m)),u+=String(t[d]),f=m+2,m++;break;case 37:f<m&&(u+=e.slice(f,m)),u+=`%`,f=m+2,m++,d--;break}++d}++m}return f===-1?e:(f<p&&(u+=e.slice(f)),u)}})),PH=l(o(((e,t)=>{var n=NH();t.exports=f;var r=M().console||{},i={mapHttpRequest:T,mapHttpResponse:T,wrapRequestSerializer:E,wrapResponseSerializer:E,wrapErrorSerializer:E,req:T,res:T,err:C,errWithCause:C};function a(e,t){return e===`silent`?1/0:t.levels.values[e]}var o=Symbol(`pino.logFuncs`),s=Symbol(`pino.hierarchy`),c={error:`log`,fatal:`error`,warn:`error`,info:`log`,debug:`log`,trace:`log`};function l(e,t){t[s]={logger:t,parent:e[s]}}function u(e,t,n){let i={};t.forEach(e=>{i[e]=n[e]?n[e]:r[e]||r[c[e]||`log`]||D}),e[o]=i}function d(e,t){return Array.isArray(e)?e.filter(function(e){return e!==`!stdSerializers.err`}):e===!0&&Object.keys(t)}function f(e){e||={},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!=`function`)throw Error(`pino: transmit option must have a send function`);let n=e.browser.write||r;e.browser.write&&(e.browser.asObject=!0);let i=e.serializers||{},o=d(e.browser.serialize,i),s=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf(`!stdSerializers.err`)>-1&&(s=!1);let c=Object.keys(e.customLevels||{}),f=[`error`,`fatal`,`warn`,`info`,`debug`,`trace`].concat(c);typeof n==`function`&&f.forEach(function(e){n[e]=n}),(e.enabled===!1||e.browser.disabled)&&(e.level=`silent`);let m=e.level||`info`,h=Object.create(n);h.log||=D,u(h,f,n),l({},h),Object.defineProperty(h,"levelVal",{get:v}),Object.defineProperty(h,"level",{get:y,set:x});let _={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:f,timestamp:w(e),messageKey:e.messageKey||`msg`,onChild:e.onChild||D};h.levels=p(e),h.level=m,h.isLevelEnabled=function(e){return this.levels.values[e]?this.levels.values[e]>=this.levels.values[this.level]:!1},h.setMaxListeners=h.getMaxListeners=h.emit=h.addListener=h.on=h.prependListener=h.once=h.prependOnceListener=h.removeListener=h.removeAllListeners=h.listeners=h.listenerCount=h.eventNames=h.write=h.flush=D,h.serializers=i,h._serialize=o,h._stdErrSerialize=s,h.child=function(...e){return C.call(this,_,...e)},t&&(h._logEvent=S());function v(){return a(this.level,this)}function y(){return this._level}function x(e){if(e!==`silent`&&!this.levels.values[e])throw Error(`unknown level `+e);this._level=e,g(this,_,h,`error`),g(this,_,h,`fatal`),g(this,_,h,`warn`),g(this,_,h,`info`),g(this,_,h,`debug`),g(this,_,h,`trace`),c.forEach(e=>{g(this,_,h,e)})}function C(n,r,a){if(!r)throw Error(`missing bindings for child Pino`);a||={},o&&r.serializers&&(a.serializers=r.serializers);let s=a.serializers;if(o&&s){var c=Object.assign({},i,s),u=e.browser.serialize===!0?Object.keys(c):o;delete r.serializers,b([r],u,c,this._stdErrSerialize)}function d(e){this._childLevel=(e._childLevel|0)+1,this.bindings=r,c&&(this.serializers=c,this._serialize=u),t&&(this._logEvent=S([].concat(e._logEvent.bindings,r)))}d.prototype=this;let f=new d(this);return l(this,f),f.child=function(...e){return C.call(this,n,...e)},f.level=a.level||this.level,n.onChild(f),f}return h}function p(e){let t=e.customLevels||{};return{values:Object.assign({},f.levels.values,t),labels:Object.assign({},f.levels.labels,m(t))}}function m(e){let t={};return Object.keys(e).forEach(function(n){t[e[n]]=n}),t}f.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:`trace`,20:`debug`,30:`info`,40:`warn`,50:`error`,60:`fatal`}},f.stdSerializers=i,f.stdTimeFunctions=Object.assign({},{nullTime:O,epochTime:k,unixTime:A,isoTime:j});function h(e){let t=[];e.bindings&&t.push(e.bindings);let n=e[s];for(;n.parent;)n=n.parent,n.logger.bindings&&t.push(n.logger.bindings);return t.reverse()}function g(e,t,n,r){if(Object.defineProperty(e,r,{value:a(e.level,n)>a(r,n)?D:n[o][r],writable:!0,enumerable:!0,configurable:!0}),e[r]===D){if(!t.transmit)return;let i=a(t.transmit.level||e.level,n);if(a(r,n)<i)return}e[r]=v(e,t,n,r);let i=h(e);i.length!==0&&(e[r]=_(i,e[r]))}function _(e,t){return function(){return t.apply(this,[...e,...arguments])}}function v(e,t,n,i){return(function(o){return function(){let s=t.timestamp(),c=Array(arguments.length),l=Object.getPrototypeOf&&Object.getPrototypeOf(this)===r?r:this;for(var u=0;u<c.length;u++)c[u]=arguments[u];var d=!1;if(t.serialize&&(b(c,this._serialize,this.serializers,this._stdErrSerialize),d=!0),t.asObject||t.formatters?o.call(l,...y(this,i,c,s,t)):o.apply(l,c),t.transmit){let r=t.transmit.level||e._level,o=a(r,n),l=a(i,n);if(l<o)return;x(this,{ts:s,methodLevel:i,methodValue:l,transmitLevel:r,transmitValue:n.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:a(e._level,n)},c,d)}}})(e[o][i])}function y(e,t,r,i,a){let{level:o,log:s=e=>e}=a.formatters||{},c=r.slice(),l=c[0],u={},d=(e._childLevel|0)+1;if(d<1&&(d=1),i&&(u.time=i),o){let n=o(t,e.levels.values[t]);Object.assign(u,n)}else u.level=e.levels.values[t];if(a.asObjectBindingsOnly){if(typeof l==`object`&&l)for(;d--&&typeof c[0]==`object`;)Object.assign(u,c.shift());return[s(u),...c]}else{if(typeof l==`object`&&l){for(;d--&&typeof c[0]==`object`;)Object.assign(u,c.shift());l=c.length?n(c.shift(),c):void 0}else typeof l==`string`&&(l=n(c.shift(),c));return l!==void 0&&(u[a.messageKey]=l),[s(u)]}}function b(e,t,n,r){for(let i in e)if(r&&e[i]instanceof Error)e[i]=f.stdSerializers.err(e[i]);else if(typeof e[i]==`object`&&!Array.isArray(e[i])&&t)for(let r in e[i])t.indexOf(r)>-1&&r in n&&(e[i][r]=n[r](e[i][r]))}function x(e,t,n,r=!1){let i=t.send,a=t.ts,o=t.methodLevel,s=t.methodValue,c=t.val,l=e._logEvent.bindings;r||b(n,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0||e._stdErrSerialize),e._logEvent.ts=a,e._logEvent.messages=n.filter(function(e){return l.indexOf(e)===-1}),e._logEvent.level.label=o,e._logEvent.level.value=s,i(o,e._logEvent,c),e._logEvent=S(l)}function S(e){return{ts:0,messages:[],bindings:e||[],level:{label:``,value:0}}}function C(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let n in e)t[n]===void 0&&(t[n]=e[n]);return t}function w(e){return typeof e.timestamp==`function`?e.timestamp:e.timestamp===!1?O:k}function T(){return{}}function E(e){return e}function D(){}function O(){return!1}function k(){return Date.now()}function A(){return Math.round(Date.now()/1e3)}function j(){return new Date(Date.now()).toISOString()}function M(){function e(e){return e!==void 0&&e}try{return typeof globalThis<`u`||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}t.exports.default=f,t.exports.pino=f}))(),1);function FH(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch,r=e.level??`info`;return(0,PH.default)({level:r,browser:{write:()=>{},transmit:{level:r,send:(r,i)=>{let a={"Content-Type":`application/json`};e.authToken&&(a[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`),n(`${t}/api/log`,{method:`POST`,headers:a,body:JSON.stringify(i)}).catch(()=>{})}}}})}var IH=class{baseUrl;authToken;fetchFn;constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,``),this.authToken=e.authToken,this.fetchFn=e.fetchFn??((...e)=>globalThis.fetch(...e))}getStoreId(e){return`inspector-session-${e}`}async saveSession(e,t){let n=this.getStoreId(e),r=`${this.baseUrl}/api/storage/${encodeURIComponent(n)}`,i={"Content-Type":`application/json`};this.authToken&&(i[`x-mcp-remote-auth`]=`Bearer ${this.authToken}`);let a={...t,fetchRequests:t.fetchRequests.map(e=>({...e,timestamp:e.timestamp instanceof Date?e.timestamp.toISOString():e.timestamp}))},o=await this.fetchFn(r,{method:`POST`,headers:i,body:JSON.stringify(a),keepalive:!0});if(!o.ok){let e=await o.text();throw Error(`Failed to save session: ${o.status} ${e}`)}}async loadSession(e){let t=this.getStoreId(e),n=`${this.baseUrl}/api/storage/${encodeURIComponent(t)}`,r={};this.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${this.authToken}`);let i=await this.fetchFn(n,{method:`GET`,headers:r});if(!i.ok){if(i.status===404)return;let e=await i.text();throw Error(`Failed to load session: ${i.status} ${e}`)}let a=await i.json();return{...a,fetchRequests:a.fetchRequests.map(e=>({...e,timestamp:typeof e.timestamp==`string`?new Date(e.timestamp):e.timestamp instanceof Date?e.timestamp:new Date(e.timestamp)}))}}async deleteSession(e){let t=this.getStoreId(e),n=`${this.baseUrl}/api/storage/${encodeURIComponent(t)}`,r={};this.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${this.authToken}`);let i=await this.fetchFn(n,{method:`DELETE`,headers:r});if(!i.ok&&i.status!==404){let e=await i.text();throw Error(`Failed to delete session: ${i.status} ${e}`)}}},LH=Object.freeze({});function RH(e){let[t,n]=(0,D.useState)(e?.getStatus()??`disconnected`),[r,i]=(0,D.useState)(e?.getCapabilities()),[a,o]=(0,D.useState)(e?.getServerInfo()),[s,c]=(0,D.useState)(e?.getInstructions()),[l,u]=(0,D.useState)(e?.getProtocolVersion()),[d,f]=(0,D.useState)(e?.getProtocolEra()),[p,m]=(0,D.useState)(e?.getDiscoverResult()),[h,g]=(0,D.useState)(e?.getExcludedTools()??[]),[_,v]=(0,D.useState)(void 0);(0,D.useEffect)(()=>{if(!e){n(`disconnected`),i(void 0),o(void 0),c(void 0),u(void 0),f(void 0),m(void 0),g([]),v(void 0);return}n(e.getStatus()),i(e.getCapabilities()),o(e.getServerInfo()),c(e.getInstructions()),u(e.getProtocolVersion()),f(e.getProtocolEra()),m(e.getDiscoverResult()),g(e.getExcludedTools()),v(void 0);let t=e=>{n(e.detail),e.detail===`connecting`&&v(void 0)},r=e=>{v(e.detail.message)},a=e=>{i(e.detail)},s=e=>{o(e.detail)},l=e=>{c(e.detail)},d=e=>{u(e.detail)},p=e=>{f(e.detail)},h=e=>{m(e.detail)},_=e=>{g(e.detail)};return e.addEventListener(`statusChange`,t),e.addEventListener(`error`,r),e.addEventListener(`capabilitiesChange`,a),e.addEventListener(`serverInfoChange`,s),e.addEventListener(`instructionsChange`,l),e.addEventListener(`protocolVersionChange`,d),e.addEventListener(`protocolEraChange`,p),e.addEventListener(`discoverResultChange`,h),e.addEventListener(`excludedToolsChange`,_),()=>{e.removeEventListener(`statusChange`,t),e.removeEventListener(`error`,r),e.removeEventListener(`capabilitiesChange`,a),e.removeEventListener(`serverInfoChange`,s),e.removeEventListener(`instructionsChange`,l),e.removeEventListener(`protocolVersionChange`,d),e.removeEventListener(`protocolEraChange`,p),e.removeEventListener(`discoverResultChange`,h),e.removeEventListener(`excludedToolsChange`,_)}},[e]);let y=(0,D.useCallback)(async()=>{e&&await e.connect()},[e]),b=(0,D.useCallback)(async()=>{e&&await e.disconnect()},[e]);return{status:t,capabilities:r,clientCapabilities:e?.getClientCapabilities()??LH,serverInfo:a,instructions:s,protocolVersion:l,protocolEra:d,discoverResult:p,excludedTools:h,lastError:_,appRendererClient:e?.getAppRendererClient()??null,connect:y,disconnect:b}}function zH(e,t){let n={};return t&&(n[`Content-Type`]=`application/json`),e&&(n[`x-mcp-remote-auth`]=`Bearer ${e}`),n}async function BH(e){try{let t=await e.json();if(typeof t?.error==`string`)return t.error}catch{}return`HTTP ${e.status}`}function VH(e){let{baseUrl:t,authToken:n,fetchFn:r}=e,i=r??globalThis.fetch,a=t.replace(/\/$/,``),[o,s]=(0,D.useState)([]),[c,l]=(0,D.useState)(!0),[u,d]=(0,D.useState)(void 0),f=(0,D.useCallback)(async e=>{e||l(!0),d(void 0);try{let e=await i(`${a}/api/servers`,{method:`GET`,headers:zH(n,!1)});if(!e.ok)throw Error(await BH(e));let t=await e.json();s(rie(t))}catch(e){d(e instanceof Error?e.message:String(e))}finally{e||l(!1)}},[a,n,i]),p=(0,D.useCallback)(()=>f(!1),[f]);(0,D.useEffect)(()=>{p()},[p]),(0,D.useEffect)(()=>{let e=new AbortController;return(async()=>{try{let t=await i(`${a}/api/servers/events`,{method:`GET`,headers:zH(n,!1),signal:e.signal});if(!t.ok||!t.body)return;let r=t.body.getReader(),o=new TextDecoder,s=``;for(;;){let{done:e,value:t}=await r.read();if(e)break;s+=o.decode(t,{stream:!0});let n=!1,i=s.indexOf(`
|
|
152
|
-
|
|
153
|
-
`);for(;i!==-1;)s=s.slice(i+2),n=!0,i=s.indexOf(`
|
|
154
|
-
|
|
155
|
-
`);n&&f(!0)}}catch{}})(),()=>e.abort()},[a,n,i,f]);let m=(0,D.useCallback)(async(e,t)=>{let r=await i(`${a}/api/servers`,{method:`POST`,headers:zH(n,!0),body:JSON.stringify({id:e,config:t})});if(!r.ok)throw Error(await BH(r));await p()},[a,n,i,p]),h=(0,D.useCallback)(async e=>{let t=await i(`${a}/api/import-source?type=${encodeURIComponent(e)}`,{headers:zH(n,!1)});if(!t.ok)throw Error(await BH(t));return await t.json()},[a,n,i]);return{servers:o,loading:c,error:u,refresh:p,addServer:m,updateServer:(0,D.useCallback)(async(e,t,r)=>{let o=await i(`${a}/api/servers/${encodeURIComponent(e)}`,{method:`PUT`,headers:zH(n,!0),body:JSON.stringify({id:t,config:r})});if(!o.ok)throw Error(await BH(o));await p()},[a,n,i,p]),updateServerSettings:(0,D.useCallback)(async(e,t)=>{let r=await i(`${a}/api/servers/${encodeURIComponent(e)}`,{method:`PUT`,headers:zH(n,!0),body:JSON.stringify({id:e,settings:t})});if(!r.ok)throw Error(await BH(r));await p()},[a,n,i,p]),removeServer:(0,D.useCallback)(async e=>{let t=await i(`${a}/api/servers/${encodeURIComponent(e)}`,{method:`DELETE`,headers:zH(n,!1)});if(!t.ok)throw Error(await BH(t));await p()},[a,n,i,p]),reorderServers:(0,D.useCallback)(async e=>{s(t=>{let n=new Map(t.map(e=>[e.id,e])),r=e.map(e=>n.get(e)).filter(e=>e!==void 0);if(r.length!==t.length){let n=new Set(e);for(let e of t)n.has(e.id)||r.push(e)}return r});try{let t=await i(`${a}/api/servers/order`,{method:`PUT`,headers:zH(n,!0),body:JSON.stringify({order:e})});if(!t.ok)throw Error(await BH(t))}catch(e){throw await p(),e instanceof Error?e:Error(String(e))}},[a,n,i,p]),importSource:h}}function HH({targetId:e,resolveInitial:t,onPersist:n,onError:r,debounceMs:i=300}){let[a,o]=(0,D.useState)(null),s=(0,D.useRef)(void 0),c=(0,D.useRef)(t),l=(0,D.useRef)(n),u=(0,D.useRef)(r),d=(0,D.useRef)(null),f=(0,D.useRef)(e);c.current=t,l.current=n,u.current=r,d.current=a,f.current=e,(0,D.useEffect)(()=>{if(!e){o(null);return}o(c.current(e))},[e]),(0,D.useEffect)(()=>()=>{s.current&&=(clearTimeout(s.current),void 0)},[]);let p=(0,D.useCallback)((e,t)=>{l.current(e,t).catch(t=>{u.current(e,t)})},[]);return{draft:a,onChange:(0,D.useCallback)(t=>{if(!e)return;o(t),s.current&&clearTimeout(s.current);let n=e;s.current=setTimeout(()=>{s.current=void 0,p(n,t)},i)},[e,i,p]),flush:(0,D.useCallback)(()=>{if(!s.current)return;clearTimeout(s.current),s.current=void 0;let e=f.current,t=d.current;e&&t!==null&&p(e,t)},[p])}}function UH({opened:e,resolveInitial:t,onPersist:n,onError:r,debounceMs:i=300}){let[a,o]=(0,D.useState)(null),s=(0,D.useRef)(void 0),c=(0,D.useRef)(null),l=(0,D.useRef)(t),u=(0,D.useRef)(n),d=(0,D.useRef)(r),f=(0,D.useRef)(e);l.current=t,u.current=n,d.current=r,f.current=e,(0,D.useEffect)(()=>{if(!e){o(null),c.current=null;return}let t=l.current();o(t),c.current=t},[e]),(0,D.useEffect)(()=>()=>{s.current&&=(clearTimeout(s.current),void 0)},[]);let p=(0,D.useCallback)(e=>{u.current(e).catch(e=>{d.current(e)})},[]);return{draft:a,onChange:(0,D.useCallback)(t=>{if(!e)return;let n=c.current;if(n===null)return;let r=typeof t==`function`?t(n):t;c.current=r,o(r),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=void 0;let e=c.current;e!==null&&p(e)},i)},[e,i,p]),flush:(0,D.useCallback)(()=>{if(!s.current)return;clearTimeout(s.current),s.current=void 0;let e=c.current;f.current&&e!==null&&p(e)},[p])}}function WH(e,t,n){let r=t?sB(t):``,[i,a]=(0,D.useState)(`none`),o=(0,D.useCallback)(async()=>{if(!r){a(`none`);return}a(await jB(e,r))},[e,r]);return(0,D.useEffect)(()=>{n&&o()},[n,o]),{loginState:i,refresh:o,logout:(0,D.useCallback)(()=>{r&&MB(e,r).then(()=>{a(`none`)}).catch(()=>{})},[e,r])}}function GH(e,t){return t===void 0?e:{...e,issuer:t}}var KH=class{loaded=!1;loadPromise;persistQueue=Promise.resolve();memory;backend;constructor(e,t){this.memory=e,this.backend=t}load(){return this.loadPromise||=this.doLoad(),this.loadPromise}async doLoad(){if(this.loaded)return;let e=await this.backend.read();e&&this.memory.replace(e),this.loaded=!0}async ensureLoaded(){await this.load()}async persist(){let e=this.memory.snapshot(),t=this.persistQueue.catch(()=>{}).then(()=>this.backend.write(e));this.persistQueue=t,await t}resolveReadIssuer(e,t){return t??e.activeIssuer}issuerSlot(e,t){let n=this.resolveReadIssuer(e,t);return n?e.byIssuer?.[n]:void 0}updateIssuerSlot(e,t,n,r,i=!0){let a=this.memory.getState().getServerState(e),o={...a.byIssuer,[t]:{...a.byIssuer?.[t],...n}};this.memory.getState().setServerState(e,{byIssuer:o,...i&&{activeIssuer:t},...r})}mapIssuerSlots(e,t){let n={};for(let[r,i]of Object.entries(e.byIssuer??{}))n[r]={...i,...t(i)};return n}async getClientInformation(e,t,n){await this.ensureLoaded();let r=this.memory.getState().getServerState(e);if(t){let e=r.preregisteredClientInformation;return e?await xO.parseAsync(e):void 0}let i=this.issuerSlot(r,n)?.clientInformation,a=i??r.clientInformation;if(a)return GH(await xO.parseAsync(a),i?this.resolveReadIssuer(r,n):void 0)}async getClientRegistrationKind(e,t){await this.ensureLoaded();let n=this.memory.getState().getServerState(e);return this.issuerSlot(n,t)?.clientRegistrationKind??n.clientRegistrationKind}async saveClientInformation(e,t,n){await this.ensureLoaded(),n.issuer===void 0?this.memory.getState().setServerState(e,{clientInformation:t,clientRegistrationKind:n.registrationKind}):this.updateIssuerSlot(e,n.issuer,{clientInformation:t,clientRegistrationKind:n.registrationKind},{clientInformation:void 0,clientRegistrationKind:void 0}),await this.persist()}async savePreregisteredClientInformation(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{preregisteredClientInformation:t,clientRegistrationKind:`static`}),await this.persist()}async clearClientInformation(e,t,n){if(await this.ensureLoaded(),t){this.memory.getState().setServerState(e,{preregisteredClientInformation:void 0}),await this.persist();return}if(n!==void 0)this.updateIssuerSlot(e,n,{clientInformation:void 0,clientRegistrationKind:void 0},{},!1);else{let t=this.memory.getState().getServerState(e),n=this.mapIssuerSlots(t,()=>({clientInformation:void 0,clientRegistrationKind:void 0}));this.memory.getState().setServerState(e,{byIssuer:n,clientInformation:void 0,clientRegistrationKind:void 0})}await this.persist()}async getTokens(e,t){await this.ensureLoaded();let n=this.memory.getState().getServerState(e),r=this.issuerSlot(n,t)?.tokens,i=r??n.tokens;if(i)return GH(await gO.parseAsync(i),r?this.resolveReadIssuer(n,t):void 0)}async saveTokens(e,t,n){await this.ensureLoaded(),n?.issuer===void 0?this.memory.getState().setServerState(e,{tokens:t,...n?.enterpriseManaged===!0&&{enterpriseManaged:!0}}):this.updateIssuerSlot(e,n.issuer,{tokens:t},{tokens:void 0,...n.enterpriseManaged===!0&&{enterpriseManaged:!0}}),await this.persist()}async clearTokens(e,t){if(await this.ensureLoaded(),t!==void 0)this.updateIssuerSlot(e,t,{tokens:void 0},{},!1);else{let t=this.memory.getState().getServerState(e),n=this.mapIssuerSlots(t,()=>({tokens:void 0}));this.memory.getState().setServerState(e,{byIssuer:n,tokens:void 0})}await this.persist()}async getCodeVerifier(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).codeVerifier}async saveCodeVerifier(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{codeVerifier:t}),await this.persist()}async clearCodeVerifier(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{codeVerifier:void 0}),await this.persist()}async getScope(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).scope}async saveScope(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{scope:t}),await this.persist()}async clearScope(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{scope:void 0}),await this.persist()}async getServerMetadata(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).serverMetadata||null}async saveServerMetadata(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{serverMetadata:t}),await this.persist()}async clearServerMetadata(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{serverMetadata:void 0}),await this.persist()}async getDiscoveryState(e){return await this.ensureLoaded(),this.memory.getState().getServerState(e).discoveryState}async saveDiscoveryState(e,t){await this.ensureLoaded(),this.memory.getState().setServerState(e,{discoveryState:t}),await this.persist()}async clearDiscoveryState(e){await this.ensureLoaded(),this.memory.getState().setServerState(e,{discoveryState:void 0}),await this.persist()}async clear(e){await this.ensureLoaded(),this.memory.getState().clearServerState(e),await this.persist()}async getIdpSession(e){await this.ensureLoaded();let t=this.memory.getState().getIdpSession(e);if(!(!t.idToken&&!t.refreshToken&&t.idTokenExpiresAt===void 0))return t}async saveIdpSession(e,t){await this.ensureLoaded(),this.memory.getState().setIdpSession(e,t),await this.persist()}async clearIdpSession(e){await this.ensureLoaded(),this.memory.getState().clearIdpSession(e),await this.persist()}async clearEnterpriseManagedResourceServers(){await this.ensureLoaded(),this.memory.getState().clearEnterpriseManagedResourceServers(),await this.persist()}},qH=class{servers={};idpSessions={};constructor(e){e&&this.replace(e)}getState(){return{servers:this.servers,idpSessions:this.idpSessions,getServerState:e=>this.servers[e]||{},setServerState:(e,t)=>{this.servers={...this.servers,[e]:{...this.servers[e],...t}}},clearServerState:e=>{let t={...this.servers};delete t[e],this.servers=t},getIdpSession:e=>this.idpSessions[e]||{},setIdpSession:(e,t)=>{this.idpSessions={...this.idpSessions,[e]:{...this.idpSessions[e],...t}}},clearIdpSession:e=>{let t={...this.idpSessions};delete t[e],this.idpSessions=t},clearEnterpriseManagedResourceServers:()=>{let e={...this.servers};for(let[t,n]of Object.entries(this.servers))n.enterpriseManaged===!0&&delete e[t];this.servers=e}}}snapshot(){return{servers:{...this.servers},idpSessions:{...this.idpSessions}}}replace(e){this.servers={...e.servers??{}},this.idpSessions={...e.idpSessions??{}}}};function JH(e){return JSON.stringify(e,null,2)}function YH(e){return JSON.parse(e)}function XH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ZH(e){return{servers:e.servers??{},idpSessions:e.idpSessions??{}}}function QH(e){if(e==null)return null;let t=typeof e==`string`?e?YH(e):null:e;return XH(t)?XH(t.state)&&`version`in t?ZH(t.state):`servers`in t||`idpSessions`in t?ZH(t):null:null}function $H(e){return JH(e)}function eU(e){let t=e.baseUrl.replace(/\/$/,``),n=e.fetchFn??globalThis.fetch;return{async read(){let r={};e.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let i=await n(`${t}/api/storage/${e.storeId}`,{method:`GET`,headers:r});if(!i.ok){if(i.status===404)return null;throw Error(`Failed to read store: ${i.status}`)}return QH(await i.json())},async write(r){let i={"Content-Type":`application/json`};e.authToken&&(i[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let a=await n(`${t}/api/storage/${e.storeId}`,{method:`POST`,headers:i,body:$H(r)});if(!a.ok)throw Error(`Failed to write store: ${a.status}`)},async remove(){let r={};e.authToken&&(r[`x-mcp-remote-auth`]=`Bearer ${e.authToken}`);let i=await n(`${t}/api/storage/${e.storeId}`,{method:`DELETE`,headers:r});if(!i.ok&&i.status!==404)throw Error(`Failed to delete store: ${i.status}`)}}}var tU=class extends KH{constructor(e){super(new qH,eU({baseUrl:e.baseUrl,storeId:e.storeId??`oauth`,authToken:e.authToken,fetchFn:e.fetchFn}))}},nU;function rU(e){return`${e.baseUrl}\0${e.authToken??``}`}var iU=(...e)=>globalThis.fetch(...e);function aU(e){let t=rU(e);return nU?.cacheKey===t||(nU={cacheKey:t,storage:new tU({baseUrl:e.baseUrl,authToken:e.authToken,fetchFn:iU})}),nU.storage}function oU(e){if(typeof window>`u`)throw Error(`getWebRemoteOAuthStorage requires a browser environment`);return aU({baseUrl:`${window.location.protocol}//${window.location.host}`,authToken:e})}function sU(e,t){let[n,r]=(0,D.useState)(t?.getTools()??[]),[i,a]=(0,D.useState)(t?.getListChanged()??!1);return(0,D.useEffect)(()=>{if(!t){r([]),a(!1);return}r(t.getTools()),a(t.getListChanged());let e=e=>{r(e.detail)},n=e=>{a(e.detail)};return t.addEventListener(`toolsChange`,e),t.addEventListener(`listChangedChange`,n),()=>{t.removeEventListener(`toolsChange`,e),t.removeEventListener(`listChangedChange`,n)}},[t]),{tools:n,listChanged:i,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];t.clearListChanged();let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t]),clearListChanged:(0,D.useCallback)(()=>{t?.clearListChanged()},[t])}}function cU(e,t){let[n,r]=(0,D.useState)(t?.getPrompts()??[]),[i,a]=(0,D.useState)(t?.getListChanged()??!1);return(0,D.useEffect)(()=>{if(!t){r([]),a(!1);return}r(t.getPrompts()),a(t.getListChanged());let e=e=>{r(e.detail)},n=e=>{a(e.detail)};return t.addEventListener(`promptsChange`,e),t.addEventListener(`listChangedChange`,n),()=>{t.removeEventListener(`promptsChange`,e),t.removeEventListener(`listChangedChange`,n)}},[t]),{prompts:n,listChanged:i,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];t.clearListChanged();let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t]),clearListChanged:(0,D.useCallback)(()=>{t?.clearListChanged()},[t])}}function lU(e,t){let[n,r]=(0,D.useState)(t?.getResources()??[]),[i,a]=(0,D.useState)(t?.getListChanged()??!1);return(0,D.useEffect)(()=>{if(!t){r([]),a(!1);return}r(t.getResources()),a(t.getListChanged());let e=e=>{r(e.detail)},n=e=>{a(e.detail)};return t.addEventListener(`resourcesChange`,e),t.addEventListener(`listChangedChange`,n),()=>{t.removeEventListener(`resourcesChange`,e),t.removeEventListener(`listChangedChange`,n)}},[t]),{resources:n,listChanged:i,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];t.clearListChanged();let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t]),clearListChanged:(0,D.useCallback)(()=>{t?.clearListChanged()},[t])}}function uU(e,t){let[n,r]=(0,D.useState)(t?.getTools()??[]),[i,a]=(0,D.useState)(t?.getPagination().nextCursor),[o,s]=(0,D.useState)(t?.getPagination().pageCount??0);return(0,D.useEffect)(()=>{if(!t){r([]),a(void 0),s(0);return}r(t.getTools()),a(t.getPagination().nextCursor),s(t.getPagination().pageCount);let e=e=>{r(e.detail)},n=e=>{a(e.detail.nextCursor),s(e.detail.pageCount)};return t.addEventListener(`toolsChange`,e),t.addEventListener(`paginationChange`,n),()=>{t.removeEventListener(`toolsChange`,e),t.removeEventListener(`paginationChange`,n)}},[t]),{tools:n,nextCursor:i,pageCount:o,loadPage:(0,D.useCallback)(async n=>!t||!e?{tools:[],nextCursor:void 0}:t.loadPage(n),[e,t]),clear:(0,D.useCallback)(()=>{t?.clear()},[t])}}function dU(e,t){let[n,r]=(0,D.useState)(t?.getPrompts()??[]),[i,a]=(0,D.useState)(t?.getPagination().nextCursor),[o,s]=(0,D.useState)(t?.getPagination().pageCount??0);return(0,D.useEffect)(()=>{if(!t){r([]),a(void 0),s(0);return}r(t.getPrompts()),a(t.getPagination().nextCursor),s(t.getPagination().pageCount);let e=e=>{r(e.detail)},n=e=>{a(e.detail.nextCursor),s(e.detail.pageCount)};return t.addEventListener(`promptsChange`,e),t.addEventListener(`paginationChange`,n),()=>{t.removeEventListener(`promptsChange`,e),t.removeEventListener(`paginationChange`,n)}},[t]),{prompts:n,nextCursor:i,pageCount:o,loadPage:(0,D.useCallback)(async(n,r)=>!t||!e?{prompts:[],nextCursor:void 0}:t.loadPage(n,r),[e,t]),clear:(0,D.useCallback)(()=>{t?.clear()},[t])}}function fU(e,t){let[n,r]=(0,D.useState)(t?.getResources()??[]),[i,a]=(0,D.useState)(t?.getPagination().nextCursor),[o,s]=(0,D.useState)(t?.getPagination().pageCount??0);return(0,D.useEffect)(()=>{if(!t){r([]),a(void 0),s(0);return}r(t.getResources()),a(t.getPagination().nextCursor),s(t.getPagination().pageCount);let e=e=>{r(e.detail)},n=e=>{a(e.detail.nextCursor),s(e.detail.pageCount)};return t.addEventListener(`resourcesChange`,e),t.addEventListener(`paginationChange`,n),()=>{t.removeEventListener(`resourcesChange`,e),t.removeEventListener(`paginationChange`,n)}},[t]),{resources:n,nextCursor:i,pageCount:o,loadPage:(0,D.useCallback)(async(n,r)=>!t||!e?{resources:[],nextCursor:void 0}:t.loadPage(n,r),[e,t]),clear:(0,D.useCallback)(()=>{t?.clear()},[t])}}function pU({connected:e,paginated:t,managedItems:n,managedRefresh:r,pagedItems:i,pagedNextCursor:a,pagedPageCount:o,loadPage:s}){let c=(0,D.useCallback)(()=>a===void 0?Promise.resolve():s(a),[a,s]),l=(0,D.useCallback)(()=>t?s(void 0):r(),[t,s,r]);return{items:t?i:n,paginated:t,canLoadMore:e&&t&&a!==void 0,loadedPages:e?o:0,onLoadMore:c,onRefresh:l}}function mU(e,t){let[n,r]=(0,D.useState)(t?.getResourceTemplates()??[]);return(0,D.useEffect)(()=>{if(!t){r([]);return}r(t.getResourceTemplates());let e=e=>{r(e.detail)};return t.addEventListener(`resourceTemplatesChange`,e),()=>{t.removeEventListener(`resourceTemplatesChange`,e)}},[t]),{resourceTemplates:n,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];let n=await t.refresh(void 0,`refresh`);return r(n),n},[e,t])}}function hU(e,t){let[n,r]=(0,D.useState)(t?.getTasks()??[]);return(0,D.useEffect)(()=>{if(!t){r([]);return}r(t.getTasks());let e=e=>{r(e.detail)};return t.addEventListener(`tasksChange`,e),()=>{t.removeEventListener(`tasksChange`,e)}},[t]),{tasks:n,refresh:(0,D.useCallback)(async()=>{if(!t||!e)return[];let n=await t.refresh();return r(n),n},[e,t]),clearCompleted:(0,D.useCallback)(()=>{t?.clearCompleted()},[t])}}function gU(e){let[t,n]=(0,D.useState)(e?.getSubscriptions()??[]),[r,i]=(0,D.useState)(e?.getStreamState()??TN);return(0,D.useEffect)(()=>{if(!e){n([]),i(TN);return}n(e.getSubscriptions()),i(e.getStreamState());let t=e=>{n(e.detail)},r=e=>{i(e.detail)};return e.addEventListener(`subscriptionsChange`,t),e.addEventListener(`streamStateChange`,r),()=>{e.removeEventListener(`subscriptionsChange`,t),e.removeEventListener(`streamStateChange`,r)}},[e]),{subscriptions:t,streamState:r}}function _U(e){let[t,n]=(0,D.useState)(e?.getMessages()??[]);return(0,D.useEffect)(()=>{if(!e){n([]);return}n(e.getMessages());let t=e=>{n(e.detail)};return e.addEventListener(`messagesChange`,t),()=>{e.removeEventListener(`messagesChange`,t)}},[e]),{messages:t}}function vU(e){let[t,n]=(0,D.useState)(e?.getFetchRequests()??[]);return(0,D.useEffect)(()=>{if(!e){n([]);return}n(e.getFetchRequests());let t=e=>{n(e.detail)};return e.addEventListener(`fetchRequestsChange`,t),()=>{e.removeEventListener(`fetchRequestsChange`,t)}},[e]),{fetchRequests:t}}function yU(e){let[t,n]=(0,D.useState)(e?.getStderrLogs()??[]);return(0,D.useEffect)(()=>{if(!e){n([]);return}n(e.getStderrLogs());let t=e=>{n(e.detail)};return e.addEventListener(`stderrLogsChange`,t),()=>{e.removeEventListener(`stderrLogsChange`,t)}},[e]),{stderrLogs:t}}function bU(e){return typeof e==`string`&&e?e:void 0}function xU(e){let{baseUrl:t,authToken:n,fetchFn:r}=e,i=r??globalThis.fetch,a=t.replace(/\/$/,``),[o,s]=(0,D.useState)(void 0),[c,l]=(0,D.useState)(void 0),[u,d]=(0,D.useState)(!0),[f,p]=(0,D.useState)(!0),m=(0,D.useCallback)(async e=>{let t={};n&&(t[`x-mcp-remote-auth`]=`Bearer ${n}`);try{let n=await i(`${a}/api/config`,{method:`GET`,headers:t});if(e()||!n.ok)return;let r=await n.json();if(e())return;s(bU(r.version)),l(bU(r.sandboxUrl)),d(r.writable!==!1)}catch{}finally{e()||p(!1)}},[a,n,i]);return(0,D.useEffect)(()=>{let e=!1;return m(()=>e),()=>{e=!0}},[m]),{version:o,sandboxUrl:c,writable:u,loading:f}}function SU(e){let[t,n]=(0,D.useState)(e?.getPendingSamples()??[]),[r,i]=(0,D.useState)(e?.getPendingElicitations()??[]);return(0,D.useEffect)(()=>{if(!e){n([]),i([]);return}n(e.getPendingSamples()),i(e.getPendingElicitations());let t=e=>{n([...e.detail])},r=e=>{i([...e.detail])};return e.addEventListener(`pendingSamplesChange`,t),e.addEventListener(`pendingElicitationsChange`,r),()=>{e.removeEventListener(`pendingSamplesChange`,t),e.removeEventListener(`pendingElicitationsChange`,r)}},[e]),{pendingSamples:t,pendingElicitations:r}}var CU=`io.modelcontextprotocol/related-task`,wU=HI(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),TU=dI([Z(),qF().int()]),EU=Z();lI({ttl:qF().optional(),pollInterval:qF().optional()});var DU=Q({ttl:qF().optional()}),OU=Q({taskId:Z()}),kU=lI({progressToken:TU.optional(),[CU]:OU.optional()}),AU=Q({_meta:kU.optional()}),jU=AU.extend({task:DU.optional()}),MU=Q({method:Z(),params:AU.loose().optional()}),NU=Q({_meta:kU.optional()}),PU=Q({method:Z(),params:NU.loose().optional()}),FU=lI({_meta:kU.optional()}),IU=dI([Z(),qF().int()]),LU=Q({jsonrpc:$(`2.0`),id:IU,...MU.shape}).strict(),RU=Q({jsonrpc:$(`2.0`),...PU.shape}).strict(),zU=Q({jsonrpc:$(`2.0`),id:IU,result:FU}).strict(),BU;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(BU||={});var VU=Q({jsonrpc:$(`2.0`),id:IU.optional(),error:Q({code:qF().int(),message:Z(),data:rI().optional()})}).strict();dI([LU,RU,zU,VU]),dI([zU,VU]);var HU=FU.strict(),UU=NU.extend({requestId:IU.optional(),reason:Z().optional()}),WU=PU.extend({method:$(`notifications/cancelled`),params:UU}),GU=Q({icons:sI(Q({src:Z(),mimeType:Z().optional(),sizes:sI(Z()).optional(),theme:yI([`light`,`dark`]).optional()})).optional()}),KU=Q({name:Z(),title:Z().optional()}),qU=KU.extend({...KU.shape,...GU.shape,version:Z(),websiteUrl:Z().optional(),description:Z().optional()}),JU=GI(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,hI(Q({form:hI(Q({applyDefaults:ZF().optional()}),_I(Z(),rI())).optional(),url:wU.optional()}),_I(Z(),rI()).optional())),YU=lI({list:wU.optional(),cancel:wU.optional(),requests:lI({sampling:lI({createMessage:wU.optional()}).optional(),elicitation:lI({create:wU.optional()}).optional()}).optional()}),XU=lI({list:wU.optional(),cancel:wU.optional(),requests:lI({tools:lI({call:wU.optional()}).optional()}).optional()}),ZU=Q({experimental:_I(Z(),wU).optional(),sampling:Q({context:wU.optional(),tools:wU.optional()}).optional(),elicitation:JU.optional(),roots:Q({listChanged:ZF().optional()}).optional(),tasks:YU.optional(),extensions:_I(Z(),wU).optional()}),QU=AU.extend({protocolVersion:Z(),capabilities:ZU,clientInfo:qU}),$U=MU.extend({method:$(`initialize`),params:QU}),eW=Q({experimental:_I(Z(),wU).optional(),logging:wU.optional(),completions:wU.optional(),prompts:Q({listChanged:ZF().optional()}).optional(),resources:Q({subscribe:ZF().optional(),listChanged:ZF().optional()}).optional(),tools:Q({listChanged:ZF().optional()}).optional(),tasks:XU.optional(),extensions:_I(Z(),wU).optional()}),tW=FU.extend({protocolVersion:Z(),capabilities:eW,serverInfo:qU,instructions:Z().optional()}),nW=PU.extend({method:$(`notifications/initialized`),params:NU.optional()}),rW=MU.extend({method:$(`ping`),params:AU.optional()}),iW=Q({progress:qF(),total:wI(qF()),message:wI(Z())}),aW=Q({...NU.shape,...iW.shape,progressToken:TU}),oW=PU.extend({method:$(`notifications/progress`),params:aW}),sW=AU.extend({cursor:EU.optional()}),cW=MU.extend({params:sW.optional()}),lW=FU.extend({nextCursor:EU.optional()}),uW=yI([`working`,`input_required`,`completed`,`failed`,`cancelled`]),dW=Q({taskId:Z(),status:uW,ttl:dI([qF(),tI()]),createdAt:Z(),lastUpdatedAt:Z(),pollInterval:wI(qF()),statusMessage:wI(Z())}),fW=FU.extend({task:dW}),pW=NU.merge(dW),mW=PU.extend({method:$(`notifications/tasks/status`),params:pW}),hW=MU.extend({method:$(`tasks/get`),params:AU.extend({taskId:Z()})}),gW=FU.merge(dW),_W=MU.extend({method:$(`tasks/result`),params:AU.extend({taskId:Z()})});FU.loose();var vW=cW.extend({method:$(`tasks/list`)}),yW=lW.extend({tasks:sI(dW)}),bW=MU.extend({method:$(`tasks/cancel`),params:AU.extend({taskId:Z()})});FU.merge(dW);var xW=Q({uri:Z(),mimeType:wI(Z()),_meta:_I(Z(),rI()).optional()}),SW=xW.extend({text:Z()}),CW=Z().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),wW=xW.extend({blob:CW}),TW=yI([`user`,`assistant`]),EW=Q({audience:sI(TW).optional(),priority:qF().min(0).max(1).optional(),lastModified:sF({offset:!0}).optional()}),DW=Q({...KU.shape,...GU.shape,uri:Z(),description:wI(Z()),mimeType:wI(Z()),size:wI(qF()),annotations:EW.optional(),_meta:wI(lI({}))}),OW=Q({...KU.shape,...GU.shape,uriTemplate:Z(),description:wI(Z()),mimeType:wI(Z()),annotations:EW.optional(),_meta:wI(lI({}))}),kW=cW.extend({method:$(`resources/list`)}),AW=lW.extend({resources:sI(DW)}),jW=cW.extend({method:$(`resources/templates/list`)}),MW=lW.extend({resourceTemplates:sI(OW)}),NW=AU.extend({uri:Z()}),PW=NW,FW=MU.extend({method:$(`resources/read`),params:PW}),IW=FU.extend({contents:sI(dI([SW,wW]))}),LW=PU.extend({method:$(`notifications/resources/list_changed`),params:NU.optional()}),RW=NW,zW=MU.extend({method:$(`resources/subscribe`),params:RW}),BW=NW,VW=MU.extend({method:$(`resources/unsubscribe`),params:BW}),HW=NU.extend({uri:Z()}),UW=PU.extend({method:$(`notifications/resources/updated`),params:HW}),WW=Q({name:Z(),description:wI(Z()),required:wI(ZF())}),GW=Q({...KU.shape,...GU.shape,description:wI(Z()),arguments:wI(sI(WW)),_meta:wI(lI({}))}),KW=cW.extend({method:$(`prompts/list`)}),qW=lW.extend({prompts:sI(GW)}),JW=AU.extend({name:Z(),arguments:_I(Z(),Z()).optional()}),YW=MU.extend({method:$(`prompts/get`),params:JW}),XW=Q({type:$(`text`),text:Z(),annotations:EW.optional(),_meta:_I(Z(),rI()).optional()}),ZW=Q({type:$(`image`),data:CW,mimeType:Z(),annotations:EW.optional(),_meta:_I(Z(),rI()).optional()}),QW=Q({type:$(`audio`),data:CW,mimeType:Z(),annotations:EW.optional(),_meta:_I(Z(),rI()).optional()}),$W=Q({type:$(`tool_use`),name:Z(),id:Z(),input:_I(Z(),rI()),_meta:_I(Z(),rI()).optional()}),eG=Q({type:$(`resource`),resource:dI([SW,wW]),annotations:EW.optional(),_meta:_I(Z(),rI()).optional()}),tG=DW.extend({type:$(`resource_link`)}),nG=dI([XW,ZW,QW,tG,eG]),rG=Q({role:TW,content:nG}),iG=FU.extend({description:Z().optional(),messages:sI(rG)}),aG=PU.extend({method:$(`notifications/prompts/list_changed`),params:NU.optional()}),oG=Q({title:Z().optional(),readOnlyHint:ZF().optional(),destructiveHint:ZF().optional(),idempotentHint:ZF().optional(),openWorldHint:ZF().optional()}),sG=Q({taskSupport:yI([`required`,`optional`,`forbidden`]).optional()}),cG=Q({...KU.shape,...GU.shape,description:Z().optional(),inputSchema:Q({type:$(`object`),properties:_I(Z(),wU).optional(),required:sI(Z()).optional()}).catchall(rI()),outputSchema:Q({type:$(`object`),properties:_I(Z(),wU).optional(),required:sI(Z()).optional()}).catchall(rI()).optional(),annotations:oG.optional(),execution:sG.optional(),_meta:_I(Z(),rI()).optional()}),lG=cW.extend({method:$(`tools/list`)}),uG=lW.extend({tools:sI(cG)}),dG=FU.extend({content:sI(nG).default([]),structuredContent:_I(Z(),rI()).optional(),isError:ZF().optional()});dG.or(FU.extend({toolResult:rI()}));var fG=jU.extend({name:Z(),arguments:_I(Z(),rI()).optional()}),pG=MU.extend({method:$(`tools/call`),params:fG}),mG=PU.extend({method:$(`notifications/tools/list_changed`),params:NU.optional()});Q({autoRefresh:ZF().default(!0),debounceMs:qF().int().nonnegative().default(300)});var hG=yI([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),gG=AU.extend({level:hG}),_G=MU.extend({method:$(`logging/setLevel`),params:gG}),vG=NU.extend({level:hG,logger:Z().optional(),data:rI()}),yG=PU.extend({method:$(`notifications/message`),params:vG}),bG=Q({hints:sI(Q({name:Z().optional()})).optional(),costPriority:qF().min(0).max(1).optional(),speedPriority:qF().min(0).max(1).optional(),intelligencePriority:qF().min(0).max(1).optional()}),xG=Q({mode:yI([`auto`,`required`,`none`]).optional()}),SG=Q({type:$(`tool_result`),toolUseId:Z().describe(`The unique identifier for the corresponding tool call.`),content:sI(nG).default([]),structuredContent:Q({}).loose().optional(),isError:ZF().optional(),_meta:_I(Z(),rI()).optional()}),CG=pI(`type`,[XW,ZW,QW]),wG=pI(`type`,[XW,ZW,QW,$W,SG]),TG=Q({role:TW,content:dI([wG,sI(wG)]),_meta:_I(Z(),rI()).optional()}),EG=jU.extend({messages:sI(TG),modelPreferences:bG.optional(),systemPrompt:Z().optional(),includeContext:yI([`none`,`thisServer`,`allServers`]).optional(),temperature:qF().optional(),maxTokens:qF().int(),stopSequences:sI(Z()).optional(),metadata:wU.optional(),tools:sI(cG).optional(),toolChoice:xG.optional()}),DG=MU.extend({method:$(`sampling/createMessage`),params:EG}),OG=FU.extend({model:Z(),stopReason:wI(yI([`endTurn`,`stopSequence`,`maxTokens`]).or(Z())),role:TW,content:CG}),kG=FU.extend({model:Z(),stopReason:wI(yI([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(Z())),role:TW,content:dI([wG,sI(wG)])}),AG=Q({type:$(`boolean`),title:Z().optional(),description:Z().optional(),default:ZF().optional()}),jG=Q({type:$(`string`),title:Z().optional(),description:Z().optional(),minLength:qF().optional(),maxLength:qF().optional(),format:yI([`email`,`uri`,`date`,`date-time`]).optional(),default:Z().optional()}),MG=Q({type:yI([`number`,`integer`]),title:Z().optional(),description:Z().optional(),minimum:qF().optional(),maximum:qF().optional(),default:qF().optional()}),NG=Q({type:$(`string`),title:Z().optional(),description:Z().optional(),enum:sI(Z()),default:Z().optional()}),PG=Q({type:$(`string`),title:Z().optional(),description:Z().optional(),oneOf:sI(Q({const:Z(),title:Z()})),default:Z().optional()}),FG=dI([dI([Q({type:$(`string`),title:Z().optional(),description:Z().optional(),enum:sI(Z()),enumNames:sI(Z()).optional(),default:Z().optional()}),dI([NG,PG]),dI([Q({type:$(`array`),title:Z().optional(),description:Z().optional(),minItems:qF().optional(),maxItems:qF().optional(),items:Q({type:$(`string`),enum:sI(Z())}),default:sI(Z()).optional()}),Q({type:$(`array`),title:Z().optional(),description:Z().optional(),minItems:qF().optional(),maxItems:qF().optional(),items:Q({anyOf:sI(Q({const:Z(),title:Z()}))}),default:sI(Z()).optional()})])]),AG,jG,MG]),IG=dI([jU.extend({mode:$(`form`).optional(),message:Z(),requestedSchema:Q({type:$(`object`),properties:_I(Z(),FG),required:sI(Z()).optional()})}),jU.extend({mode:$(`url`),message:Z(),elicitationId:Z(),url:Z().url()})]),LG=MU.extend({method:$(`elicitation/create`),params:IG}),RG=NU.extend({elicitationId:Z()}),zG=PU.extend({method:$(`notifications/elicitation/complete`),params:RG}),BG=FU.extend({action:yI([`accept`,`decline`,`cancel`]),content:GI(e=>e===null?void 0:e,_I(Z(),dI([Z(),qF(),ZF(),sI(Z())])).optional())}),VG=Q({type:$(`ref/resource`),uri:Z()}),HG=Q({type:$(`ref/prompt`),name:Z()}),UG=AU.extend({ref:dI([HG,VG]),argument:Q({name:Z(),value:Z()}),context:Q({arguments:_I(Z(),Z()).optional()}).optional()}),WG=MU.extend({method:$(`completion/complete`),params:UG}),GG=FU.extend({completion:lI({values:sI(Z()).max(100),total:wI(qF().int()),hasMore:wI(ZF())})}),KG=Q({uri:Z().startsWith(`file://`),name:Z().optional(),_meta:_I(Z(),rI()).optional()}),qG=MU.extend({method:$(`roots/list`),params:AU.optional()}),JG=FU.extend({roots:sI(KG)}),YG=PU.extend({method:$(`notifications/roots/list_changed`),params:NU.optional()});dI([rW,$U,WG,_G,YW,KW,kW,jW,FW,zW,VW,pG,lG,hW,_W,vW,bW]),dI([WU,oW,nW,YG,mW]),dI([HU,OG,kG,BG,JG,gW,yW,fW]),dI([rW,DG,LG,qG,hW,_W,vW,bW]),dI([WU,oW,yG,UW,LW,mG,aG,mW,zG]),dI([HU,tW,GG,iG,qW,AW,MW,IW,dG,uG,gW,yW,fW]),(e=>typeof u<`u`?u:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof u<`u`?u:e)[t]}):e)(function(e){if(typeof u<`u`)return u.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var XG=dI([$(`light`),$(`dark`)]).describe(`Color theme preference for the host environment.`),ZG=dI([$(`inline`),$(`fullscreen`),$(`pip`)]).describe(`Display mode for UI presentation.`),QG=_I(dI([$(`--color-background-primary`),$(`--color-background-secondary`),$(`--color-background-tertiary`),$(`--color-background-inverse`),$(`--color-background-ghost`),$(`--color-background-info`),$(`--color-background-danger`),$(`--color-background-success`),$(`--color-background-warning`),$(`--color-background-disabled`),$(`--color-text-primary`),$(`--color-text-secondary`),$(`--color-text-tertiary`),$(`--color-text-inverse`),$(`--color-text-ghost`),$(`--color-text-info`),$(`--color-text-danger`),$(`--color-text-success`),$(`--color-text-warning`),$(`--color-text-disabled`),$(`--color-border-primary`),$(`--color-border-secondary`),$(`--color-border-tertiary`),$(`--color-border-inverse`),$(`--color-border-ghost`),$(`--color-border-info`),$(`--color-border-danger`),$(`--color-border-success`),$(`--color-border-warning`),$(`--color-border-disabled`),$(`--color-ring-primary`),$(`--color-ring-secondary`),$(`--color-ring-inverse`),$(`--color-ring-info`),$(`--color-ring-danger`),$(`--color-ring-success`),$(`--color-ring-warning`),$(`--font-sans`),$(`--font-mono`),$(`--font-weight-normal`),$(`--font-weight-medium`),$(`--font-weight-semibold`),$(`--font-weight-bold`),$(`--font-text-xs-size`),$(`--font-text-sm-size`),$(`--font-text-md-size`),$(`--font-text-lg-size`),$(`--font-heading-xs-size`),$(`--font-heading-sm-size`),$(`--font-heading-md-size`),$(`--font-heading-lg-size`),$(`--font-heading-xl-size`),$(`--font-heading-2xl-size`),$(`--font-heading-3xl-size`),$(`--font-text-xs-line-height`),$(`--font-text-sm-line-height`),$(`--font-text-md-line-height`),$(`--font-text-lg-line-height`),$(`--font-heading-xs-line-height`),$(`--font-heading-sm-line-height`),$(`--font-heading-md-line-height`),$(`--font-heading-lg-line-height`),$(`--font-heading-xl-line-height`),$(`--font-heading-2xl-line-height`),$(`--font-heading-3xl-line-height`),$(`--border-radius-xs`),$(`--border-radius-sm`),$(`--border-radius-md`),$(`--border-radius-lg`),$(`--border-radius-xl`),$(`--border-radius-full`),$(`--border-width-regular`),$(`--shadow-hairline`),$(`--shadow-sm`),$(`--shadow-md`),$(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
|
|
156
|
-
|
|
157
|
-
Individual style keys are optional - hosts may provide any subset of these values.
|
|
158
|
-
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
159
|
-
|
|
160
|
-
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
161
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),dI([Z(),$F()]).describe(`Style variables for theming MCP apps.
|
|
162
|
-
|
|
163
|
-
Individual style keys are optional - hosts may provide any subset of these values.
|
|
164
|
-
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
165
|
-
|
|
166
|
-
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
167
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
|
|
168
|
-
|
|
169
|
-
Individual style keys are optional - hosts may provide any subset of these values.
|
|
170
|
-
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
171
|
-
|
|
172
|
-
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
173
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);Q({method:$(`ui/open-link`),params:Q({url:Z().describe(`URL to open in the host's browser`)})}),Q({isError:ZF().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),Q({isError:ZF().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),Q({isError:ZF().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough(),Q({method:$(`ui/notifications/sandbox-proxy-ready`),params:Q({})});var $G=Q({connectDomains:sI(Z()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
174
|
-
|
|
175
|
-
- Maps to CSP \`connect-src\` directive
|
|
176
|
-
- Empty or omitted → no network connections (secure default)`),resourceDomains:sI(Z()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:sI(Z()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:sI(Z()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),eK=Q({camera:Q({}).optional().describe(`Request camera access.
|
|
177
|
-
|
|
178
|
-
Maps to Permission Policy \`camera\` feature.`),microphone:Q({}).optional().describe(`Request microphone access.
|
|
179
|
-
|
|
180
|
-
Maps to Permission Policy \`microphone\` feature.`),geolocation:Q({}).optional().describe(`Request geolocation access.
|
|
181
|
-
|
|
182
|
-
Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:Q({}).optional().describe(`Request clipboard write access.
|
|
183
|
-
|
|
184
|
-
Maps to Permission Policy \`clipboard-write\` feature.`)});Q({method:$(`ui/notifications/size-changed`),params:Q({width:qF().optional().describe(`New width in pixels.`),height:qF().optional().describe(`New height in pixels.`)})}),Q({method:$(`ui/notifications/tool-input`),params:Q({arguments:_I(Z(),rI().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),Q({method:$(`ui/notifications/tool-input-partial`),params:Q({arguments:_I(Z(),rI().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),Q({method:$(`ui/notifications/tool-cancelled`),params:Q({reason:Z().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var tK=Q({fonts:Z().optional()}),nK=Q({variables:QG.optional().describe(`CSS variables for theming the app.`),css:tK.optional().describe(`CSS blocks that apps can inject.`)});Q({method:$(`ui/resource-teardown`),params:Q({})}),_I(Z(),rI());var rK=Q({text:Q({}).optional().describe(`Host supports text content blocks.`),image:Q({}).optional().describe(`Host supports image content blocks.`),audio:Q({}).optional().describe(`Host supports audio content blocks.`),resource:Q({}).optional().describe(`Host supports resource content blocks.`),resourceLink:Q({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:Q({}).optional().describe(`Host supports structured content.`)});Q({method:$(`ui/notifications/request-teardown`),params:Q({}).optional()});var iK=Q({experimental:Q({}).optional().describe(`Experimental features (structure TBD).`),openLinks:Q({}).optional().describe(`Host supports opening external URLs.`),downloadFile:Q({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:Q({listChanged:ZF().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:Q({listChanged:ZF().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:Q({}).optional().describe(`Host accepts log messages.`),sandbox:Q({permissions:eK.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:$G.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:rK.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:rK.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:Q({tools:Q({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),aK=Q({experimental:Q({}).optional().describe(`Experimental features (structure TBD).`),tools:Q({listChanged:ZF().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:sI(ZG).optional().describe(`Display modes the app supports.`)});Q({method:$(`ui/notifications/initialized`),params:Q({}).optional()}),Q({csp:$G.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:eK.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:Z().optional().describe(`Dedicated origin for view sandbox.
|
|
185
|
-
|
|
186
|
-
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
187
|
-
|
|
188
|
-
**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
|
|
189
|
-
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
|
|
190
|
-
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
|
|
191
|
-
|
|
192
|
-
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:ZF().optional().describe(`Visual boundary preference - true if view prefers a visible border.
|
|
193
|
-
|
|
194
|
-
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
|
|
195
|
-
|
|
196
|
-
- \`true\`: request visible border + background
|
|
197
|
-
- \`false\`: request no visible border + background
|
|
198
|
-
- omitted: host decides border`)}),Q({method:$(`ui/request-display-mode`),params:Q({mode:ZG.describe(`The display mode being requested.`)})}),Q({mode:ZG.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough();var oK=dI([$(`model`),$(`app`)]).describe(`Tool visibility scope - who can access the tool.`);Q({resourceUri:Z().optional(),visibility:sI(oK).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
199
|
-
- "model": Tool visible to and callable by the agent
|
|
200
|
-
- "app": Tool callable by the app from this server only`),csp:aI().optional(),permissions:aI().optional()}),Q({mimeTypes:sI(Z()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Q({method:$(`ui/download-file`),params:Q({contents:sI(dI([eG,tG])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),Q({method:$(`ui/message`),params:Q({role:$(`user`).describe(`Message role, currently only "user" is supported.`),content:sI(nG).describe(`Message content blocks (text, image, etc.).`)})}),Q({method:$(`ui/notifications/sandbox-resource-ready`),params:Q({html:Z().describe(`HTML content to load into the inner iframe.`),sandbox:Z().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:$G.optional().describe(`CSP configuration from resource metadata.`),permissions:eK.optional().describe(`Sandbox permissions from resource metadata.`)})}),Q({method:$(`ui/notifications/tool-result`),params:dG.describe(`Standard MCP tool execution result.`)});var sK=Q({toolInfo:Q({id:IU.optional().describe(`JSON-RPC id of the tools/call request.`),tool:cG.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:XG.optional().describe(`Current color theme preference.`),styles:nK.optional().describe(`Style configuration for theming the app.`),displayMode:ZG.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:sI(ZG).optional().describe(`Display modes the host supports.`),containerDimensions:dI([Q({height:qF().describe(`Fixed container height in pixels.`)}),Q({maxHeight:dI([qF(),$F()]).optional().describe(`Maximum container height in pixels.`)})]).and(dI([Q({width:qF().describe(`Fixed container width in pixels.`)}),Q({maxWidth:dI([qF(),$F()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
201
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:Z().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:Z().optional().describe(`User's timezone in IANA format.`),userAgent:Z().optional().describe(`Host application identifier.`),platform:dI([$(`web`),$(`desktop`),$(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:Q({touch:ZF().optional().describe(`Whether the device supports touch input.`),hover:ZF().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:Q({top:qF().describe(`Top safe area inset in pixels.`),right:qF().describe(`Right safe area inset in pixels.`),bottom:qF().describe(`Bottom safe area inset in pixels.`),left:qF().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();Q({method:$(`ui/notifications/host-context-changed`),params:sK.describe(`Partial context update containing only changed fields.`)}),Q({method:$(`ui/update-model-context`),params:Q({content:sI(nG).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:_I(Z(),rI().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Q({method:$(`ui/initialize`),params:Q({appInfo:qU.describe(`App identification (name and version).`),appCapabilities:aK.describe(`Features and capabilities this app provides.`),protocolVersion:Z().describe(`Protocol version this app supports.`)})}),Q({protocolVersion:Z().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:qU.describe(`Host application identification and version.`),hostCapabilities:iK.describe(`Features and capabilities provided by the host.`),hostContext:sK.describe(`Rich context about the host environment.`)}).passthrough();var cK=`ui/resourceUri`;function lK(e){let t=e._meta?.ui?.resourceUri;if(t===void 0&&(t=e._meta?.[cK]),typeof t==`string`&&t.startsWith(`ui://`))return t;if(t!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(t)}`)}function uK(e){return lK(e)}function dK(e){return uK(e)!==void 0}var fK={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pK=D.createContext&&D.createContext(fK),mK=[`attr`,`size`,`title`];function hK(e,t){if(e==null)return{};var n,r,i=gK(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gK(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function _K(){return _K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_K.apply(null,arguments)}function vK(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yK(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vK(Object(n),!0).forEach(function(t){bK(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vK(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bK(e,t,n){return(t=xK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xK(e){var t=SK(e,`string`);return typeof t==`symbol`?t:t+``}function SK(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function CK(e){return e&&e.map((e,t)=>D.createElement(e.tag,yK({key:t},e.attr),CK(e.child)))}function wK(e){return t=>D.createElement(TK,_K({attr:yK({},e.attr)},t),CK(e.child))}function TK(e){var t=t=>{var{attr:n,size:r,title:i}=e,a=hK(e,mK),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),D.createElement(`svg`,_K({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:yK(yK({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&D.createElement(`title`,null,i),e.children)};return pK===void 0?t(fK):D.createElement(pK.Consumer,null,e=>t(e))}function EK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z`},child:[]}]})(e)}function DK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z`},child:[]}]})(e)}function OK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`},child:[]}]})(e)}function kK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`},child:[]}]})(e)}function AK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z`},child:[]}]})(e)}function jK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 0 0-1.41 0 .996.996 0 0 0 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 0 0 0-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 0 0 0-1.41.996.996 0 0 0-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z`},child:[]}]})(e)}function MK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M12 3a9 9 0 1 0 9 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 0 1-4.4 2.26 5.403 5.403 0 0 1-3.14-9.8c-.44-.06-.9-.1-1.36-.1z`},child:[]}]})(e)}function NK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z`},child:[]}]})(e)}function PK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`M8 5v14l11-7z`},child:[]}]})(e)}function FK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0V0z`},child:[]},{tag:`path`,attr:{d:`M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z`},child:[]}]})(e)}function IK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 16 16`,fill:`currentColor`},child:[{tag:`path`,attr:{fillRule:`evenodd`,clipRule:`evenodd`,d:`M13.617 3.844a2.87 2.87 0 0 0-.451-.868l1.354-1.36L13.904 1l-1.36 1.354a2.877 2.877 0 0 0-.868-.452 3.073 3.073 0 0 0-2.14.075 3.03 3.03 0 0 0-.991.664L7 4.192l4.327 4.328 1.552-1.545c.287-.287.508-.618.663-.992a3.074 3.074 0 0 0 .075-2.14zm-.889 1.804a2.15 2.15 0 0 1-.471.705l-.93.93-3.09-3.09.93-.93a2.15 2.15 0 0 1 .704-.472 2.134 2.134 0 0 1 1.689.007c.264.114.494.271.69.472.2.195.358.426.472.69a2.134 2.134 0 0 1 .007 1.688zm-4.824 4.994l1.484-1.545-.616-.622-1.49 1.551-1.86-1.859 1.491-1.552L6.291 6 4.808 7.545l-.616-.615-1.551 1.545a3 3 0 0 0-.663.998 3.023 3.023 0 0 0-.233 1.169c0 .332.05.656.15.97.105.31.258.597.459.862L1 13.834l.615.615 1.36-1.353c.265.2.552.353.862.458.314.1.638.15.97.15.406 0 .796-.077 1.17-.232.378-.155.71-.376.998-.663l1.545-1.552-.616-.615zm-2.262 2.023a2.16 2.16 0 0 1-.834.164c-.301 0-.586-.057-.855-.17a2.278 2.278 0 0 1-.697-.466 2.28 2.28 0 0 1-.465-.697 2.167 2.167 0 0 1-.17-.854 2.16 2.16 0 0 1 .642-1.545l.93-.93 3.09 3.09-.93.93a2.22 2.22 0 0 1-.711.478z`},child:[]}]})(e)}var LK={connected:`var(--inspector-status-connected)`,connecting:`var(--inspector-status-connecting)`,disconnected:`var(--inspector-status-disconnected)`,error:`var(--inspector-status-error)`};function RK(e,t,n){switch(e){case`connected`:return t==null?`Connected`:`Connected (${t}ms)`;case`connecting`:return`Connecting...`;case`disconnected`:return`Disconnected`;case`error`:return n==null?`Error`:`Error (${n})`}}var zK=kl.withProps({w:10,h:10,radius:`xl`});function BK({status:e,latencyMs:t,retryCount:n,failed:r=!1,showLabel:i}){let a=Rt(`(min-width: 1500px)`),o=i??a,s=r?`Failed`:RK(e,t,n),c=r?`var(--inspector-status-error)`:LK[e];return(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(zK,{bg:c,className:!r&&e===`connecting`?`inspector-pulse`:void 0,title:o?void 0:s}),o&&(0,R.jsx)(H,{size:`sm`,children:s})]})}function VK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M5 5m0 .5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5z`},child:[]},{tag:`path`,attr:{d:`M5 14m0 .5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5z`},child:[]},{tag:`path`,attr:{d:`M14 15l3 3l3 -3`},child:[]},{tag:`path`,attr:{d:`M17 18v-12`},child:[]}]})(e)}function HK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M14 9l3 -3l3 3`},child:[]},{tag:`path`,attr:{d:`M5 5m0 .5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5z`},child:[]},{tag:`path`,attr:{d:`M5 14m0 .5a.5 .5 0 0 1 .5 -.5h4a.5 .5 0 0 1 .5 .5v4a.5 .5 0 0 1 -.5 .5h-4a.5 .5 0 0 1 -.5 -.5z`},child:[]},{tag:`path`,attr:{d:`M17 6v12`},child:[]}]})(e)}function UK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z`},child:[]},{tag:`path`,attr:{d:`M15 4v16`},child:[]},{tag:`path`,attr:{d:`M10 10l-2 2l2 2`},child:[]}]})(e)}function WK(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z`},child:[]},{tag:`path`,attr:{d:`M15 4v16`},child:[]},{tag:`path`,attr:{d:`M9 10l2 2l-2 2`},child:[]}]})(e)}var GK=Eu.withProps({variant:`subtle`,size:36});function KK({open:e,onToggle:t}){let n=e?WK:UK,r=e?`Close monitoring sidebar`:`Open monitoring sidebar`;return(0,R.jsx)(y_,{label:r,children:(0,R.jsx)(GK,{"aria-label":r,onClick:t,children:(0,R.jsx)(n,{size:20})})})}var qK=`/assets/MCP-CWGQJYyH.svg`,JK=`data:image/svg+xml,%3csvg%20width='180'%20height='180'%20viewBox='0%200%20180%20180'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_19_13)'%3e%3cpath%20d='M18%2084.8528L85.8822%2016.9706C95.2548%207.59798%20110.451%207.59798%20119.823%2016.9706V16.9706C129.196%2026.3431%20129.196%2041.5391%20119.823%2050.9117L68.5581%20102.177'%20stroke='white'%20stroke-width='12'%20stroke-linecap='round'/%3e%3cpath%20d='M69.2652%20101.47L119.823%2050.9117C129.196%2041.5391%20144.392%2041.5391%20153.765%2050.9117L154.118%2051.2652C163.491%2060.6378%20163.491%2075.8338%20154.118%2085.2063L92.7248%20146.6C89.6006%20149.724%2089.6006%20154.789%2092.7248%20157.913L105.331%20170.52'%20stroke='white'%20stroke-width='12'%20stroke-linecap='round'/%3e%3cpath%20d='M102.853%2033.9411L52.6482%2084.1457C43.2756%2093.5183%2043.2756%20108.714%2052.6482%20118.087V118.087C62.0208%20127.459%2077.2167%20127.459%2086.5893%20118.087L136.794%2067.8822'%20stroke='white'%20stroke-width='12'%20stroke-linecap='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_19_13'%3e%3crect%20width='180'%20height='180'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e`,YK=1e3,XK=`
|
|
202
|
-
`;function ZK(e){return e.join(XK)}function QK(e){return[e.serverName,e.status,e.latencyMs??``,e.activeTab,ZK(e.availableTabs)].join(XK)}var $K=H.withProps({span:!0,variant:`tabGlow`});function eq(e,t){return e.map(e=>({value:e,label:(0,R.jsx)($K,{"data-glow":t.includes(e)?`on`:void 0,children:e})}))}var tq=V.withProps({h:`100%`,px:`md`,wrap:`nowrap`,gap:`md`}),nq=V.withProps({gap:`md`,wrap:`nowrap`,flex:1,miw:0}),rq=tf.withProps({href:`https://modelcontextprotocol.io`,target:`_blank`,rel:`nofollow noopener noreferrer`}),iq=mm.withProps({alt:`MCP`,w:28,h:28,fit:`contain`}),aq=H.withProps({className:`header-anim`,fw:600,size:`lg`,truncate:`end`,miw:0,flex:1}),oq=V.withProps({gap:`sm`,wrap:`nowrap`,flex:1,miw:0,justify:`flex-end`}),sq=V.withProps({className:`header-anim`,gap:`sm`,wrap:`nowrap`}),cq=V.withProps({className:`header-anim`,styles:{root:{gridArea:`1 / 1`,placeSelf:`center`}}}),lq=Eu.withProps({variant:`subtle`,size:36,"aria-label":`Disconnect from server`}),uq=Eu.withProps({variant:`subtle`,size:36,"aria-label":`Client settings`}),dq=Eu.withProps({variant:`subtle`,size:36,"aria-label":`Toggle color scheme`}),fq=200,pq={in:{opacity:1,width:36,marginLeft:0,transform:`translateX(0)`},out:{opacity:0,width:0,marginLeft:`calc(var(--mantine-spacing-sm) * -1)`,transform:`translateX(-8px)`},common:{overflow:`hidden`,flexShrink:0},transitionProperty:`opacity, width, margin-left, transform`};function mq(e){let t=di(),[n,r]=(0,D.useState)(e.monitorToggle);e.monitorToggle&&e.monitorToggle.open!==n?.open&&r(e.monitorToggle);let i=e.monitorToggle??n,a=t===`dark`?jK:MK,o=e.connected?{serverName:e.serverInfo.name,status:e.status,latencyMs:e.latencyMs,activeTab:e.activeTab,availableTabs:e.availableTabs}:null,[s,c]=(0,D.useState)(o);o&&QK(o)!==(s?QK(s):``)&&c(o);let l=e.connected?o:s,u=e.connected?e.onTabChange:void 0,d=e.connected?e.onDisconnect:void 0,[f,p]=(0,D.useState)(!1);!e.connected&&f&&p(!1),(0,D.useEffect)(()=>{if(!e.connected)return;let t=setTimeout(()=>p(!0),YK);return()=>clearTimeout(t)},[e.connected]);let m=e.connected?e.availableTabs:[],h=ZK(m),[g,_]=(0,D.useState)(h),[v,y]=(0,D.useState)([]);if(h!==g){let e=g?g.split(XK):[];_(h),y(f&&e.length?m.filter(t=>!e.includes(t)):[])}let b=e.connected?`in`:`out`;return(0,R.jsxs)(tq,{children:[(0,R.jsxs)(nq,{children:[(0,R.jsx)(y_,{label:`MCP Documentation`,children:(0,R.jsx)(rq,{children:(0,R.jsx)(iq,{src:t===`dark`?JK:qK})})}),(0,R.jsx)(Xl,{mounted:e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>l?(0,R.jsx)(aq,{"data-anim":b,children:l.serverName}):(0,R.jsx)(R.Fragment,{})})]}),(0,R.jsxs)(B,{display:`grid`,flex:`0 0 auto`,children:[(0,R.jsx)(Xl,{mounted:e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>l?(0,R.jsx)(cq,{"data-anim":b,children:(0,R.jsx)(C_,{value:l.activeTab,onChange:u,data:eq(l.availableTabs,v),size:`sm`})}):(0,R.jsx)(R.Fragment,{})}),(0,R.jsx)(Xl,{mounted:!e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>(0,R.jsx)(cq,{"data-anim":e.connected?`out`:`in`,children:(0,R.jsx)(uv,{order:2,children:`MCP Inspector`})})})]}),(0,R.jsxs)(oq,{children:[(0,R.jsx)(Xl,{mounted:e.connected,transition:`fade`,duration:300,exitDuration:300,children:()=>l?(0,R.jsxs)(sq,{"data-anim":b,children:[(0,R.jsx)(BK,{status:l.status,latencyMs:l.latencyMs}),(0,R.jsx)(y_,{label:`Disconnect from server`,children:(0,R.jsx)(lq,{onClick:d,children:(0,R.jsx)(IK,{size:20})})})]}):(0,R.jsx)(R.Fragment,{})}),(0,R.jsx)(y_,{label:`Client settings`,children:(0,R.jsx)(uq,{onClick:e.onOpenClientSettings,children:(0,R.jsx)(FK,{size:20})})}),(0,R.jsx)(y_,{label:t===`dark`?`Switch to light theme`:`Switch to dark theme`,children:(0,R.jsx)(dq,{onClick:e.onToggleTheme,children:(0,R.jsx)(a,{size:20})})}),(0,R.jsx)(Xl,{mounted:!!e.monitorToggle,transition:pq,duration:fq,exitDuration:fq,timingFunction:`ease`,children:e=>i?(0,R.jsx)(B,{style:e,children:(0,R.jsx)(KK,{open:i.open,onToggle:i.onToggle})}):(0,R.jsx)(R.Fragment,{})})]})]})}var hq=H.withProps({variant:`versionBadge`});function gq({version:e}){return e?(0,R.jsxs)(hq,{"aria-label":`Inspector version ${e}`,children:[`v`,e]}):null}var _q=`Copyright © Model Context Protocol a Series of LF Projects, LLC.`,vq=H.withProps({variant:`copyrightBadge`});function yq(){return(0,R.jsx)(vq,{children:_q})}function bq(){var e=[...arguments];return(0,D.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var xq=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Sq(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Cq(e){return`nodeType`in e}function wq(e){return e?Sq(e)?e:Cq(e)?e.ownerDocument?.defaultView??window:window:window}function Tq(e){let{Document:t}=wq(e);return e instanceof t}function Eq(e){return!Sq(e)&&e instanceof wq(e).HTMLElement}function Dq(e){return e instanceof wq(e).SVGElement}function Oq(e){return e?Sq(e)?e.document:Cq(e)?Tq(e)?e:Eq(e)||Dq(e)?e.ownerDocument:document:document:document}var kq=xq?D.useLayoutEffect:D.useEffect;function Aq(e){let t=(0,D.useRef)(e);return kq(()=>{t.current=e}),(0,D.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function jq(){let e=(0,D.useRef)(null);return[(0,D.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,D.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function Mq(e,t){t===void 0&&(t=[e]);let n=(0,D.useRef)(e);return kq(()=>{n.current!==e&&(n.current=e)},t),n}function Nq(e,t){let n=(0,D.useRef)();return(0,D.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Pq(e){let t=Aq(e),n=(0,D.useRef)(null);return[n,(0,D.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function Fq(e){let t=(0,D.useRef)();return(0,D.useEffect)(()=>{t.current=e},[e]),t.current}var Iq={};function Lq(e,t){return(0,D.useMemo)(()=>{if(t)return t;let n=Iq[e]==null?0:Iq[e]+1;return Iq[e]=n,e+`-`+n},[e,t])}function Rq(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var zq=Rq(1),Bq=Rq(-1);function Vq(e){return`clientX`in e&&`clientY`in e}function Hq(e){if(!e)return!1;let{KeyboardEvent:t}=wq(e.target);return t&&e instanceof t}function Uq(e){if(!e)return!1;let{TouchEvent:t}=wq(e.target);return t&&e instanceof t}function Wq(e){if(Uq(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Vq(e)?{x:e.clientX,y:e.clientY}:null}var Gq=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[Gq.Translate.toString(e),Gq.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),Kq=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function qq(e){return e.matches(Kq)?e:e.querySelector(Kq)}var Jq={display:`none`};function Yq(e){let{id:t,value:n}=e;return D.createElement(`div`,{id:t,style:Jq},n)}function Xq(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return D.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Zq(){let[e,t]=(0,D.useState)(``);return{announce:(0,D.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Qq=(0,D.createContext)(null);function $q(e){let t=(0,D.useContext)(Qq);(0,D.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function eJ(){let[e]=(0,D.useState)(()=>new Set),t=(0,D.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,D.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var tJ={draggable:`
|
|
203
|
-
To pick up a draggable item, press the space bar.
|
|
204
|
-
While dragging, use the arrow keys to move the item.
|
|
205
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
206
|
-
`},nJ={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function rJ(e){let{announcements:t=nJ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=tJ}=e,{announce:a,announcement:o}=Zq(),s=Lq(`DndLiveRegion`),[c,l]=(0,D.useState)(!1);if((0,D.useEffect)(()=>{l(!0)},[]),$q((0,D.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=D.createElement(D.Fragment,null,D.createElement(Yq,{id:r,value:i.draggable}),D.createElement(Xq,{id:s,announcement:o}));return n?(0,ea.createPortal)(u,n):u}var iJ;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(iJ||={});function aJ(){}function oJ(e,t){return(0,D.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function sJ(){var e=[...arguments];return(0,D.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var cJ=Object.freeze({x:0,y:0});function lJ(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function uJ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function dJ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function fJ(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function pJ(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function mJ(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var hJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=mJ(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=lJ(mJ(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(uJ)},gJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=fJ(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=fJ(r),o=i.reduce((e,t,r)=>e+lJ(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(uJ)};function _J(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var vJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=_J(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(dJ)};function yJ(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function bJ(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:cJ}function xJ(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var SJ=xJ(1);function CJ(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function wJ(e,t,n){let r=CJ(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var TJ={ignoreTransform:!1};function EJ(e,t){t===void 0&&(t=TJ);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=wq(e).getComputedStyle(e);t&&(n=wJ(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function DJ(e){return EJ(e,{ignoreTransform:!0})}function OJ(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function kJ(e,t){return t===void 0&&(t=wq(e).getComputedStyle(e)),t.position===`fixed`}function AJ(e,t){t===void 0&&(t=wq(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function jJ(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Tq(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Eq(i)||Dq(i)||n.includes(i))return n;let a=wq(e).getComputedStyle(i);return i!==e&&AJ(i,a)&&n.push(i),kJ(i,a)?n:r(i.parentNode)}return e?r(e):n}function MJ(e){let[t]=jJ(e,1);return t??null}function NJ(e){return!xq||!e?null:Sq(e)?e:Cq(e)?Tq(e)||e===Oq(e).scrollingElement?window:Eq(e)?e:null:null}function PJ(e){return Sq(e)?e.scrollX:e.scrollLeft}function FJ(e){return Sq(e)?e.scrollY:e.scrollTop}function IJ(e){return{x:PJ(e),y:FJ(e)}}var LJ;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(LJ||={});function RJ(e){return!xq||!e?!1:e===document.scrollingElement}function zJ(e){let t={x:0,y:0},n=RJ(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var BJ={x:.2,y:.2};function VJ(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=BJ);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=zJ(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=LJ.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=LJ.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=LJ.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=LJ.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function HJ(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function UJ(e){return e.reduce((e,t)=>zq(e,IJ(t)),cJ)}function WJ(e){return e.reduce((e,t)=>e+PJ(t),0)}function GJ(e){return e.reduce((e,t)=>e+FJ(t),0)}function KJ(e,t){if(t===void 0&&(t=EJ),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);MJ(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var qJ=[[`x`,[`left`,`right`],WJ],[`y`,[`top`,`bottom`],GJ]],JJ=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=jJ(t),r=UJ(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of qJ)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},YJ=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function XJ(e){let{EventTarget:t}=wq(e);return e instanceof t?e:Oq(e)}function ZJ(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var QJ;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(QJ||={});function $J(e){e.preventDefault()}function eY(e){e.stopPropagation()}var tY;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(tY||={});var nY={start:[tY.Space,tY.Enter],cancel:[tY.Esc],end:[tY.Space,tY.Enter,tY.Tab]},rY=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case tY.Right:return{...n,x:n.x+25};case tY.Left:return{...n,x:n.x-25};case tY.Down:return{...n,y:n.y+25};case tY.Up:return{...n,y:n.y-25}}},iY=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new YJ(Oq(t)),this.windowListeners=new YJ(wq(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(QJ.Resize,this.handleCancel),this.windowListeners.add(QJ.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(QJ.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&KJ(n),t(cJ)}handleKeyDown(e){if(Hq(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=nY,coordinateGetter:a=rY,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:cJ;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Bq(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=zJ(n),p=HJ(n),m={x:Math.min(i===tY.Right?p.right-p.width/2:p.right,Math.max(i===tY.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===tY.Down?p.bottom-p.height/2:p.bottom,Math.max(i===tY.Down?p.top:p.top+p.height/2,u.y))},h=i===tY.Right&&!s||i===tY.Left&&!c,g=i===tY.Down&&!l||i===tY.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===tY.Right&&e<=d.x||i===tY.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===tY.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===tY.Down&&e<=d.y||i===tY.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===tY.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,zq(Bq(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};iY.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=nY,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function aY(e){return!!(e&&`distance`in e)}function oY(e){return!!(e&&`delay`in e)}var sY=class{constructor(e,t,n){n===void 0&&(n=XJ(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=Oq(i),this.documentListeners=new YJ(this.document),this.listeners=new YJ(n),this.windowListeners=new YJ(wq(i)),this.initialCoordinates=Wq(r)??cJ,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(QJ.Resize,this.handleCancel),this.windowListeners.add(QJ.DragStart,$J),this.windowListeners.add(QJ.VisibilityChange,this.handleCancel),this.windowListeners.add(QJ.ContextMenu,$J),this.documentListeners.add(QJ.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(oY(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(aY(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(QJ.Click,eY,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(QJ.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Wq(e)??cJ,s=Bq(n,o);if(!t&&a){if(aY(a)){if(a.tolerance!=null&&ZJ(s,a.tolerance))return this.handleCancel();if(ZJ(s,a.distance))return this.handleStart()}if(oY(a)&&ZJ(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===tY.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},cY={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},lY=class extends sY{constructor(e){let{event:t}=e,n=Oq(t.target);super(e,cY,n)}};lY.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var uY={move:{name:`mousemove`},end:{name:`mouseup`}},dY;(function(e){e[e.RightClick=2]=`RightClick`})(dY||={});var fY=class extends sY{constructor(e){super(e,uY,Oq(e.event.target))}};fY.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===dY.RightClick?!1:(r?.({event:n}),!0)}}];var pY={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},mY=class extends sY{constructor(e){super(e,pY)}static setup(){return window.addEventListener(pY.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(pY.move.name,e)};function e(){}}};mY.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var hY;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(hY||={});var gY;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(gY||={});function _Y(e){let{acceleration:t,activator:n=hY.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=gY.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=yY({delta:d,disabled:!a}),[m,h]=jq(),g=(0,D.useRef)({x:0,y:0}),_=(0,D.useRef)({x:0,y:0}),v=(0,D.useMemo)(()=>{switch(n){case hY.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case hY.DraggableRect:return i}},[n,i,c]),y=(0,D.useRef)(null),b=(0,D.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,D.useMemo)(()=>s===gY.TreeOrder?[...l].reverse():l,[s,l]);(0,D.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=l.indexOf(e),i=u[n];if(!i)continue;let{direction:a,speed:s}=VJ(e,i,v,t,f);for(let e of[`x`,`y`])p[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0){h(),y.current=e,m(b,o),g.current=s,_.current=a;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var vY={x:{[LJ.Backward]:!1,[LJ.Forward]:!1},y:{[LJ.Backward]:!1,[LJ.Forward]:!1}};function yY(e){let{delta:t,disabled:n}=e,r=Fq(t);return Nq(e=>{if(n||!r||!e)return vY;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[LJ.Backward]:e.x[LJ.Backward]||i.x===-1,[LJ.Forward]:e.x[LJ.Forward]||i.x===1},y:{[LJ.Backward]:e.y[LJ.Backward]||i.y===-1,[LJ.Forward]:e.y[LJ.Forward]||i.y===1}}},[n,t,r])}function bY(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return Nq(e=>t==null?null:r??e??null,[r,t])}function xY(e,t){return(0,D.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var SY;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(SY||={});var CY;(function(e){e.Optimized=`optimized`})(CY||={});var wY=new Map;function TY(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,D.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,D.useRef)(e),d=g(),f=Mq(d),p=(0,D.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,D.useRef)(null),h=Nq(t=>{if(d&&!n)return wY;if(!t||t===wY||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new JJ(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,D.useEffect)(()=>{u.current=e},[e]),(0,D.useEffect)(()=>{d||p()},[n,d]),(0,D.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,D.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case SY.Always:return!1;case SY.BeforeDragging:return n;default:return!n}}}function EY(e,t){return Nq(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function DY(e,t){return EY(e,t)}function OY(e){let{callback:t,disabled:n}=e,r=Aq(t),i=(0,D.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,D.useEffect)(()=>()=>i?.disconnect(),[i]),i}function kY(e){let{callback:t,disabled:n}=e,r=Aq(t),i=(0,D.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,D.useEffect)(()=>()=>i?.disconnect(),[i]),i}function AY(e){return new JJ(EJ(e),e)}function jY(e,t,n){t===void 0&&(t=AY);let[r,i]=(0,D.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=OY({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=kY({callback:a});return kq(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function MY(e){return bJ(e,EY(e))}var NY=[];function PY(e){let t=(0,D.useRef)(e),n=Nq(n=>e?n&&n!==NY&&e&&t.current&&e.parentNode===t.current.parentNode?n:jJ(e):NY,[e]);return(0,D.useEffect)(()=>{t.current=e},[e]),n}function FY(e){let[t,n]=(0,D.useState)(null),r=(0,D.useRef)(e),i=(0,D.useCallback)(e=>{let t=NJ(e.target);t&&n(e=>e?(e.set(t,IJ(t)),new Map(e)):null)},[]);return(0,D.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=NJ(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,IJ(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{NJ(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,D.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>zq(e,t),cJ):UJ(e):cJ,[e,t])}function IY(e,t){t===void 0&&(t=[]);let n=(0,D.useRef)(null);return(0,D.useEffect)(()=>{n.current=null},t),(0,D.useEffect)(()=>{let t=e!==cJ;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Bq(e,n.current):cJ}function LY(e){(0,D.useEffect)(()=>{if(!xq)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function RY(e,t){return(0,D.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function zY(e){return(0,D.useMemo)(()=>e?OJ(e):null,[e])}var BY=[];function VY(e,t){t===void 0&&(t=EJ);let[n]=e,r=zY(n?wq(n):null),[i,a]=(0,D.useState)(BY);function o(){a(()=>e.length?e.map(e=>RJ(e)?r:new JJ(t(e),e)):BY)}let s=kY({callback:o});return kq(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function HY(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return Eq(t)?t:e}function UY(e){let{measure:t}=e,[n,r]=(0,D.useState)(null),i=kY({callback:(0,D.useCallback)(e=>{for(let{target:n}of e)if(Eq(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=Pq((0,D.useCallback)(e=>{let n=HY(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,D.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var WY=[{sensor:lY,options:{}},{sensor:iY,options:{}}],GY={current:{}},KY={draggable:{measure:DJ},droppable:{measure:DJ,strategy:SY.WhileDragging,frequency:CY.Optimized},dragOverlay:{measure:EJ}},qY=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},JY={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new qY,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:aJ},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:KY,measureDroppableContainers:aJ,windowRect:null,measuringScheduled:!1},YY={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:aJ,draggableNodes:new Map,over:null,measureDroppableContainers:aJ},XY=(0,D.createContext)(YY),ZY=(0,D.createContext)(JY);function QY(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new qY}}}function $Y(e,t){switch(t.type){case iJ.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case iJ.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case iJ.DragEnd:case iJ.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case iJ.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new qY(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case iJ.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new qY(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case iJ.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new qY(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function eX(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,D.useContext)(XY),a=Fq(r),o=Fq(n?.id);return(0,D.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!Hq(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=qq(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function tX(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function nX(e){return(0,D.useMemo)(()=>({draggable:{...KY.draggable,...e?.draggable},droppable:{...KY.droppable,...e?.droppable},dragOverlay:{...KY.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function rX(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,D.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;kq(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=bJ(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=MJ(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var iX=(0,D.createContext)({...cJ,scaleX:1,scaleY:1}),aX;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(aX||={});var oX=(0,D.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=WY,collisionDetection:o=vJ,measuring:s,modifiers:c,...l}=e,[u,d]=(0,D.useReducer)($Y,void 0,QY),[f,p]=eJ(),[m,h]=(0,D.useState)(aX.Uninitialized),g=m===aX.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,D.useRef)({initial:null,translated:null}),C=(0,D.useMemo)(()=>_==null?null:{id:_,data:x?.data??GY,rect:S},[_,x]),w=(0,D.useRef)(null),[T,E]=(0,D.useState)(null),[O,k]=(0,D.useState)(null),A=Mq(l,Object.values(l)),j=Lq(`DndDescribedBy`,t),M=(0,D.useMemo)(()=>b.getEnabled(),[b]),N=nX(s),{droppableRects:ee,measureDroppableContainers:te,measuringScheduled:P}=TY(M,{dragging:g,dependencies:[y.x,y.y],config:N.droppable}),F=bY(v,_),I=(0,D.useMemo)(()=>O?Wq(O):null,[O]),ne=Ne(),re=DY(F,N.draggable.measure);rX({activeNode:_==null?null:v.get(_),config:ne.layoutShiftCompensation,initialRect:re,measure:N.draggable.measure});let ie=jY(F,N.draggable.measure,re),ae=jY(F?F.parentElement:null),oe=(0,D.useRef)({activatorEvent:null,active:null,activeNode:F,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=b.getNodeFor(oe.current.over?.id),ce=UY({measure:N.dragOverlay.measure}),le=ce.nodeRef.current??F,ue=g?ce.rect??ie:null,de=!!(ce.nodeRef.current&&ce.rect),fe=MY(de?null:ie),pe=zY(le?wq(le):null),me=PY(g?se??F:null),he=VY(me),ge=tX(c,{transform:{x:y.x-fe.x,y:y.y-fe.y,scaleX:1,scaleY:1},activatorEvent:O,active:C,activeNodeRect:ie,containerNodeRect:ae,draggingNodeRect:ue,over:oe.current.over,overlayNodeRect:ce.rect,scrollableAncestors:me,scrollableAncestorRects:he,windowRect:pe}),_e=I?zq(I,y):null,ve=FY(me),ye=IY(ve),be=IY(ve,[ie]),xe=zq(ge,ye),Se=ue?SJ(ue,ge):null,Ce=C&&Se?o({active:C,collisionRect:Se,droppableRects:ee,droppableContainers:M,pointerCoordinates:_e}):null,we=pJ(Ce,`id`),[Te,Ee]=(0,D.useState)(null),De=yJ(de?ge:zq(ge,be),Te?.rect??null,ie),Oe=(0,D.useRef)(null),ke=(0,D.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent,o=new n({active:w.current,activeNode:i,event:a,options:r,context:oe,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=A.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=A.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=A.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,ea.unstable_batchedUpdates)(()=>{r?.(i),h(aX.Initializing),d({type:iJ.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(Oe.current),k(a)})},onMove(e){d({type:iJ.DragMove,coordinates:e})},onEnd:s(iJ.DragEnd),onCancel:s(iJ.DragCancel)});Oe.current=o;function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=oe.current,o=null;if(t&&i){let{cancelDrop:s}=A.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===iJ.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=iJ.DragCancel)}w.current=null,(0,ea.unstable_batchedUpdates)(()=>{d({type:e}),h(aX.Uninitialized),Ee(null),E(null),k(null),Oe.current=null;let t=e===iJ.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=A.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),Ae=xY(a,(0,D.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,ke(n,t))},[v,ke]));LY(a),kq(()=>{ie&&m===aX.Initializing&&h(aX.Initialized)},[ie,m]),(0,D.useEffect)(()=>{let{onDragMove:e}=A.current,{active:t,activatorEvent:n,collisions:r,over:i}=oe.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:xe.x,y:xe.y},over:i};(0,ea.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[xe.x,xe.y]),(0,D.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=oe.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=A.current,o=r.get(we),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,ea.unstable_batchedUpdates)(()=>{Ee(s),a?.(c),f({type:`onDragOver`,event:c})})},[we]),kq(()=>{oe.current={activatorEvent:O,active:C,activeNode:F,collisionRect:Se,collisions:Ce,droppableRects:ee,draggableNodes:v,draggingNode:le,draggingNodeRect:ue,droppableContainers:b,over:Te,scrollableAncestors:me,scrollAdjustedTranslate:xe},S.current={initial:ue,translated:Se}},[C,F,Ce,Se,v,le,ue,ee,b,Te,me,xe]),_Y({...ne,delta:y,draggingRect:Se,pointerCoordinates:_e,scrollableAncestors:me,scrollableAncestorRects:he});let je=(0,D.useMemo)(()=>({active:C,activeNode:F,activeNodeRect:ie,activatorEvent:O,collisions:Ce,containerNodeRect:ae,dragOverlay:ce,draggableNodes:v,droppableContainers:b,droppableRects:ee,over:Te,measureDroppableContainers:te,scrollableAncestors:me,scrollableAncestorRects:he,measuringConfiguration:N,measuringScheduled:P,windowRect:pe}),[C,F,ie,O,Ce,ae,ce,v,b,ee,Te,te,me,he,N,P,pe]),Me=(0,D.useMemo)(()=>({activatorEvent:O,activators:Ae,active:C,activeNodeRect:ie,ariaDescribedById:{draggable:j},dispatch:d,draggableNodes:v,over:Te,measureDroppableContainers:te}),[O,Ae,C,ie,d,j,v,Te,te]);return D.createElement(Qq.Provider,{value:p},D.createElement(XY.Provider,{value:Me},D.createElement(ZY.Provider,{value:je},D.createElement(iX.Provider,{value:De},i)),D.createElement(eX,{disabled:n?.restoreFocus===!1})),D.createElement(rJ,{...n,hiddenTextDescribedById:j}));function Ne(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),sX=(0,D.createContext)(null),cX=`button`,lX=`Draggable`;function uX(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=Lq(lX),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,D.useContext)(XY),{role:p=cX,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,D.useContext)(g?iX:sX),[v,y]=Pq(),[b,x]=Pq(),S=RY(o,t),C=Mq(n);return kq(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,D.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===cX?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function dX(){return(0,D.useContext)(ZY)}var fX=`Droppable`,pX={timeout:25};function mX(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Lq(fX),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,D.useContext)(XY),u=(0,D.useRef)({disabled:n}),d=(0,D.useRef)(!1),f=(0,D.useRef)(null),p=(0,D.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...pX,...i},_=Mq(h??r),v=kY({callback:(0,D.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=Pq((0,D.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=Mq(t);return(0,D.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,D.useEffect)(()=>(s({type:iJ.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:iJ.UnregisterDroppable,key:a,id:r})),[r]),(0,D.useEffect)(()=>{n!==u.current.disabled&&(s({type:iJ.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function hX(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function gX(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function _X(e){return e!==null&&e>=0}function vX(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 yX(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var bX=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=hX(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},xX=`Sortable`,SX=D.createContext({activeIndex:-1,containerId:xX,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:bX,disabled:{draggable:!1,droppable:!1}});function CX(e){let{children:t,id:n,items:r,strategy:i=bX,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=dX(),d=Lq(xX,n),f=s.rect!==null,p=(0,D.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,D.useRef)(p),v=!vX(p,_.current),y=g!==-1&&h===-1||v,b=yX(a);kq(()=>{v&&m&&u(p)},[v,p,m,u]),(0,D.useEffect)(()=>{_.current=p},[p]);let x=(0,D.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:gX(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return D.createElement(SX.Provider,{value:x},t)}var wX=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return hX(n,r,i).indexOf(t)},TX=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},EX={duration:200,easing:`ease`},DX=`transform`,OX=Gq.Transition.toString({property:DX,duration:0,easing:`linear`}),kX={roleDescription:`sortable`};function AX(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,D.useState)(null),s=(0,D.useRef)(n);return kq(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=EJ(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,D.useEffect)(()=>{a&&o(null)},[a]),a}function jX(e){let{animateLayoutChanges:t=TX,attributes:n,disabled:r,data:i,getNewIndex:a=wX,id:o,strategy:s,resizeObserverConfig:c,transition:l=EX}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,D.useContext)(SX),y=MX(r,p),b=u.indexOf(o),x=(0,D.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,D.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=mX({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:O,activatorEvent:k,activeNodeRect:A,attributes:j,setNodeRef:M,listeners:N,isDragging:ee,over:te,setActivatorNodeRef:P,transform:F}=uX({id:o,data:x,attributes:{...kX,...n},disabled:y.draggable}),I=bq(E,M),ne=!!O,re=ne&&!m&&_X(f)&&_X(g),ie=!_&&ee,ae=re?(ie&&re?F:null)??(s??v)({rects:h,activeNodeRect:A,activeIndex:f,overIndex:g,index:b}):null,oe=_X(f)&&_X(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,se=O?.id,ce=(0,D.useRef)({activeId:se,items:u,newIndex:oe,containerId:d}),le=u!==ce.current.items,ue=t({active:O,containerId:d,isDragging:ee,isSorting:ne,id:o,index:b,items:u,newIndex:ce.current.newIndex,previousItems:ce.current.items,previousContainerId:ce.current.containerId,transition:l,wasDragging:ce.current.activeId!=null}),de=AX({disabled:!ue,index:b,node:w,rect:C});return(0,D.useEffect)(()=>{ne&&ce.current.newIndex!==oe&&(ce.current.newIndex=oe),d!==ce.current.containerId&&(ce.current.containerId=d),u!==ce.current.items&&(ce.current.items=u)},[ne,oe,d,u]),(0,D.useEffect)(()=>{if(se===ce.current.activeId)return;if(se&&!ce.current.activeId){ce.current.activeId=se;return}let e=setTimeout(()=>{ce.current.activeId=se},50);return()=>clearTimeout(e)},[se]),{active:O,activeIndex:f,attributes:j,data:x,rect:C,index:b,newIndex:oe,items:u,isOver:T,isSorting:ne,isDragging:ee,listeners:N,node:w,overIndex:g,over:te,setNodeRef:I,setActivatorNodeRef:P,setDroppableNodeRef:E,setDraggableNodeRef:M,transform:de??ae,transition:fe()};function fe(){if(de||le&&ce.current.newIndex===b)return OX;if(!(ie&&!Hq(k)||!l)&&(ne||ue))return Gq.Transition.toString({...l,property:DX})}}function MX(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function NX(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var PX=[tY.Down,tY.Right,tY.Up,tY.Left],FX=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(PX.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case tY.Down:r.top<a.top&&t.push(n);break;case tY.Up:r.top>a.top&&t.push(n);break;case tY.Left:r.left>a.left&&t.push(n);break;case tY.Right:r.left<a.left&&t.push(n);break}});let c=gJ({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=pJ(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=jJ(c).some((e,t)=>s[t]!==e),i=IX(e,t),a=LX(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:Bq(u,l)}}}};function IX(e,t){return!NX(e)||!NX(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function LX(e,t){return!NX(e)||!NX(t)||!IX(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}var RX={stdio:`STDIO`,sse:`HTTP`,"streamable-http":`HTTP`},zX=Vp.withProps({variant:`outline`,color:`gray`});function BX({transport:e}){return(0,R.jsx)(zX,{children:RX[e]})}function VX({status:e,disabled:t=!1,onToggle:n,"aria-label":r=`Toggle server connection`}){let i=e===`connected`,a=e===`connecting`;return(0,R.jsx)(W_,{size:`lg`,checked:i||a,disabled:t||a,onChange:n,"aria-label":r})}function HX(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function UX(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var WX=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,GX=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KX={};function qX(e,t){return((t||KX).jsx?GX:WX).test(e)}var JX=/[ \t\n\f\r]/g;function YX(e){return typeof e==`object`?e.type===`text`&&XX(e.value):XX(e)}function XX(e){return e.replace(JX,``)===``}var ZX=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ZX.prototype.normal={},ZX.prototype.property={},ZX.prototype.space=void 0;function QX(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ZX(n,r,t)}function $X(e){return e.toLowerCase()}var eZ=class{constructor(e,t){this.attribute=t,this.property=e}};eZ.prototype.attribute=``,eZ.prototype.booleanish=!1,eZ.prototype.boolean=!1,eZ.prototype.commaOrSpaceSeparated=!1,eZ.prototype.commaSeparated=!1,eZ.prototype.defined=!1,eZ.prototype.mustUseProperty=!1,eZ.prototype.number=!1,eZ.prototype.overloadedBoolean=!1,eZ.prototype.property=``,eZ.prototype.spaceSeparated=!1,eZ.prototype.space=void 0;var tZ=s({boolean:()=>rZ,booleanish:()=>iZ,commaOrSpaceSeparated:()=>lZ,commaSeparated:()=>cZ,number:()=>oZ,overloadedBoolean:()=>aZ,spaceSeparated:()=>sZ}),nZ=0,rZ=uZ(),iZ=uZ(),aZ=uZ(),oZ=uZ(),sZ=uZ(),cZ=uZ(),lZ=uZ();function uZ(){return 2**++nZ}var dZ=Object.keys(tZ),fZ=class extends eZ{constructor(e,t,n,r){let i=-1;if(super(e,t),pZ(this,`space`,r),typeof n==`number`)for(;++i<dZ.length;){let e=dZ[i];pZ(this,dZ[i],(n&tZ[e])===tZ[e])}}};fZ.prototype.defined=!0;function pZ(e,t,n){n&&(e[t]=n)}function mZ(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new fZ(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[$X(r)]=r,n[$X(a.attribute)]=r}return new ZX(t,n,e.space)}var hZ=mZ({properties:{ariaActiveDescendant:null,ariaAtomic:iZ,ariaAutoComplete:null,ariaBusy:iZ,ariaChecked:iZ,ariaColCount:oZ,ariaColIndex:oZ,ariaColSpan:oZ,ariaControls:sZ,ariaCurrent:null,ariaDescribedBy:sZ,ariaDetails:null,ariaDisabled:iZ,ariaDropEffect:sZ,ariaErrorMessage:null,ariaExpanded:iZ,ariaFlowTo:sZ,ariaGrabbed:iZ,ariaHasPopup:null,ariaHidden:iZ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:sZ,ariaLevel:oZ,ariaLive:null,ariaModal:iZ,ariaMultiLine:iZ,ariaMultiSelectable:iZ,ariaOrientation:null,ariaOwns:sZ,ariaPlaceholder:null,ariaPosInSet:oZ,ariaPressed:iZ,ariaReadOnly:iZ,ariaRelevant:null,ariaRequired:iZ,ariaRoleDescription:sZ,ariaRowCount:oZ,ariaRowIndex:oZ,ariaRowSpan:oZ,ariaSelected:iZ,ariaSetSize:oZ,ariaSort:null,ariaValueMax:oZ,ariaValueMin:oZ,ariaValueNow:oZ,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function gZ(e,t){return t in e?e[t]:t}function _Z(e,t){return gZ(e,t.toLowerCase())}var vZ=mZ({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:cZ,acceptCharset:sZ,accessKey:sZ,action:null,allow:null,allowFullScreen:rZ,allowPaymentRequest:rZ,allowUserMedia:rZ,alt:null,as:null,async:rZ,autoCapitalize:null,autoComplete:sZ,autoFocus:rZ,autoPlay:rZ,blocking:sZ,capture:null,charSet:null,checked:rZ,cite:null,className:sZ,cols:oZ,colSpan:null,content:null,contentEditable:iZ,controls:rZ,controlsList:sZ,coords:oZ|cZ,crossOrigin:null,data:null,dateTime:null,decoding:null,default:rZ,defer:rZ,dir:null,dirName:null,disabled:rZ,download:aZ,draggable:iZ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:rZ,formTarget:null,headers:sZ,height:oZ,hidden:aZ,high:oZ,href:null,hrefLang:null,htmlFor:sZ,httpEquiv:sZ,id:null,imageSizes:null,imageSrcSet:null,inert:rZ,inputMode:null,integrity:null,is:null,isMap:rZ,itemId:null,itemProp:sZ,itemRef:sZ,itemScope:rZ,itemType:sZ,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:rZ,low:oZ,manifest:null,max:null,maxLength:oZ,media:null,method:null,min:null,minLength:oZ,multiple:rZ,muted:rZ,name:null,nonce:null,noModule:rZ,noValidate:rZ,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:rZ,optimum:oZ,pattern:null,ping:sZ,placeholder:null,playsInline:rZ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:rZ,referrerPolicy:null,rel:sZ,required:rZ,reversed:rZ,rows:oZ,rowSpan:oZ,sandbox:sZ,scope:null,scoped:rZ,seamless:rZ,selected:rZ,shadowRootClonable:rZ,shadowRootDelegatesFocus:rZ,shadowRootMode:null,shape:null,size:oZ,sizes:null,slot:null,span:oZ,spellCheck:iZ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oZ,step:null,style:null,tabIndex:oZ,target:null,title:null,translate:null,type:null,typeMustMatch:rZ,useMap:null,value:iZ,width:oZ,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:sZ,axis:null,background:null,bgColor:null,border:oZ,borderColor:null,bottomMargin:oZ,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:rZ,declare:rZ,event:null,face:null,frame:null,frameBorder:null,hSpace:oZ,leftMargin:oZ,link:null,longDesc:null,lowSrc:null,marginHeight:oZ,marginWidth:oZ,noResize:rZ,noHref:rZ,noShade:rZ,noWrap:rZ,object:null,profile:null,prompt:null,rev:null,rightMargin:oZ,rules:null,scheme:null,scrolling:iZ,standby:null,summary:null,text:null,topMargin:oZ,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oZ,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:rZ,disableRemotePlayback:rZ,prefix:null,property:null,results:oZ,security:null,unselectable:null},space:`html`,transform:_Z}),yZ=mZ({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:lZ,accentHeight:oZ,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oZ,amplitude:oZ,arabicForm:null,ascent:oZ,attributeName:null,attributeType:null,azimuth:oZ,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oZ,by:null,calcMode:null,capHeight:oZ,className:sZ,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:oZ,diffuseConstant:oZ,direction:null,display:null,dur:null,divisor:oZ,dominantBaseline:null,download:rZ,dx:null,dy:null,edgeMode:null,editable:null,elevation:oZ,enableBackground:null,end:null,event:null,exponent:oZ,externalResourcesRequired:null,fill:null,fillOpacity:oZ,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:cZ,g2:cZ,glyphName:cZ,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oZ,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oZ,horizOriginX:oZ,horizOriginY:oZ,id:null,ideographic:oZ,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oZ,k:oZ,k1:oZ,k2:oZ,k3:oZ,k4:oZ,kernelMatrix:lZ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oZ,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:oZ,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:oZ,overlineThickness:oZ,paintOrder:null,panose1:null,path:null,pathLength:oZ,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:sZ,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oZ,pointsAtY:oZ,pointsAtZ:oZ,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:lZ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:lZ,rev:lZ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:lZ,requiredFeatures:lZ,requiredFonts:lZ,requiredFormats:lZ,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:oZ,specularExponent:oZ,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oZ,strikethroughThickness:oZ,string:null,stroke:null,strokeDashArray:lZ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oZ,strokeOpacity:oZ,strokeWidth:null,style:null,surfaceScale:oZ,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:lZ,tabIndex:oZ,tableValues:null,target:null,targetX:oZ,targetY:oZ,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:lZ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oZ,underlineThickness:oZ,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oZ,values:null,vAlphabetic:oZ,vMathematical:oZ,vectorEffect:null,vHanging:oZ,vIdeographic:oZ,version:null,vertAdvY:oZ,vertOriginX:oZ,vertOriginY:oZ,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oZ,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:gZ}),bZ=mZ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),xZ=mZ({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:_Z}),SZ=mZ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),CZ={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},wZ=/[A-Z]/g,TZ=/-[a-z]/g,EZ=/^data[-\w.:]+$/i;function DZ(e,t){let n=$X(t),r=t,i=eZ;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&EZ.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(TZ,kZ);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!TZ.test(e)){let n=e.replace(wZ,OZ);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=fZ}return new i(r,t)}function OZ(e){return`-`+e.toLowerCase()}function kZ(e){return e.charAt(1).toUpperCase()}var AZ=QX([hZ,vZ,bZ,xZ,SZ],`html`),jZ=QX([hZ,yZ,bZ,xZ,SZ],`svg`);function MZ(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function NZ(e){return e.join(` `).trim()}var PZ=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
207
|
-
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(!(e.charAt(0)!=`/`||e.charAt(1)!=`*`)){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),FZ=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(PZ());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),IZ=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),LZ=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(FZ()),r=IZ();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),RZ=BZ(`end`),zZ=BZ(`start`);function BZ(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function VZ(e){let t=zZ(e),n=RZ(e);if(t&&n)return{start:t,end:n}}function HZ(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?WZ(e.position):`start`in e||`end`in e?WZ(e):`line`in e||`column`in e?UZ(e):``}function UZ(e){return GZ(e&&e.line)+`:`+GZ(e&&e.column)}function WZ(e){return UZ(e&&e.start)+`-`+UZ(e&&e.end)}function GZ(e){return e&&typeof e==`number`?e:1}var KZ=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=HZ(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};KZ.prototype.file=``,KZ.prototype.name=``,KZ.prototype.reason=``,KZ.prototype.message=``,KZ.prototype.stack=``,KZ.prototype.column=void 0,KZ.prototype.line=void 0,KZ.prototype.ancestors=void 0,KZ.prototype.cause=void 0,KZ.prototype.fatal=void 0,KZ.prototype.place=void 0,KZ.prototype.ruleId=void 0,KZ.prototype.source=void 0;var qZ=l(LZ(),1),JZ={}.hasOwnProperty,YZ=new Map,XZ=/[A-Z]/g,ZZ=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),QZ=new Set([`td`,`th`]);function $Z(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=uQ(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=lQ(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?jZ:AZ,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=eQ(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function eQ(e,t,n){if(t.type===`element`)return tQ(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return nQ(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return iQ(e,t,n);if(t.type===`mdxjsEsm`)return rQ(e,t);if(t.type===`root`)return aQ(e,t,n);if(t.type===`text`)return oQ(e,t)}function tQ(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=jZ,e.schema=i),e.ancestors.push(t);let a=gQ(e,t.tagName,!1),o=dQ(e,t),s=pQ(e,t);return ZZ.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!YX(e)})),sQ(e,o,a,t),cQ(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function nQ(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}_Q(e,t.position)}function rQ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_Q(e,t.position)}function iQ(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=jZ,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:gQ(e,t.name,!0),o=fQ(e,t),s=pQ(e,t);return sQ(e,o,a,t),cQ(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function aQ(e,t,n){let r={};return cQ(r,pQ(e,t)),e.create(t,e.Fragment,r,n)}function oQ(e,t){return t.value}function sQ(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cQ(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function lQ(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function uQ(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=zZ(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function dQ(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&JZ.call(t.properties,i)){let a=mQ(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&QZ.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function fQ(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else _Q(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else _Q(e,t.position);else a=r.value===null||r.value;n[i]=a}return n}function pQ(e,t){let n=[],r=-1,i=e.passKeys?new Map:YZ;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=eQ(e,a,o);s!==void 0&&n.push(s)}return n}function mQ(e,t,n){let r=DZ(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?UX(n):NZ(n)),r.property===`style`){let t=typeof n==`object`?n:hQ(e,String(n));return e.stylePropertyNameCase===`css`&&(t=vQ(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?CZ[r.property]||r.property:r.attribute,n]}}function hQ(e,t){try{return(0,qZ.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new KZ("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function gQ(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=qX(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=qX(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return JZ.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);_Q(e)}function _Q(e,t){let n=new KZ("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function vQ(e){let t={},n;for(n in e)JZ.call(e,n)&&(t[yQ(n)]=e[n]);return t}function yQ(e){let t=e.replace(XZ,bQ);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function bQ(e){return`-`+e.toLowerCase()}var xQ={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},SQ={};function CQ(e,t){let n=t||SQ;return wQ(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function wQ(e,t,n){if(EQ(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return TQ(e.children,t,n)}return Array.isArray(e)?TQ(e,t,n):``}function TQ(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=wQ(e[i],t,n);return r.join(``)}function EQ(e){return!!(e&&typeof e==`object`)}var DQ=document.createElement(`i`);function OQ(e){let t=`&`+e+`;`;DQ.innerHTML=t;let n=DQ.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function kQ(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function AQ(e,t){return e.length>0?(kQ(e,e.length,0,t),e):t}var jQ={}.hasOwnProperty;function MQ(e){let t={},n=-1;for(;++n<e.length;)NQ(t,e[n]);return t}function NQ(e,t){let n;for(n in t){let r=(jQ.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){jQ.call(r,a)||(r[a]=[]);let e=i[a];PQ(r[a],Array.isArray(e)?e:e?[e]:[])}}}function PQ(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);kQ(e,0,0,r)}function FQ(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function IQ(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var LQ=YQ(/[A-Za-z]/),RQ=YQ(/[\dA-Za-z]/),zQ=YQ(/[#-'*+\--9=?A-Z^-~]/);function BQ(e){return e!==null&&(e<32||e===127)}var VQ=YQ(/\d/),HQ=YQ(/[\dA-Fa-f]/),UQ=YQ(/[!-/:-@[-`{-~]/);function WQ(e){return e!==null&&e<-2}function GQ(e){return e!==null&&(e<0||e===32)}function KQ(e){return e===-2||e===-1||e===32}var qQ=YQ(/\p{P}|\p{S}/u),JQ=YQ(/\s/);function YQ(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function XQ(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&RQ(e.charCodeAt(n+1))&&RQ(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function ZQ(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return KQ(r)?(e.enter(n),s(r)):t(r)}function s(r){return KQ(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var QQ={tokenize:$Q};function $Q(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),ZQ(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return WQ(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var e$={tokenize:n$},t$={tokenize:r$};function n$(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return kQ(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(t$,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(t$,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return WQ(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;kQ(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function r$(e,t,n){return ZQ(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function i$(e){if(e===null||GQ(e)||JQ(e))return 1;if(qQ(e))return 2}function a$(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var o$={name:`attention`,resolveAll:s$,tokenize:c$};function s$(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};l$(d,-c),l$(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=AQ(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=AQ(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=AQ(l,a$(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=AQ(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=AQ(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,kQ(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function c$(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=i$(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=i$(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function l$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var u$={name:`autolink`,tokenize:d$};function d$(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return LQ(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||RQ(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||RQ(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||BQ(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):zQ(t)?(e.consume(t),l):n(t)}function u(e){return RQ(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||RQ(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var f$={partial:!0,tokenize:p$};function p$(e,t,n){return r;function r(t){return KQ(t)?ZQ(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||WQ(e)?t(e):n(e)}}var m$={continuation:{tokenize:g$},exit:_$,name:`blockQuote`,tokenize:h$};function h$(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return KQ(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function g$(e,t,n){let r=this;return i;function i(t){return KQ(t)?ZQ(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(m$,t,n)(r)}}function _$(e){e.exit(`blockQuote`)}var v$={name:`characterEscape`,tokenize:y$};function y$(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return UQ(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var b$={name:`characterReference`,tokenize:x$};function x$(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=RQ,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=HQ,u):(e.enter(`characterReferenceValue`),a=7,o=VQ,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===RQ&&!OQ(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var S$={partial:!0,tokenize:T$},C$={concrete:!0,name:`codeFenced`,tokenize:w$};function w$(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),KQ(t)?ZQ(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||WQ(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(S$,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||WQ(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):KQ(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),ZQ(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||WQ(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||WQ(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&KQ(t)?ZQ(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||WQ(t)?e.check(S$,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||WQ(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),KQ(t)?ZQ(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),KQ(t)?ZQ(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||WQ(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function T$(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var E$={name:`codeIndented`,tokenize:O$},D$={partial:!0,tokenize:k$};function O$(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),ZQ(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):WQ(t)?e.attempt(D$,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||WQ(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function k$(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):WQ(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):ZQ(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):WQ(e)?i(e):n(e)}}var A$={name:`codeText`,previous:M$,resolve:j$,tokenize:N$};function j$(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function M$(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function N$(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):WQ(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||WQ(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var P$=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&F$(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),F$(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),F$(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);F$(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);F$(this.left,t.reverse())}}};function F$(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function I$(e){let t={},n=-1,r,i,a,o,s,c,l,u=new P$(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,L$(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return kQ(e,0,1/0,u.slice(0)),!l}function L$(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var R$={resolve:B$,tokenize:V$},z$={partial:!0,tokenize:H$};function B$(e){return I$(e),e}function V$(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):WQ(t)?e.check(z$,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function H$(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ZQ(e,a,`linePrefix`)}function a(i){if(i===null||WQ(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function U$(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||BQ(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||WQ(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||GQ(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||BQ(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function W$(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):WQ(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||WQ(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!KQ(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function G$(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):WQ(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ZQ(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||WQ(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function K$(e,t){let n;return r;function r(i){return WQ(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):KQ(i)?ZQ(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var q$={name:`definition`,tokenize:Y$},J$={partial:!0,tokenize:X$};function Y$(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return W$.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=IQ(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return GQ(t)?K$(e,l)(t):l(t)}function l(t){return U$(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(J$,d,d)(t)}function d(t){return KQ(t)?ZQ(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||WQ(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function X$(e,t,n){return r;function r(t){return GQ(t)?K$(e,i)(t):n(t)}function i(t){return G$(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return KQ(t)?ZQ(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||WQ(e)?t(e):n(e)}}var Z$={name:`hardBreakEscape`,tokenize:Q$};function Q$(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return WQ(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var $$={name:`headingAtx`,resolve:e1,tokenize:t1};function e1(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},kQ(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function t1(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||GQ(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||WQ(n)?(e.exit(`atxHeading`),t(n)):KQ(n)?ZQ(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||GQ(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var n1=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),r1=[`pre`,`script`,`style`,`textarea`],i1={concrete:!0,name:`htmlFlow`,resolveTo:s1,tokenize:c1},a1={partial:!0,tokenize:u1},o1={partial:!0,tokenize:l1};function s1(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function c1(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):LQ(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):LQ(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return LQ(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||GQ(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&r1.includes(l)?(i=1,r.interrupt?t(s):O(s)):n1.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||RQ(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return KQ(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||LQ(t)?(e.consume(t),b):KQ(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||RQ(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):KQ(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):KQ(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||WQ(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||GQ(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||KQ(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||WQ(t)?O(t):KQ(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),F):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):WQ(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(a1,I,k)(t)):t===null||WQ(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(o1,A,I)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||WQ(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return r1.includes(n)?(e.consume(t),F):O(t)}return LQ(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),F):t===45&&i===2?(e.consume(t),P):O(t)}function F(t){return t===null||WQ(t)?(e.exit(`htmlFlowData`),I(t)):(e.consume(t),F)}function I(n){return e.exit(`htmlFlow`),t(n)}}function l1(e,t,n){let r=this;return i;function i(t){return WQ(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function u1(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(f$,t,n)}}var d1={name:`htmlText`,tokenize:f1};function f1(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):LQ(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):LQ(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):WQ(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):WQ(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):WQ(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):WQ(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return LQ(t)?(e.consume(t),S):n(t)}function S(t){return t===45||RQ(t)?(e.consume(t),S):C(t)}function C(t){return WQ(t)?(o=C,N(t)):KQ(t)?(e.consume(t),C):M(t)}function w(t){return t===45||RQ(t)?(e.consume(t),w):t===47||t===62||GQ(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||LQ(t)?(e.consume(t),E):WQ(t)?(o=T,N(t)):KQ(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||RQ(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):WQ(t)?(o=D,N(t)):KQ(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):WQ(t)?(o=O,N(t)):KQ(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):WQ(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||GQ(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||GQ(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return KQ(t)?ZQ(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var p1={name:`labelEnd`,resolveAll:_1,resolveTo:v1,tokenize:y1},m1={tokenize:b1},h1={tokenize:x1},g1={tokenize:S1};function _1(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&kQ(e,0,e.length,n),e}function v1(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=AQ(s,e.slice(a+1,a+r+3)),s=AQ(s,[[`enter`,u,t]]),s=AQ(s,a$(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=AQ(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=AQ(s,e.slice(o+1)),s=AQ(s,[[`exit`,c,t]]),kQ(e,a,e.length,s),e}function y1(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(IQ(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(m1,u,o?u:d)(t):t===91?e.attempt(h1,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(g1,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function b1(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return GQ(t)?K$(e,a)(t):a(t)}function a(t){return t===41?u(t):U$(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return GQ(t)?K$(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?G$(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return GQ(t)?K$(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function x1(e,t,n){let r=this;return i;function i(t){return W$.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(IQ(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function S1(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var C1={name:`labelStartImage`,resolveAll:p1.resolveAll,tokenize:w1};function w1(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var T1={name:`labelStartLink`,resolveAll:p1.resolveAll,tokenize:E1};function E1(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var D1={name:`lineEnding`,tokenize:O1};function O1(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),ZQ(e,t,`linePrefix`)}}var k1={name:`thematicBreak`,tokenize:A1};function A1(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||WQ(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),KQ(t)?ZQ(e,s,`whitespace`)(t):s(t))}}var j1={continuation:{tokenize:F1},exit:L1,name:`list`,tokenize:P1},M1={partial:!0,tokenize:R1},N1={partial:!0,tokenize:I1};function P1(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:VQ(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(k1,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return VQ(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(f$,r.interrupt?n:u,e.attempt(M1,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return KQ(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function F1(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(f$,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ZQ(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!KQ(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(N1,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,ZQ(e,e.attempt(j1,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function I1(e,t,n){let r=this;return ZQ(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function L1(e){e.exit(this.containerState.type)}function R1(e,t,n){let r=this;return ZQ(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!KQ(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var z1={name:`setextUnderline`,resolveTo:B1,tokenize:V1};function B1(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function V1(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),KQ(t)?ZQ(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||WQ(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var H1={tokenize:U1};function U1(e){let t=this,n=e.attempt(f$,r,e.attempt(this.parser.constructs.flowInitial,i,ZQ(e,e.attempt(this.parser.constructs.flow,i,e.attempt(R$,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var W1={resolveAll:J1()},G1=q1(`string`),K1=q1(`text`);function q1(e){return{resolveAll:J1(e===`text`?Y1:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function J1(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Y1(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var X1=s({attentionMarkers:()=>i0,contentInitial:()=>Q1,disable:()=>a0,document:()=>Z1,flow:()=>e0,flowInitial:()=>$1,insideSpan:()=>r0,string:()=>t0,text:()=>n0}),Z1={42:j1,43:j1,45:j1,48:j1,49:j1,50:j1,51:j1,52:j1,53:j1,54:j1,55:j1,56:j1,57:j1,62:m$},Q1={91:q$},$1={[-2]:E$,[-1]:E$,32:E$},e0={35:$$,42:k1,45:[z1,k1],60:i1,61:z1,95:k1,96:C$,126:C$},t0={38:b$,92:v$},n0={[-5]:D1,[-4]:D1,[-3]:D1,33:C1,38:b$,42:o$,60:[u$,d1],91:T1,92:[Z$,v$],93:p1,95:o$,96:A$},r0={null:[o$,W1]},i0={null:[42,95]},a0={null:[]};function o0(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=AQ(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=a$(a,l.events,l),l.events):[]}function f(e,t){return c0(p(e),t)}function p(e){return s0(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){WQ(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&kQ(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function s0(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function c0(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
208
|
-
`;break;case-3:o=`\r
|
|
209
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function l0(e){let t={constructs:MQ([X1,...(e||{}).extensions||[]]),content:n(QQ),defined:[],document:n(e$),flow:n(H1),lazy:{},string:n(G1),text:n(K1)};return t;function n(e){return n;function n(n){return o0(t,e,n)}}}function u0(e){for(;!I$(e););return e}var d0=/[\0\t\n\r]/g;function f0(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(d0.lastIndex=u,c=d0.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var p0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function m0(e){return e.replace(p0,h0)}function h0(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return FQ(n.slice(t?2:1),t?16:10)}return OQ(n)||e}var g0={}.hasOwnProperty;function _0(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),v0(n)(u0(l0(n).document().write(f0()(e,t,!0))))}function v0(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(xe),reference:ne,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(Se),thematicBreak:a(we)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ae,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:te,labelText:ee,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:P,resourceTitleString:F,resource:I,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};b0(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];g0.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||S0).call(a,void 0,e[0])}for(r.position={start:y0(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:y0(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:y0(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||S0).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+HZ({start:e.start,end:e.end})+`): it’s not open`);n.position.end=y0(e.end)}function u(){return CQ(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=IQ(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ce(),n.position={start:y0(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=y0(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=y0(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=m0(t),n.identifier=IQ(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function I(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=IQ(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ie(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=FQ(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=OQ(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=y0(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function xe(){return{type:`paragraph`,children:[]}}function Se(){return{type:`strong`,children:[]}}function Ce(){return{type:`text`,value:``}}function we(){return{type:`thematicBreak`}}}function y0(e){return{line:e.line,column:e.column,offset:e.offset}}function b0(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?b0(e,r):x0(e,r)}}function x0(e,t){let n;for(n in t)if(g0.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function S0(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+HZ({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+HZ({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+HZ({start:t.start,end:t.end})+`) is still open`)}function C0(e){let t=this;t.parser=n;function n(n){return _0(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function w0(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function T0(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
210
|
-
`}]}function E0(e,t){let n=t.value?t.value+`
|
|
211
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function D0(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function O0(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k0(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=XQ(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function A0(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function j0(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function M0(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function N0(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return M0(e,t);let i={src:XQ(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function P0(e,t){let n={src:XQ(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function F0(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function I0(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return M0(e,t);let i={href:XQ(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function L0(e,t){let n={href:XQ(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function R0(e,t,n){let r=e.all(t),i=n?z0(n):B0(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
212
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
213
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function z0(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=B0(n[r])}return t}function B0(e){return e.spread??e.children.length>1}function V0(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function H0(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function U0(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function W0(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function G0(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=zZ(t.children[1]),o=RZ(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function K0(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function q0(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var J0=9,Y0=32;function X0(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Z0(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Z0(t.slice(i),i>0,!1)),a.join(``)}function Z0(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===J0||t===Y0;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===J0||t===Y0;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Q0(e,t){let n={type:`text`,value:X0(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function $0(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var e2={blockquote:w0,break:T0,code:E0,delete:D0,emphasis:O0,footnoteReference:k0,heading:A0,html:j0,imageReference:N0,image:P0,inlineCode:F0,linkReference:I0,link:L0,listItem:R0,list:V0,paragraph:H0,root:U0,strong:W0,table:G0,tableCell:q0,tableRow:K0,text:Q0,thematicBreak:$0,toml:t2,yaml:t2,definition:t2,footnoteDefinition:t2};function t2(){}var n2=typeof self==`object`?self:globalThis,r2=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new n2[e](t)},i2=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(r2(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(r2(a,o),i)};return r},a2=e=>i2(new Map,e)(0),o2=``,{toString:s2}={},{keys:c2}=Object,l2=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=s2.call(e).slice(8,-1);switch(n){case`Array`:return[1,o2];case`Object`:return[2,o2];case`Date`:return[3,o2];case`RegExp`:return[4,o2];case`Map`:return[5,o2];case`Set`:return[6,o2];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},u2=([e,t])=>e===0&&(t===`function`||t===`symbol`),d2=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=l2(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of c2(r))(e||!u2(l2(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(u2(l2(n))||u2(l2(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!u2(l2(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},f2=(e,{json:t,lossy:n}={})=>{let r=[];return d2(!(t||n),!!t,new Map,r)(e),r},p2=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?a2(f2(e,t)):structuredClone(e):(e,t)=>a2(f2(e,t));function Hse(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Use(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Wse(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Hse,r=e.options.footnoteBackLabel||Use,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=XQ(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...p2(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
214
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
215
|
-
`}]}}var m2=(function(e){if(e==null)return Jse;if(typeof e==`function`)return h2(e);if(typeof e==`object`)return Array.isArray(e)?Gse(e):Kse(e);if(typeof e==`string`)return qse(e);throw Error(`Expected function, string, or object as test`)});function Gse(e){let t=[],n=-1;for(;++n<e.length;)t[n]=m2(e[n]);return h2(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Kse(e){let t=e;return h2(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function qse(e){return h2(t);function t(t){return t&&t.type===e}}function h2(e){return t;function t(t,n,r){return!!(Yse(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Jse(){return!0}function Yse(e){return typeof e==`object`&&!!e&&`type`in e}function Xse(e){return e}var g2=[];function _2(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=m2(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Xse(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=g2,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Zse(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Zse(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?g2:[e]}function v2(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),_2(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var y2={}.hasOwnProperty,Qse={};function $se(e,t){let n=t||Qse,r=new Map,i=new Map,a={all:s,applyData:tce,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...e2,...n.handlers},one:o,options:n,patch:ece,wrap:rce};return v2(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(y2.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=p2(n);return r.children=a.all(e),r}return p2(e)}return(a.options.unknownHandler||nce)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=b2(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=b2(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function ece(e,t){e.position&&(t.position=VZ(e))}function tce(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,p2(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function nce(e,t){let n=t.data||{},r=`value`in t&&!(y2.call(n,`hProperties`)||y2.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rce(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
216
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
217
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
218
|
-
`}),n}function b2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function x2(e,t){let n=$se(e,t),r=n.one(e,void 0),i=Wse(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
219
|
-
`},i)),a}function ice(e,t){return e&&`run`in e?async function(n,r){let i=x2(n,{file:r,...t});await e.run(i,r)}:function(n,r){return x2(n,{file:r,...e||t})}}function S2(e){if(e)throw e}var ace=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function C2(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function oce(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?sce(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function sce(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var w2={basename:cce,dirname:lce,extname:uce,join:dce,sep:`/`};function cce(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);T2(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function lce(e){if(T2(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function uce(e){T2(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function dce(...e){let t=-1,n;for(;++t<e.length;)T2(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:fce(n)}function fce(e){T2(e);let t=e.codePointAt(0)===47,n=pce(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function pce(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function T2(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var mce={cwd:hce};function hce(){return`/`}function E2(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function gce(e){if(typeof e==`string`)e=new URL(e);else if(!E2(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return _ce(e)}function _ce(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var D2=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],O2=class{constructor(e){let t;t=e?E2(e)?{path:e}:typeof e==`string`||vce(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:mce.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<D2.length;){let e=D2[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)D2.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?w2.basename(this.path):void 0}set basename(e){A2(e,`basename`),k2(e,`basename`),this.path=w2.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?w2.dirname(this.path):void 0}set dirname(e){j2(this.basename,`dirname`),this.path=w2.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?w2.extname(this.path):void 0}set extname(e){if(k2(e,`extname`),j2(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=w2.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){E2(e)&&(e=gce(e)),A2(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?w2.basename(this.path,this.extname):void 0}set stem(e){A2(e,`stem`),k2(e,`stem`),this.path=w2.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new KZ(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function k2(e,t){if(e&&e.includes(w2.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+w2.sep+"`")}function A2(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function j2(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function vce(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var yce=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),M2=l(ace(),1),bce={}.hasOwnProperty,xce=new class e extends yce{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=oce()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,M2.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(F2(`data`,this.frozen),this.namespace[e]=t,this):bce.call(this.namespace,e)&&this.namespace[e]||void 0:e?(F2(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=R2(e),n=this.parser||this.Parser;return N2(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),N2(`process`,this.parser||this.Parser),P2(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=R2(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Cce(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),N2(`processSync`,this.parser||this.Parser),P2(`processSync`,this.compiler||this.Compiler),this.process(e,r),L2(`processSync`,`process`,t),n;function r(e,r){t=!0,S2(e),n=r}}run(e,t,n){I2(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=R2(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),L2(`runSync`,`run`,n),r;function i(e,t){S2(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=R2(t),r=this.compiler||this.Compiler;return P2(`stringify`,r),I2(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(F2(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,M2.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];C2(o)&&C2(r)&&(r=(0,M2.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function N2(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function P2(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function F2(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function I2(e){if(!C2(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function L2(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function R2(e){return Sce(e)?e:new O2(e)}function Sce(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Cce(e){return typeof e==`string`||wce(e)}function wce(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var z2=[],B2={allowDangerousHtml:!0},Tce=/^(https?|ircs?|mailto|xmpp)$/i,Ece=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Dce(e){let t=Oce(e),n=kce(e);return Ace(t.runSync(t.parse(n),n),e)}function Oce(e){let t=e.rehypePlugins||z2,n=e.remarkPlugins||z2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...B2}:B2;return xce().use(C0).use(n).use(ice,r).use(t)}function kce(e){let t=e.children||``,n=new O2;return typeof t==`string`?n.value=t:``+t,n}function Ace(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||jce;for(let e of Ece)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return v2(e,l),$Z(e,{Fragment:R.Fragment,components:i,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in xQ)if(Object.hasOwn(xQ,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=xQ[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function jce(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Tce.test(e.slice(0,t))?e:``}function V2(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Mce(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Nce(e,t,n){let r=m2((n||{}).ignore||[]),i=Pce(t),a=-1;for(;++a<i.length;)_2(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Pce(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Fce(e[0]),Ice(e[1])])}return t}function Fce(e){return typeof e==`string`?new RegExp(Mce(e),`g`):e}function Ice(e){return typeof e==`function`?e:function(){return e}}var H2=`phrasing`,U2=[`autolink`,`link`,`image`,`label`];function Lce(){return{transforms:[Wce],enter:{literalAutolink:zce,literalAutolinkEmail:W2,literalAutolinkHttp:W2,literalAutolinkWww:W2},exit:{literalAutolink:Uce,literalAutolinkEmail:Hce,literalAutolinkHttp:Bce,literalAutolinkWww:Vce}}}function Rce(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:H2,notInConstruct:U2},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:H2,notInConstruct:U2},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:H2,notInConstruct:U2}]}}function zce(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function W2(e){this.config.enter.autolinkProtocol.call(this,e)}function Bce(e){this.config.exit.autolinkProtocol.call(this,e)}function Vce(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Hce(e){this.config.exit.autolinkEmail.call(this,e)}function Uce(e){this.exit(e)}function Wce(e){Nce(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Gce],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Kce]],{ignore:[`link`,`linkReference`]})}function Gce(e,t,n,r,i){let a=``;if(!G2(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!qce(n)))return!1;let o=Jce(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Kce(e,t,n,r){return!G2(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function qce(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Jce(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=V2(e,`(`),a=V2(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function G2(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||JQ(n)||qQ(n))&&(!t||n!==47)}K2.peek=rle;function Yce(){this.buffer()}function Xce(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Zce(){this.buffer()}function Qce(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function $ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=IQ(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ele(e){this.exit(e)}function tle(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=IQ(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nle(e){this.exit(e)}function rle(){return`[`}function K2(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function ile(){return{enter:{gfmFootnoteCallString:Yce,gfmFootnoteCall:Xce,gfmFootnoteDefinitionLabelString:Zce,gfmFootnoteDefinition:Qce},exit:{gfmFootnoteCallString:$ce,gfmFootnoteCall:ele,gfmFootnoteDefinitionLabelString:tle,gfmFootnoteDefinition:nle}}}function ale(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:K2},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
220
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?q2:ole))),s(),o}}function ole(e,t,n){return t===0?e:q2(e,t,n)}function q2(e,t,n){return(n?``:` `)+e}var sle=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];J2.peek=fle;function cle(){return{canContainEols:[`delete`],enter:{strikethrough:ule},exit:{strikethrough:dle}}}function lle(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:sle}],handlers:{delete:J2}}}function ule(e){this.enter({type:`delete`,children:[]},e)}function dle(e){this.exit(e)}function J2(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function fle(){return`~`}function ple(e){return e.length}function mle(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ple,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=hle(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Y2(r[d]);else{let e=Y2(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
221
|
-
`)}function hle(e){return e==null?``:String(e)}function Y2(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function gle(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),_le);return i(),o}function _le(e,t,n){return`>`+(n?``:` `)+e}function vle(e,t){return X2(e,t.inConstruct,!0)&&!X2(e,t.notInConstruct,!1)}function X2(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Z2(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
222
|
-
`&&vle(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
223
|
-
`}function yle(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function ble(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function xle(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Sle(e,t,n,r){let i=xle(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(ble(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Cle);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(yle(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
224
|
-
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
225
|
-
`),a&&(u+=s.move(a+`
|
|
226
|
-
`)),u+=s.move(c),l(),u}function Cle(e,t,n){return(n?``:` `)+e}function Q2(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function wle(e,t,n,r){let i=Q2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
227
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Tle(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function $2(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function e4(e,t,n){let r=i$(e),i=i$(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}t4.peek=Ele;function t4(e,t,n,r){let i=Tle(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=e4(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=$2(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=e4(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+$2(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ele(e,t,n){return n.options.emphasis||`*`}function Dle(e,t){let n=!1;return v2(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&CQ(e)&&(t.options.setext||n))}function Ole(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Dle(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
228
|
-
`,after:`
|
|
229
|
-
`});return r(),t(),o+`
|
|
230
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
231
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
232
|
-
`,...a.current()});return/^[\t ]/.test(l)&&(l=$2(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}n4.peek=kle;function n4(e){return e.value||``}function kle(){return`<`}r4.peek=Ale;function r4(e,t,n,r){let i=Q2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Ale(){return`!`}i4.peek=jle;function i4(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function jle(){return`!`}a4.peek=Mle;function a4(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Mle(){return"`"}function o4(e,t){let n=CQ(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}s4.peek=Nle;function s4(e,t,n,r){let i=Q2(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(o4(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Nle(e,t,n){return o4(e,n)?`<`:`[`}c4.peek=Ple;function c4(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ple(){return`[`}function l4(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Fle(e){let t=l4(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Ile(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function u4(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Lle(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Ile(n):l4(n),s=e.ordered?o===`.`?`)`:`.`:Fle(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),u4(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Rle(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function zle(e,t,n,r){let i=Rle(n),a=n.bulletCurrent||l4(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Ble(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Vle=m2([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Hle(e,t,n,r){return(e.children.some(function(e){return Vle(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ule(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}d4.peek=Wle;function d4(e,t,n,r){let i=Ule(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=e4(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=$2(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=e4(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+$2(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Wle(e,t,n){return n.options.strong||`*`}function Gle(e,t,n,r){return n.safe(e.value,r)}function Kle(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function qle(e,t,n){let r=(u4(n)+(n.options.ruleSpaces?` `:``)).repeat(Kle(n));return n.options.ruleSpaces?r.slice(0,-1):r}var f4={blockquote:gle,break:Z2,code:Sle,definition:wle,emphasis:t4,hardBreak:Z2,heading:Ole,html:n4,image:r4,imageReference:i4,inlineCode:a4,link:s4,linkReference:c4,list:Lle,listItem:zle,paragraph:Ble,root:Hle,strong:d4,text:Gle,thematicBreak:qle};function Jle(){return{enter:{table:Yle,tableData:m4,tableHeader:m4,tableRow:Zle},exit:{codeText:Qle,table:Xle,tableData:p4,tableHeader:p4,tableRow:p4}}}function Yle(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Xle(e){this.exit(e),this.data.inTable=void 0}function Zle(e){this.enter({type:`tableRow`,children:[]},e)}function p4(e){this.exit(e)}function m4(e){this.enter({type:`tableCell`,children:[]},e)}function Qle(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,$le));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function $le(e,t){return t===`|`?t:e}function eue(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
233
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
234
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return mle(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=f4.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function tue(){return{exit:{taskListCheckValueChecked:h4,taskListCheckValueUnchecked:h4,paragraph:rue}}}function nue(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:iue}}}function h4(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function rue(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function iue(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=f4.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function aue(){return[Lce(),ile(),cle(),Jle(),tue()]}function oue(e){return{extensions:[Rce(),ale(e),lle(),eue(e),nue()]}}var sue={tokenize:pue,partial:!0},g4={tokenize:mue,partial:!0},_4={tokenize:hue,partial:!0},v4={tokenize:gue,partial:!0},cue={tokenize:_ue,partial:!0},y4={name:`wwwAutolink`,tokenize:due,previous:w4},b4={name:`protocolAutolink`,tokenize:fue,previous:T4},x4={name:`emailAutolink`,tokenize:uue,previous:E4},S4={};function lue(){return{text:S4}}for(var C4=48;C4<123;)S4[C4]=x4,C4++,C4===58?C4=65:C4===91&&(C4=97);S4[43]=x4,S4[45]=x4,S4[46]=x4,S4[95]=x4,S4[72]=[x4,b4],S4[104]=[x4,b4],S4[87]=[x4,y4],S4[119]=[x4,y4];function uue(e,t,n){let r=this,i,a;return o;function o(t){return!D4(t)||!E4.call(r,r.previous)||O4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return D4(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(cue,u,l)(t):t===45||t===95||RQ(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&LQ(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function due(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!w4.call(r,r.previous)||O4(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(sue,e.attempt(g4,e.attempt(_4,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function fue(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&T4.call(r,r.previous)&&!O4(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(LQ(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||BQ(t)||GQ(t)||JQ(t)||qQ(t)?n(t):e.attempt(g4,e.attempt(_4,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function pue(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function mue(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(v4,c,s)(t):t===null||GQ(t)||JQ(t)||t!==45&&qQ(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function hue(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(v4,t,a)(o):o===null||GQ(o)||JQ(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function gue(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||GQ(o)||JQ(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||GQ(e)||JQ(e)?t(e):r(e)}function a(e){return LQ(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):LQ(t)?(e.consume(t),o):n(t)}}function _ue(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return RQ(e)?n(e):t(e)}}function w4(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||GQ(e)}function T4(e){return!LQ(e)}function E4(e){return!(e===47||D4(e))}function D4(e){return e===43||e===45||e===46||e===95||RQ(e)}function O4(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var vue={tokenize:Eue,partial:!0};function yue(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Cue,continuation:{tokenize:wue},exit:Tue}},text:{91:{name:`gfmFootnoteCall`,tokenize:Sue},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:bue,resolveTo:xue}}}}function bue(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=IQ(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function xue(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Sue(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||GQ(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(IQ(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return GQ(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Cue(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||GQ(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=IQ(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return GQ(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),ZQ(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function wue(e,t,n){return e.check(f$,t,e.attempt(vue,t,n))}function Tue(e){e.exit(`gfmFootnoteDefinition`)}function Eue(e,t,n){let r=this;return ZQ(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Due(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&kQ(o,o.length,0,a$(s,e.slice(r+1,n),t)),kQ(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),kQ(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=i$(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=i$(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Oue=class{constructor(){this.map=[]}add(e,t,n){kue(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function kue(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Aue(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function jue(){return{flow:{null:{name:`table`,tokenize:Mue,resolveAll:Nue}}}}function Mue(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):WQ(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):KQ(t)?ZQ(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||GQ(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,KQ(t)?ZQ(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return KQ(t)?ZQ(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||WQ(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return KQ(t)?ZQ(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||WQ(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||WQ(n)?(e.exit(`tableRow`),t(n)):KQ(n)?ZQ(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||GQ(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Nue(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Oue;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(A4(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=k4(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=k4(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=k4(f,t,o,i,n,d)):(o[0]=o[1],d=k4(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&A4(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Aue(t.events,n))}return e}function k4(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},j4(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=j4(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=j4(t.events,n[2]),a=j4(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},j4(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function A4(e,t,n,r,i){let a=[],o=j4(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function j4(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Pue={name:`tasklistCheck`,tokenize:Iue};function Fue(){return{text:{91:Pue}}}function Iue(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return GQ(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return WQ(r)?t(r):KQ(r)?e.check({tokenize:Lue},t,n)(r):n(r)}}function Lue(e,t,n){return ZQ(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Rue(e){return MQ([lue(),yue(),Due(e),jue(),Fue()])}var zue={};function Bue(e){let t=this,n=e||zue,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Rue(n)),a.push(aue()),o.push(oue(n))}var Vue={json:()=>PM(()=>import(`./json-BJ8dCynk.js`),[]),markup:()=>PM(()=>import(`./markup-CWGodlA2.js`),__vite__mapDeps([0,1])),css:()=>PM(()=>import(`./css-BwN3NHAj.js`),[]),yaml:()=>PM(()=>import(`./yaml-BXU4NK_h.js`),[]),markdown:()=>PM(()=>import(`./markdown-CZCm46w1.js`),__vite__mapDeps([2,1]))},Hue={xml:`markup`,html:`markup`,htm:`markup`,svg:`markup`,yml:`yaml`,md:`markdown`},M4=new Set,N4=new Set,P4=new Map,F4=null,I4=null;function L4(e){return Hue[e]??e}async function Uue(){return F4||(I4||=(async()=>{let[e,t]=await Promise.all([PM(()=>import(`./prism-light-CVa8c8_p.js`),[]),PM(()=>import(`./tomorrow-DlPePFH9.js`),[])]);return F4={Prism:e.default,style:t.default},F4})(),I4)}async function Wue(e){let t=L4(e);if(M4.has(t)||N4.has(t))return;let n=P4.get(t);if(n)return n;let r=Vue[t];if(!r){N4.add(t);return}let i=(async()=>{try{let e=await Uue(),{default:n}=await r();e.Prism.registerLanguage(t,n),M4.add(t)}catch{N4.add(t)}finally{P4.delete(t)}})();return P4.set(t,i),i}var Gue=im.withProps({block:!0});function Kue({language:e,code:t}){let[,n]=(0,D.useState)(0);(0,D.useEffect)(()=>{let t=!1;return Wue(e).then(()=>{t||n(e=>e+1)}),()=>{t=!0}},[e]);let r=L4(e),i=F4;if(!i||!M4.has(r))return(0,R.jsx)(Gue,{children:t});let{Prism:a,style:o}=i;return(0,R.jsx)(a,{language:r,style:o,customStyle:{margin:0},wrapLongLines:!0,children:t})}var que=Eu.withProps({variant:`subtle`,fz:24});function R4({value:e,flush:t=!1}){return(0,R.jsx)(om,{value:e,children:({copied:e,copy:n})=>(0,R.jsx)(y_,{label:e?`Copied`:`Copy`,children:(0,R.jsx)(que,{color:e?`green`:`var(--inspector-text-primary)`,onClick:n,"aria-label":e?`Copied`:`Copy`,...t&&{p:0,h:`auto`,w:`auto`},children:e?`✓`:`⎘`})})})}var Jue=U.withProps({gap:4}),Yue=V.withProps({wrap:`nowrap`,gap:`xs`,align:`center`}),Xue=V.withProps({justify:`space-between`,wrap:`nowrap`,gap:`xs`,align:`center`}),Zue=V.withProps({wrap:`nowrap`,gap:`xs`,align:`center`,flex:1,miw:0}),Que=H.withProps({size:`sm`,fw:500,variant:`monoBreak`,flex:1,miw:0}),$ue=Vp.withProps({size:`md`,radius:`sm`,tt:`none`,autoContrast:!1,bg:`light-dark(var(--mantine-color-blue-light), var(--mantine-color-blue-9))`,c:`light-dark(var(--mantine-color-blue-light-color), var(--mantine-color-white))`}),ede=H.withProps({size:`sm`,fw:600,flex:1,miw:0});function z4({uri:e,name:t,mimeType:n,action:r}){return(0,R.jsxs)(Jue,{children:[!!(t||n)&&(0,R.jsxs)(Yue,{justify:t?`space-between`:`flex-end`,children:[t&&(0,R.jsx)(ede,{children:t}),n&&(0,R.jsx)($ue,{children:n})]}),(0,R.jsxs)(Xue,{children:[(0,R.jsxs)(Zue,{children:[(0,R.jsx)(R4,{value:e}),(0,R.jsx)(Que,{children:e})]}),r]})]})}function tde(e){return e.split(`;`)[0].trim().toLowerCase()}function B4(e){let t=tde(e);return t.startsWith(`image/`)?`image`:t.startsWith(`audio/`)?`audio`:t===`application/pdf`?`pdf`:t===`text/markdown`||t===`text/x-markdown`?`markdown`:t===`application/json`||t.endsWith(`+json`)?`json`:t===`text/csv`?`csv`:t===`text/html`?`html`:t===`text/css`?`css`:t===`text/xml`||t===`application/xml`||t.endsWith(`+xml`)?`xml`:t===`application/javascript`||t===`application/ecmascript`||t===`application/x-javascript`||t.startsWith(`text/`)?`text`:`binary`}var nde=new Set([`markdown`,`json`,`xml`,`css`,`csv`,`html`,`text`]);function rde(e){return nde.has(e)}function ide(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return new TextDecoder(`utf-8`).decode(n)}function ade(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function ode(e){try{return ide(e)}catch{return null}}function sde(e){try{return ade(e)}catch{return null}}function V4(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function cde(e){let t=e.trimStart();return t.startsWith(`{`)||t.startsWith(`[`)}function lde(e){let t=e.replace(/>\s*</g,`>
|
|
235
|
-
<`).trim(),n=0,r=[];for(let e of t.split(`
|
|
236
|
-
`)){let t=e.trim();if(!t)continue;let i=/^<\//.test(t);i&&(n=Math.max(n-1,0)),r.push(` `.repeat(n)+t),/^<[A-Za-z]/.test(t)&&!/\/>$/.test(t)&&!i&&!/^<([A-Za-z][\w-]*)\b[^>]*>.*<\/\1>$/.test(t)&&n++}return r.join(`
|
|
237
|
-
`)}var H4=`<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline' https://fonts.googleapis.com; img-src data: blob:; font-src data: https://fonts.gstatic.com; base-uri 'none'; object-src 'none'; form-action 'none';">`;function ude(e){return/<head[\s>]/i.test(e)?e.replace(/<head([^>]*)>/i,`<head$1>${H4}`):/<html[\s>]/i.test(e)?e.replace(/<html([^>]*)>/i,`<html$1><head>${H4}</head>`):`<html><head>${H4}</head><body>${e}</body></html>`}var dde=/^(https?:|mailto:|#|\/(?!\/))/i;function fde(e){return typeof e==`string`&&dde.test(e)}var pde=Dd.withProps({pos:`relative`,direction:`column`}),mde=im.withProps({block:!0,p:36});function U4({mimeType:e}){return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(pde,{children:(0,R.jsx)(mde,{children:`[Binary content (${e}) — preview not supported]`})})})}var hde=l(o(((e,t)=>{((n,r)=>{typeof define==`function`&&define.amd?define([],r):typeof t==`object`&&e!==void 0?t.exports=r():n.Papa=r()})(e,function e(){var t=typeof self<`u`?self:typeof window<`u`?window:t===void 0?{}:t,n,r=!t.document&&!!t.postMessage,i=t.IS_PAPA_WORKER||!1,a={},o=0,s={};function c(e){return e.charCodeAt(0)===65279?e.slice(1):e}function l(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine=``,this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null),this._handle=new m(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,n){var r=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<r){let t=this._config.newline;t||=(a=this._config.quoteChar||`"`,this._handle.guessLineEndings(e,a)),e=[...e.split(t).slice(r)].join(t)}this.isFirstChunk&&S(this._config.beforeFirstChunk)&&(a=this._config.beforeFirstChunk(e))!==void 0&&(e=a),this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+e,a=(this._partialLine=``,this._handle.parse(r,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(e=a.meta.cursor,r=(this._finished||(this._partialLine=r.substring(e-this._baseIndex),this._baseIndex=e),a&&a.data&&(this._rowCount+=a.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),i)t.postMessage({results:a,workerId:s.WORKER_ID,finished:r});else if(S(this._config.chunk)&&!n){if(this._config.chunk(a,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=a=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(a.data),this._completeResults.errors=this._completeResults.errors.concat(a.errors),this._completeResults.meta=a.meta),this._completed||!r||!S(this._config.complete)||a&&a.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),r||a&&a.meta.paused||this._nextChunk(),a}this._halted=!0},this._sendError=function(e){S(this._config.error)?this._config.error(e):i&&this._config.error&&t.postMessage({workerId:s.WORKER_ID,error:e,finished:!1})}}function u(e){var t;(e||={}).chunkSize||(e.chunkSize=s.RemoteChunkSize),l.call(this,e),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),r||(t.onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)),t.open(this._config.downloadRequestBody?`POST`:`GET`,this._input,!r),this._config.downloadRequestHeaders){var e,n=this._config.downloadRequestHeaders;for(e in n)t.setRequestHeader(e,n[e])}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,t.setRequestHeader(`Range`,`bytes=`+this._start+`-`+i));try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}r&&t.status===0&&this._chunkError()}},this._chunkLoaded=function(){t.readyState===4&&(t.status<200||400<=t.status?this._chunkError():(this._start+=this._config.chunkSize||t.responseText.length,this._finished=!this._config.chunkSize||this._start>=(e=>(e=e.getResponseHeader(`Content-Range`))===null?-1:parseInt(e.substring(e.lastIndexOf(`/`)+1)))(t),this.parseChunk(t.responseText)))},this._chunkError=function(e){e=t.statusText||e,this._sendError(Error(e))}}function d(e){(e||={}).chunkSize||(e.chunkSize=s.LocalChunkSize),l.call(this,e);var t,n,r=typeof FileReader<`u`;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=x(this._chunkLoaded,this),t.onerror=x(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input,i=(this._config.chunkSize&&(i=Math.min(this._start+this._config.chunkSize,this._input.size),e=n.call(e,this._start,i)),t.readAsText(e,this._config.encoding));r||this._chunkLoaded({target:{result:i}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function f(e){var t;l.call(this,e||={}),this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){var e,n;if(!this._finished)return e=this._config.chunkSize,t=e?(n=t.substring(0,e),t.substring(e)):(n=t,``),this._finished=!t,this.parseChunk(n)}}function p(e){l.call(this,e||={});var t=[],n=!0,r=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on(`data`,this._streamData),this._input.on(`end`,this._streamEnd),this._input.on(`error`,this._streamError)},this._checkIsFinished=function(){r&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=x(function(e){try{t.push(typeof e==`string`?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=x(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=x(function(){this._streamCleanUp(),r=!0,this._streamData(``)},this),this._streamCleanUp=x(function(){this._input.removeListener(`data`,this._streamData),this._input.removeListener(`end`,this._streamEnd),this._input.removeListener(`error`,this._streamError)},this)}function m(e){var t,n,r,i,a=2**53,o=-a,l=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,u=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,d=this,f=0,p=0,m=!1,_=!1,v=[],y={data:[],errors:[],meta:{}};function x(t){return e.skipEmptyLines===`greedy`?t.join(``).trim()===``:t.length===1&&t[0].length===0}function C(){if(y&&r&&(T(`Delimiter`,`UndetectableDelimiter`,`Unable to auto-detect delimiting character; defaulted to '`+s.DefaultDelimiter+`'`),r=!1),e.skipEmptyLines&&(y.data=y.data.filter(function(e){return!x(e)})),w()){if(y)if(Array.isArray(y.data[0])){for(var t=0;w()&&t<y.data.length;t++)y.data[t].forEach(n);y.data.splice(0,1)}else y.data.forEach(n);function n(t,n){t=c(t),S(e.transformHeader)&&(t=e.transformHeader(t,n)),v.push(t)}}function n(t,n){for(var r=e.header?{}:[],i=0;i<t.length;i++){var s=i,c=t[i],c=((t,n)=>(t=>(e.dynamicTypingFunction&&e.dynamicTyping[t]===void 0&&(e.dynamicTyping[t]=e.dynamicTypingFunction(t)),!0===(e.dynamicTyping[t]||e.dynamicTyping)))(t)?n===`true`||n===`TRUE`||n!==`false`&&n!==`FALSE`&&((e=>{if(l.test(e)&&(e=parseFloat(e),o<e&&e<a))return 1})(n)?parseFloat(n):u.test(n)?new Date(n):n===``?null:n):n)(s=e.header?i>=v.length?`__parsed_extra`:v[i]:s,c=e.transform?e.transform(c,s):c);s===`__parsed_extra`?(r[s]=r[s]||[],r[s].push(c)):r[s]=c}return e.header&&(i>v.length?T(`FieldMismatch`,`TooManyFields`,`Too many fields: expected `+v.length+` fields but parsed `+i,p+n):i<v.length&&T(`FieldMismatch`,`TooFewFields`,`Too few fields: expected `+v.length+` fields but parsed `+i,p+n)),r}var i;y&&(e.header||e.dynamicTyping||e.transform)&&(i=1,!y.data.length||Array.isArray(y.data[0])?(y.data=y.data.map(n),i=y.data.length):y.data=n(y.data,0),e.header&&y.meta&&(y.meta.fields=v),p+=i)}function w(){return e.header&&v.length===0}function T(e,t,n,r){e={type:e,code:t,message:n},r!==void 0&&(e.row=r),y.errors.push(e)}S(e.step)&&(i=e.step,e.step=function(t){y=t,w()?C():(C(),y.data.length!==0&&(f+=t.data.length,e.preview&&f>e.preview?n.abort():(y.data=y.data[0],i(y,d))))}),this.parse=function(i,a,o){var c=e.quoteChar||`"`,c=(e.newline||=this.guessLineEndings(i,c),r=!1,e.delimiter?S(e.delimiter)&&(e.delimiter=e.delimiter(i),y.meta.delimiter=e.delimiter):((c=((t,n,r,i,a)=>{var o,c,l,u;a||=[`,`,` `,`|`,`;`,s.RECORD_SEP,s.UNIT_SEP];for(var d=0;d<a.length;d++){for(var f,p=a[d],m=0,h=0,_=0,v=(l=void 0,new g({comments:i,delimiter:p,newline:n,preview:10}).parse(t)),y=0;y<v.data.length;y++)r&&x(v.data[y])?_++:(f=v.data[y].length,h+=f,l===void 0?l=f:0<f&&(m+=Math.abs(f-l),l=f));0<v.data.length&&(h/=v.data.length-_),(c===void 0||m<=c)&&(u===void 0||u<h)&&1.99<h&&(c=m,o=p,u=h)}return{successful:!!(e.delimiter=o),bestDelimiter:o}})(i,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess)).successful?e.delimiter=c.bestDelimiter:(r=!0,e.delimiter=s.DefaultDelimiter),y.meta.delimiter=e.delimiter),b(e));return e.preview&&e.header&&c.preview++,t=i,n=new g(c),y=n.parse(t,a,o),C(),m?{meta:{paused:!0}}:y||{meta:{paused:!1}}},this.paused=function(){return m},this.pause=function(){m=!0,n.abort(),t=S(e.chunk)?``:t.substring(n.getCharIndex())},this.resume=function(){d.streamer._halted?(m=!1,d.streamer.parseChunk(t,!0)):setTimeout(d.resume,3)},this.aborted=function(){return _},this.abort=function(){_=!0,n.abort(),y.meta.aborted=!0,S(e.complete)&&e.complete(y),t=``},this.guessLineEndings=function(e,t){e=e.substring(0,1048576);var t=RegExp(h(t)+`([^]*?)`+h(t),`gm`),n=(e=e.replace(t,``)).split(`\r`),t=e.split(`
|
|
238
|
-
`),e=1<t.length&&t[0].length<n[0].length;if(n.length===1||e)return`
|
|
239
|
-
`;for(var r=0,i=0;i<n.length;i++)n[i][0]===`
|
|
240
|
-
`&&r++;return r>=n.length/2?`\r
|
|
241
|
-
`:`\r`}}function h(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function g(e){var t=(e||={}).delimiter,n=e.newline,r=e.comments,i=e.step,a=e.preview,o=e.fastMode,l=null,u=!1,d=e.quoteChar==null?`"`:e.quoteChar,f=d;if(e.escapeChar!==void 0&&(f=e.escapeChar),(typeof t!=`string`||-1<s.BAD_DELIMITERS.indexOf(t))&&(t=`,`),r===t)throw Error(`Comment character same as delimiter`);!0===r?r=`#`:(typeof r!=`string`||-1<s.BAD_DELIMITERS.indexOf(r))&&(r=!1),n!==`
|
|
242
|
-
`&&n!==`\r`&&n!==`\r
|
|
243
|
-
`&&(n=`
|
|
244
|
-
`);var p=0,m=!1;this.parse=function(s,g,_){if(typeof s!=`string`)throw Error(`Input must be a string`);var v=s.length,y=t.length,b=n.length,x=r.length,C=S(i),w=[],T=[],E=[],D=p=0;if(!s)return ne();if(o||!1!==o&&s.indexOf(d)===-1){for(var O=s.split(n),k=0;k<O.length;k++){if(E=O[k],p+=E.length,k!==O.length-1)p+=n.length;else if(_)return ne();if(!r||E.substring(0,x)!==r){if(C){if(w=[],te(E.split(t)),re(),m)return ne()}else te(E.split(t));if(a&&a<=k)return w=w.slice(0,a),ne(!0)}}return ne()}for(var A=s.indexOf(t,p),j=s.indexOf(n,p),M=new RegExp(h(f)+h(d),`g`),N=s.indexOf(d,p);;)if(s[p]===d)for(N=p,p++;;){if((N=s.indexOf(d,N+1))===-1)return _||T.push({type:`Quotes`,code:`MissingQuotes`,message:`Quoted field unterminated`,row:w.length,index:p}),F();if(N===v-1)return F(s.substring(p,N).replace(M,d));if(d===f&&s[N+1]===f)N++;else if(d===f||N===0||s[N-1]!==f){A!==-1&&A<N+1&&(A=s.indexOf(t,N+1));var ee=P((j=j!==-1&&j<N+1?s.indexOf(n,N+1):j)===-1?A:Math.min(A,j));if(s.substr(N+1+ee,y)===t){E.push(s.substring(p,N).replace(M,d)),s[p=N+1+ee+y]!==d&&(N=s.indexOf(d,p)),A=s.indexOf(t,p),j=s.indexOf(n,p);break}if(ee=P(j),s.substring(N+1+ee,N+1+ee+b)===n){if(E.push(s.substring(p,N).replace(M,d)),I(N+1+ee+b),A=s.indexOf(t,p),N=s.indexOf(d,p),C&&(re(),m))return ne();if(a&&w.length>=a)return ne(!0);break}T.push({type:`Quotes`,code:`InvalidQuotes`,message:`Trailing quote on quoted field is malformed`,row:w.length,index:p}),N++}}else if(r&&E.length===0&&s.substring(p,p+x)===r){if(j===-1)return ne();p=j+b,j=s.indexOf(n,p),A=s.indexOf(t,p)}else if(A!==-1&&(A<j||j===-1))E.push(s.substring(p,A)),p=A+y,A=s.indexOf(t,p);else{if(j===-1)break;if(E.push(s.substring(p,j)),I(j+b),C&&(re(),m))return ne();if(a&&w.length>=a)return ne(!0)}return F();function te(e){w.push(e),D=p}function P(e){var t=0;return t=e!==-1&&(e=s.substring(N+1,e))&&e.trim()===``?e.length:t}function F(e){return _||(e===void 0&&(e=s.substring(p)),E.push(e),p=v,te(E),C&&re()),ne()}function I(e){p=e,te(E),E=[],j=s.indexOf(n,p)}function ne(r){if(e.header&&!g&&w.length&&!u){var i=w[0],a=Object.create(null),o=new Set(i);let t=!1;for(let n=0;n<i.length;n++){let r=c(i[n]);if(a[r=S(e.transformHeader)?e.transformHeader(r,n):r]){let e,s=a[r];for(;e=r+`_`+s,s++,o.has(e););o.add(e),i[n]=e,a[r]++,t=!0,(l=l===null?{}:l)[e]=r}else a[r]=1,i[n]=r;o.add(r)}t&&console.warn(`Duplicate headers found and renamed.`),u=!0}return{data:w,errors:T,meta:{delimiter:t,linebreak:n,aborted:m,truncated:!!r,cursor:D+(g||0),renamedHeaders:l}}}function re(){i(ne()),w=[],T=[]}},this.abort=function(){m=!0},this.getCharIndex=function(){return p}}function _(e){var t=e.data,n=a[t.workerId],r=!1;if(t.error)n.userError(t.error,t.file);else if(t.results&&t.results.data){var i={abort:function(){r=!0,v(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(S(n.userStep)){for(var o=0;o<t.results.data.length&&(n.userStep({data:t.results.data[o],errors:t.results.errors,meta:t.results.meta},i),!r);o++);delete t.results}else S(n.userChunk)&&(n.userChunk(t.results,i,t.file),delete t.results)}t.finished&&!r&&v(t.workerId,t.results)}function v(e,t){var n=a[e];S(n.userComplete)&&n.userComplete(t),n.terminate(),delete a[e]}function y(){throw Error(`Not implemented.`)}function b(e){if(typeof e!=`object`||!e)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)n[t]=b(e[t]);return n}function x(e,t){return function(){e.apply(t,arguments)}}function S(e){return typeof e==`function`}return s.parse=function(n,r){var i=(r||={}).dynamicTyping||!1;if(S(i)&&(r.dynamicTypingFunction=i,i={}),r.dynamicTyping=i,r.transform=!!S(r.transform)&&r.transform,!r.worker||!s.WORKERS_SUPPORTED)return i=null,s.NODE_STREAM_INPUT,typeof n==`string`?(n=c(n),i=new(r.download?u:f)(r)):!0===n.readable&&S(n.read)&&S(n.on)?i=new p(r):(t.File&&n instanceof File||n instanceof Object)&&(i=new d(r)),i.stream(n);(i=(()=>{var n;return!!s.WORKERS_SUPPORTED&&(n=(()=>{var n=t.URL||t.webkitURL||null,r=e.toString();return s.BLOB_URL||=n.createObjectURL(new Blob([`var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; `,`(`,r,`)();`],{type:`text/javascript`}))})(),(n=new t.Worker(n)).onmessage=_,n.id=o++,a[n.id]=n)})()).userStep=r.step,i.userChunk=r.chunk,i.userComplete=r.complete,i.userError=r.error,r.step=S(r.step),r.chunk=S(r.chunk),r.complete=S(r.complete),r.error=S(r.error),delete r.worker,i.postMessage({input:n,config:r,workerId:i.id})},s.unparse=function(e,t){var n=!1,r=!0,i=`,`,a=`\r
|
|
245
|
-
`,o=`"`,c=o+o,l=!1,u=null,d=!1,f=((()=>{if(typeof t==`object`){if(typeof t.delimiter!=`string`||s.BAD_DELIMITERS.filter(function(e){return t.delimiter.indexOf(e)!==-1}).length||(i=t.delimiter),typeof t.quotes!=`boolean`&&typeof t.quotes!=`function`&&!Array.isArray(t.quotes)||(n=t.quotes),typeof t.skipEmptyLines!=`boolean`&&typeof t.skipEmptyLines!=`string`||(l=t.skipEmptyLines),typeof t.newline==`string`&&(a=t.newline),typeof t.quoteChar==`string`&&(o=t.quoteChar,c=o+o),typeof t.header==`boolean`&&(r=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw Error(`Option columns is empty`);u=t.columns}t.escapeChar!==void 0&&(c=t.escapeChar+o),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:typeof t.escapeFormulae==`boolean`&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}})(),new RegExp(h(o),`g`));if(typeof e==`string`&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return p(null,e,l);if(typeof e[0]==`object`)return p(u||Object.keys(e[0]),e,l)}else if(typeof e==`object`)return typeof e.data==`string`&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||=e.meta&&e.meta.fields||u,e.fields||=Array.isArray(e.data[0])?e.fields:typeof e.data[0]==`object`?Object.keys(e.data[0]):[],Array.isArray(e.data[0])||typeof e.data[0]==`object`||(e.data=[e.data])),p(e.fields||[],e.data||[],l);throw Error(`Unable to serialize unrecognized input`);function p(e,t,n){var o=``,s=(typeof e==`string`&&(e=JSON.parse(e)),typeof t==`string`&&(t=JSON.parse(t)),Array.isArray(e)&&0<e.length),c=!Array.isArray(t[0]);if(s&&r){for(var l=0;l<e.length;l++)0<l&&(o+=i),o+=m(e[l],l);0<t.length&&(o+=a)}for(var u=0;u<t.length;u++){var d=(s?e:t[u]).length,f=!1,p=s?Object.keys(t[u]).length===0:t[u].length===0;if(n&&!s&&(f=n===`greedy`?t[u].join(``).trim()===``:t[u].length===1&&t[u][0].length===0),n===`greedy`&&s){for(var h=[],g=0;g<d;g++){var _=c?e[g]:g;h.push(t[u][_])}f=h.join(``).trim()===``}if(!f){for(var v=0;v<d;v++){0<v&&!p&&(o+=i);var y=s&&c?e[v]:v;o+=m(t[u][y],v)}u<t.length-1&&(!n||0<d&&!p)&&(o+=a)}}return o}function m(e,t){var r,a,l;return e==null?``:e.constructor===Date?JSON.stringify(e).slice(1,25):(l=!1,d&&typeof e==`string`&&d.test(e)&&(e=`'`+e,l=!0),a=(r=e.toString()).replace(f,c),(l=l||!0===n||typeof n==`function`&&n(e,t)||Array.isArray(n)&&n[t]||((e,t)=>{for(var n=0;n<t.length;n++)if(-1<e.indexOf(t[n]))return!0;return!1})(a,s.BAD_DELIMITERS)||-1<a.indexOf(i)||-1<r.indexOf(o)||a.charAt(0)===` `||a.charAt(a.length-1)===` `)?o+a+o:a)}},s.RECORD_SEP=``,s.UNIT_SEP=``,s.BYTE_ORDER_MARK=``,s.BAD_DELIMITERS=[`\r`,`
|
|
246
|
-
`,`"`,s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!r&&!!t.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=`,`,s.Parser=g,s.ParserHandle=m,s.NetworkStreamer=u,s.FileStreamer=d,s.StringStreamer=f,s.ReadableStreamStreamer=p,t.jQuery&&((n=t.jQuery).fn.parse=function(e){var r=e.config||{},i=[];return this.each(function(e){if(!(n(this).prop(`tagName`).toUpperCase()===`INPUT`&&n(this).attr(`type`).toLowerCase()===`file`&&t.FileReader)||!this.files||this.files.length===0)return!0;for(var a=0;a<this.files.length;a++)i.push({file:this.files[a],inputElem:this,instanceConfig:n.extend({},r)})}),a(),this;function a(){if(i.length===0)S(e.complete)&&e.complete();else{var t,r,a,c,l=i[0];if(S(e.before)){var u=e.before(l.file,l.inputElem);if(typeof u==`object`){if(u.action===`abort`)return t=`AbortError`,r=l.file,a=l.inputElem,c=u.reason,void(S(e.error)&&e.error({name:t},r,a,c));if(u.action===`skip`)return void o();typeof u.config==`object`&&(l.instanceConfig=n.extend(l.instanceConfig,u.config))}else if(u===`skip`)return void o()}var d=l.instanceConfig.complete;l.instanceConfig.complete=function(e){S(d)&&d(e,l.file,l.inputElem),o()},s.parse(l.file,l.instanceConfig)}}function o(){i.splice(0,1),a()}}),i&&(t.onmessage=function(e){e=e.data,s.WORKER_ID===void 0&&e&&(s.WORKER_ID=e.workerId),typeof e.input==`string`?t.postMessage({workerId:s.WORKER_ID,results:s.parse(e.input,e.config),finished:!0}):(t.File&&e.input instanceof File||e.input instanceof Object)&&(e=s.parse(e.input,e.config))&&t.postMessage({workerId:s.WORKER_ID,results:e,finished:!0})}),(u.prototype=Object.create(l.prototype)).constructor=u,(d.prototype=Object.create(l.prototype)).constructor=d,(f.prototype=Object.create(f.prototype)).constructor=f,(p.prototype=Object.create(l.prototype)).constructor=p,s})}))(),1),gde=im.withProps({block:!0,variant:`wrapping`}),_de=av.withProps({striped:!0,highlightOnHover:!0,withTableBorder:!0,withColumnBorders:!0});function vde(e){let t=hde.default.parse(e,{header:!0,skipEmptyLines:!0}),n=t.meta.fields??[];return n.length===0||t.data.length===0?null:{fields:n,rows:t.data.slice(0,100).map(e=>n.map(t=>e[t]??``)),total:t.data.length}}function yde({text:e}){let t=(0,D.useMemo)(()=>vde(e),[e]);if(!t)return(0,R.jsx)(gde,{children:e});let n=t.total>100;return(0,R.jsxs)(_de,{children:[n&&(0,R.jsx)(av.Caption,{children:`Showing first 100 of ${t.total} rows`}),(0,R.jsx)(av.Thead,{children:(0,R.jsx)(av.Tr,{children:t.fields.map(e=>(0,R.jsx)(av.Th,{children:e},e))})}),(0,R.jsx)(av.Tbody,{children:t.rows.map((e,t)=>(0,R.jsx)(av.Tr,{children:e.map((e,t)=>(0,R.jsx)(av.Td,{children:e},t))},t))})]})}function W4(e){let t=(0,D.useMemo)(()=>URL.createObjectURL(e),[e]),n=(0,D.useRef)(null);return(0,D.useEffect)(()=>(n.current=t,()=>{n.current=null,queueMicrotask(()=>{n.current!==t&&URL.revokeObjectURL(t)})}),[t]),t}function bde({html:e}){return(0,R.jsx)(B,{component:`iframe`,title:`HTML preview`,src:W4((0,D.useMemo)(()=>new Blob([ude(e)],{type:`text/html`}),[e])),sandbox:``,w:`100%`,h:400,bd:0,display:`block`})}function xde({data:e}){let t=(0,D.useMemo)(()=>sde(e),[e]),n=W4((0,D.useMemo)(()=>t?new Blob([t],{type:`application/pdf`}):new Blob([]),[t]));return t?(0,R.jsx)(B,{component:`iframe`,title:`PDF preview`,src:`${n}#view=FitH`,w:`100%`,h:600,bd:0,display:`block`}):(0,R.jsx)(U4,{mimeType:`application/pdf`})}function G4(e,t){return`data:${e};base64,${t}`}var K4=Dd.withProps({pos:`relative`,direction:`column`}),Sde=Dd.withProps({pos:`absolute`,top:4,right:4}),Cde=Dd.withProps({className:`markdown-content`,direction:`column`}),wde=mm.withProps({alt:`Content preview`,maw:400,radius:`md`}),q4=im.withProps({block:!0,p:36}),Tde={a:({href:e,children:t})=>fde(e)?(0,R.jsx)(`a`,{href:e,children:t}):(0,R.jsx)(`span`,{children:t})};function J4({copyable:e,copyValue:t,children:n}){return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsxs)(K4,{children:[n,e&&(0,R.jsx)(Sde,{children:(0,R.jsx)(R4,{value:t})})]})})}function Ede({text:e,copyable:t}){return(0,R.jsx)(J4,{copyable:t,copyValue:e,children:(0,R.jsx)(Cde,{children:(0,R.jsx)(Dce,{remarkPlugins:[Bue],components:Tde,children:e})})})}function Y4({code:e,language:t,copyValue:n,copyable:r}){return(0,R.jsx)(J4,{copyable:r,copyValue:n,children:(0,R.jsx)(Kue,{language:t,code:e})})}function Dde({text:e,copyable:t,wrap:n}){let r=cde(e)?V4(e):e;return(0,R.jsx)(J4,{copyable:t,copyValue:e,children:(0,R.jsx)(q4,{tabIndex:0,variant:n?`wrapping`:`nowrap`,title:n?void 0:r,children:r})})}function X4({text:e,mimeType:t,copyable:n,wrap:r}){switch(t?B4(t):`text`){case`markdown`:return(0,R.jsx)(Ede,{text:e,copyable:n});case`json`:return(0,R.jsx)(Y4,{code:V4(e),language:`json`,copyValue:e,copyable:n});case`xml`:return(0,R.jsx)(Y4,{code:lde(e),language:`xml`,copyValue:e,copyable:n});case`css`:return(0,R.jsx)(Y4,{code:e,language:`css`,copyValue:e,copyable:n});case`csv`:return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(yde,{text:e})});case`html`:return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(bde,{html:e})});default:return(0,R.jsx)(Dde,{text:e,copyable:n,wrap:r})}}function Z4({data:e,mimeType:t}){return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(wde,{src:G4(t,e)})})}function Q4({data:e,mimeType:t}){return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(`audio`,{controls:!0,children:(0,R.jsx)(`source`,{src:G4(t,e)})})})}function Ode({contents:e,mimeType:t,copyable:n,wrap:r}){if(`text`in e)return(0,R.jsx)(X4,{text:e.text,mimeType:t,copyable:n,wrap:r});let i=B4(t);if(i===`image`)return(0,R.jsx)(Z4,{data:e.blob,mimeType:t});if(i===`audio`)return(0,R.jsx)(Q4,{data:e.blob,mimeType:t});if(i===`pdf`)return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(xde,{data:e.blob})});if(rde(i)){let i=ode(e.blob);return i===null?(0,R.jsx)(U4,{mimeType:t}):(0,R.jsx)(X4,{text:i,mimeType:t,copyable:n,wrap:r})}return(0,R.jsx)(U4,{mimeType:t})}function kde({block:e,mimeType:t,copyable:n,wrap:r}){switch(e.type){case`text`:return(0,R.jsx)(X4,{text:e.text,mimeType:t,copyable:n,wrap:r});case`image`:return(0,R.jsx)(Z4,{data:e.data,mimeType:e.mimeType});case`audio`:return(0,R.jsx)(Q4,{data:e.data,mimeType:e.mimeType});case`resource`:return(0,R.jsx)(U,{gap:`xs`,children:(0,R.jsx)(K4,{children:(0,R.jsx)(q4,{children:`text`in e.resource?e.resource.text:`[blob: ${e.resource.uri}]`})})});case`resource_link`:return(0,R.jsx)(z4,{uri:e.uri,name:e.name,mimeType:e.mimeType});default:return null}}function $4({block:e,contents:t,copyable:n=!1,mimeType:r,wrap:i=!0}){return t?(0,R.jsx)(Ode,{contents:t,mimeType:r??t.mimeType??`application/octet-stream`,copyable:n,wrap:i}):e?(0,R.jsx)(kde,{block:e,mimeType:r,copyable:n,wrap:i}):null}var Ade=V.withProps({justify:`space-between`,wrap:`nowrap`}),jde=V.withProps({gap:`sm`,wrap:`nowrap`,miw:0,flex:1}),Mde=V.withProps({gap:`sm`,mih:30}),Nde=V.withProps({gap:`sm`,wrap:`nowrap`}),e3=V.withProps({gap:`xs`}),Pde=H.withProps({fw:600,size:`lg`,truncate:`end`,miw:0,flex:1}),Fde=H.withProps({size:`sm`,c:`dimmed`}),Ide=H.withProps({size:`sm`,c:`dimmed`,ml:`auto`}),t3=Xp.withProps({variant:`subtle`,size:`xs`}),Lde={root:{"--inspector-code-surface":`var(--inspector-surface-code-oncard)`}},Rde=Xp.withProps({variant:`subtle`,size:`xs`,color:`red.6`,c:`var(--inspector-danger-text)`});function zde(e){return e.type??`stdio`}var Bde={stdio:`Standard I/O`,sse:`SSE (Server Sent Events) [deprecated]`,"streamable-http":`Streamable HTTP`};function Vde(e){if(e.type===`sse`||e.type===`streamable-http`)return e.url;let t=e.args??[];return t.length>0?`${e.command} ${t.join(` `)}`:e.command}function n3({id:e,name:t,config:n,info:r,connection:i,activeServer:a,onToggleConnection:o,onConnectionInfo:s,onSettings:c,onEdit:l,onClone:u,onRemove:d,compact:f=!1,writable:p=!0,dragHandle:m,highlighted:h=!1,errored:g=!1,justConnected:_=!1,scrollOnHighlight:v=!0,onClearHighlight:y}){let b=a!==void 0&&a!==e,x=(0,D.useRef)(null);(0,D.useEffect)(()=>{h&&v&&x.current?.scrollIntoView({behavior:`smooth`,block:`center`})},[h,v]);let S=(0,D.useRef)(g);(0,D.useEffect)(()=>{let e=g&&!S.current;if(S.current=g,!e)return;let t=setTimeout(()=>{x.current?.scrollIntoView({behavior:`smooth`,block:`center`})},320);return()=>clearTimeout(t)},[g]);let C=(0,D.useRef)(_);(0,D.useEffect)(()=>{let e=_&&!C.current;if(C.current=_,!e)return;let t=setTimeout(()=>{x.current?.scrollIntoView({behavior:`smooth`,block:`center`})},320);return()=>clearTimeout(t)},[_]);let w=zde(n),T=Vde(n),E=r?.version,O=i.status===`connected`?i.protocolVersion:void 0;return(0,R.jsx)(tm,{ref:x,variant:b?`disabled`:g?`errored`:h||_?`highlighted`:void 0,styles:Lde,onClick:h?y:void 0,...b?{"aria-disabled":!0,inert:!0}:{},children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsxs)(Ade,{children:[(0,R.jsxs)(jde,{children:[m,(0,R.jsx)(Pde,{children:t})]}),(0,R.jsxs)(Nde,{children:[(0,R.jsx)(BK,{status:i.status,retryCount:i.retryCount,failed:g,showLabel:!0}),(0,R.jsx)(VX,{status:i.status,disabled:b,onToggle:()=>o(e),"aria-label":`Connect or disconnect "${t}"`})]})]}),!f&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Mde,{children:[E&&(0,R.jsx)(Vp,{variant:`outline`,children:E}),(0,R.jsx)(BX,{transport:w}),(0,R.jsx)(Fde,{children:Bde[w]}),O&&(0,R.jsxs)(Ide,{children:[`MCP `,O]})]}),(0,R.jsx)($4,{block:{type:`text`,text:T},copyable:!0,wrap:!1}),(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(e3,{children:p&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(t3,{onClick:()=>u(e),children:`Clone`}),(0,R.jsx)(t3,{onClick:()=>l(e),children:`Edit`}),(0,R.jsx)(Rde,{onClick:()=>d(e),children:`Remove`})]})}),(0,R.jsxs)(e3,{children:[i.status===`connected`&&(0,R.jsx)(t3,{onClick:()=>s(e),children:`Connection Info`}),p&&(0,R.jsx)(t3,{onClick:()=>c(e),children:`Settings`})]})]})]})]})})}function r3(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z`},child:[]}]})(e)}function Hde(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.5 7C9.32843 7 10 6.32843 10 5.5C10 4.67157 9.32843 4 8.5 4C7.67157 4 7 4.67157 7 5.5C7 6.32843 7.67157 7 8.5 7ZM8.5 13.5C9.32843 13.5 10 12.8284 10 12C10 11.1716 9.32843 10.5 8.5 10.5C7.67157 10.5 7 11.1716 7 12C7 12.8284 7.67157 13.5 8.5 13.5ZM10 18.5C10 19.3284 9.32843 20 8.5 20C7.67157 20 7 19.3284 7 18.5C7 17.6716 7.67157 17 8.5 17C9.32843 17 10 17.6716 10 18.5ZM15.5 7C16.3284 7 17 6.32843 17 5.5C17 4.67157 16.3284 4 15.5 4C14.6716 4 14 4.67157 14 5.5C14 6.32843 14.6716 7 15.5 7ZM17 12C17 12.8284 16.3284 13.5 15.5 13.5C14.6716 13.5 14 12.8284 14 12C14 11.1716 14.6716 10.5 15.5 10.5C16.3284 10.5 17 11.1716 17 12ZM15.5 20C16.3284 20 17 19.3284 17 18.5C17 17.6716 16.3284 17 15.5 17C14.6716 17 14 17.6716 14 18.5C14 19.3284 14.6716 20 15.5 20Z`},child:[]}]})(e)}function i3(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11.9995 0.499512L16.9492 5.44926L15.535 6.86347L12.9995 4.32794V9.99951H10.9995L10.9995 4.32794L8.46643 6.86099L7.05222 5.44678L11.9995 0.499512ZM10.9995 13.9995L10.9995 19.6704L8.46448 17.1353L7.05026 18.5496L12 23.4995L16.9497 18.5498L15.5355 17.1356L12.9995 19.6716V13.9995H10.9995Z`},child:[]}]})(e)}function a3(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11.9995 13.4995 16.9492 18.4493 15.535 19.8635 12.9995 17.3279 12.9995 22.9995H10.9995L10.9995 17.3279 8.46643 19.861 7.05222 18.4468 11.9995 13.4995ZM10.9995.999512 10.9995 6.67035 8.46448 4.13535 7.05026 5.54956 12 10.4995 16.9497 5.54977 15.5355 4.13555 12.9995 6.67157V.999512L10.9995.999512Z`},child:[]}]})(e)}function o3(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z`},child:[]}]})(e)}function s3(e){return wK({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z`},child:[]}]})(e)}var Ude=Eu.withProps({variant:`subtle`,color:`gray`,size:`md`}),Wde=Eu.withProps({variant:`subtle`,size:36});function c3({compact:e,onToggle:t,variant:n=`default`}){let r=e?i3:a3,i=e?`Expand all`:`Collapse all`;return n===`subtle`?(0,R.jsx)(y_,{label:i,children:(0,R.jsx)(Ude,{"aria-label":i,onClick:t,children:(0,R.jsx)(r,{size:16})})}):(0,R.jsx)(y_,{label:i,children:(0,R.jsx)(Wde,{"aria-label":i,onClick:t,children:(0,R.jsx)(r,{size:20})})})}function Gde({onAddManually:e,onImportConfig:t,onImportServerJson:n}){let r=s3;return(0,R.jsxs)(ih,{children:[(0,R.jsx)(ih.Target,{children:(0,R.jsx)(Xp,{rightSection:(0,R.jsx)(r,{size:20}),children:`Add Servers`})}),(0,R.jsxs)(ih.Dropdown,{children:[(0,R.jsx)(ih.Item,{onClick:e,children:`+ Add manually`}),(0,R.jsx)(ih.Item,{onClick:t,children:`Import from client config`}),(0,R.jsx)(ih.Item,{onClick:n,children:`Import from registry config`})]})]})}var Kde=V.withProps({justify:`flex-end`,gap:`sm`});function qde({compact:e,serverCount:t,onToggleList:n,onAddManually:r,onImportConfig:i,onImportServerJson:a,onExport:o,writable:s=!0}){return(0,R.jsxs)(Kde,{children:[(0,R.jsx)(Xp,{variant:`default`,onClick:o,disabled:t===0,children:`Export`}),s&&(0,R.jsx)(Gde,{onAddManually:r,onImportConfig:i,onImportServerJson:a}),t>0&&(0,R.jsx)(c3,{compact:e,onToggle:n})]})}var Jde=Eu.withProps({variant:`subtle`,color:`gray`,size:`md`,className:`server-drag-handle`});function Yde(e){let{attributes:t,listeners:n,setNodeRef:r,setActivatorNodeRef:i,transform:a,transition:o,isDragging:s}=jX({id:e.id}),c=(0,R.jsx)(Jde,{ref:i,"aria-label":`Reorder ${e.name}`,...t,...n,children:(0,R.jsx)(Hde,{size:16})});return(0,R.jsx)(B,{ref:r,style:{transform:Gq.Transform.toString(a),transition:o,zIndex:s?2:void 0,opacity:s?.85:void 0},children:(0,R.jsx)(n3,{...e,dragHandle:c})})}function Xde(e,t,n){if(t===n)return e;let r=e.indexOf(t),i=e.indexOf(n);return r===-1||i===-1?e:hX(e,r,i)}function l3(e,t){return e.find(e=>e.id===t)?.name??t}function u3(e,t){return e.findIndex(e=>e.id===t)+1}function Zde(e){let t=e.length;return{onDragStart:({active:n})=>`Picked up server ${l3(e,String(n.id))}. It is in position ${u3(e,String(n.id))} of ${t}.`,onDragOver:({active:n,over:r})=>r?`Server ${l3(e,String(n.id))} moved to position ${u3(e,String(r.id))} of ${t}.`:void 0,onDragEnd:({active:n,over:r})=>r?`Server ${l3(e,String(n.id))} dropped at position ${u3(e,String(r.id))} of ${t}.`:`Server ${l3(e,String(n.id))} dropped.`,onDragCancel:({active:t})=>`Reorder cancelled. Server ${l3(e,String(t.id))} returned to its original position.`}}function Qde(e,t){return({active:n,over:r})=>{if(!r||n.id===r.id)return;let i=e.map(e=>e.id),a=Xde(i,String(n.id),String(r.id));a!==i&&t?.(a)}}var $de=Dd.withProps({variant:`screen`,direction:`column`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),efe=kl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`,bg:`var(--mantine-color-body)`}),tfe=V.withProps({justify:`space-between`,mb:`sm`}),nfe=U.withProps({flex:1,mih:0,gap:0}),rfe=U.withProps({flex:1,align:`center`,justify:`center`}),ife=H.withProps({c:`dimmed`,ta:`center`}),afe={root:{"--inspector-surface-card":`var(--inspector-surface-card-server)`,alignItems:`start`}},ofe=Jd.withProps({color:`gray`,variant:`light`,title:`Read-only session`}),sfe=uv.withProps({order:3,size:`h4`}),cfe=N_.withProps({type:`container`,cols:{base:1,"1040px":2,"1560px":3},spacing:`lg`,styles:afe}),lfe=bl.Autosize.withProps({mah:`100%`,type:`scroll`,offsetScrollbars:!0});function ufe({servers:e,writable:t=!0,activeServer:n,erroredServerId:r,connectedServerId:i,onAddManually:a,onImportConfig:o,onImportServerJson:s,onExport:c,onToggleConnection:l,onConnectionInfo:u,onSettings:d,onEdit:f,onClone:p,onRemove:m,onReorder:h,highlightedServerIds:g,onClearHighlight:_,compact:v,onToggleCompact:y}){let b=sJ(oJ(lY),oJ(iY,{coordinateGetter:FX})),x=e.map(e=>e.id),S=h!==void 0&&t,C=S?Qde(e,h):void 0,w=S?Zde(e):void 0,T=e.find(e=>g?.includes(e.id))?.id,E=e=>({compact:v,writable:t,activeServer:n,onToggleConnection:l,onConnectionInfo:u,onSettings:d,onEdit:f,onClone:p,onRemove:m,highlighted:g?.includes(e.id)??!1,errored:e.id===r,justConnected:e.id===i,scrollOnHighlight:e.id===T,onClearHighlight:_?()=>_(e.id):void 0,...e}),D=(0,R.jsx)(cfe,{children:e.map(e=>S?(0,R.jsx)(Yde,{...E(e)},e.id):(0,R.jsx)(n3,{...E(e)},e.id))});return(0,R.jsxs)($de,{children:[!t&&(0,R.jsxs)(ofe,{children:[`This server list was launched with `,(0,R.jsx)(im,{children:`--config`}),` or an ad-hoc server and can't be edited here. Changes won't be saved. Use`,` `,(0,R.jsx)(im,{children:`--catalog`}),` (or no flag) to manage a writable catalog.`]}),(0,R.jsxs)(efe,{children:[(0,R.jsxs)(tfe,{children:[(0,R.jsx)(sfe,{children:`Servers`}),(0,R.jsx)(qde,{serverCount:e.length,compact:v,writable:t,onToggleList:y,onAddManually:a,onImportConfig:o,onImportServerJson:s,onExport:c})]}),e.length===0?(0,R.jsx)(rfe,{children:(0,R.jsx)(ife,{children:`No servers configured. Add a server to get started.`})}):(0,R.jsx)(nfe,{children:(0,R.jsx)(lfe,{children:S?(0,R.jsx)(oX,{sensors:b,collisionDetection:hJ,onDragEnd:C,accessibility:{announcements:w},children:(0,R.jsx)(CX,{items:x,strategy:bX,children:D})}):D})})]})]})}var d3=ju.withProps({"aria-label":`Clear`,tabIndex:-1}),dfe=kl.withProps({w:8,h:8,radius:`xl`,bg:`var(--inspector-status-connecting)`}),ffe=H.withProps({size:`sm`,c:`dimmed`}),pfe=Xp.withProps({size:`sm`,variant:`subtle`});function f3({visible:e,onRefresh:t}){return e?(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(dfe,{}),(0,R.jsx)(ffe,{children:`List updated`}),(0,R.jsx)(pfe,{onClick:t,children:`Refresh`})]}):null}var mfe=V.withProps({gap:`sm`,align:`center`,justify:`space-between`,wrap:`nowrap`}),hfe=W_.withProps({size:`sm`,"aria-label":`Fetch lists one page at a time`}),gfe=Xp.withProps({size:`compact-sm`,variant:`light`}),_fe=H.withProps({size:`xs`,ta:`center`,c:`var(--inspector-text-secondary)`});function p3({paginated:e,onPaginatedChange:t,canLoadMore:n,loadedPages:r,onLoadMore:i}){return e&&!n&&r===1?null:(0,R.jsxs)(U,{gap:4,children:[(0,R.jsxs)(mfe,{children:[(0,R.jsx)(hfe,{label:`Paginated`,checked:e,onChange:e=>t(e.currentTarget.checked)}),e?(0,R.jsx)(gfe,{disabled:!n,onClick:i,children:`Load next page`}):null]}),e?(0,R.jsxs)(_fe,{children:[r,` `,r===1?`page`:`pages`,` loaded`,n?``:` · end`]}):null]})}function m3(e,t){return t??e}function h3(e){return Object.keys(e.inputSchema.properties??{}).length>0}var vfe=H.withProps({fw:500,truncate:!0}),yfe=H.withProps({size:`xs`,c:`dimmed`,truncate:!0}),bfe=U.withProps({gap:2,flex:1,miw:0}),xfe=V.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),Sfe=mm.withProps({w:20,h:20,fit:`contain`}),Cfe=wl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function wfe({tool:e,selected:t,onClick:n}){let{name:r,title:i,icons:a}=e,o=a?.[0]?.src;return(0,R.jsx)(Cfe,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsxs)(xfe,{children:[o&&(0,R.jsx)(Sfe,{src:o,alt:``}),(0,R.jsxs)(bfe,{children:[(0,R.jsx)(vfe,{children:m3(r,i)}),i&&(0,R.jsx)(yfe,{children:r})]})]})})}var g3=new Map;function Tfe(){g3.clear()}function _3(e){let t=(0,D.useRef)(null);return(0,D.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let r=g3.get(e);return r&&n.scrollTo({left:r.x,top:r.y}),()=>{g3.set(e,{x:n.scrollLeft,y:n.scrollTop})}},[e]),t}var Efe=V.withProps({gap:`xs`,wrap:`nowrap`,align:`center`}),Dfe=cv.withProps({size:`sm`,variant:`transparent`,c:`var(--inspector-log-warning)`,"aria-hidden":!0}),Ofe=H.withProps({size:`sm`,td:`line-through`,c:`var(--inspector-text-secondary)`,truncate:`end`}),kfe=U.withProps({gap:`sm`,flex:1,mih:0}),Afe=uv.withProps({order:3,size:`h4`}),jfe=ov.withProps({placeholder:`Search tools...`,rightSectionPointerEvents:`auto`}),Mfe=bl.withProps({flex:1,mih:0}),Nfe=lm.withProps({label:`Excluded (SEP-2243)`,labelPosition:`left`,mt:`sm`}),Pfe=y_.withProps({multiline:!0,w:280,withArrow:!0,position:`right`});function Ffe({tools:e,excludedTools:t=[],selectedName:n,searchText:r=``,listChanged:i,onRefreshList:a,pagination:o,onSearchChange:s,onSelectTool:c}){let l=_3(`tools-sidebar`),u=r.toLowerCase(),d=r?e.filter(e=>e.name.toLowerCase().includes(u)||(e.title?.toLowerCase().includes(u)??!1)):e,f=r?t.filter(({tool:e})=>e.name.toLowerCase().includes(u)||(e.title?.toLowerCase().includes(u)??!1)):t;return(0,R.jsxs)(kfe,{children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(Afe,{children:`Tools`}),(0,R.jsx)(f3,{visible:i,onRefresh:a})]}),(0,R.jsx)(jfe,{value:r,onChange:e=>s(e.currentTarget.value),rightSection:r?(0,R.jsx)(d3,{onClick:()=>s(``)}):null}),(0,R.jsx)(p3,{...o}),(0,R.jsx)(Mfe,{viewportRef:l,children:(0,R.jsxs)(U,{gap:`xs`,children:[d.map(e=>(0,R.jsx)(wfe,{tool:e,selected:e.name===n,onClick:()=>{e.name!==n&&c(e.name)}},e.name)),f.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Nfe,{}),f.map(({tool:e,reason:t})=>(0,R.jsx)(Pfe,{label:t,children:(0,R.jsxs)(Efe,{children:[(0,R.jsx)(Dfe,{children:(0,R.jsx)(r3,{})}),(0,R.jsx)(Ofe,{children:e.name})]})},e.name))]})]})})]})}function v3(e){return typeof e!=`object`||!e||Array.isArray(e)?null:e}function y3(e){let t=e.properties??{},n={};for(let[e,r]of Object.entries(t))if(r.default!==void 0)n[e]=r.default;else if(r.type===`object`&&r.properties){let t=y3(r);Object.keys(t).length>0&&(n[e]=t)}return n}function b3(e,t){return(e.required??[]).some(e=>{let n=t[e];return n==null||n===``})}function x3(e){return e===`yellow`?`yellow.5`:e===`orange`?`orange.5`:e}var Ife={audience:`blue`,priority:`orange`,readOnlyHint:`green`,destructiveHint:`red`,idempotentHint:`teal`,openWorldHint:`grape`,longRunHint:`yellow`},Lfe=Vp.withProps({variant:`filled`,fw:500,autoContrast:!0});function Rfe(e,t){switch(e){case`audience`:return`audience: ${t.join(`, `)}`;case`priority`:{let e=t;return e>=.7?`priority: high`:e>=.4?`priority: medium`:`priority: low`}case`readOnlyHint`:return`read-only`;case`destructiveHint`:return`destructive`;case`idempotentHint`:return`idempotent`;case`openWorldHint`:return`open-world`;case`longRunHint`:return`long-running`}}function S3({facet:e,value:t}){let n=x3(Ife[e]);return(0,R.jsx)(Lfe,{color:n,children:Rfe(e,t)})}function zfe(e,t){return t!=null&&t>0?Math.round(e/t*100):e}function Bfe(e){return`${e}%`}var C3=H.withProps({size:`sm`,c:`dimmed`}),Vfe=H.withProps({size:`xs`,c:`dimmed`});function w3({params:e,elapsed:t}){let n=zfe(e.progress,e.total);return(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[e.message&&(0,R.jsx)(C3,{children:e.message}),(0,R.jsx)(C3,{children:Bfe(n)})]}),(0,R.jsx)(Lg,{value:n,size:`sm`,"aria-label":e.message?`${e.message} progress`:`Progress`}),t&&(0,R.jsx)(Vfe,{children:t})]})}var Hfe=H.withProps({fw:500,size:`sm`}),Ufe=H.withProps({size:`xs`,c:`dimmed`}),Wfe=U.withProps({gap:`sm`,pl:`md`}),Gfe=Pm.withProps({formatOnBlur:!0,autosize:!0});function Kfe(e){return JSON.stringify(e,null,2)}function T3(e,t){return t&&t.length===e.length?e.map((e,n)=>({value:e,label:t[n]})):e}function qfe(e){if(e.default!==void 0)return e.default}function Jfe(e,t){return e===void 0?qfe(t):e}function E3({schema:e,values:t,onChange:n,disabled:r=!1}){let i=e.properties??{},a=e.required??[];function o(e,r){n({...t,[e]:r})}function s(e,n){let i=a.includes(e),s=n.title??e,c=n.description,l=Jfe(t[e],n);return n.type===`string`&&n.enum?(0,R.jsx)(T_,{label:s,description:c,withAsterisk:i,disabled:r,data:T3(n.enum,n.enumNames),value:l??null,onChange:t=>o(e,t)},e):n.type===`string`&&n.oneOf?(0,R.jsx)(T_,{label:s,description:c,withAsterisk:i,disabled:r,data:n.oneOf.map(e=>({value:String(e.const??``),label:e.title??String(e.const??``)})),value:l??null,onChange:t=>o(e,t)},e):n.type===`string`?(0,R.jsx)(ov,{label:s,description:c,withAsterisk:i,disabled:r,value:l??``,minLength:n.minLength,maxLength:n.maxLength,onChange:t=>o(e,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:l?(0,R.jsx)(d3,{onClick:()=>o(e,``)}):null},e):n.type===`number`||n.type===`integer`?(0,R.jsx)(Og,{label:s,description:c,withAsterisk:i,disabled:r,value:l??``,min:n.minimum,max:n.maximum,onChange:t=>{o(e,typeof t==`string`?void 0:t)}},e):n.type===`boolean`?(0,R.jsx)(Ap,{label:s,description:c,disabled:r,checked:l??!1,onChange:t=>o(e,t.currentTarget.checked)},e):n.type===`array`&&n.items?.enum?(0,R.jsx)(Ih,{label:s,description:c,withAsterisk:i,disabled:r,data:T3(n.items.enum,n.items.enumNames),value:l??[],onChange:t=>o(e,t)},e):n.type===`array`&&n.items?.anyOf?(0,R.jsx)(Ih,{label:s,description:c,withAsterisk:i,disabled:r,data:n.items.anyOf.map(e=>({value:String(e.const??``),label:e.title??String(e.const??``)})),value:l??[],onChange:t=>o(e,t)},e):n.type===`object`&&n.properties?(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(Hfe,{children:s}),c&&(0,R.jsx)(Ufe,{children:c}),(0,R.jsx)(Wfe,{children:(0,R.jsx)(E3,{schema:n,values:l??{},onChange:t=>o(e,t),disabled:r})})]},e):(0,R.jsx)(Gfe,{label:s,description:c,withAsterisk:i,disabled:r,value:l===void 0?``:Kfe(l),onChange:t=>{try{o(e,JSON.parse(t))}catch{o(e,t)}}},e)}return(0,R.jsx)(U,{gap:`sm`,children:Object.entries(i).map(([e,t])=>s(e,t))})}var Yfe=U.withProps({gap:`md`,miw:0,mih:0}),Xfe=U.withProps({gap:`md`,flex:`0 0 auto`}),Zfe=bl.withProps({flex:`0 1 auto`,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),Qfe=U.withProps({gap:`md`}),$fe=V.withProps({justify:`flex-start`,flex:`0 0 auto`}),epe=V.withProps({gap:`sm`,wrap:`nowrap`,align:`center`,miw:0}),tpe=mm.withProps({w:24,h:24,fit:`contain`}),npe=H.withProps({fw:700,size:`lg`,truncate:`end`,flex:1}),rpe=Eu.withProps({variant:`subtle`,color:`gray`,size:`sm`}),ipe=H.withProps({size:`sm`,c:`dimmed`}),ape=Xp.withProps({variant:`subtle`,color:`red`}),ope=V.withProps({justify:`flex-start`,flex:`0 0 auto`}),spe=W_.withProps({size:`sm`,label:`Run as task`}),cpe=U.withProps({gap:`xs`}),lpe=H.withProps({size:`sm`,fw:600}),upe=H.withProps({size:`xs`,c:`var(--inspector-text-secondary)`}),dpe=V.withProps({gap:`xs`,wrap:`nowrap`}),fpe=H.withProps({size:`sm`,c:`var(--inspector-text-secondary)`});function ppe(e){return e.execution?.taskSupport??`forbidden`}function mpe(e){return!!(e&&(e.readOnlyHint||e.destructiveHint||e.idempotentHint||e.openWorldHint))}function hpe({tool:e,formValues:t,isExecuting:n,progress:r,serverSupportsTaskToolCalls:i,modernTasks:a=!1,runAsTask:o,onRunAsTaskChange:s,onFormChange:c,onExecute:l,onCancel:u}){let{name:d,title:f,description:p,icons:m,annotations:h,inputSchema:g}=e,_=v3(g)??{},v=m?.[0]?.src,y=Vre(e),[b,x]=(0,D.useState)(!0),[S,C]=(0,D.useState)(d);d!==S&&(C(d),x(!0));let w=(0,D.useId)(),T=ppe(e),E=i&&(a||T!==`forbidden`),O=E&&(T===`required`||(T===`optional`||a)&&o);return(0,R.jsxs)(Yfe,{children:[(0,R.jsxs)(Xfe,{children:[(0,R.jsxs)(epe,{children:[v&&(0,R.jsx)(tpe,{src:v,alt:``}),(0,R.jsx)(npe,{children:m3(d,f)}),p&&(0,R.jsx)(rpe,{"aria-label":b?`Hide description`:`Show description`,"aria-expanded":b,"aria-controls":w,onClick:()=>x(e=>!e),children:b?(0,R.jsx)(s3,{}):(0,R.jsx)(o3,{})})]}),mpe(h)&&h&&(0,R.jsxs)(V,{gap:`xs`,children:[h.readOnlyHint&&(0,R.jsx)(S3,{facet:`readOnlyHint`,value:!0}),h.destructiveHint&&(0,R.jsx)(S3,{facet:`destructiveHint`,value:!0}),h.idempotentHint&&(0,R.jsx)(S3,{facet:`idempotentHint`,value:!0}),h.openWorldHint&&(0,R.jsx)(S3,{facet:`openWorldHint`,value:!0})]})]}),(0,R.jsx)(Zfe,{children:(0,R.jsxs)(Qfe,{children:[p&&(0,R.jsx)(ca,{in:b,id:w,children:(0,R.jsx)(ipe,{children:p})}),(0,R.jsx)(lm,{}),y.length>0&&(0,R.jsxs)(cpe,{children:[(0,R.jsx)(lpe,{children:`Mirrored request headers (SEP-2243)`}),y.map(e=>(0,R.jsxs)(dpe,{children:[(0,R.jsx)(im,{children:e.path}),(0,R.jsx)(fpe,{children:`→`}),(0,R.jsx)(im,{children:e.header})]},e.path)),(0,R.jsxs)(upe,{children:[`These argument values are mirrored into HTTP headers on the call. The SDK sends them only on a Node/proxy transport — the browser omits `,(0,R.jsx)(im,{children:`Mcp-Param-*`}),` headers.`]})]}),(0,R.jsx)(E3,{schema:_,values:t,onChange:c,disabled:n}),r&&(0,R.jsx)(w3,{params:r})]})}),E&&(0,R.jsx)(ope,{children:(0,R.jsx)(spe,{checked:O,disabled:n||T===`required`,onChange:e=>s(e.currentTarget.checked)})}),(0,R.jsxs)($fe,{children:[(0,R.jsx)(Xp,{size:`md`,onClick:()=>l(O),disabled:n,loading:n,children:`Execute Tool`}),n&&(0,R.jsx)(ape,{onClick:u,children:`Cancel`})]})]})}var gpe=Eu.withProps({variant:`subtle`,color:`gray`,size:`md`});function D3({expanded:e,onToggle:t,ariaLabel:n}){let r=e?a3:i3,i=e?`Collapse`:`Expand`;return(0,R.jsx)(y_,{label:i,children:(0,R.jsx)(gpe,{"aria-label":n??i,"aria-expanded":e,onClick:t,children:(0,R.jsx)(r,{size:16})})})}var _pe=tm.withProps({withBorder:!0,padding:`sm`,radius:`md`,variant:`inset`}),vpe=U.withProps({gap:`xs`,mt:`xs`}),ype=bl.Autosize.withProps({mah:400,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),bpe=H.withProps({size:`sm`,c:`dimmed`}),xpe=Jd.withProps({color:`red`,variant:`light`,title:`Failed to read resource`});function Spe({uri:e,name:t,mimeType:n,onReadResource:r}){let[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(!1),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)(null),f=!!r;async function p(){if(r){if(i){a(!1);return}if(a(!0),c===null&&!o){d(null),s(!0);try{l(await r(e))}catch(e){d(e instanceof Error?e.message:String(e))}finally{s(!1)}}}}let m=f?(0,R.jsx)(D3,{expanded:i,onToggle:()=>void p(),ariaLabel:`${i?`Collapse`:`Expand`} resource ${e}`}):void 0;return(0,R.jsxs)(_pe,{children:[(0,R.jsx)(z4,{uri:e,name:t,mimeType:n,action:m}),f&&(0,R.jsx)(ca,{in:i,children:(0,R.jsx)(vpe,{children:o?(0,R.jsx)(bpe,{children:`Loading resource…`}):u===null?c===null?null:(0,R.jsx)(ype,{children:(0,R.jsx)($4,{block:{type:`text`,text:JSON.stringify(c,null,2)},copyable:!0})}):(0,R.jsx)(xpe,{children:u})})})]})}var Cpe=/\b(unknown tool|no such tool)\b|\btool\b[^.!?]*\b(not found|not recognized|does not exist|is unknown|unrecognized)\b/i;function wpe(e,t){return e===Sk.InvalidParams?t&&Cpe.test(t)?`unknown-tool`:`invalid-params`:`generic`}function O3(e){return!e.isError&&e.content.some(e=>e.type===`resource_link`)}function Tpe(e){let t=[];return e.forEach((e,n)=>{if(e.type===`resource_link`){let r=t[t.length-1];r&&r.kind===`links`?r.links.push({block:e,index:n}):t.push({kind:`links`,links:[{block:e,index:n}]})}else t.push({kind:`block`,block:e,index:n})}),t}var Epe=U.withProps({gap:`md`,miw:0,mih:0,flex:1}),Dpe=V.withProps({justify:`space-between`,flex:`0 0 auto`}),Ope=V.withProps({gap:`xs`,wrap:`nowrap`}),k3=bl.withProps({flex:1,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),kpe=U.withProps({gap:`md`}),Ape=bl.Autosize.withProps({mah:`50%`,flex:`0 1 auto`,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),jpe=U.withProps({gap:`md`,flex:1,mih:0}),Mpe=kl.withProps({withBorder:!0,radius:`md`,p:`md`,variant:`panel`,flex:1,mih:0}),Npe=U.withProps({gap:`sm`,flex:1,mih:0}),Ppe=uv.withProps({order:4,size:`h5`}),Fpe=bl.withProps({flex:1,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),Ipe=U.withProps({gap:`sm`}),Lpe=uv.withProps({order:3,size:`h4`}),Rpe=Jd.withProps({color:`red`,variant:`light`,title:`Tool Error`});function zpe({links:e,onReadResource:t}){return(0,R.jsx)(Mpe,{children:(0,R.jsxs)(Npe,{children:[(0,R.jsx)(Ppe,{children:`Resource Links`}),(0,R.jsx)(Fpe,{children:(0,R.jsx)(Ipe,{children:e.map(({block:e,index:n})=>(0,R.jsx)(Spe,{uri:e.uri,name:e.name,mimeType:e.mimeType,onReadResource:t},n))})})]})})}function Bpe({result:e,onClear:t,onReadResource:n}){let r=e.isError||e.content.length===0?[]:Tpe(e.content),i=O3(e),a=r.map(e=>{if(e.kind===`links`)return(0,R.jsx)(zpe,{links:e.links,onReadResource:n},`links-${e.links[0].index}`);let t=(0,R.jsx)($4,{block:e.block,copyable:e.block.type===`text`},e.index);return i?(0,R.jsx)(Ape,{children:t},e.index):t});return(0,R.jsxs)(Epe,{children:[(0,R.jsx)(Dpe,{children:(0,R.jsxs)(Ope,{children:[(0,R.jsx)(ju,{"aria-label":`Close results`,onClick:t}),(0,R.jsx)(Lpe,{children:`Results`})]})}),e.isError?(0,R.jsx)(k3,{children:(0,R.jsx)(Rpe,{children:e.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
247
|
-
`)})}):e.content.length===0?(0,R.jsx)(k3,{children:(0,R.jsx)(H,{c:`dimmed`,children:`No results yet`})}):i?(0,R.jsx)(jpe,{children:a}):(0,R.jsx)(k3,{children:(0,R.jsx)(kpe,{children:a})})]})}var Vpe=U.withProps({gap:`md`,miw:0,mih:0,flex:1}),Hpe=V.withProps({gap:`xs`,wrap:`nowrap`,flex:`0 0 auto`}),A3=H.withProps({size:`sm`,c:`var(--inspector-text-secondary)`}),Upe=uv.withProps({order:3,size:`h4`}),Wpe=Jd.withProps({color:`red`,variant:`light`}),Gpe={"unknown-tool":`Unknown Tool`,"invalid-params":`Invalid Parameters`,generic:`Tool Error`};function Kpe({error:e,errorCode:t,onClear:n}){let r=wpe(t,e);return(0,R.jsxs)(Vpe,{children:[(0,R.jsxs)(Hpe,{children:[(0,R.jsx)(ju,{"aria-label":`Close error`,onClick:n}),(0,R.jsx)(Upe,{children:`Tool Call Failed`})]}),(0,R.jsx)(Wpe,{title:Gpe[r],children:(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(H,{size:`sm`,children:e}),r===`unknown-tool`&&(0,R.jsxs)(A3,{children:[`The server rejected this call with `,(0,R.jsx)(im,{children:`-32602`}),` (Invalid params) — it does not recognize this tool. It may have been excluded for an invalid `,(0,R.jsx)(im,{children:`x-mcp-header`}),` annotation or removed since the list was last fetched. Try refreshing the tools list.`]}),r===`invalid-params`&&(0,R.jsxs)(A3,{children:[`The server rejected this call with `,(0,R.jsx)(im,{children:`-32602`}),` (Invalid params). Check the argument values against the tool's schema.`]})]})})]})}var j3=`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2)`,qpe=Dd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),Jpe=U.withProps({w:360,flex:`0 0 auto`}),Ype=tm.withProps({withBorder:!0,padding:`lg`,variant:`sidebar`}),M3=Dd.withProps({flex:1,miw:0,direction:`column`,align:`stretch`}),N3=tm.withProps({withBorder:!0,padding:`lg`,variant:`preview`}),Xpe=tm.withProps({withBorder:!0,padding:`lg`}),Zpe=H.withProps({c:`dimmed`,ta:`center`,py:`xl`});function Qpe({tools:e,excludedTools:t,callState:n,ui:r,listChanged:i,serverSupportsTaskToolCalls:a,modernTasks:o=!1,onUiChange:s,onRefreshList:c,pagination:l,onCallTool:u,onCancelCall:d,onClearResult:f,onReadResource:p}){let{selectedToolName:m,formValues:h,search:g}=r,_=m?e.find(e=>e.name===m):void 0,v=n?.status===`pending`;return(0,R.jsxs)(qpe,{children:[(0,R.jsx)(Jpe,{children:(0,R.jsx)(Ype,{children:(0,R.jsx)(Ffe,{tools:e,excludedTools:t,selectedName:m,searchText:g,listChanged:i,onRefreshList:c,pagination:l,onSearchChange:e=>s({...r,search:e}),onSelectTool:t=>{let n=e.find(e=>e.name===t),i={};n&&(i=y3(v3(n.inputSchema)??{})),s({...r,selectedToolName:t,formValues:i})}})})}),n?.result?(0,R.jsx)(M3,{mah:j3,children:(0,R.jsx)(N3,{flex:O3(n.result)?1:void 0,children:(0,R.jsx)(Bpe,{result:n.result,onClear:()=>f?.(),onReadResource:p})})}):n?.status===`error`&&n.error?(0,R.jsx)(M3,{mah:j3,children:(0,R.jsx)(N3,{children:(0,R.jsx)(Kpe,{error:n.error,errorCode:n.errorCode,onClear:()=>f?.()})})}):_?(0,R.jsx)(M3,{mah:j3,children:(0,R.jsx)(N3,{children:(0,R.jsx)(hpe,{tool:_,formValues:h,isExecuting:v,progress:n?.progress,serverSupportsTaskToolCalls:a,modernTasks:o,runAsTask:r.runAsTask,onRunAsTaskChange:e=>s({...r,runAsTask:e}),onFormChange:e=>s({...r,formValues:e}),onExecute:e=>u(_.name,h,e),onCancel:()=>d?.()})})}):(0,R.jsx)(Xpe,{flex:1,children:(0,R.jsx)(Zpe,{children:`Select a tool to view details`})})]})}function P3(){if(typeof document<`u`){let e=document.documentElement.getAttribute(`data-mantine-color-scheme`);if(e===`dark`||e===`light`)return e}return typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}var $pe=Object.entries({"--color-background-primary":`--mantine-color-body`,"--color-background-secondary":`--inspector-surface-card`,"--color-background-tertiary":`--inspector-surface-subtle`,"--color-text-primary":`--mantine-color-text`,"--color-text-secondary":`--inspector-text-secondary`,"--color-text-inverse":`--inspector-text-inverse`,"--color-text-info":`--inspector-log-info`,"--color-text-danger":`--inspector-log-error`,"--color-text-success":`--inspector-status-connected`,"--color-text-warning":`--inspector-log-warning`,"--color-border-primary":`--inspector-border-default`,"--color-border-secondary":`--inspector-border-subtle`,"--font-sans":`--mantine-font-family`,"--font-mono":`--mantine-font-family-monospace`,"--font-text-xs-size":`--mantine-font-size-xs`,"--font-text-sm-size":`--mantine-font-size-sm`,"--font-text-md-size":`--mantine-font-size-md`,"--font-text-lg-size":`--mantine-font-size-lg`,"--border-radius-xs":`--mantine-radius-xs`,"--border-radius-sm":`--mantine-radius-sm`,"--border-radius-md":`--mantine-radius-md`,"--border-radius-lg":`--mantine-radius-lg`,"--border-radius-xl":`--mantine-radius-xl`,"--shadow-sm":`--mantine-shadow-sm`,"--shadow-md":`--mantine-shadow-md`,"--shadow-lg":`--mantine-shadow-lg`});function F3(){if(typeof document>`u`||typeof window>`u`)return;let e=window.getComputedStyle(document.documentElement),t={},n=!1;for(let[r,i]of $pe){let a=e.getPropertyValue(i).trim();a&&(t[r]=a,n=!0)}return n?{variables:t}:void 0}function I3(e){if(typeof e.getBoundingClientRect!=`function`)return;let t=e.getBoundingClientRect(),n=Math.round(t.width),r=Math.round(t.height);if(!(n<=0||r<=0))return{width:n,height:r}}function eme(e,t){let n=F3(),r=e?I3(e):void 0;return{theme:P3(),displayMode:`inline`,availableDisplayModes:[...t],...n?{styles:n}:{},...r?{containerDimensions:r}:{}}}function L3(e){return e instanceof Error?e:Error(String(e))}async function R3(e){try{await e.teardownResource({})}catch{}try{await e.close()}catch{}}function tme({sandboxPath:e,tool:t,bridgeFactory:n,onError:r,onAppStatusChange:i,onSizeChange:a,displayMode:o,onRequestDisplayMode:s,onMessage:c,onLog:l,partialInputs:u,containerRef:d,ref:f}){let p=(0,D.useRef)(null),m=(0,D.useRef)(null),h=(0,D.useRef)(!1),g=(0,D.useRef)([]),_=(0,D.useRef)(null),v=(0,D.useRef)(null),y=(0,D.useRef)(!1),b=(0,D.useRef)(0),x=(0,D.useRef)(!1),S=(0,D.useRef)(null),C=(0,D.useRef)(r),w=(0,D.useRef)(i),T=(0,D.useRef)(a),E=(0,D.useRef)(o),O=(0,D.useRef)(s),k=(0,D.useRef)(c),A=(0,D.useRef)(l),j=(0,D.useRef)(u);(0,D.useEffect)(()=>{C.current=r,w.current=i,T.current=a,E.current=o,O.current=s,k.current=c,A.current=l,j.current=u});let M=(0,D.useCallback)(()=>{let e=m.current;if(!(!e||!h.current)){for(let t of g.current)e.sendToolInputPartial({arguments:t});if(g.current=[],_.current!==null){let t=_.current;_.current=null,e.sendToolInput({arguments:t})}if(v.current!==null){let t=v.current;v.current=null,e.sendToolResult(t)}}},[]),N=(0,D.useCallback)(()=>{x.current=!0,queueMicrotask(()=>{if(!x.current)return;x.current=!1,b.current++;let e=m.current;m.current=null,h.current=!1,S.current=null,g.current=[],e&&R3(e)})},[]);return(0,D.useEffect)(()=>{let r=p.current;if(!r)return;let i=S.current,a=i!==null&&i.bridgeFactory===n&&i.sandboxPath===e&&i.tool===t;if(x.current&&a)return x.current=!1,M(),N;if(x.current){x.current=!1,b.current++;let e=m.current;m.current=null,h.current=!1,e&&R3(e)}S.current={bridgeFactory:n,sandboxPath:e,tool:t};let o=++b.current;y.current=!1,h.current=!1,w.current?.(`loading`),g.current=[...j.current??[]];let s;try{s=Promise.resolve(n(r,t))}catch(e){return w.current?.(`error`),C.current?.(L3(e)),N}return s.then(e=>{if(b.current!==o){R3(e);return}m.current=e,e.addEventListener(`initialized`,()=>{h.current=!0,w.current?.(`ready`);let t=d?.current??p.current,n=t?I3(t):void 0;n&&e.sendHostContextChange({containerDimensions:n}),M()}),e.addEventListener(`sizechange`,e=>{T.current?.(e)}),e.addEventListener(`loggingmessage`,e=>{A.current?.(e)}),e.onrequestdisplaymode=async({mode:e})=>{let t=O.current;return{mode:t?t(e):E.current??`inline`}},e.onmessage=async e=>{let t=k.current;return t?(t(e),{}):{isError:!0}},M()}).catch(e=>{b.current===o&&(w.current?.(`error`),C.current?.(L3(e)))}),N},[n,e,t,d,M,N]),(0,D.useEffect)(()=>{if(typeof MutationObserver>`u`||typeof document>`u`)return;let e=new MutationObserver(()=>{if(!h.current)return;let e=F3();m.current?.sendHostContextChange({theme:P3(),...e?{styles:e}:{}})});return e.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-mantine-color-scheme`]}),()=>e.disconnect()},[]),(0,D.useEffect)(()=>{let e=d?.current??p.current;if(typeof ResizeObserver>`u`||!e)return;let t,n=new ResizeObserver(()=>{if(!h.current)return;let n=I3(e);n&&(t&&t.width===n.width&&t.height===n.height||(t=n,m.current?.sendHostContextChange({containerDimensions:n})))});return n.observe(e),()=>n.disconnect()},[d]),(0,D.useEffect)(()=>{o!==void 0&&h.current&&m.current?.sendHostContextChange({displayMode:o})},[o]),(0,D.useImperativeHandle)(f,()=>({async sendToolInput(e){_.current=e,M()},async sendToolResult(e){v.current=e,M()},async sendToolCancelled(e){let t=m.current;t&&await t.sendToolCancelled({reason:e})},async teardown(){let e=m.current;!e||y.current||(y.current=!0,b.current++,x.current=!1,S.current=null,m.current=null,h.current=!1,_.current=null,v.current=null,await R3(e))}}),[M]),(0,R.jsx)(B,{component:`iframe`,ref:p,src:e,title:t.title??t.name,w:`100%`,h:`100%`,bd:0,display:`block`})}var z3=`io.modelcontextprotocol/related-task`,B3=Uw(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),V3=Ow([G(),K().int()]),H3=G();Ew({ttl:K().optional(),pollInterval:K().optional()});var nme=J({ttl:K().optional()}),rme=J({taskId:G()}),U3=Ew({progressToken:V3.optional(),[z3]:rme.optional()}),W3=J({_meta:U3.optional()}),G3=W3.extend({task:nme.optional()}),ime=e=>G3.safeParse(e).success,K3=J({method:G(),params:W3.loose().optional()}),q3=J({_meta:U3.optional()}),J3=J({method:G(),params:q3.loose().optional()}),Y3=Ew({_meta:U3.optional()}),X3=Ow([G(),K().int()]),Z3=J({jsonrpc:Y(`2.0`),id:X3,...K3.shape}).strict(),Q3=e=>Z3.safeParse(e).success,$3=J({jsonrpc:Y(`2.0`),...J3.shape}).strict(),ame=e=>$3.safeParse(e).success,e6=J({jsonrpc:Y(`2.0`),id:X3,result:Y3}).strict(),t6=e=>e6.safeParse(e).success,n6;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(n6||={});var r6=J({jsonrpc:Y(`2.0`),id:X3.optional(),error:J({code:K().int(),message:G(),data:Cw().optional()})}).strict(),ome=e=>r6.safeParse(e).success,sme=Ow([Z3,$3,e6,r6]);Ow([e6,r6]);var i6=Y3.strict(),cme=q3.extend({requestId:X3.optional(),reason:G().optional()}),a6=J3.extend({method:Y(`notifications/cancelled`),params:cme}),o6=J({icons:q(J({src:G(),mimeType:G().optional(),sizes:q(G()).optional(),theme:Nw([`light`,`dark`]).optional()})).optional()}),s6=J({name:G(),title:G().optional()}),c6=s6.extend({...s6.shape,...o6.shape,version:G(),websiteUrl:G().optional(),description:G().optional()}),lme=Kw(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Aw(J({form:Aw(J({applyDefaults:bw().optional()}),jw(G(),Cw())).optional(),url:B3.optional()}),jw(G(),Cw()).optional())),ume=Ew({list:B3.optional(),cancel:B3.optional(),requests:Ew({sampling:Ew({createMessage:B3.optional()}).optional(),elicitation:Ew({create:B3.optional()}).optional()}).optional()}),dme=Ew({list:B3.optional(),cancel:B3.optional(),requests:Ew({tools:Ew({call:B3.optional()}).optional()}).optional()}),fme=J({experimental:jw(G(),B3).optional(),sampling:J({context:B3.optional(),tools:B3.optional()}).optional(),elicitation:lme.optional(),roots:J({listChanged:bw().optional()}).optional(),tasks:ume.optional(),extensions:jw(G(),B3).optional()}),pme=W3.extend({protocolVersion:G(),capabilities:fme,clientInfo:c6}),mme=K3.extend({method:Y(`initialize`),params:pme}),hme=J({experimental:jw(G(),B3).optional(),logging:B3.optional(),completions:B3.optional(),prompts:J({listChanged:bw().optional()}).optional(),resources:J({subscribe:bw().optional(),listChanged:bw().optional()}).optional(),tools:J({listChanged:bw().optional()}).optional(),tasks:dme.optional(),extensions:jw(G(),B3).optional()}),gme=Y3.extend({protocolVersion:G(),capabilities:hme,serverInfo:c6,instructions:G().optional()}),_me=J3.extend({method:Y(`notifications/initialized`),params:q3.optional()}),l6=K3.extend({method:Y(`ping`),params:W3.optional()}),vme=J({progress:K(),total:Iw(K()),message:Iw(G())}),yme=J({...q3.shape,...vme.shape,progressToken:V3}),u6=J3.extend({method:Y(`notifications/progress`),params:yme}),bme=W3.extend({cursor:H3.optional()}),d6=K3.extend({params:bme.optional()}),f6=Y3.extend({nextCursor:H3.optional()}),xme=Nw([`working`,`input_required`,`completed`,`failed`,`cancelled`]),p6=J({taskId:G(),status:xme,ttl:Ow([K(),Sw()]),createdAt:G(),lastUpdatedAt:G(),pollInterval:Iw(K()),statusMessage:Iw(G())}),m6=Y3.extend({task:p6}),Sme=q3.merge(p6),h6=J3.extend({method:Y(`notifications/tasks/status`),params:Sme}),g6=K3.extend({method:Y(`tasks/get`),params:W3.extend({taskId:G()})}),_6=Y3.merge(p6),v6=K3.extend({method:Y(`tasks/result`),params:W3.extend({taskId:G()})});Y3.loose();var y6=d6.extend({method:Y(`tasks/list`)}),b6=f6.extend({tasks:q(p6)}),x6=K3.extend({method:Y(`tasks/cancel`),params:W3.extend({taskId:G()})}),Cme=Y3.merge(p6),S6=J({uri:G(),mimeType:Iw(G()),_meta:jw(G(),Cw()).optional()}),C6=S6.extend({text:G()}),w6=G().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),T6=S6.extend({blob:w6}),E6=Nw([`user`,`assistant`]),D6=J({audience:q(E6).optional(),priority:K().min(0).max(1).optional(),lastModified:aw({offset:!0}).optional()}),O6=J({...s6.shape,...o6.shape,uri:G(),description:Iw(G()),mimeType:Iw(G()),size:Iw(K()),annotations:D6.optional(),_meta:Iw(Ew({}))}),wme=J({...s6.shape,...o6.shape,uriTemplate:G(),description:Iw(G()),mimeType:Iw(G()),annotations:D6.optional(),_meta:Iw(Ew({}))}),k6=d6.extend({method:Y(`resources/list`)}),A6=f6.extend({resources:q(O6)}),j6=d6.extend({method:Y(`resources/templates/list`)}),M6=f6.extend({resourceTemplates:q(wme)}),N6=W3.extend({uri:G()}),Tme=N6,P6=K3.extend({method:Y(`resources/read`),params:Tme}),F6=Y3.extend({contents:q(Ow([C6,T6]))}),I6=J3.extend({method:Y(`notifications/resources/list_changed`),params:q3.optional()}),Eme=N6,Dme=K3.extend({method:Y(`resources/subscribe`),params:Eme}),Ome=N6,kme=K3.extend({method:Y(`resources/unsubscribe`),params:Ome}),Ame=q3.extend({uri:G()}),jme=J3.extend({method:Y(`notifications/resources/updated`),params:Ame}),Mme=J({name:G(),description:Iw(G()),required:Iw(bw())}),Nme=J({...s6.shape,...o6.shape,description:Iw(G()),arguments:Iw(q(Mme)),_meta:Iw(Ew({}))}),L6=d6.extend({method:Y(`prompts/list`)}),R6=f6.extend({prompts:q(Nme)}),Pme=W3.extend({name:G(),arguments:jw(G(),G()).optional()}),Fme=K3.extend({method:Y(`prompts/get`),params:Pme}),z6=J({type:Y(`text`),text:G(),annotations:D6.optional(),_meta:jw(G(),Cw()).optional()}),B6=J({type:Y(`image`),data:w6,mimeType:G(),annotations:D6.optional(),_meta:jw(G(),Cw()).optional()}),V6=J({type:Y(`audio`),data:w6,mimeType:G(),annotations:D6.optional(),_meta:jw(G(),Cw()).optional()}),Ime=J({type:Y(`tool_use`),name:G(),id:G(),input:jw(G(),Cw()),_meta:jw(G(),Cw()).optional()}),H6=J({type:Y(`resource`),resource:Ow([C6,T6]),annotations:D6.optional(),_meta:jw(G(),Cw()).optional()}),U6=O6.extend({type:Y(`resource_link`)}),W6=Ow([z6,B6,V6,U6,H6]),Lme=J({role:E6,content:W6}),Rme=Y3.extend({description:G().optional(),messages:q(Lme)}),G6=J3.extend({method:Y(`notifications/prompts/list_changed`),params:q3.optional()}),zme=J({title:G().optional(),readOnlyHint:bw().optional(),destructiveHint:bw().optional(),idempotentHint:bw().optional(),openWorldHint:bw().optional()}),Bme=J({taskSupport:Nw([`required`,`optional`,`forbidden`]).optional()}),K6=J({...s6.shape,...o6.shape,description:G().optional(),inputSchema:J({type:Y(`object`),properties:jw(G(),B3).optional(),required:q(G()).optional()}).catchall(Cw()),outputSchema:J({type:Y(`object`),properties:jw(G(),B3).optional(),required:q(G()).optional()}).catchall(Cw()).optional(),annotations:zme.optional(),execution:Bme.optional(),_meta:jw(G(),Cw()).optional()}),Vme=d6.extend({method:Y(`tools/list`)}),q6=f6.extend({tools:q(K6)}),J6=Y3.extend({content:q(W6).default([]),structuredContent:jw(G(),Cw()).optional(),isError:bw().optional()});J6.or(Y3.extend({toolResult:Cw()}));var Hme=G3.extend({name:G(),arguments:jw(G(),Cw()).optional()}),Y6=K3.extend({method:Y(`tools/call`),params:Hme}),X6=J3.extend({method:Y(`notifications/tools/list_changed`),params:q3.optional()});J({autoRefresh:bw().default(!0),debounceMs:K().int().nonnegative().default(300)});var Z6=Nw([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Ume=W3.extend({level:Z6}),Wme=K3.extend({method:Y(`logging/setLevel`),params:Ume}),Gme=q3.extend({level:Z6,logger:G().optional(),data:Cw()}),Q6=J3.extend({method:Y(`notifications/message`),params:Gme}),Kme=J({hints:q(J({name:G().optional()})).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),qme=J({mode:Nw([`auto`,`required`,`none`]).optional()}),Jme=J({type:Y(`tool_result`),toolUseId:G().describe(`The unique identifier for the corresponding tool call.`),content:q(W6).default([]),structuredContent:J({}).loose().optional(),isError:bw().optional(),_meta:jw(G(),Cw()).optional()}),Yme=kw(`type`,[z6,B6,V6]),$6=kw(`type`,[z6,B6,V6,Ime,Jme]),Xme=J({role:E6,content:Ow([$6,q($6)]),_meta:jw(G(),Cw()).optional()}),Zme=G3.extend({messages:q(Xme),modelPreferences:Kme.optional(),systemPrompt:G().optional(),includeContext:Nw([`none`,`thisServer`,`allServers`]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:q(G()).optional(),metadata:B3.optional(),tools:q(K6).optional(),toolChoice:qme.optional()}),e8=K3.extend({method:Y(`sampling/createMessage`),params:Zme}),Qme=Y3.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`]).or(G())),role:E6,content:Yme}),$me=Y3.extend({model:G(),stopReason:Iw(Nw([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(G())),role:E6,content:Ow([$6,q($6)])}),ehe=J({type:Y(`boolean`),title:G().optional(),description:G().optional(),default:bw().optional()}),the=J({type:Y(`string`),title:G().optional(),description:G().optional(),minLength:K().optional(),maxLength:K().optional(),format:Nw([`email`,`uri`,`date`,`date-time`]).optional(),default:G().optional()}),nhe=J({type:Nw([`number`,`integer`]),title:G().optional(),description:G().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),rhe=J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),default:G().optional()}),ihe=J({type:Y(`string`),title:G().optional(),description:G().optional(),oneOf:q(J({const:G(),title:G()})),default:G().optional()}),ahe=Ow([Ow([J({type:Y(`string`),title:G().optional(),description:G().optional(),enum:q(G()),enumNames:q(G()).optional(),default:G().optional()}),Ow([rhe,ihe]),Ow([J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({type:Y(`string`),enum:q(G())}),default:q(G()).optional()}),J({type:Y(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({anyOf:q(J({const:G(),title:G()}))}),default:q(G()).optional()})])]),ehe,the,nhe]),ohe=Ow([G3.extend({mode:Y(`form`).optional(),message:G(),requestedSchema:J({type:Y(`object`),properties:jw(G(),ahe),required:q(G()).optional()})}),G3.extend({mode:Y(`url`),message:G(),elicitationId:G(),url:G().url()})]),she=K3.extend({method:Y(`elicitation/create`),params:ohe}),che=q3.extend({elicitationId:G()}),lhe=J3.extend({method:Y(`notifications/elicitation/complete`),params:che}),uhe=Y3.extend({action:Nw([`accept`,`decline`,`cancel`]),content:Kw(e=>e===null?void 0:e,jw(G(),Ow([G(),K(),bw(),q(G())])).optional())}),dhe=J({type:Y(`ref/resource`),uri:G()}),fhe=J({type:Y(`ref/prompt`),name:G()}),phe=W3.extend({ref:Ow([fhe,dhe]),argument:J({name:G(),value:G()}),context:J({arguments:jw(G(),G()).optional()}).optional()}),mhe=K3.extend({method:Y(`completion/complete`),params:phe}),hhe=Y3.extend({completion:Ew({values:q(G()).max(100),total:Iw(K().int()),hasMore:Iw(bw())})}),ghe=J({uri:G().startsWith(`file://`),name:G().optional(),_meta:jw(G(),Cw()).optional()}),_he=K3.extend({method:Y(`roots/list`),params:W3.optional()}),vhe=Y3.extend({roots:q(ghe)}),yhe=J3.extend({method:Y(`notifications/roots/list_changed`),params:q3.optional()});Ow([l6,mme,mhe,Wme,Fme,L6,k6,j6,P6,Dme,kme,Y6,Vme,g6,v6,y6,x6]),Ow([a6,u6,_me,yhe,h6]),Ow([i6,Qme,$me,uhe,vhe,_6,b6,m6]),Ow([l6,e8,she,_he,g6,v6,y6,x6]),Ow([a6,u6,Q6,jme,I6,X6,G6,h6,lhe]),Ow([i6,gme,hhe,Rme,R6,A6,M6,F6,J6,q6,_6,b6,m6]);var t8=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===n6.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new bhe(e.elicitations,n)}return new e(t,n,r)}},bhe=class extends t8{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(n6.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function n8(e){return!!e._zod}function r8(e,t){return n8(e)?Uy(e,t):e.safeParse(t)}function xhe(e){if(!e)return;let t;if(t=n8(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function She(e){if(n8(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}function i8(e){return e===`completed`||e===`failed`||e===`cancelled`}function a8(e){let t=xhe(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=She(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function o8(e,t){let n=r8(e,t);if(!n.success)throw n.error;return n.data}var Che=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(a6,e=>{this._oncancel(e)}),this.setNotificationHandler(u6,e=>{this._onprogress(e)}),this.setRequestHandler(l6,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(g6,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new t8(n6.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(v6,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r)if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new t8(e.error.code,e.error.message,e.error.data))}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new t8(n6.InvalidParams,`Task not found: ${r}`);if(!i8(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(i8(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[z3]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(y6,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new t8(n6.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(x6,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new t8(n6.InvalidParams,`Task not found: ${e.params.taskId}`);if(i8(n.status))throw new t8(n6.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new t8(n6.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof t8?e:new t8(n6.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),t8.fromError(n6.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),t6(e)||ome(e)?this._onresponse(e):Q3(e)?this._onrequest(e,t):ame(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=t8.fromError(n6.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[z3]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:n6.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=ime(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new t8(n6.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:n6.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),t6(e)?n(e):n(new t8(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(t6(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),t6(e)?r(e):r(t8.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof t8?e:new t8(n6.InternalError,String(e))}}return}let i;try{let r=await this.request(e,m6,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new t8(n6.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},i8(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new t8(n6.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new t8(n6.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof t8?e:new t8(n6.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[z3]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof t8?e:new t8(n6.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=r8(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(t8.fromError(n6.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},_6,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},b6,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},Cme,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[z3]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[z3]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[z3]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=a8(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=o8(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=a8(e);this._notificationHandlers.set(n,n=>{let r=o8(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&Q3(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new t8(n6.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new t8(n6.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new t8(n6.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new t8(n6.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=h6.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),i8(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new t8(n6.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(i8(a.status))throw new t8(n6.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=h6.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),i8(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}};(e=>typeof u<`u`?u:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof u<`u`?u:e)[t]}):e)(function(e){if(typeof u<`u`)return u.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var whe=class extends Che{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},s8=`2026-01-26`,The=Ow([Y(`light`),Y(`dark`)]).describe(`Color theme preference for the host environment.`),c8=Ow([Y(`inline`),Y(`fullscreen`),Y(`pip`)]).describe(`Display mode for UI presentation.`),Ehe=jw(Ow([Y(`--color-background-primary`),Y(`--color-background-secondary`),Y(`--color-background-tertiary`),Y(`--color-background-inverse`),Y(`--color-background-ghost`),Y(`--color-background-info`),Y(`--color-background-danger`),Y(`--color-background-success`),Y(`--color-background-warning`),Y(`--color-background-disabled`),Y(`--color-text-primary`),Y(`--color-text-secondary`),Y(`--color-text-tertiary`),Y(`--color-text-inverse`),Y(`--color-text-ghost`),Y(`--color-text-info`),Y(`--color-text-danger`),Y(`--color-text-success`),Y(`--color-text-warning`),Y(`--color-text-disabled`),Y(`--color-border-primary`),Y(`--color-border-secondary`),Y(`--color-border-tertiary`),Y(`--color-border-inverse`),Y(`--color-border-ghost`),Y(`--color-border-info`),Y(`--color-border-danger`),Y(`--color-border-success`),Y(`--color-border-warning`),Y(`--color-border-disabled`),Y(`--color-ring-primary`),Y(`--color-ring-secondary`),Y(`--color-ring-inverse`),Y(`--color-ring-info`),Y(`--color-ring-danger`),Y(`--color-ring-success`),Y(`--color-ring-warning`),Y(`--font-sans`),Y(`--font-mono`),Y(`--font-weight-normal`),Y(`--font-weight-medium`),Y(`--font-weight-semibold`),Y(`--font-weight-bold`),Y(`--font-text-xs-size`),Y(`--font-text-sm-size`),Y(`--font-text-md-size`),Y(`--font-text-lg-size`),Y(`--font-heading-xs-size`),Y(`--font-heading-sm-size`),Y(`--font-heading-md-size`),Y(`--font-heading-lg-size`),Y(`--font-heading-xl-size`),Y(`--font-heading-2xl-size`),Y(`--font-heading-3xl-size`),Y(`--font-text-xs-line-height`),Y(`--font-text-sm-line-height`),Y(`--font-text-md-line-height`),Y(`--font-text-lg-line-height`),Y(`--font-heading-xs-line-height`),Y(`--font-heading-sm-line-height`),Y(`--font-heading-md-line-height`),Y(`--font-heading-lg-line-height`),Y(`--font-heading-xl-line-height`),Y(`--font-heading-2xl-line-height`),Y(`--font-heading-3xl-line-height`),Y(`--border-radius-xs`),Y(`--border-radius-sm`),Y(`--border-radius-md`),Y(`--border-radius-lg`),Y(`--border-radius-xl`),Y(`--border-radius-full`),Y(`--border-width-regular`),Y(`--shadow-hairline`),Y(`--shadow-sm`),Y(`--shadow-md`),Y(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
|
|
248
|
-
|
|
249
|
-
Individual style keys are optional - hosts may provide any subset of these values.
|
|
250
|
-
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
251
|
-
|
|
252
|
-
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
253
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Ow([G(),xw()]).describe(`Style variables for theming MCP apps.
|
|
254
|
-
|
|
255
|
-
Individual style keys are optional - hosts may provide any subset of these values.
|
|
256
|
-
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
257
|
-
|
|
258
|
-
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
259
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
|
|
260
|
-
|
|
261
|
-
Individual style keys are optional - hosts may provide any subset of these values.
|
|
262
|
-
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
263
|
-
|
|
264
|
-
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
265
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Dhe=J({method:Y(`ui/open-link`),params:J({url:G().describe(`URL to open in the host's browser`)})});J({isError:bw().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),J({isError:bw().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),J({isError:bw().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough();var Ohe=J({method:Y(`ui/notifications/sandbox-proxy-ready`),params:J({})}),l8=J({connectDomains:q(G()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
266
|
-
|
|
267
|
-
- Maps to CSP \`connect-src\` directive
|
|
268
|
-
- Empty or omitted → no network connections (secure default)`),resourceDomains:q(G()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:q(G()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:q(G()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),u8=J({camera:J({}).optional().describe(`Request camera access.
|
|
269
|
-
|
|
270
|
-
Maps to Permission Policy \`camera\` feature.`),microphone:J({}).optional().describe(`Request microphone access.
|
|
271
|
-
|
|
272
|
-
Maps to Permission Policy \`microphone\` feature.`),geolocation:J({}).optional().describe(`Request geolocation access.
|
|
273
|
-
|
|
274
|
-
Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:J({}).optional().describe(`Request clipboard write access.
|
|
275
|
-
|
|
276
|
-
Maps to Permission Policy \`clipboard-write\` feature.`)}),khe=J({method:Y(`ui/notifications/size-changed`),params:J({width:K().optional().describe(`New width in pixels.`),height:K().optional().describe(`New height in pixels.`)})});J({method:Y(`ui/notifications/tool-input`),params:J({arguments:jw(G(),Cw().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),J({method:Y(`ui/notifications/tool-input-partial`),params:J({arguments:jw(G(),Cw().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),J({method:Y(`ui/notifications/tool-cancelled`),params:J({reason:G().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var Ahe=J({fonts:G().optional()}),jhe=J({variables:Ehe.optional().describe(`CSS variables for theming the app.`),css:Ahe.optional().describe(`CSS blocks that apps can inject.`)});J({method:Y(`ui/resource-teardown`),params:J({})});var Mhe=jw(G(),Cw()),d8=J({text:J({}).optional().describe(`Host supports text content blocks.`),image:J({}).optional().describe(`Host supports image content blocks.`),audio:J({}).optional().describe(`Host supports audio content blocks.`),resource:J({}).optional().describe(`Host supports resource content blocks.`),resourceLink:J({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:J({}).optional().describe(`Host supports structured content.`)}),Nhe=J({method:Y(`ui/notifications/request-teardown`),params:J({}).optional()}),Phe=J({experimental:J({}).optional().describe(`Experimental features (structure TBD).`),openLinks:J({}).optional().describe(`Host supports opening external URLs.`),downloadFile:J({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:J({listChanged:bw().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:J({listChanged:bw().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:J({}).optional().describe(`Host accepts log messages.`),sandbox:J({permissions:u8.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:l8.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:d8.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:d8.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:J({tools:J({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Fhe=J({experimental:J({}).optional().describe(`Experimental features (structure TBD).`),tools:J({listChanged:bw().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:q(c8).optional().describe(`Display modes the app supports.`)}),Ihe=J({method:Y(`ui/notifications/initialized`),params:J({}).optional()});J({csp:l8.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:u8.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:G().optional().describe(`Dedicated origin for view sandbox.
|
|
277
|
-
|
|
278
|
-
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
279
|
-
|
|
280
|
-
**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
|
|
281
|
-
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
|
|
282
|
-
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
|
|
283
|
-
|
|
284
|
-
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:bw().optional().describe(`Visual boundary preference - true if view prefers a visible border.
|
|
285
|
-
|
|
286
|
-
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
|
|
287
|
-
|
|
288
|
-
- \`true\`: request visible border + background
|
|
289
|
-
- \`false\`: request no visible border + background
|
|
290
|
-
- omitted: host decides border`)});var f8=J({method:Y(`ui/request-display-mode`),params:J({mode:c8.describe(`The display mode being requested.`)})});J({mode:c8.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough();var Lhe=Ow([Y(`model`),Y(`app`)]).describe(`Tool visibility scope - who can access the tool.`);J({resourceUri:G().optional(),visibility:q(Lhe).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
291
|
-
- "model": Tool visible to and callable by the agent
|
|
292
|
-
- "app": Tool callable by the app from this server only`),csp:ww().optional(),permissions:ww().optional()}),J({mimeTypes:q(G()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var Rhe=J({method:Y(`ui/download-file`),params:J({contents:q(Ow([H6,U6])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),zhe=J({method:Y(`ui/message`),params:J({role:Y(`user`).describe(`Message role, currently only "user" is supported.`),content:q(W6).describe(`Message content blocks (text, image, etc.).`)})});J({method:Y(`ui/notifications/sandbox-resource-ready`),params:J({html:G().describe(`HTML content to load into the inner iframe.`),sandbox:G().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:l8.optional().describe(`CSP configuration from resource metadata.`),permissions:u8.optional().describe(`Sandbox permissions from resource metadata.`)})}),J({method:Y(`ui/notifications/tool-result`),params:J6.describe(`Standard MCP tool execution result.`)});var p8=J({toolInfo:J({id:X3.optional().describe(`JSON-RPC id of the tools/call request.`),tool:K6.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:The.optional().describe(`Current color theme preference.`),styles:jhe.optional().describe(`Style configuration for theming the app.`),displayMode:c8.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:q(c8).optional().describe(`Display modes the host supports.`),containerDimensions:Ow([J({height:K().describe(`Fixed container height in pixels.`)}),J({maxHeight:Ow([K(),xw()]).optional().describe(`Maximum container height in pixels.`)})]).and(Ow([J({width:K().describe(`Fixed container width in pixels.`)}),J({maxWidth:Ow([K(),xw()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
293
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:G().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:G().optional().describe(`User's timezone in IANA format.`),userAgent:G().optional().describe(`Host application identifier.`),platform:Ow([Y(`web`),Y(`desktop`),Y(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:J({touch:bw().optional().describe(`Whether the device supports touch input.`),hover:bw().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:J({top:K().describe(`Top safe area inset in pixels.`),right:K().describe(`Right safe area inset in pixels.`),bottom:K().describe(`Bottom safe area inset in pixels.`),left:K().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();J({method:Y(`ui/notifications/host-context-changed`),params:p8.describe(`Partial context update containing only changed fields.`)});var Bhe=J({method:Y(`ui/update-model-context`),params:J({content:q(W6).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:jw(G(),Cw().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Vhe=J({method:Y(`ui/initialize`),params:J({appInfo:c6.describe(`App identification (name and version).`),appCapabilities:Fhe.describe(`Features and capabilities this app provides.`),protocolVersion:G().describe(`Protocol version this app supports.`)})});J({protocolVersion:G().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:c6.describe(`Host application identification and version.`),hostCapabilities:Phe.describe(`Features and capabilities provided by the host.`),hostContext:p8.describe(`Rich context about the host environment.`)}).passthrough();var Hhe=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=sme.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},Uhe=`ui/resourceUri`;function Whe(e){let t=e._meta?.ui?.resourceUri;if(t===void 0&&(t=e._meta?.[Uhe]),typeof t==`string`&&t.startsWith(`ui://`))return t;if(t!==void 0)throw Error(`Invalid UI resource URI: ${JSON.stringify(t)}`)}var Ghe=[s8],Khe=class extends whe{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_baseReplaceRequestHandler=this.replaceRequestHandler;replaceRequestHandler=(e,t)=>{this._baseReplaceRequestHandler(e,(e,n)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${e.method}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),t(e,n)))};eventSchemas={sizechange:khe,sandboxready:Ohe,initialized:Ihe,requestteardown:Nhe,loggingmessage:Q6};constructor(e,t,n,r){super(r),this._client=e,this._hostInfo=t,this._capabilities=n,this.addEventListener(`initialized`,()=>{this._initializedReceived=!0}),this._hostContext=r?.hostContext||{},this.setRequestHandler(Vhe,e=>this._oninitialize(e)),this.setRequestHandler(l6,(e,t)=>(this.onping?.(e.params,t),{})),this.replaceRequestHandler(f8,e=>({mode:this._hostContext.displayMode??`inline`}))}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;get onsizechange(){return this.getEventHandler(`sizechange`)}set onsizechange(e){this.setEventHandler(`sizechange`,e)}get onsandboxready(){return this.getEventHandler(`sandboxready`)}set onsandboxready(e){this.setEventHandler(`sandboxready`,e)}get oninitialized(){return this.getEventHandler(`initialized`)}set oninitialized(e){this.setEventHandler(`initialized`,e)}_onmessage;get onmessage(){return this._onmessage}set onmessage(e){this.warnIfRequestHandlerReplaced(`onmessage`,this._onmessage,e),this._onmessage=e,this.replaceRequestHandler(zhe,async(e,t)=>{if(!this._onmessage)throw Error(`No onmessage handler set`);return this._onmessage(e.params,t)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced(`onopenlink`,this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(Dhe,async(e,t)=>{if(!this._onopenlink)throw Error(`No onopenlink handler set`);return this._onopenlink(e.params,t)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced(`ondownloadfile`,this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(Rhe,async(e,t)=>{if(!this._ondownloadfile)throw Error(`No ondownloadfile handler set`);return this._ondownloadfile(e.params,t)})}get onrequestteardown(){return this.getEventHandler(`requestteardown`)}set onrequestteardown(e){this.setEventHandler(`requestteardown`,e)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(e){this.warnIfRequestHandlerReplaced(`onrequestdisplaymode`,this._onrequestdisplaymode,e),this._onrequestdisplaymode=e,this.replaceRequestHandler(f8,async(e,t)=>{if(!this._onrequestdisplaymode)throw Error(`No onrequestdisplaymode handler set`);return this._onrequestdisplaymode(e.params,t)})}get onloggingmessage(){return this.getEventHandler(`loggingmessage`)}set onloggingmessage(e){this.setEventHandler(`loggingmessage`,e)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(e){this.warnIfRequestHandlerReplaced(`onupdatemodelcontext`,this._onupdatemodelcontext,e),this._onupdatemodelcontext=e,this.replaceRequestHandler(Bhe,async(e,t)=>{if(!this._onupdatemodelcontext)throw Error(`No onupdatemodelcontext handler set`);return this._onupdatemodelcontext(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Y6,async(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}set oncreatesamplingmessage(e){this.setRequestHandler(e8,async(t,n)=>e(t.params,n))}sendToolListChanged(e={}){return this.notification({method:`notifications/tools/list_changed`,params:e})}_onlistresources;get onlistresources(){return this._onlistresources}set onlistresources(e){this.warnIfRequestHandlerReplaced(`onlistresources`,this._onlistresources,e),this._onlistresources=e,this.replaceRequestHandler(k6,async(e,t)=>{if(!this._onlistresources)throw Error(`No onlistresources handler set`);return this._onlistresources(e.params,t)})}_onlistresourcetemplates;get onlistresourcetemplates(){return this._onlistresourcetemplates}set onlistresourcetemplates(e){this.warnIfRequestHandlerReplaced(`onlistresourcetemplates`,this._onlistresourcetemplates,e),this._onlistresourcetemplates=e,this.replaceRequestHandler(j6,async(e,t)=>{if(!this._onlistresourcetemplates)throw Error(`No onlistresourcetemplates handler set`);return this._onlistresourcetemplates(e.params,t)})}_onreadresource;get onreadresource(){return this._onreadresource}set onreadresource(e){this.warnIfRequestHandlerReplaced(`onreadresource`,this._onreadresource,e),this._onreadresource=e,this.replaceRequestHandler(P6,async(e,t)=>{if(!this._onreadresource)throw Error(`No onreadresource handler set`);return this._onreadresource(e.params,t)})}sendResourceListChanged(e={}){return this.notification({method:`notifications/resources/list_changed`,params:e})}_onlistprompts;get onlistprompts(){return this._onlistprompts}set onlistprompts(e){this.warnIfRequestHandlerReplaced(`onlistprompts`,this._onlistprompts,e),this._onlistprompts=e,this.replaceRequestHandler(L6,async(e,t)=>{if(!this._onlistprompts)throw Error(`No onlistprompts handler set`);return this._onlistprompts(e.params,t)})}sendPromptListChanged(e={}){return this.notification({method:`notifications/prompts/list_changed`,params:e})}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}getCapabilities(){return this._capabilities}async _oninitialize(e){let t=e.params.protocolVersion;return this._appInfo!==void 0&&console.warn(`[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values.`),this._appCapabilities=e.params.appCapabilities,this._appInfo=e.params.appInfo,{protocolVersion:Ghe.includes(t)?t:s8,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(e){let t={},n=!1;for(let r of Object.keys(e)){let i=this._hostContext[r],a=e[r];qhe(i,a)||(t[r]=a,n=!0)}n&&(this._hostContext=e,this.sendHostContextChange(t))}sendHostContextChange(e){return this.notification({method:`ui/notifications/host-context-changed`,params:e})}sendToolInput(e){return this.notification({method:`ui/notifications/tool-input`,params:e})}sendToolInputPartial(e){return this.notification({method:`ui/notifications/tool-input-partial`,params:e})}sendToolResult(e){return this.notification({method:`ui/notifications/tool-result`,params:e})}sendToolCancelled(e){return this.notification({method:`ui/notifications/tool-cancelled`,params:e})}sendSandboxResourceReady(e){return this.notification({method:`ui/notifications/sandbox-resource-ready`,params:e})}teardownResource(e,t){return this.request({method:`ui/resource-teardown`,params:e},Mhe,t)}sendResourceTeardown=this.teardownResource;callTool(e,t){return this.request({method:`tools/call`,params:e},J6,t)}listTools(e,t){return this.request({method:`tools/list`,params:e},q6,t)}async connect(e){if(this.transport)throw Error(`AppBridge is already connected. Call close() before connecting again.`);if(this._initializedReceived=!1,this._client){let e=this._client.getServerCapabilities();if(!e)throw Error(`Client server capabilities not available`);e.tools&&(this.oncalltool=async(e,t)=>this._client.request({method:`tools/call`,params:e},J6,{signal:t.signal}),e.tools.listChanged&&this._client.setNotificationHandler(X6,e=>this.sendToolListChanged(e.params))),e.resources&&(this.onlistresources=async(e,t)=>this._client.request({method:`resources/list`,params:e},A6,{signal:t.signal}),this.onlistresourcetemplates=async(e,t)=>this._client.request({method:`resources/templates/list`,params:e},M6,{signal:t.signal}),this.onreadresource=async(e,t)=>this._client.request({method:`resources/read`,params:e},F6,{signal:t.signal}),e.resources.listChanged&&this._client.setNotificationHandler(I6,e=>this.sendResourceListChanged(e.params))),e.prompts&&(this.onlistprompts=async(e,t)=>this._client.request({method:`prompts/list`,params:e},R6,{signal:t.signal}),e.prompts.listChanged&&this._client.setNotificationHandler(G6,e=>this.sendPromptListChanged(e.params)))}return super.connect(e)}};function qhe(e,t){return JSON.stringify(e)===JSON.stringify(t)}var Jhe=/^(?:\*|[a-zA-Z][a-zA-Z0-9+.-]*:(?:\/\/(?:\*\.)?[A-Za-z0-9._~%!$&'()*+,=@:-]+(?::\d+)?(?:\/[A-Za-z0-9._~%!$&'()*+,=@:/-]*)?)?|(?:\*\.)?[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?)$/;function Yhe(e){return e}var Xhe=Yhe([`connectDomains`,`resourceDomains`,`frameDomains`,`baseUriDomains`]);function Zhe(e){let t={};if(!e)return t;for(let n of Xhe){let r=e[n];if(!Array.isArray(r))continue;let i=[];for(let e of r)typeof e==`string`&&Jhe.test(e)?i.push(e):console.warn(`[mcp-app sandbox] dropping unsafe CSP source:`,e);i.length>0&&(t[n]=i)}return t}function m8(e,t){return e&&e.length>0?e.join(` `):t}function Qhe(e){let t=m8(e.resourceDomains,`'none'`),n=t===`'none'`?`'unsafe-inline'`:`'unsafe-inline' ${t}`;return[`default-src 'none'`,`connect-src ${m8(e.connectDomains,`'none'`)}`,`script-src ${n}`,`style-src ${n}`,`img-src ${t}`,`font-src ${t}`,`media-src ${t}`,`frame-src ${m8(e.frameDomains,`'none'`)}`,`base-uri ${m8(e.baseUriDomains,`'self'`)}`,`form-action 'none'`,`object-src 'none'`,`worker-src 'none'`].join(`; `)}function $he(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function ege(e,t){return`<!DOCTYPE html><html><head>${`<meta http-equiv="Content-Security-Policy" content="${$he(t)}">`}<meta charset="utf-8"></head><body>${e}</body></html>`}function h8(e,t){let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e,document.body.appendChild(r);try{r.click()}finally{document.body.removeChild(r),setTimeout(()=>URL.revokeObjectURL(n),0)}}function g8(e,t){h8(e,new Blob([t],{type:`application/json`}))}function _8(e){let t=(e.split(/[\\/]/).pop()??``).replace(/[\p{Cc}\p{Cf}]+/gu,``).replace(/[\\/:*?"<>|]+/g,`_`).trim();return t.length>0?t.slice(0,255):`download`}function tge(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t:null}catch{return null}}function v8(e,t,n=new Date){let r=n.toISOString().replace(/:/g,`-`),i=t?encodeURIComponent(t):void 0;return`${[`inspector`,e,...i?[i]:[],r].join(`-`)}.json`}var nge={name:`MCP Inspector`,version:`2.0.0`},rge={openLinks:{},downloadFile:{},serverTools:{listChanged:!0},serverResources:{listChanged:!0},logging:{}},y8=[`inline`,`fullscreen`];function ige(e){for(let t of e.contents){let e=t.text;if(typeof e==`string`)return{html:e,meta:t._meta}}throw Error(`UI resource has no text (HTML) content`)}function age(e){let t=atob(e),n=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var b8=20;function oge(e){let t=e.replace(/[\p{Cc}\p{Cf}]+/gu,` `).trim();return t.length>80?t.slice(0,77)+`...`:t}function x8(e,t=!1){return e.type===`resource_link`?t?`↗ ${e.uri}`:e.uri:_8(e.resource.uri)}function sge(e){if(e.type===`resource_link`){let t=tge(e.uri);return t?(window.open(t.href,`_blank`,`noopener,noreferrer`),!0):!1}let t=e.resource;if(!(`blob`in t)&&typeof t.text!=`string`)return!1;let n=`blob`in t?new Blob([age(t.blob)],{type:t.mimeType??`application/octet-stream`}):new Blob([t.text],{type:t.mimeType??`text/plain`});return h8(_8(t.uri),n),!0}function cge(e){return async(t,n)=>{let r=e.getClient();if(!r)throw Error(`Cannot render MCP App: no connected MCP client.`);let i=t.contentWindow;if(!i)throw Error(`Cannot render MCP App: sandbox iframe has no window.`);let a={...rge},o=new Khe(r,nge,a,{hostContext:eme(t,y8)});o.addEventListener(`sandboxready`,()=>{(async()=>{try{let t=Whe(n);if(!t)return;let{html:r,meta:i}=ige(await e.readResource(t)),s=Zhe(i?.csp);a.sandbox={permissions:i?.permissions,csp:s},await o.sendSandboxResourceReady({html:ege(r,Qhe(s)),permissions:i?.permissions})}catch(t){let n=t instanceof Error?t:Error(String(t));console.error(`[mcp-app] failed to load UI resource into sandbox:`,n),e.onResourceError?.(n)}})()}),o.onopenlink=async({url:e})=>/^https?:\/\//i.test(e)?(window.open(e,`_blank`,`noopener,noreferrer`),{isError:!1}):{isError:!0},o.ondownloadfile=async({contents:e})=>{if(!Array.isArray(e)||e.length===0)return{isError:!0};if(e.length>b8)return console.warn(`[mcp-app] refusing download batch of ${e.length} items (max ${b8})`),{isError:!0};let t=e.map(e=>oge(x8(e,!0))).join(`
|
|
294
|
-
`);if(!window.confirm(`This MCP App wants to download or open ${e.length} item(s):\n\n${t}`))return{isError:!0};let n=0,r=[];for(let t of e)try{sge(t)?n++:r.push(x8(t))}catch(e){r.push(x8(t)),console.error(`[mcp-app] download item failed:`,e)}return r.length>0&&console.warn(`[mcp-app] ${r.length} of ${e.length} download item(s) skipped:`,r),{isError:n===0}};let s=new Hhe(i,i);return await o.connect(s),o}}var lge=H.withProps({size:`sm`,c:`dimmed`}),uge=bl.withProps({flex:1,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),dge=U.withProps({gap:`md`,miw:0}),fge=Xp.withProps({size:`md`,fullWidth:!0,leftSection:(0,R.jsx)(PK,{"aria-hidden":!0,size:18})});function pge({tool:e,formValues:t,isOpening:n,onFormChange:r,onOpenApp:i}){let{description:a,inputSchema:o}=e,s=v3(o)??{},c=b3(s,t),l=n||c,u=h3(e);return(0,R.jsx)(uge,{children:(0,R.jsxs)(dge,{children:[a&&(0,R.jsx)(lge,{children:a}),u&&(0,R.jsx)(lm,{}),(0,R.jsx)(E3,{schema:s,values:t,onChange:r,disabled:n}),(0,R.jsx)(fge,{onClick:i,disabled:l,loading:n,"data-testid":`open-app`,children:`Open App`})]})})}var mge=H.withProps({fw:500,truncate:!0}),hge=H.withProps({size:`xs`,c:`dimmed`,lineClamp:2}),gge=U.withProps({gap:2,flex:1,miw:0}),_ge=V.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),vge=mm.withProps({w:20,h:20,fit:`contain`}),yge=wl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function bge({tool:e,selected:t,onClick:n}){let{name:r,title:i,description:a,icons:o}=e,s=o?.[0]?.src;return(0,R.jsx)(yge,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsxs)(_ge,{children:[s&&(0,R.jsx)(vge,{src:s,alt:``}),(0,R.jsxs)(gge,{children:[(0,R.jsx)(mge,{children:m3(r,i)}),a&&(0,R.jsx)(hge,{children:a})]}),(0,R.jsx)(kK,{"aria-hidden":!0,color:`var(--inspector-text-secondary)`,size:18})]})})}var xge=`calc(100vh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2 - 220px)`,Sge=H.withProps({c:`dimmed`,ta:`center`,py:`xl`});function Cge({tools:e,selectedName:t,searchText:n=``,listChanged:r,onRefreshList:i,onSearchChange:a,onSelectApp:o}){let s=_3(`apps-sidebar`),c=n.toLowerCase(),l=n?e.filter(e=>e.name.toLowerCase().includes(c)||(e.title?.toLowerCase().includes(c)??!1)):e;return(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsxs)(uv,{order:4,children:[`MCP Apps (`,e.length,`)`]}),(0,R.jsx)(f3,{visible:r,onRefresh:i})]}),(0,R.jsx)(ov,{placeholder:`Search apps...`,value:n,onChange:e=>a(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:n?(0,R.jsx)(d3,{onClick:()=>a(``)}):null}),(0,R.jsx)(bl.Autosize,{viewportRef:s,mah:xge,children:(0,R.jsx)(U,{gap:`xs`,children:l.length===0?(0,R.jsx)(Sge,{children:e.length===0?`No apps available`:`No matching apps`}):l.map(e=>(0,R.jsx)(bge,{tool:e,selected:e.name===t,onClick:()=>{e.name!==t&&o(e.name)}},e.name))})})]})}var wge={debug:`gray`,info:`blue`,notice:`teal`,warning:`yellow`,error:`red`,critical:`red`,alert:`red`,emergency:`red`},Tge=new Set([`alert`,`emergency`]),Ege=Vp.withProps({variant:`filled`,autoContrast:!0});function S8({level:e}){let t=Tge.has(e)?500:void 0;return(0,R.jsx)(Ege,{color:x3(wge[e]),fw:t,children:e})}var C8=Dd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`,align:`flex-start`}),Dge=U.withProps({w:340,flex:`0 0 auto`}),Oge=tm.withProps({withBorder:!0,padding:`lg`}),w8=tm.withProps({withBorder:!0,padding:`lg`,variant:`preview`,flex:1,h:`100%`}),T8=H.withProps({c:`dimmed`,ta:`center`,py:`xl`}),kge=V.withProps({justify:`space-between`,wrap:`nowrap`,gap:`sm`}),Age=V.withProps({gap:`sm`,wrap:`nowrap`,align:`center`,flex:1,miw:0}),jge=mm.withProps({w:24,h:24,fit:`contain`}),Mge=H.withProps({fw:600,size:`lg`,truncate:!0,flex:1,miw:0}),Nge=V.withProps({gap:`xs`,wrap:`nowrap`}),Pge=Xp.withProps({variant:`subtle`,size:`sm`,leftSection:(0,R.jsx)(AK,{"aria-hidden":!0,size:16})}),Fge=Eu.withProps({variant:`subtle`,"aria-label":`Close`}),Ige=U.withProps({flex:1,miw:0,mih:0,gap:0}),Lge=U.withProps({miw:0,mih:0,gap:0}),Rge=U.withProps({gap:`md`,h:`100%`}),E8=U.withProps({gap:`xs`,flex:`0 0 auto`,mih:0}),D8=bl.withProps({mah:200,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),zge=U.withProps({gap:`sm`}),Bge=kl.withProps({p:`md`,radius:`md`,withBorder:!0}),Vge=U.withProps({gap:`xs`}),O8=H.withProps({size:`xs`,c:`dimmed`,ff:`monospace`}),Hge=U.withProps({gap:`xs`}),Uge=V.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),Wge=im.withProps({block:!0,fz:`xs`}),k8=Xp.withProps({variant:`subtle`,size:`compact-xs`}),Gge=V.withProps({justify:`space-between`,wrap:`nowrap`,gap:`sm`}),Kge=V.withProps({gap:`sm`,wrap:`nowrap`,align:`center`,flex:`0 0 auto`}),qge=Xp.withProps({variant:`default`,size:`compact-xs`}),Jge=H.withProps({size:`xs`,c:`dimmed`}),Yge=kl.withProps({p:`md`,radius:`md`,withBorder:!0,c:`var(--inspector-log-error)`}),Xge=H.withProps({fw:600,size:`sm`}),Zge=H.withProps({size:`sm`,ff:`monospace`});function Qge(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??``}catch{return String(e)}}var A8=500;function j8(e,t){let n=[...e,t];return n.length>A8?n.slice(n.length-A8):n}function $ge({tools:e,listChanged:t,sandboxPath:n,bridgeFactory:r,rendererRef:i,ui:a,onUiChange:o,onRefreshList:s,onSelectApp:c,onOpenApp:l,onCloseApp:u,onError:d,autoOpen:f=!1}){let{selectedAppName:p,formValues:m,search:h}=a,[g,_]=(0,D.useState)(!1),[v,y]=(0,D.useState)(!1),b=(0,D.useRef)(null),x=(0,D.useRef)(0),S=(0,D.useRef)(0),[C,w]=(0,D.useState)(void 0),[T,E]=(0,D.useState)([]),[O,k]=(0,D.useState)([]),[A,j]=(0,D.useState)(!0),[M,N]=(0,D.useState)([]),[ee,te]=(0,D.useState)(`idle`),[P,F]=(0,D.useState)(void 0),I=p?e.find(e=>e.name===p):void 0,ne=I?h3(I):!1;function re(e){e.height!=null&&e.height>0&&w(e.height)}function ie(e){E(t=>j8(t,{id:S.current++,...e}))}function ae(e){k(t=>j8(t,{id:x.current++,level:e.level,logger:e.logger,text:Qge(e.data)}))}let oe=(0,D.useCallback)(e=>{w(void 0),E([]),k([]),j(!0),te(`idle`),F(void 0),e?.keepPartials||N([])},[]);function se(e){F(e),d?.(e)}function ce(){N(e=>[...e,{...m}])}let le=v?`fullscreen`:`inline`;function ue(e){return y8.includes(e)?(y(e===`fullscreen`),e):le}function de(t){if(t===p)return;let n=e.find(e=>e.name===t);n&&(o({...a,selectedAppName:t,formValues:y3(v3(n.inputSchema)??{})}),y(!1),oe(),c(t),h3(n)?_(!1):(_(!0),l(t,{})))}function fe(){I&&(oe({keepPartials:!0}),_(!0),l(I.name,m))}function pe(){_(!1),o({...a,selectedAppName:void 0,formValues:{}}),y(!1),oe(),u()}let me=(0,D.useRef)(!1);(0,D.useEffect)(()=>{!f||me.current||!I||g||(me.current=!0,Promise.resolve().then(()=>{oe({keepPartials:!0}),_(!0),l(I.name,m)}))},[f,I,g,m,l,oe]);function he(){_(!1),y(!1),oe()}if(!n)return(0,R.jsx)(C8,{children:(0,R.jsx)(w8,{children:(0,R.jsx)(T8,{children:`MCP Apps are unavailable — the sandbox could not be reached.`})})});let ge=v?void 0:C;return(0,R.jsxs)(C8,{children:[!v&&(0,R.jsx)(Dge,{children:(0,R.jsx)(Oge,{children:(0,R.jsx)(Cge,{tools:e,selectedName:p,searchText:h,listChanged:t,onRefreshList:s,onSearchChange:e=>o({...a,search:e}),onSelectApp:de})})}),(0,R.jsx)(w8,{"data-testid":`apps-form`,"data-app-status":g?ee:`idle`,"data-app-error":g?P?.message:void 0,children:I?(0,R.jsxs)(Rge,{children:[(0,R.jsxs)(kge,{children:[(0,R.jsxs)(Age,{children:[I.icons?.[0]?.src&&(0,R.jsx)(jge,{src:I.icons[0].src,alt:``}),(0,R.jsx)(Mge,{children:m3(I.name,I.title)})]}),(0,R.jsxs)(Nge,{children:[g&&ne&&(0,R.jsx)(Pge,{onClick:he,children:`Back to Input`}),g&&(0,R.jsx)(y_,{label:v?`Restore`:`Maximize`,children:(0,R.jsx)(Eu,{variant:`subtle`,onClick:()=>y(e=>!e),"aria-label":v?`Restore`:`Maximize`,children:v?(0,R.jsx)(EK,{"aria-hidden":!0,size:20}):(0,R.jsx)(DK,{"aria-hidden":!0,size:20})})}),(0,R.jsx)(y_,{label:`Close`,children:(0,R.jsx)(Fge,{onClick:pe,children:(0,R.jsx)(OK,{"aria-hidden":!0,size:20})})})]})]}),g?(0,R.jsxs)(Ige,{ref:b,children:[(0,R.jsx)(Lge,{flex:ge==null?1:`0 0 auto`,h:ge,mah:`100%`,children:(0,R.jsx)(tme,{sandboxPath:n,tool:I,bridgeFactory:r,onError:se,onAppStatusChange:te,onSizeChange:re,displayMode:le,onRequestDisplayMode:ue,onMessage:ie,onLog:ae,partialInputs:M,containerRef:b,ref:i},I.name)}),P&&(0,R.jsxs)(Yge,{"data-testid":`apps-error`,children:[(0,R.jsx)(Xge,{children:`App failed to load`}),(0,R.jsx)(Zge,{children:P.message})]})]}):(0,R.jsxs)(R.Fragment,{children:[ne&&(0,R.jsxs)(Kge,{children:[(0,R.jsx)(qge,{onClick:ce,"data-testid":`apps-stage`,children:`Stage partial input`}),M.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Jge,{children:[M.length,` staged`]}),(0,R.jsx)(k8,{onClick:()=>N([]),children:`Clear staged`})]})]}),(0,R.jsx)(pge,{tool:I,formValues:m,isOpening:!1,onFormChange:e=>o({...a,formValues:e}),onOpenApp:fe})]}),g&&T.length>0&&(0,R.jsxs)(E8,{"data-testid":`apps-messages`,children:[(0,R.jsxs)(uv,{order:5,children:[`Messages from app (`,T.length,`)`]}),(0,R.jsx)(D8,{children:(0,R.jsx)(zge,{children:T.map((e,t)=>(0,R.jsx)(Bge,{children:(0,R.jsxs)(Vge,{children:[(0,R.jsxs)(O8,{children:[`[`,t,`] role: `,e.role]}),e.content.map((e,t)=>(0,R.jsx)($4,{block:e,copyable:!0},t))]})},e.id))})})]}),g&&O.length>0&&(0,R.jsxs)(E8,{"data-testid":`apps-logs`,children:[(0,R.jsxs)(Gge,{children:[(0,R.jsxs)(k8,{onClick:()=>j(e=>!e),"aria-expanded":A,"aria-controls":`apps-logs-region`,children:[`App logs (`,O.length,`)`]}),(0,R.jsx)(k8,{onClick:()=>k([]),children:`Clear`})]}),(0,R.jsx)(ca,{in:A,id:`apps-logs-region`,children:(0,R.jsx)(D8,{children:(0,R.jsx)(Hge,{children:O.map(e=>(0,R.jsxs)(Uge,{children:[(0,R.jsx)(S8,{level:e.level}),e.logger&&(0,R.jsx)(O8,{children:e.logger}),(0,R.jsx)(Wge,{children:e.text})]},e.id))})})})]})]}):(0,R.jsx)(T8,{children:`Select an app to view details`})})]})}var e_e=H.withProps({fw:500}),t_e=H.withProps({size:`xs`,c:`dimmed`,lineClamp:1}),n_e=wl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function r_e({prompt:e,selected:t,onClick:n}){let{name:r,title:i,description:a}=e;return(0,R.jsx)(n_e,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsxs)(U,{gap:2,children:[(0,R.jsx)(e_e,{children:i??r}),a&&(0,R.jsx)(t_e,{children:a})]})})}var i_e=U.withProps({gap:`sm`,flex:1,mih:0}),a_e=ov.withProps({placeholder:`Search prompts...`,rightSectionPointerEvents:`auto`}),o_e=bl.withProps({flex:1,mih:0});function s_e({prompts:e,selectedName:t,searchText:n=``,listChanged:r,onRefreshList:i,pagination:a,onSearchChange:o,onSelectPrompt:s}){let c=_3(`prompts-sidebar`),l=n.toLowerCase(),u=e.filter(e=>e.name.toLowerCase().includes(l)||(e.title?.toLowerCase().includes(l)??!1)||(e.description?.toLowerCase().includes(l)??!1));return(0,R.jsxs)(i_e,{children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(uv,{order:4,children:`Prompts`}),(0,R.jsx)(f3,{visible:r,onRefresh:i})]}),(0,R.jsx)(a_e,{value:n,onChange:e=>o(e.currentTarget.value),rightSection:n?(0,R.jsx)(d3,{onClick:()=>o(``)}):null}),(0,R.jsx)(p3,{...a}),(0,R.jsx)(o_e,{viewportRef:c,children:(0,R.jsx)(U,{gap:`xs`,children:u.map(e=>(0,R.jsx)(r_e,{prompt:e,selected:e.name===t,onClick:()=>{e.name!==t&&s(e.name)}},e.name))})})]})}var c_e=300,l_e=H.withProps({fw:700,size:`lg`,truncate:`end`}),u_e=H.withProps({size:`sm`,c:`dimmed`});function M8(e){return`Enter ${e}...`}function d_e({prompt:e,argumentValues:t,onArgumentChange:n,onGetPrompt:r,onCompleteArgument:i,completionsSupported:a=!1}){let{name:o,title:s,description:c,arguments:l}=e,[u,d]=(0,D.useState)({});(0,D.useEffect)(()=>{d({})},[o]);let f=(0,D.useRef)(new Map),p=(0,D.useRef)(new Map);(0,D.useEffect)(()=>{let e=p.current,t=f.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear();for(let e of t.values())e.abort();t.clear()}},[]);let m=a&&!!i,h=(0,D.useCallback)(async(e,t,n)=>{if(!i)return;f.current.get(e)?.abort();let r=new AbortController;f.current.set(e,r);try{let a=await i(e,t,n);if(r.signal.aborted)return;d(t=>({...t,[e]:a}))}catch{r.signal.aborted||d(t=>({...t,[e]:[]}))}finally{f.current.get(e)===r&&f.current.delete(e)}},[i]),g=(0,D.useRef)(t);(0,D.useEffect)(()=>{g.current=t},[t]);let _=(0,D.useCallback)(e=>{let t={};for(let n of l??[])n.name!==e&&(t[n.name]=g.current[n.name]??``);return t},[l]);function v(e,t){if(n(e,t),!m)return;d(t=>{if(t[e]===void 0)return t;let n={...t};return delete n[e],n});let r=p.current.get(e);r&&clearTimeout(r);let i=setTimeout(()=>{p.current.delete(e),h(e,t,_(e))},c_e);p.current.set(e,i)}function y(e){if(!m)return;let t=p.current.get(e);t&&(clearTimeout(t),p.current.delete(e));let n=g.current[e]??``;h(e,n,_(e))}let b=(l??[]).filter(e=>e.required===!0).every(e=>(t[e.name]??``).length>0);return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(l_e,{children:s??o}),c&&(0,R.jsx)(u_e,{children:c}),l&&l.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(uv,{order:4,children:`Arguments`}),(0,R.jsx)(U,{gap:`sm`,children:l.map(e=>m?(0,R.jsx)(Rp,{label:e.name,withAsterisk:e.required===!0,description:e.description,placeholder:M8(e.name),value:t[e.name]||``,data:u[e.name]??[],filter:({options:e})=>e,onChange:t=>v(e.name,t),onFocus:()=>y(e.name)},e.name):(0,R.jsx)(ov,{label:e.name,withAsterisk:e.required===!0,description:e.description,placeholder:M8(e.name),value:t[e.name]||``,onChange:t=>v(e.name,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:t[e.name]?(0,R.jsx)(d3,{onClick:()=>v(e.name,``)}):null},e.name))})]}),(0,R.jsx)(V,{justify:`flex-start`,children:(0,R.jsx)(Xp,{size:`sm`,disabled:!b,onClick:r,children:`Get Prompt`})})]})}function f_e(e,t){return`[${e}] role: ${t}`}var p_e=new Set([`text`,`image`,`audio`,`resource`,`resource_link`]);function m_e(e){if(typeof e!=`object`||!e)return!1;let t=e.type;return typeof t==`string`&&p_e.has(t)}function h_e(e){if(e.type===`text`)return`text/markdown`}var g_e=kl.withProps({p:`md`,radius:`md`,withBorder:!0}),__e=H.withProps({size:`xs`,c:`dimmed`,ff:`monospace`}),v_e=V.withProps({justify:`space-between`});function N8({index:e,message:t}){let n=t.content,r=(Array.isArray(n)?n:[n]).filter(m_e);return(0,R.jsx)(g_e,{children:(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(v_e,{children:(0,R.jsx)(__e,{children:f_e(e,t.role)})}),r.map((e,t)=>(0,R.jsx)($4,{block:e,mimeType:h_e(e),copyable:!0},t))]})})}var y_e=Xp.withProps({variant:`subtle`,size:`sm`}),b_e=U.withProps({gap:`md`,miw:0,mih:0}),x_e=V.withProps({justify:`space-between`,flex:`0 0 auto`}),S_e=V.withProps({gap:`xs`,wrap:`nowrap`}),C_e=bl.withProps({flex:`0 1 auto`,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),w_e=U.withProps({gap:`md`});function T_e({messages:e,onCopyAll:t,onClose:n}){return(0,R.jsxs)(b_e,{children:[(0,R.jsxs)(x_e,{children:[(0,R.jsxs)(S_e,{children:[n&&(0,R.jsx)(ju,{"aria-label":`Close messages`,onClick:n}),(0,R.jsx)(uv,{order:4,children:`Messages`})]}),t&&e.length>0&&(0,R.jsx)(y_e,{onClick:t,children:`Copy All`})]}),(0,R.jsx)(C_e,{children:(0,R.jsx)(w_e,{children:e.length===0?(0,R.jsx)(H,{c:`dimmed`,children:`No messages to display`}):e.map((e,t)=>(0,R.jsx)(N8,{index:t,message:e},t))})})]})}var E_e=Dd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),D_e=U.withProps({w:360,flex:`0 0 auto`}),O_e=tm.withProps({withBorder:!0,padding:`lg`,variant:`sidebar`}),k_e=tm.withProps({withBorder:!0,padding:`lg`}),P8=tm.withProps({withBorder:!0,padding:`lg`,variant:`preview`}),F8=Dd.withProps({flex:1,miw:0,direction:`column`,align:`stretch`}),A_e=H.withProps({c:`dimmed`,ta:`center`,py:`xl`}),j_e=U.withProps({align:`center`,py:`xl`}),M_e=Jd.withProps({color:`red`,variant:`light`,title:`Prompt Error`}),I8=`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2)`;function L8(e){return!!e.arguments&&e.arguments.length>0}function N_e({prompts:e,getPromptState:t,ui:n,listChanged:r,completionsSupported:i,onUiChange:a,onRefreshList:o,pagination:s,onGetPrompt:c,onCopyMessages:l,onCompleteArgument:u}){let{selectedPromptName:d,argumentValues:f,submittedFor:p,search:m}=n,h=d?e.find(e=>e.name===d):void 0;function g(t){if(t===d)return;let r=e.find(e=>e.name===t),i=!!r&&!L8(r);a({...n,argumentValues:{},selectedPromptName:t,submittedFor:i?t:void 0}),i&&c(t,{})}function _(){h&&(a({...n,submittedFor:h.name}),c(h.name,f))}function v(){h&&L8(h)?a({...n,submittedFor:void 0}):a({...n,selectedPromptName:void 0,submittedFor:void 0})}let y=!!h&&!!t&&p===h.name&&t.promptName===h.name;function b(){return!y||!t?null:t.status===`pending`?(0,R.jsx)(P8,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(V,{justify:`flex-start`,children:(0,R.jsx)(ju,{"aria-label":`Close messages`,onClick:v})}),(0,R.jsxs)(j_e,{children:[(0,R.jsx)(vu,{size:`sm`}),(0,R.jsx)(H,{c:`dimmed`,children:`Loading prompt...`})]})]})}):t.status===`error`?(0,R.jsx)(P8,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(V,{justify:`flex-start`,children:(0,R.jsx)(ju,{"aria-label":`Close messages`,onClick:v})}),(0,R.jsx)(M_e,{children:t.error??`Failed to get prompt`})]})}):t.result?(0,R.jsx)(P8,{children:(0,R.jsx)(T_e,{messages:t.result.messages,onCopyAll:l,onClose:v})}):null}return(0,R.jsxs)(E_e,{children:[(0,R.jsx)(D_e,{children:(0,R.jsx)(O_e,{children:(0,R.jsx)(s_e,{prompts:e,selectedName:d,searchText:m,listChanged:r,onRefreshList:o,pagination:s,onSearchChange:e=>a({...n,search:e}),onSelectPrompt:g})})}),y?(0,R.jsx)(F8,{mah:I8,children:b()}):h&&L8(h)?(0,R.jsx)(F8,{mah:I8,children:(0,R.jsx)(P8,{children:(0,R.jsx)(d_e,{prompt:h,argumentValues:f,onArgumentChange:(e,t)=>a({...n,argumentValues:{...f,[e]:t}}),onGetPrompt:_,completionsSupported:i,onCompleteArgument:u?(e,t,n)=>u({type:`ref/prompt`,name:h.name},e,t,n):void 0})})}):(0,R.jsx)(k_e,{flex:1,children:(0,R.jsx)(A_e,{children:`Select a prompt to view details`})})]})}function R8(e){return e===`modern`}function P_e(e){return R8(e)?`Modern`:`Legacy`}var z8=`On modern (2026-07-28) servers, resource subscriptions are a filter over one long-lived subscriptions/listen stream.`,F_e={connecting:{color:`blue`,label:`Connecting…`,tooltip:`${z8} Opening the stream — waiting for the server to acknowledge the subscription.`},acknowledged:{color:`green`,label:`Listening`,tooltip:`${z8} The server acknowledged the subscription and the stream is open, carrying resources/updated notifications.`},reconnecting:{color:`yellow`,label:`Reconnecting…`,tooltip:`${z8} The stream dropped unexpectedly; re-listening to re-establish it (there is no resumability, so the full filter is re-sent).`},ended:{color:`gray`,label:`Stream ended`,tooltip:`${z8} The stream is closed and won't reconnect on its own — either the server ended it (for example, on shutdown) or reconnection was abandoned after repeated failures. Re-subscribe to try again.`}};function I_e(e){return F_e[e]}var L_e=y_.withProps({multiline:!0,w:260,withArrow:!0});function R_e({status:e}){let{color:t,label:n,tooltip:r}=I_e(e);return(0,R.jsx)(L_e,{label:r,children:(0,R.jsx)(Vp,{variant:`dot`,color:t,children:n})})}var z_e=wl.withProps({w:`100%`,p:`sm`,variant:`listItem`});function B8({resource:e,selected:t,onClick:n}){return(0,R.jsx)(z_e,{bg:t?`var(--mantine-primary-color-light)`:void 0,onClick:n,children:(0,R.jsx)(H,{fw:500,children:e.title??e.name})})}var B_e=H.withProps({size:`sm`,fw:500,truncate:`end`}),V_e=H.withProps({size:`xs`,c:`dimmed`}),H_e=Xp.withProps({variant:`subtle`,size:`xs`}),U_e=V.withProps({justify:`space-between`,wrap:`nowrap`,gap:`xs`}),W_e=U.withProps({gap:2,flex:1,miw:0});function G_e(e){return e.toLocaleString()}function K_e(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function q_e({subscription:e,onUnsubscribe:t}){let{resource:n,lastUpdated:r}=e;return(0,R.jsxs)(U_e,{children:[(0,R.jsxs)(W_e,{children:[(0,R.jsx)(y_,{label:n.uri,withinPortal:!0,children:(0,R.jsx)(B_e,{children:K_e(n.uri)})}),r&&(0,R.jsx)(V_e,{children:G_e(r)})]}),(0,R.jsx)(H_e,{onClick:t,children:`Unsubscribe`})]})}var V8=V.withProps({gap:`xs`,wrap:`nowrap`}),J_e=U.withProps({gap:`sm`,flex:1,mih:0}),Y_e=ov.withProps({flex:1,placeholder:`Search...`,rightSectionPointerEvents:`auto`});function H8(e,t){return`${e} (${t})`}function U8(e,t){return e&&t>0?`0 ${t} auto`:`0 0 auto`}function X_e({resources:e,templates:t,subscriptions:n,subscriptionsSupported:r=!0,subscriptionStreamState:i,protocolEra:a,selectedUri:o,selectedTemplateUri:s,searchText:c=``,openSections:l,listChanged:u,onRefreshList:d,pagination:f,onSearchChange:p,onOpenSectionsChange:m,onSelectUri:h,onSelectTemplate:g,onUnsubscribeResource:_,compact:v,onCompactChange:y}){let b=c.toLowerCase(),x=e.filter(e=>e.name.toLowerCase().includes(b)||(e.title?.toLowerCase().includes(b)??!1)||e.uri.toLowerCase().includes(b)),S=t.filter(e=>e.name.toLowerCase().includes(b)||(e.title?.toLowerCase().includes(b)??!1)||e.uriTemplate.toLowerCase().includes(b)),C=n.filter(e=>e.resource.name.toLowerCase().includes(b)||(e.resource.title?.toLowerCase().includes(b)??!1)||e.resource.uri.toLowerCase().includes(b)),w=R8(a)&&i?.active===!0&&C.length>0?i.status:void 0,T=r?[`resources`,`templates`,`subscriptions`]:[`resources`,`templates`],E=l??(v?[]:[...T]),D=E.filter(e=>T.includes(e)).length===T.length,O={resources:x.length,templates:S.length,subscriptions:C.length},k=E.filter(e=>T.includes(e)&&(O[e]??0)>0),A=E.filter(e=>T.includes(e)&&!k.includes(e));function j(e){m([...e,...A])}function M(){let e=D;m(e?[]:[...T]),y(e)}return(0,R.jsxs)(J_e,{children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(uv,{order:4,children:`Resources`}),(0,R.jsx)(f3,{visible:u,onRefresh:d})]}),(0,R.jsxs)(V8,{children:[(0,R.jsx)(Y_e,{value:c,onChange:e=>p(e.currentTarget.value),rightSection:c?(0,R.jsx)(d3,{onClick:()=>p(``)}):null}),(0,R.jsx)(c3,{compact:!D,onToggle:M})]}),(0,R.jsx)(p3,{...f}),(0,R.jsxs)(Gd,{multiple:!0,variant:`disclosure`,chevron:(0,R.jsx)(o3,{}),flex:1,mih:0,transitionDuration:0,value:k,onChange:j,children:[(0,R.jsxs)(Gd.Item,{value:`resources`,flex:U8(k.includes(`resources`),x.length),children:[(0,R.jsx)(Gd.Control,{disabled:x.length===0,children:H8(`URIs`,x.length)}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsx)(U,{gap:`xs`,children:x.map(e=>(0,R.jsx)(B8,{resource:e,selected:e.uri===o,onClick:()=>{e.uri!==o&&h(e.uri)}},e.uri))})})]}),(0,R.jsxs)(Gd.Item,{value:`templates`,flex:U8(k.includes(`templates`),S.length),children:[(0,R.jsx)(Gd.Control,{disabled:S.length===0,children:H8(`Templates`,S.length)}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsx)(U,{gap:`xs`,children:S.map(e=>(0,R.jsx)(B8,{resource:e,selected:e.uriTemplate===s,onClick:()=>{e.uriTemplate!==s&&g(e.uriTemplate)}},e.uriTemplate))})})]}),r&&(0,R.jsxs)(Gd.Item,{value:`subscriptions`,flex:U8(k.includes(`subscriptions`),C.length),children:[(0,R.jsx)(Gd.Control,{disabled:C.length===0,children:(0,R.jsxs)(V8,{children:[(0,R.jsx)(H,{span:!0,children:H8(`Subscriptions`,C.length)}),w&&(0,R.jsx)(R_e,{status:w})]})}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsx)(U,{gap:`xs`,children:C.map(e=>(0,R.jsx)(q_e,{subscription:e,onUnsubscribe:()=>_(e.resource.uri)},e.resource.uri))})})]})]})]})}function W8(e){return!e||e===`dimmed`?e:`var(--mantine-color-${e}-light-color)`}var Z_e=Xp.withProps({variant:`filled`,size:`sm`});function Q_e({subscribed:e,onToggle:t}){return(0,R.jsx)(Z_e,{onClick:t,children:e?`Unsubscribe`:`Subscribe`})}function $_e(e){return`Last updated: ${e.toLocaleString()}`}var eve=new Set([`markdown`,`csv`,`html`]),tve=`text/plain`;function G8(e){return eve.has(B4(e))}var nve=V.withProps({justify:`space-between`,wrap:`nowrap`,flex:`0 0 auto`}),rve=V.withProps({gap:`xs`,wrap:`nowrap`}),ive=V.withProps({gap:`xs`,wrap:`nowrap`}),ave=H.withProps({size:`sm`,c:W8(`blue`),truncate:`end`}),ove=V.withProps({justify:`space-between`,wrap:`nowrap`,flex:`0 0 auto`}),sve=H.withProps({size:`xs`,c:`dimmed`}),cve=H.withProps({size:`sm`,c:`dimmed`}),lve=V.withProps({justify:`flex-start`,flex:`0 0 auto`}),uve=V.withProps({gap:`xs`}),dve=V.withProps({gap:`xs`}),K8=Xp.withProps({variant:`subtle`,size:`sm`}),fve=Dd.withProps({}),pve=U.withProps({gap:`md`,miw:0,mih:0}),mve=bl.withProps({flex:`0 1 auto`,miw:0,mih:0,type:`auto`,scrollbars:`y`,offsetScrollbars:!0}),hve=U.withProps({gap:`md`}),gve=[[`.md`,`text/markdown`],[`.markdown`,`text/markdown`],[`.csv`,`text/csv`],[`.json`,`application/json`],[`.xml`,`application/xml`],[`.html`,`text/html`],[`.htm`,`text/html`],[`.css`,`text/css`],[`.pdf`,`application/pdf`]];function _ve(e){let t=e.split(`?`)[0].split(`#`)[0].toLowerCase();for(let[e,n]of gve)if(t.endsWith(e))return n}function q8(e,t){return e??t.mimeType??_ve(t.uri)??`application/octet-stream`}function vve({resource:e,contents:t,lastUpdated:n,isSubscribed:r,subscriptionsSupported:i=!0,onRefresh:a,onSubscribe:o,onUnsubscribe:s,onClose:c}){let{uri:l,annotations:u}=e,d=q8(t[0]?.mimeType,e),[f,p]=(0,D.useState)(!1),[m,h]=(0,D.useState)(l);l!==m&&(h(l),p(!1));let g=G8(d);return(0,R.jsxs)(pve,{children:[(0,R.jsxs)(nve,{children:[(0,R.jsxs)(rve,{children:[c&&(0,R.jsx)(ju,{"aria-label":`Close preview`,onClick:c}),(0,R.jsx)(uv,{order:4,children:`Resource`})]}),(0,R.jsxs)(ive,{children:[(0,R.jsx)(ave,{children:l}),(0,R.jsx)(R4,{value:l})]})]}),(0,R.jsx)(mve,{children:(0,R.jsx)(hve,{children:t.map((t,n)=>{let r=q8(t.mimeType,e);return(0,R.jsx)($4,{contents:t,mimeType:f&&G8(r)?tve:r,copyable:!0},n)})})}),(0,R.jsxs)(ove,{children:[n?(0,R.jsx)(sve,{children:$_e(n)}):(0,R.jsx)(fve,{}),t.length<=1&&(0,R.jsx)(cve,{children:d})]}),(0,R.jsxs)(lve,{children:[(0,R.jsxs)(dve,{children:[i&&(0,R.jsx)(Q_e,{subscribed:r,onToggle:r?s:o}),(0,R.jsx)(K8,{onClick:a,children:`Refresh`}),g&&(0,R.jsx)(K8,{"aria-pressed":f,onClick:()=>p(e=>!e),children:f?`View Rendered`:`View Source`})]}),(0,R.jsxs)(uve,{children:[u?.audience&&(0,R.jsx)(S3,{facet:`audience`,value:u.audience}),u?.priority!==void 0&&(0,R.jsx)(S3,{facet:`priority`,value:u.priority})]})]})]})}var yve=300;function bve(e){let t=[],n=/\{(\w+)\}/g,r;for(;(r=n.exec(e))!==null;)t.push(r[1]);return t}function xve(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>t[n])}function Sve(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>t[n]?.length>0?t[n]:e)}var Cve=V.withProps({justify:`space-between`,wrap:`nowrap`}),wve=V.withProps({gap:`xs`,wrap:`nowrap`}),Tve=H.withProps({size:`sm`,c:W8(`blue`),truncate:`end`}),Eve=H.withProps({size:`sm`,c:`dimmed`}),Dve=V.withProps({justify:`flex-start`}),Ove=V.withProps({gap:`xs`});function kve({template:e,onReadResource:t,onCompleteArgument:n,completionsSupported:r=!1}){let{name:i,title:a,uriTemplate:o,description:s,annotations:c}=e,l=(0,D.useMemo)(()=>bve(o),[o]),[u,d]=(0,D.useState)(()=>Object.fromEntries(l.map(e=>[e,``]))),[f,p]=(0,D.useState)({});(0,D.useEffect)(()=>{d(Object.fromEntries(l.map(e=>[e,``]))),p({})},[o,l]);let m=(0,D.useRef)(new Map),h=(0,D.useRef)(new Map);(0,D.useEffect)(()=>{let e=h.current,t=m.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear();for(let e of t.values())e.abort();t.clear()}},[]);let g=r&&!!n,_=(0,D.useCallback)(async(e,t,r)=>{if(!n)return;m.current.get(e)?.abort();let i=new AbortController;m.current.set(e,i);try{let a=await n(e,t,r);if(i.signal.aborted)return;p(t=>({...t,[e]:a}))}catch{i.signal.aborted||p(t=>({...t,[e]:[]}))}finally{m.current.get(e)===i&&m.current.delete(e)}},[n]),v=(0,D.useRef)(u);(0,D.useEffect)(()=>{v.current=u},[u]);function y(e){let t={...v.current};return delete t[e],t}function b(e,t){if(d(n=>({...n,[e]:t})),!g)return;p(t=>{if(t[e]===void 0)return t;let n={...t};return delete n[e],n});let n=h.current.get(e);n&&clearTimeout(n);let r=setTimeout(()=>{h.current.delete(e),_(e,t,y(e))},yve);h.current.set(e,r)}function x(e){if(!g)return;let t=h.current.get(e);t&&(clearTimeout(t),h.current.delete(e));let n=v.current[e]??``;_(e,n,y(e))}let S=l.every(e=>u[e]?.length>0);function C(){t(xve(o,u))}let w=Sve(o,u);return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(Cve,{children:[(0,R.jsxs)(uv,{order:4,children:[a??i,` Template`]}),(0,R.jsxs)(wve,{children:[(0,R.jsx)(Tve,{children:w}),(0,R.jsx)(R4,{value:w})]})]}),s&&(0,R.jsx)(Eve,{children:s}),(0,R.jsx)(U,{gap:`sm`,children:l.map(e=>{let t=u[e]??``;return g?(0,R.jsx)(Rp,{label:e,placeholder:`Enter ${e}`,value:t,data:f[e]??[],filter:({options:e})=>e,onChange:t=>b(e,t),onFocus:()=>x(e)},e):(0,R.jsx)(ov,{label:e,placeholder:`Enter ${e}`,value:t,onChange:t=>b(e,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:u[e]?(0,R.jsx)(d3,{onClick:()=>b(e,``)}):null},e)})}),(0,R.jsxs)(Dve,{children:[(0,R.jsx)(Xp,{size:`sm`,disabled:!S,onClick:C,children:`Read Resource`}),(0,R.jsxs)(Ove,{children:[c?.audience&&(0,R.jsx)(S3,{facet:`audience`,value:c.audience}),c?.priority!==void 0&&(0,R.jsx)(S3,{facet:`priority`,value:c.priority})]})]})]})}var Ave=Dd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),jve=U.withProps({w:360,flex:`0 0 auto`}),Mve=tm.withProps({withBorder:!0,padding:`lg`,variant:`sidebar`}),Nve=tm.withProps({withBorder:!0,padding:`lg`}),J8=tm.withProps({withBorder:!0,padding:`lg`,variant:`preview`}),Y8=Dd.withProps({flex:1,miw:0,direction:`column`,align:`stretch`}),Pve=H.withProps({c:`dimmed`,ta:`center`,py:`xl`}),Fve=U.withProps({align:`center`,py:`xl`}),Ive=Jd.withProps({color:`red`,variant:`light`,title:`Read Error`}),X8=`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - var(--mantine-spacing-xl) * 2)`;function Lve({resources:e,templates:t,subscriptions:n,subscriptionStreamState:r,protocolEra:i,readState:a,ui:o,listChanged:s,completionsSupported:c,subscriptionsSupported:l=!0,onUiChange:u,onRefreshList:d,pagination:f,onReadResource:p,onSubscribeResource:m,onUnsubscribeResource:h,onCompleteArgument:g,compact:_,onCompactChange:v}){let{selectedResourceUri:y,selectedTemplateUri:b,originatingTemplateUri:x,search:S,openSections:C}=o,w=y?e.find(e=>e.uri===y):void 0,T=b?t.find(e=>e.uriTemplate===b):void 0,E=w??(a?.uri&&a.uri===y?{name:a.uri,uri:a.uri}:void 0);function D(e){u({...o,selectedTemplateUri:void 0,selectedResourceUri:e,originatingTemplateUri:void 0}),p(e)}function O(e){u({...o,selectedResourceUri:void 0,selectedTemplateUri:e,originatingTemplateUri:void 0})}function k(e){u({...o,originatingTemplateUri:b??x,selectedTemplateUri:void 0,selectedResourceUri:e}),p(e)}function A(){u(x?{...o,selectedResourceUri:void 0,selectedTemplateUri:x,originatingTemplateUri:void 0}:{...o,selectedResourceUri:void 0})}function j(){return a?a.status===`pending`?(0,R.jsx)(J8,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(V,{justify:`flex-start`,children:(0,R.jsx)(ju,{"aria-label":`Close preview`,onClick:A})}),(0,R.jsxs)(Fve,{children:[(0,R.jsx)(vu,{size:`sm`}),(0,R.jsx)(H,{c:`dimmed`,children:`Reading resource...`})]})]})}):a.status===`error`?(0,R.jsx)(J8,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(V,{justify:`flex-start`,children:(0,R.jsx)(ju,{"aria-label":`Close preview`,onClick:A})}),(0,R.jsx)(Ive,{children:a.error??`Failed to read resource`})]})}):a.result&&E?(0,R.jsx)(J8,{children:(0,R.jsx)(vve,{resource:E,contents:a.result.contents,lastUpdated:a.lastUpdated,isSubscribed:a.isSubscribed??!1,subscriptionsSupported:l,onRefresh:()=>k(E.uri),onSubscribe:()=>m(E.uri),onUnsubscribe:()=>h(E.uri),onClose:A})}):null:null}return(0,R.jsxs)(Ave,{children:[(0,R.jsx)(jve,{children:(0,R.jsx)(Mve,{children:(0,R.jsx)(X_e,{resources:e,templates:t,subscriptions:n,subscriptionsSupported:l,subscriptionStreamState:r,protocolEra:i,selectedUri:y,selectedTemplateUri:b,searchText:S,openSections:C,listChanged:s,onRefreshList:d,pagination:f,onSearchChange:e=>u({...o,search:e}),onOpenSectionsChange:e=>u({...o,openSections:e}),onSelectUri:D,onSelectTemplate:O,onUnsubscribeResource:h,compact:_,onCompactChange:v})})}),T?(0,R.jsx)(Y8,{mah:X8,children:(0,R.jsx)(J8,{children:(0,R.jsx)(kve,{template:T,onReadResource:k,completionsSupported:c,onCompleteArgument:g?(e,t,n)=>g({type:`ref/resource`,uri:T.uriTemplate},e,t,n):void 0})})}):E?(0,R.jsx)(Y8,{mah:X8,children:j()}):(0,R.jsx)(Nve,{flex:1,children:(0,R.jsx)(Pve,{children:`Select a resource to preview`})})]})}var Rve=H.withProps({ta:`center`,fw:500}),zve=wl.withProps({w:`100%`,p:`sm`,variant:`filterToggle`});function Z8({label:e,color:t,active:n,onToggle:r}){return(0,R.jsx)(zve,{"aria-pressed":n,onClick:()=>r(!n),children:(0,R.jsx)(Rve,{c:W8(t),children:e})})}var Q8=[`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`],Bve={debug:{c:`dimmed`},info:{c:`blue`},notice:{c:`teal`},warning:{c:`yellow`},error:{c:`red`},critical:{c:`red`},alert:{c:`red`},emergency:{c:`red`}},$8=`__off__`,Vve=Xp.withProps({variant:`subtle`,size:`xs`}),Hve=H.withProps({size:`xs`,c:`var(--inspector-text-secondary)`}),Uve=T_.withProps({"aria-label":`Set Active Level`,flex:1}),Wve=T_.withProps({"aria-label":`Log Level per Request`,allowDeselect:!1}),e5=Q8.map(e=>({value:e,label:e})),Gve=({currentLevel:e,onSetLevel:t})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(uv,{order:5,children:`Set Active Level`}),(0,R.jsxs)(V,{wrap:`nowrap`,children:[(0,R.jsx)(Uve,{data:e5,value:e,onChange:e=>{e&&Q8.includes(e)&&t(e)}}),(0,R.jsx)(Xp,{size:`sm`,onClick:()=>t(e),children:`Set`})]})]}),Kve=({modernLogLevel:e,onSetModernLogLevel:t})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(uv,{order:5,children:`Log Level per Request`}),(0,R.jsx)(Hve,{children:`Modern servers only emit logs for requests that opt in. The level you choose is stamped on every request, and logs arrive on the originating request's stream. Choose Off to stop requesting logs.`}),(0,R.jsx)(Wve,{data:[{value:$8,label:`Off (no logs)`},...e5],value:e??$8,onChange:e=>{e===$8?t?.(null):e&&Q8.includes(e)&&t?.(e)}})]});function qve({currentLevel:e,filterText:t,visibleLevels:n,onSetLevel:r,onFilterChange:i,onToggleLevel:a,onToggleAllLevels:o,protocolEra:s,modernLogLevel:c=null,onSetModernLogLevel:l}){return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(uv,{order:4,children:`Logging`}),(0,R.jsx)(ov,{placeholder:`Search...`,value:t,onChange:e=>i(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:t?(0,R.jsx)(d3,{onClick:()=>i(``)}):null}),R8(s)?(0,R.jsx)(Kve,{modernLogLevel:c,onSetModernLogLevel:l}):(0,R.jsx)(Gve,{currentLevel:e,onSetLevel:r}),(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(uv,{order:5,children:`Filter by Level`}),(0,R.jsx)(Vve,{onClick:o,children:Object.values(n).every(Boolean)?`Deselect All`:`Select All`})]}),(0,R.jsx)(U,{gap:`xs`,children:Q8.map(e=>(0,R.jsx)(Z8,{label:e,color:Bve[e].c,active:n[e],onToggle:t=>a(e,t)},e))})]})}var t5={debug:`dimmed`,info:`blue`,notice:void 0,warning:`yellow`,error:`red`,critical:`red`,alert:`red`,emergency:`red`};function n5(e){return e.toLocaleTimeString()}function Jve(e){return`[${e}]`}function Yve(e){return e==null?``:typeof e==`string`?e:JSON.stringify(e)}var r5=H.withProps({size:`sm`,ff:`monospace`,c:`dimmed`}),Xve=H.withProps({size:`xs`,ff:`monospace`,c:`dimmed`}),Zve=H.withProps({size:`sm`,ff:`monospace`}),Qve=H.withProps({size:`sm`,ff:`monospace`,variant:`consoleLine`}),$ve=V.withProps({gap:`xs`,wrap:`nowrap`,align:`center`}),eye=V.withProps({gap:`sm`,wrap:`nowrap`});function tye({entry:e,compact:t=!1}){let{receivedAt:n,params:r}=e,i=Yve(r.data),a=r.logger?(0,R.jsx)(Xve,{children:Jve(r.logger)}):null;return t?(0,R.jsxs)(U,{gap:2,children:[(0,R.jsxs)($ve,{children:[(0,R.jsx)(r5,{children:n5(n)}),(0,R.jsx)(S8,{level:r.level}),a]}),(0,R.jsx)(Qve,{c:W8(t5[r.level]),children:i})]}):(0,R.jsxs)(eye,{children:[(0,R.jsx)(r5,{children:n5(n)}),(0,R.jsx)(S8,{level:r.level}),a,(0,R.jsx)(Zve,{c:W8(t5[r.level]),children:i})]})}var nye=[{value:`newest-first`,label:`Newest First`},{value:`oldest-first`,label:`Oldest First`}];function rye(e){return e===`oldest-first`||e===`newest-first`}var iye=T_.withProps({size:`sm`,w:150,allowDeselect:!1,withCheckIcon:!1});function i5({value:e,onChange:t,"aria-label":n=`Sort direction`}){return(0,R.jsx)(iye,{data:nye,value:e,onChange:e=>{rye(e)&&t(e)},rightSection:(0,R.jsx)(e===`newest-first`?VK:HK,{size:16}),"aria-label":n})}var aye=`calc(100vh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px) - 150px)`,oye={content:{minWidth:0}},a5=bl.Autosize.withProps({type:`scroll`,offsetScrollbars:!0,viewportProps:{tabIndex:0}}),sye=U.withProps({flex:1,mih:0,gap:0});function o5({embedded:e,viewportRef:t,children:n,constrainContentWidth:r=!1}){let i=r?oye:void 0;return e?(0,R.jsx)(sye,{children:(0,R.jsx)(a5,{viewportRef:t,mah:`100%`,styles:i,children:n})}):(0,R.jsx)(a5,{viewportRef:t,mah:aye,styles:i,children:n})}var cye=kl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),lye=U.withProps({flex:1,align:`center`,justify:`center`}),uye=V.withProps({justify:`space-between`,mb:`sm`});function dye(e){return e==null?``:typeof e==`string`?e:JSON.stringify(e)}function fye(e,t,n,r){if(!r&&!n[e.params.level])return!1;if(t){let n=t.toLowerCase();if(!`${dye(e.params.data)} ${e.params.logger??``} ${e.params.level}`.toLowerCase().includes(n))return!1}return!0}function pye({entries:e,filterText:t,visibleLevels:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,embedded:s=!1}){let c=_3(`logs-stream`),l=(0,D.useMemo)(()=>{let r=e.filter(e=>fye(e,t,n,s)).sort((e,t)=>e.receivedAt.getTime()-t.receivedAt.getTime());return a===`newest-first`&&r.reverse(),r},[e,t,n,a,s]);return(0,R.jsxs)(cye,{children:[(0,R.jsxs)(uye,{children:[(0,R.jsx)(uv,{order:4,children:`Log Stream`}),(0,R.jsxs)(V,{children:[(0,R.jsx)(i5,{value:a,onChange:o,"aria-label":`Logs sort direction`}),(0,R.jsx)(Xp,{variant:`default`,onClick:r,disabled:e.length===0,children:`Clear`}),(0,R.jsx)(Xp,{variant:`default`,onClick:i,disabled:e.length===0,children:`Export`})]})]}),l.length>0?(0,R.jsx)(o5,{embedded:s,viewportRef:c,children:(0,R.jsx)(U,{gap:`xs`,children:l.map((e,t)=>(0,R.jsx)(tye,{entry:e,compact:s},t))})}):(0,R.jsx)(lye,{children:(0,R.jsx)(H,{c:`dimmed`,children:`No log entries`})})]})}var s5={debug:!0,info:!0,notice:!0,warning:!0,error:!0,critical:!0,alert:!0,emergency:!0},mye={debug:!1,info:!1,notice:!1,warning:!1,error:!1,critical:!1,alert:!1,emergency:!1},hye=Dd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),gye=U.withProps({w:340,flex:`0 0 auto`}),_ye=tm.withProps({withBorder:!0,padding:`lg`});function c5({entries:e,currentLevel:t,ui:n,onUiChange:r,onSetLevel:i,protocolEra:a,modernLogLevel:o=null,onSetModernLogLevel:s,onClear:c,onExport:l,sortDirection:u,onSortChange:d,embedded:f=!1}){let{filterText:p,visibleLevels:m}=n;function h(e,t){r({...n,visibleLevels:{...m,[e]:t}})}function g(){let e=Object.values(m).every(Boolean);r({...n,visibleLevels:e?mye:s5})}return(0,R.jsxs)(hye,{...f?{h:`100%`,pt:`md`}:{},children:[f?null:(0,R.jsx)(gye,{children:(0,R.jsx)(_ye,{children:(0,R.jsx)(qve,{currentLevel:t,filterText:p,visibleLevels:m,onSetLevel:i,protocolEra:a,modernLogLevel:o,onSetModernLogLevel:s,onFilterChange:e=>r({...n,filterText:e}),onToggleLevel:h,onToggleAllLevels:g})})}),(0,R.jsx)(pye,{entries:e,filterText:p,visibleLevels:m,onClear:c,onExport:l,sortDirection:u,onSortChange:d,embedded:f})]})}var l5=[`working`,`input_required`,`completed`,`failed`,`cancelled`],vye=Xp.withProps({variant:`subtle`,size:`sm`}),yye=V.withProps({flex:1,justify:`space-between`}),bye=ov.withProps({placeholder:`Search...`,rightSectionPointerEvents:`auto`}),xye=uv.withProps({order:5,size:`h6`}),Sye=T_.withProps({placeholder:`All statuses`,clearable:!0});function Cye({searchText:e,statusFilter:t,onSearchChange:n,onStatusFilterChange:r,onRefresh:i}){return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(yye,{children:[(0,R.jsx)(uv,{order:4,children:`Tasks`}),(0,R.jsx)(vye,{onClick:i,children:`Refresh`})]}),(0,R.jsx)(uv,{order:5,children:`Search`}),(0,R.jsx)(bye,{value:e,onChange:e=>n(e.currentTarget.value),rightSection:e?(0,R.jsx)(d3,{onClick:()=>n(``)}):null}),(0,R.jsx)(xye,{children:`Filter by Status`}),(0,R.jsx)(Sye,{data:l5,value:t??null,onChange:e=>r(e&&l5.includes(e)?e:void 0)})]})}var wye={working:`blue`,input_required:`yellow`,completed:`green`,failed:`red`,cancelled:`gray`},Tye={working:`working`,input_required:`input required`,completed:`completed`,failed:`failed`,cancelled:`cancelled`},Eye=Vp.withProps({variant:`filled`,autoContrast:!0});function Dye({status:e}){return(0,R.jsx)(Eye,{color:x3(wye[e]),children:Tye[e]})}var Oye=tm.withProps({withBorder:!0,padding:`md`,variant:`inset`}),kye=V.withProps({justify:`space-between`,wrap:`nowrap`}),u5=H.withProps({size:`sm`,ff:`monospace`,c:`dimmed`}),d5=H.withProps({size:`sm`,c:`dimmed`}),f5=H.withProps({size:`sm`,fw:500}),Aye=H.withProps({size:`sm`,fs:`italic`}),jye=Xp.withProps({variant:`subtle`,color:`red`,size:`xs`}),Mye=V.withProps({gap:`xl`,wrap:`wrap`}),Nye=V.withProps({justify:`space-between`,wrap:`nowrap`}),Pye=V.withProps({gap:`sm`}),Fye=V.withProps({gap:`xs`,wrap:`nowrap`}),p5=H.withProps({size:`sm`,fw:600});function m5(e){return`ID: ${e}`}function Iye(e){return`${e}ms`}function h5({task:e,progress:t,isListExpanded:n,onCancel:r,embedded:i=!1}){let{taskId:a,status:o,ttl:s,createdAt:c,lastUpdatedAt:l,statusMessage:u}=e,[d,f]=(0,D.useState)(n),p=o===`working`||o===`input_required`;return(0,D.useEffect)(()=>{f(n)},[n]),(0,R.jsx)(Oye,{children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsxs)(kye,{children:[(0,R.jsxs)(Pye,{children:[(0,R.jsx)(p5,{children:`Task Details`}),!i&&(0,R.jsx)(u5,{children:m5(a)})]}),(0,R.jsxs)(Fye,{children:[p&&(0,R.jsx)(jye,{onClick:r,children:`Cancel Task`}),(0,R.jsx)(Dye,{status:o})]})]}),i&&(0,R.jsx)(u5,{truncate:`end`,children:m5(a)}),(0,R.jsxs)(Nye,{children:[(0,R.jsxs)(Mye,{children:[(0,R.jsxs)(U,{gap:2,children:[(0,R.jsx)(d5,{children:`Last Updated`}),(0,R.jsx)(f5,{children:l})]}),(0,R.jsxs)(U,{gap:2,children:[(0,R.jsx)(d5,{children:`Created At`}),(0,R.jsx)(f5,{children:c})]}),s!=null&&(0,R.jsxs)(U,{gap:2,children:[(0,R.jsx)(d5,{children:`TTL`}),(0,R.jsx)(f5,{children:Iye(s)})]})]}),(0,R.jsx)(D3,{expanded:d,onToggle:()=>f(e=>!e)})]}),t&&p?(0,R.jsx)(w3,{params:t}):u&&(0,R.jsx)(Aye,{children:u}),(0,R.jsx)(ca,{in:d,children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(lm,{}),(0,R.jsx)(p5,{children:`Full Task Object`}),(0,R.jsx)($4,{block:{type:`text`,text:JSON.stringify(e)},copyable:!0})]})})]})})}var Lye=kl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),Rye=Xp.withProps({variant:`subtle`,size:`sm`}),zye=V.withProps({justify:`space-between`,mb:`sm`}),Bye=H.withProps({c:`dimmed`,ta:`center`,py:`xl`});function Vye(e){return`Active (${e})`}function Hye(e){return`Completed (${e})`}function g5(e){return e===`working`||e===`input_required`}function Uye(e,t,n,r){if(!r&&n&&e.status!==n)return!1;if(t){let n=t.toLowerCase();if(!`${e.taskId} ${e.status} ${e.statusMessage??``}`.toLowerCase().includes(n))return!1}return!0}function Wye({tasks:e,progressByTaskId:t,searchText:n,statusFilter:r,onCancel:i,onClearCompleted:a,embedded:o=!1}){let s=_3(`tasks-list`),[c,l]=(0,D.useState)(!1),u=(0,D.useMemo)(()=>e.filter(e=>Uye(e,n,r,o)),[e,n,r,o]),d=(0,D.useMemo)(()=>u.filter(e=>g5(e.status)),[u]),f=(0,D.useMemo)(()=>u.filter(e=>!g5(e.status)),[u]),p=u.length>0;return(0,R.jsxs)(Lye,{children:[(0,R.jsxs)(zye,{children:[(0,R.jsx)(uv,{order:4,children:`Tasks`}),p&&(0,R.jsx)(c3,{compact:c,onToggle:()=>l(e=>!e)})]}),p?(0,R.jsx)(o5,{embedded:o,viewportRef:s,children:(0,R.jsxs)(U,{gap:`md`,children:[d.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(uv,{order:5,children:Vye(d.length)}),d.map(e=>(0,R.jsx)(h5,{task:e,progress:t?.[e.taskId],isListExpanded:!c,onCancel:()=>i(e.taskId),embedded:o},e.taskId))]}),f.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(uv,{order:5,children:Hye(f.length)}),(0,R.jsx)(Rye,{onClick:a,children:`Clear`})]}),f.map(e=>(0,R.jsx)(h5,{task:e,progress:t?.[e.taskId],isListExpanded:!c,onCancel:()=>i(e.taskId),embedded:o},e.taskId))]})]})}):(0,R.jsx)(Bye,{children:`No tasks`})]})}var Gye=Dd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),Kye=U.withProps({w:340,flex:`0 0 auto`}),qye=tm.withProps({withBorder:!0,padding:`lg`});function _5({tasks:e,progressByTaskId:t,ui:n,onUiChange:r,onRefresh:i,onClearCompleted:a,onCancel:o,embedded:s=!1}){let{search:c,statusFilter:l}=n;return(0,R.jsxs)(Gye,{...s?{h:`100%`,pt:`md`}:{},children:[s?null:(0,R.jsx)(Kye,{children:(0,R.jsx)(qye,{children:(0,R.jsx)(Cye,{searchText:c,statusFilter:l,onSearchChange:e=>r({...n,search:e}),onStatusFilterChange:e=>r({...n,statusFilter:e}),onRefresh:i})})}),(0,R.jsx)(Wye,{tasks:e,progressByTaskId:t,searchText:c,statusFilter:l,onCancel:o,onClearCompleted:a,embedded:s})]})}var Jye=Xp.withProps({variant:`subtle`,size:`xs`}),Yye=uv.withProps({order:5,size:`h6`}),Xye=[{origin:`client`,label:`client → server`,color:`green`},{origin:`server`,label:`server → client`,color:`violet`}];function Zye({visibleDirections:e,onToggleDirection:t,onToggleAllDirections:n}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(Yye,{children:`Filter by Message Direction`}),(0,R.jsx)(Jye,{onClick:n,children:Object.values(e).every(Boolean)?`Deselect All`:`Select All`})]}),(0,R.jsx)(U,{gap:`xs`,children:Xye.map(({origin:n,label:r,color:i})=>(0,R.jsx)(Z8,{label:r,color:i,active:e[n],onToggle:e=>t(n,e)},n))})]})}var Qye=ov.withProps({placeholder:`Search...`,rightSectionPointerEvents:`auto`}),$ye=uv.withProps({order:5,size:`h6`}),ebe=T_.withProps({placeholder:`All methods`,clearable:!0});function tbe({searchText:e,methodFilter:t,availableMethods:n,visibleDirections:r,onSearchChange:i,onMethodFilterChange:a,onToggleDirection:o,onToggleAllDirections:s}){return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(uv,{order:4,children:`Protocol`}),(0,R.jsx)(Qye,{value:e,onChange:e=>i(e.currentTarget.value),rightSection:e?(0,R.jsx)(d3,{onClick:()=>i(``)}):null}),(0,R.jsx)($ye,{children:`Filter by Method`}),(0,R.jsx)(ebe,{data:n,value:t??null,onChange:e=>a(e??void 0)}),(0,R.jsx)(Zye,{visibleDirections:r,onToggleDirection:o,onToggleAllDirections:s})]})}var nbe={outgoing:`client → server`,incoming:`server → client`},rbe={outgoing:`var(--inspector-badge-outgoing-bg)`,incoming:`var(--inspector-badge-incoming-bg)`},ibe={outgoing:`var(--inspector-badge-outgoing-fg)`,incoming:`var(--inspector-badge-incoming-fg)`};function abe({direction:e}){return(0,R.jsx)(Vp,{autoContrast:!1,bg:rbe[e],c:ibe[e],children:nbe[e]})}var obe=Vp.withProps({autoContrast:!1,bg:`var(--inspector-badge-method-bg)`,c:`var(--inspector-badge-method-fg)`});function v5({method:e}){return(0,R.jsx)(obe,{children:e})}var sbe={[-32020]:`red`,[-32021]:`orange`,[-32022]:`grape`,[-32601]:`yellow`},cbe=Vp.withProps({variant:`filled`,autoContrast:!0,tt:`none`}),lbe=y_.withProps({multiline:!0,w:280,withArrow:!0});function ube({code:e,name:t,description:n}){let r=(0,R.jsxs)(cbe,{color:x3(sbe[e]??`red`),children:[e,` `,t]});return n?(0,R.jsx)(lbe,{label:n,children:r}):r}function dbe(e){return wK({tag:`svg`,attr:{version:`1.2`,baseProfile:`tiny`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M16.729 4.271c-.389-.391-1.021-.393-1.414-.004-.104.104-.176.227-.225.355-.832 1.736-1.748 2.715-2.904 3.293-1.297.64-2.786 1.085-5.186 1.085-.13 0-.26.025-.382.076-.245.102-.439.297-.541.541-.101.244-.101.52 0 .764.051.123.124.234.217.326l3.243 3.243-4.537 6.05 6.05-4.537 3.242 3.242c.092.094.203.166.326.217.122.051.252.078.382.078s.26-.027.382-.078c.245-.102.44-.295.541-.541.051-.121.077-.252.077-.381 0-2.4.444-3.889 1.083-5.166.577-1.156 1.556-2.072 3.293-2.904.129-.049.251-.121.354-.225.389-.393.387-1.025-.004-1.414l-3.997-4.02z`},child:[]}]})(e)}function fbe(e){return wK({tag:`svg`,attr:{version:`1.2`,baseProfile:`tiny`,viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{d:`M21.436 7.586l-3.998-4.02c-.752-.756-2.063-.764-2.83-.006-.196.196-.35.436-.418.629-.653 1.362-1.354 2.215-2.254 2.727l-.217.105c-.968.485-2.285.979-4.719.979-.266 0-.521.052-.766.152-.484.202-.879.595-1.082 1.084-.199.484-.199 1.041 0 1.525.104.249.25.471.435.651l3.235 3.235-3.822 5.353 5.352-3.822 3.227 3.227c.186.189.406.339.656.441.247.103.503.154.766.154s.519-.052.765-.154c.498-.205.883-.592 1.08-1.078.103-.242.155-.507.155-.768 0-2.436.494-3.752.978-4.721.496-.992 1.369-1.748 2.754-2.414.271-.104.51-.256.711-.457.772-.782.768-2.051-.008-2.822zm-5.248 4.801c-.819 1.643-1.188 3.37-1.195 5.604l-7.993-7.991c2.139 0 3.814-.335 5.396-1.084l.235-.105c1.399-.699 2.468-1.893 3.388-3.834l3.924 4.051c-1.863.893-3.056 1.96-3.755 3.359z`},child:[]}]})(e)}var pbe=Eu.withProps({variant:`subtle`,color:`gray`,size:`md`});function y5({pinned:e,onToggle:t}){let n=e?dbe:fbe,r=e?`Unpin`:`Pin`;return(0,R.jsx)(y_,{label:r,children:(0,R.jsx)(pbe,{"aria-label":r,onClick:t,children:(0,R.jsx)(n,{size:18})})})}var mbe=Eu.withProps({variant:`subtle`,color:`gray`,size:`md`,"aria-label":`Replay`});function b5({onReplay:e}){return(0,R.jsx)(y_,{label:`Replay`,children:(0,R.jsx)(mbe,{onClick:e,children:(0,R.jsx)(NK,{size:18})})})}var hbe=-32020,gbe=`=?base64?`,_be=`?=`,vbe=new Set([`mcp-method`,`mcp-name`,`mcp-protocol-version`]),ybe=`mcp-param-`,bbe=`io.modelcontextprotocol/protocolVersion`;function xbe(e){return vbe.has(e.toLowerCase())}function Sbe(e){return e.toLowerCase().startsWith(ybe)}function x5(e){return xbe(e)||Sbe(e)}function S5(e){if(!(e.length>=11&&e.startsWith(gbe)&&e.endsWith(_be)))return{value:e,encoded:!1,raw:e};let t=e.slice(9,e.length-2);try{let n=atob(t),r=Uint8Array.from(n,e=>e.charCodeAt(0));return{value:new TextDecoder().decode(r),encoded:!0,raw:e}}catch{return{value:e,encoded:!0,raw:e}}}function Cbe(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch{return null}let n=Array.isArray(t)?t:[t];for(let e of n){if(typeof e!=`object`||!e||!(`error`in e))continue;let t=e.error;if(typeof t!=`object`||!t)continue;let{code:n,message:r,data:i}=t;if(typeof n==`number`)return{code:n,message:typeof r==`string`?r:``,data:i}}return null}var wbe={[hbe]:{name:`HeaderMismatch`,description:`An Mcp-* header did not match the JSON-RPC body (SEP-2243). The server rejected the request pre-dispatch.`,expectedHttpStatus:400,httpRelevant:!0},[Sk.MissingRequiredClientCapability]:{name:`MissingRequiredClientCapability`,description:`The server requires a client capability that was not declared (SEP-2575).`,expectedHttpStatus:400,httpRelevant:!1},[Sk.UnsupportedProtocolVersion]:{name:`UnsupportedProtocolVersion`,description:`The requested protocol version is not supported (SEP-2575). The error body lists the supported versions.`,expectedHttpStatus:400,httpRelevant:!1},[Sk.MethodNotFound]:{name:`MethodNotFound`,description:`Unknown method. A JSON-RPC error body on an HTTP 404 marks a modern server — a legacy HTTP+SSE server returns a bare 404 with no body.`,expectedHttpStatus:404,httpRelevant:!0}};function Tbe(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(!Array.isArray(t))return;let n=t.filter(e=>typeof e==`string`);return n.length>0?n:void 0}function Ebe(e,t,n){let r=wbe[e];if(!r||e===Sk.MethodNotFound&&n!==404)return null;let i={code:e,...r};if(e===Sk.UnsupportedProtocolVersion){let e=Tbe(t);e&&(i.supported=e)}return i}function Dbe(e){if(!e)return null;try{let t=JSON.parse(e);return typeof t!=`object`||!t||Array.isArray(t)?null:t}catch{return null}}function C5(e,t){for(let[n,r]of Object.entries(e))if(n.toLowerCase()===t)return r}function Obe(e){let t=Dbe(e.requestBody);if(!t)return[];let n=[],r=C5(e.requestHeaders,`mcp-method`);r!==void 0&&typeof t.method==`string`&&n.push({header:`mcp-method`,expected:t.method,actual:r,ok:r===t.method});let i=C5(e.requestHeaders,`mcp-name`),a=typeof t.params?.name==`string`?t.params.name:typeof t.params?.uri==`string`?t.params.uri:void 0;if(i!==void 0&&a!==void 0){let e=S5(i).value;n.push({header:`mcp-name`,expected:a,actual:e,ok:e===a})}let o=C5(e.requestHeaders,`mcp-protocol-version`),s=t.params?._meta?.[bbe];return o!==void 0&&typeof s==`string`&&n.push({header:`mcp-protocol-version`,expected:s,actual:o,ok:o===s}),n}function w5(e){if(!e.error)return!1;let t=e.error.toLowerCase();return t.includes(`abort`)||t.includes(`cancel`)}function T5(e){return`method`in e.message?e.message.method:`response`}var kbe=new Set([`tools/call`,`prompts/get`,`resources/read`,`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`tasks/list`,`ping`]);function E5(e){return kbe.has(e)}function D5(e){let t=e.response;if(!t||`error`in t)return;let n=t.result;return n&&typeof n==`object`?n:void 0}function O5(e){let t=e.message;if(!(!(`params`in t)||!t.params))return t.params}function k5(e){let t=D5(e);if(t)return _A(t)?`input_required`:t.resultType===`complete`?`complete`:void 0}function Abe(e){let t=D5(e)?.requestState;if(typeof t==`string`&&t.length>0)return t;let n=O5(e)?.requestState;if(typeof n==`string`&&n.length>0)return n}function jbe(e){let t=O5(e)?._meta?.[rT];return typeof t==`string`?t:void 0}function Mbe(e){let t=[];for(let n of e){let e=Abe(n);if(e){let r=t[t.length-1];if(r?.kind===`mrtr`&&r.requestState===e){r.rounds.push(n);continue}t.push({kind:`mrtr`,requestState:e,rounds:[n]});continue}t.push({kind:`single`,entry:n})}return t}var Nbe=tm.withProps({withBorder:!0,padding:`md`,variant:`inset`}),A5=V.withProps({justify:`space-between`,wrap:`nowrap`}),j5=V.withProps({gap:`sm`,wrap:`nowrap`,miw:0}),M5=V.withProps({gap:`xs`,wrap:`nowrap`}),N5=H.withProps({size:`sm`,c:`dimmed`,ff:`monospace`}),Pbe=H.withProps({size:`sm`,fw:500}),Fbe=H.withProps({size:`sm`,fw:500,variant:`nowrap`}),Ibe=H.withProps({size:`sm`,c:`dimmed`}),Lbe=H.withProps({size:`sm`,c:`dimmed`}),Rbe=H.withProps({size:`sm`,ff:`monospace`}),zbe=V.withProps({gap:4,wrap:`nowrap`,miw:0}),Bbe=Jd.withProps({variant:`light`,color:`red`,icon:(0,R.jsx)(r3,{})}),Vbe=tf.withProps({component:`button`,type:`button`,size:`xs`}),Hbe=bl.withProps({scrollbarSize:6,flex:1,miw:0,viewportProps:{tabIndex:0}}),Ube=V.withProps({gap:`xs`,justify:`flex-end`});function Wbe(e){return e===`input_required`?`yellow`:`green`}function Gbe(e){return e===`input_required`?`input required`:`complete`}function Kbe(e){return`${e}ms`}function qbe(e){return e.toISOString()}function Jbe(e){return e.toISOString().slice(11,19)}function Ybe(e){let t=e.message;if(!(`params`in t)||!t.params)return;let n=t.params;if(typeof n.name==`string`)return n.name;if(typeof n.uri==`string`)return n.uri}function Xbe(e){let t=e.message;if(!(`params`in t)||!t.params)return;let n=t.params;return typeof n.uri==`string`?n.uri:void 0}function Zbe(e){return e.direction===`request`?e.response?`error`in e.response?`error`:`success`:`pending`:`none`}function Qbe(e){return e===`success`?`green`:e===`error`?`red`:`gray`}function $be(e){return e===`success`?`OK`:e===`error`?`Error`:`Pending`}function P5(e){return JSON.stringify(e)}function exe(e,t){let n=e.response&&`error`in e.response?e.response.error:`error`in e.message?e.message.error:void 0;return!n||typeof n.code!=`number`?null:Ebe(n.code,n.data,t)}function txe({error:e,onReveal:t}){return(0,R.jsx)(Bbe,{title:`${e.code} ${e.name}`,children:(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(H,{size:`xs`,children:e.description}),e.supported&&(0,R.jsxs)(H,{size:`xs`,children:[`Server supports: `,e.supported.join(`, `)]}),t&&(0,R.jsx)(Vbe,{onClick:t,children:`View the HTTP request in the Network tab →`})]})})}function F5({entry:e,isPinned:t,isListExpanded:n,onReplay:r,onTogglePin:i,embedded:a=!1,onRevealInNetwork:o,correlatedHttpStatus:s}){let[c,l]=(0,D.useState)(n),u=T5(e),d=Ybe(e),f=Xbe(e),p=Zbe(e),m=E5(u),h=k5(e),g=jbe(e);(0,D.useEffect)(()=>{l(n)},[n]);let _=e.origin&&(0,R.jsx)(abe,{direction:e.origin===`client`?`outgoing`:`incoming`}),v=exe(e,s),y=v&&(0,R.jsx)(ube,{code:v.code,name:v.name,description:v.description}),b=h&&(0,R.jsx)(Vp,{color:Wbe(h),variant:`status`,children:Gbe(h)}),x=p!==`none`&&!h&&(0,R.jsx)(Vp,{color:Qbe(p),variant:`status`,children:$be(p)}),S=g&&(0,R.jsxs)(zbe,{children:[(0,R.jsx)(Lbe,{children:`sub`}),(0,R.jsx)(R4,{value:g}),(0,R.jsx)(Rbe,{children:g})]}),C=e.duration!=null&&(0,R.jsx)(Ibe,{children:Kbe(e.duration)});return(0,R.jsx)(Nbe,{children:(0,R.jsxs)(U,{gap:`sm`,children:[a?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(A5,{children:[(0,R.jsxs)(j5,{children:[(0,R.jsx)(N5,{children:Jbe(e.timestamp)}),_]}),(0,R.jsxs)(M5,{children:[C,b,x,S]})]}),(0,R.jsxs)(A5,{children:[(0,R.jsxs)(j5,{flex:1,children:[(0,R.jsx)(v5,{method:u}),d&&(0,R.jsxs)(R.Fragment,{children:[f&&(0,R.jsx)(R4,{value:f}),(0,R.jsx)(Hbe,{children:(0,R.jsx)(Fbe,{children:d})})]})]}),(0,R.jsxs)(M5,{children:[m&&(0,R.jsx)(b5,{onReplay:r}),(0,R.jsx)(y5,{pinned:t,onToggle:i}),(0,R.jsx)(D3,{expanded:c,onToggle:()=>l(e=>!e)})]})]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(A5,{children:[(0,R.jsxs)(V,{gap:`sm`,children:[(0,R.jsx)(N5,{children:qbe(e.timestamp)}),_,(0,R.jsx)(v5,{method:u}),y,S,d&&(0,R.jsxs)(R.Fragment,{children:[f&&(0,R.jsx)(R4,{value:f}),(0,R.jsx)(Pbe,{children:d})]})]}),(0,R.jsxs)(V,{gap:`sm`,children:[C,b,x]})]}),(0,R.jsxs)(Ube,{children:[m&&(0,R.jsx)(b5,{onReplay:r}),(0,R.jsx)(y5,{pinned:t,onToggle:i}),(0,R.jsx)(D3,{expanded:c,onToggle:()=>l(e=>!e)})]})]}),(0,R.jsx)(ca,{in:c,children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(lm,{}),v&&(0,R.jsx)(txe,{error:v,onReveal:v.httpRelevant?o:void 0}),`params`in e.message&&e.message.params&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(H,{size:`sm`,children:`Parameters:`}),(0,R.jsx)($4,{block:{type:`text`,text:P5(e.message.params)},copyable:!0})]}),e.response&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(H,{size:`sm`,children:`Response:`}),(0,R.jsx)($4,{block:{type:`text`,text:P5(e.response)},copyable:!0})]})]})})]})})}var nxe=kl.withProps({withBorder:!0,p:`md`,radius:`md`}),rxe=V.withProps({justify:`space-between`,wrap:`nowrap`}),ixe=V.withProps({gap:`sm`,wrap:`nowrap`,miw:0}),axe=V.withProps({gap:`sm`,wrap:`nowrap`}),oxe=H.withProps({size:`sm`,fw:600,c:`dimmed`}),sxe=H.withProps({size:`xs`,fw:600,c:`dimmed`}),cxe=Vp.withProps({color:`blue`,variant:`outline`});function lxe(e){return e.response?`error`in e.response?`error`:k5(e)===`input_required`?`awaiting`:`complete`:`pending`}function uxe(e){switch(e){case`complete`:return`green`;case`error`:return`red`;case`awaiting`:return`yellow`;default:return`gray`}}function dxe(e){switch(e){case`complete`:return`Complete`;case`error`:return`Error`;case`awaiting`:return`Awaiting input`;default:return`Pending`}}function fxe(e){return e===1?`1 round`:`${e} rounds`}function pxe(e){return`Round ${e+1}`}function mxe({requestState:e,rounds:t,pinnedIds:n,isListExpanded:r,embedded:i=!1,onReplay:a,onTogglePin:o}){let[s,c]=(0,D.useState)(r);(0,D.useEffect)(()=>{c(r)},[r]);let l=[...t].sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),u=T5(l[0]),d=lxe(l[l.length-1]);return(0,R.jsx)(nxe,{"aria-label":`MRTR conversation ${e}`,children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsxs)(rxe,{children:[(0,R.jsxs)(ixe,{children:[(0,R.jsx)(v5,{method:u}),(0,R.jsx)(oxe,{children:`MRTR`}),(0,R.jsx)(cxe,{children:fxe(l.length)})]}),(0,R.jsxs)(axe,{children:[(0,R.jsx)(Vp,{variant:`status`,color:uxe(d),"data-testid":`mrtr-status`,children:dxe(d)}),(0,R.jsx)(D3,{expanded:s,ariaLabel:`${s?`Collapse`:`Expand`} MRTR conversation`,onToggle:()=>c(e=>!e)})]})]}),(0,R.jsx)(ca,{in:s,children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(lm,{}),l.map((e,t)=>(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(sxe,{children:pxe(t)}),(0,R.jsx)(F5,{entry:e,isPinned:n.has(e.id),isListExpanded:r,embedded:i,onReplay:()=>a(e.id),onTogglePin:()=>o(e.id)})]},e.id))]})})]})})}function I5({era:e}){return(0,R.jsx)(Vp,{variant:`outline`,color:R8(e)?`blue`:`gray`,children:P_e(e)})}var hxe=kl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),gxe=U.withProps({flex:1,align:`center`,justify:`center`}),_xe=H.withProps({c:`dimmed`,ta:`center`}),vxe=V.withProps({justify:`space-between`,mb:`sm`}),yxe=V.withProps({variant:`sectionHeader`,gap:`sm`,wrap:`nowrap`,p:`sm`}),bxe=wl.withProps({flex:1}),xxe=H.withProps({fw:600}),Sxe=V.withProps({gap:`sm`,wrap:`nowrap`}),L5=Xp.withProps({variant:`subtle`,size:`xs`});function Cxe(e){return`Pinned Messages (${e})`}function wxe(e){return`History (${e})`}function R5({onClear:e,onExport:t}){return(0,R.jsxs)(Sxe,{children:[(0,R.jsx)(L5,{onClick:e,children:`Clear`}),(0,R.jsx)(L5,{onClick:t,children:`Export`})]})}function z5({title:e,collapsible:t,hideHeaderWhenAlone:n=!1,open:r,onToggle:i,actions:a,children:o}){return t?(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(yxe,{bg:r?`var(--mantine-primary-color-light)`:void 0,children:[(0,R.jsx)(bxe,{"aria-expanded":r,onClick:i,children:(0,R.jsx)(xxe,{children:e})}),a]}),(0,R.jsx)(ca,{in:r,children:(0,R.jsx)(U,{gap:`md`,children:o})})]}):(0,R.jsxs)(U,{gap:`md`,children:[n?null:(0,R.jsx)(uv,{order:5,children:e}),(0,R.jsx)(U,{gap:`md`,children:o})]})}function Txe(e,t,n,r,i){let a=T5(e);if(!i&&(e.origin&&!n[e.origin]||r&&a!==r))return!1;if(t){let n=t.toLowerCase(),r=e.response?JSON.stringify(e.response):``;if(!`${a} ${e.id} ${JSON.stringify(e.message)} ${r}`.toLowerCase().includes(n))return!1}return!0}function Exe({entries:e,pinnedIds:t,searchText:n,methodFilter:r,visibleDirections:i,protocolEra:a,onClearAll:o,onExport:s,onClearSection:c,onExportSection:l,onReplay:u,onTogglePin:d,sortDirection:f,onSortChange:p,compact:m,onToggleCompact:h,embedded:g=!1,onRevealInNetwork:_,revealableIds:v,correlatedStatusById:y}){let b=_3(`protocol-list`),[x,S]=(0,D.useState)(!0),[C,w]=(0,D.useState)(!0),T=(0,D.useMemo)(()=>{let t=e.filter(e=>Txe(e,n,i,r,g)).sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime());return f===`newest-first`&&t.reverse(),t},[e,n,i,r,f,g]),E=(0,D.useMemo)(()=>T.filter(e=>t.has(e.id)),[T,t]),O=(0,D.useMemo)(()=>T.filter(e=>!t.has(e.id)),[T,t]),k=T.length>0,A=E.length>0&&O.length>0,j=(e,n)=>Mbe(e).map(e=>e.kind===`mrtr`?(0,R.jsx)(mxe,{requestState:e.requestState,rounds:e.rounds,pinnedIds:t,isListExpanded:!m,embedded:g,onReplay:u,onTogglePin:d},`mrtr-${e.requestState}-${e.rounds[0].id}`):(0,R.jsx)(F5,{entry:e.entry,isPinned:n,isListExpanded:!m,embedded:g,onReplay:()=>u(e.entry.id),onTogglePin:()=>d(e.entry.id),onRevealInNetwork:_&&v?.has(e.entry.id)?()=>_(e.entry.id):void 0,correlatedHttpStatus:y?.get(e.entry.id)},e.entry.id));return(0,R.jsxs)(hxe,{children:[(0,R.jsxs)(vxe,{children:[(0,R.jsxs)(V,{gap:`sm`,children:[(0,R.jsx)(uv,{order:4,children:`Messages`}),a&&(0,R.jsx)(I5,{era:a})]}),(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(i5,{value:f,onChange:p,"aria-label":`History sort direction`}),(0,R.jsx)(Xp,{variant:`default`,onClick:o,disabled:O.length===0,children:`Clear`}),(0,R.jsx)(Xp,{variant:`default`,onClick:s,disabled:!k,children:`Export`}),k&&(0,R.jsx)(c3,{compact:m,onToggle:h})]})]}),k?(0,R.jsx)(o5,{embedded:g,viewportRef:b,children:(0,R.jsxs)(U,{gap:`md`,children:[E.length>0&&(0,R.jsx)(z5,{title:Cxe(E.length),collapsible:A,open:x,onToggle:()=>S(e=>!e),actions:A?(0,R.jsx)(R5,{onClear:()=>c(`pinned`),onExport:()=>l(`pinned`)}):void 0,children:j(E,!0)}),O.length>0&&(0,R.jsx)(z5,{title:wxe(O.length),collapsible:A,hideHeaderWhenAlone:!0,open:C,onToggle:()=>w(e=>!e),actions:A?(0,R.jsx)(R5,{onClear:()=>c(`history`),onExport:()=>l(`history`)}):void 0,children:j(O,!1)})]})}):(0,R.jsx)(gxe,{children:(0,R.jsx)(_xe,{children:`No request history`})})]})}var Dxe=Dd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),Oxe=U.withProps({w:340,flex:`0 0 auto`}),kxe=tm.withProps({withBorder:!0,padding:`lg`});function B5({entries:e,pinnedIds:t,protocolEra:n,ui:r,onUiChange:i,onClearAll:a,onExport:o,onClearSection:s,onExportSection:c,onReplay:l,onTogglePin:u,sortDirection:d,onSortChange:f,compact:p,onToggleCompact:m,embedded:h=!1,onRevealInNetwork:g,revealableIds:_,correlatedStatusById:v}){let{search:y,methodFilter:b,visibleDirections:x}=r,S=(0,D.useMemo)(()=>Array.from(new Set(e.map(T5))).sort(),[e]),C=(0,D.useCallback)(()=>{i({...r,methodFilter:void 0}),a()},[r,i,a]),w=(0,D.useCallback)((e,t)=>{i({...r,visibleDirections:{...x,[e]:t}})},[r,x,i]),T=(0,D.useCallback)(()=>{let e=!Object.values(x).every(Boolean);i({...r,visibleDirections:{client:e,server:e}})},[r,x,i]);return(0,R.jsxs)(Dxe,{...h?{h:`100%`,pt:`md`}:{},children:[h?null:(0,R.jsx)(Oxe,{children:(0,R.jsx)(kxe,{children:(0,R.jsx)(tbe,{searchText:y,methodFilter:b,availableMethods:S,visibleDirections:x,onSearchChange:e=>i({...r,search:e}),onMethodFilterChange:e=>i({...r,methodFilter:e}),onToggleDirection:w,onToggleAllDirections:T})})}),(0,R.jsx)(Exe,{entries:e,pinnedIds:t,protocolEra:n,searchText:y,methodFilter:b,visibleDirections:x,onClearAll:C,onExport:o,onClearSection:s,onExportSection:c,onReplay:l,onTogglePin:u,sortDirection:d,onSortChange:f,compact:p,onToggleCompact:m,embedded:h,onRevealInNetwork:g,revealableIds:_,correlatedStatusById:v})]})}var V5=[`auth`,`transport`],Axe={auth:`violet`,transport:`blue`},jxe=Xp.withProps({variant:`subtle`,size:`xs`});function Mxe({filterText:e,visibleCategories:t,onFilterChange:n,onToggleCategory:r,onToggleAllCategories:i}){let a=V5.every(e=>t[e]);return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(uv,{order:4,children:`Network`}),(0,R.jsx)(ov,{placeholder:`Search...`,value:e,onChange:e=>n(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:e?(0,R.jsx)(d3,{onClick:()=>n(``)}):null}),(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(uv,{order:5,children:`Filter by Category`}),(0,R.jsx)(jxe,{onClick:i,children:a?`Deselect All`:`Select All`})]}),(0,R.jsx)(U,{gap:`xs`,children:V5.map(e=>(0,R.jsx)(Z8,{label:e,color:Axe[e],active:t[e],onToggle:t=>r(e,t)},e))})]})}var Nxe={transport:`var(--inspector-badge-transport-bg)`,auth:`var(--inspector-badge-auth-bg)`},Pxe={transport:`var(--inspector-badge-transport-fg)`,auth:`var(--inspector-badge-auth-fg)`};function H5({category:e}){return(0,R.jsx)(Vp,{autoContrast:!1,bg:Nxe[e],c:Pxe[e],children:e})}var U5=new Set([`access_token`,`refresh_token`,`id_token`,`client_secret`,`registration_access_token`]),Fxe=new Set([...U5,`code`,`code_verifier`,`client_assertion`]),W5=`••••••••`;function G5(e,t){return e.has(t.toLowerCase())}function Ixe(e){return e==null?!1:typeof e!=`string`||e.length>0}function K5(e){if(Array.isArray(e)){let t=!1;return{node:e.map(e=>{let n=K5(e);return t||=n.masked,n.node}),masked:t}}if(typeof e==`object`&&e){let t=!1,n={};for(let[r,i]of Object.entries(e))if(G5(U5,r)&&Ixe(i))n[r]=W5,t=!0;else{let e=K5(i);n[r]=e.node,t||=e.masked}return{node:n,masked:t}}return{node:e,masked:!1}}function q5(e){let t;try{t=JSON.parse(e)}catch{return{masked:e,hasSecrets:!1}}let{node:n,masked:r}=K5(t);return{masked:JSON.stringify(n,null,2),hasSecrets:r}}function J5(e){let t=!1,n=e.split(`&`).map(e=>{let n=e.indexOf(`=`);if(n===-1)return e;let r=e.slice(0,n),i=e.slice(n+1),a;try{a=decodeURIComponent(r)}catch{a=r}return G5(Fxe,a)&&i.length>0?(t=!0,`${r}=${W5}`):e}).join(`&`);return{masked:t?n:e,hasSecrets:t}}function Lxe(e,t){let n=(t??``).toLowerCase();if(n)return n.includes(`json`)?q5(e):n.includes(`x-www-form-urlencoded`)?J5(e):{masked:e,hasSecrets:!1};try{JSON.parse(e)}catch{return J5(e)}return q5(e)}var Rxe={discovery:`Discovery`,registration:`Registration`,authorize:`Authorize`,token:`Token`};function zxe(e){let t;try{t=new URL(e).pathname.toLowerCase()}catch{t=e.toLowerCase().split(/[?#]/)[0]??``}if(t.includes(`/.well-known/oauth-protected-resource`)||t.includes(`/.well-known/oauth-authorization-server`)||t.includes(`/.well-known/openid-configuration`))return`discovery`;let n=t.replace(/\/+$/,``);if(n.endsWith(`/register`))return`registration`;if(n.endsWith(`/token`))return`token`;if(n.endsWith(`/authorize`))return`authorize`}function Bxe(e){return Rxe[e]}var Vxe=tm.withProps({withBorder:!0,padding:`md`,variant:`inset`}),Y5=V.withProps({justify:`space-between`,wrap:`nowrap`}),X5=H.withProps({size:`sm`,c:`dimmed`,ff:`monospace`}),Hxe=H.withProps({size:`sm`,fw:500,truncate:`end`}),Uxe=H.withProps({size:`sm`,fw:500,variant:`nowrap`}),Wxe=V.withProps({gap:`sm`,wrap:`nowrap`,miw:0}),Z5=V.withProps({gap:`sm`,wrap:`nowrap`}),Gxe=H.withProps({size:`sm`,c:`dimmed`}),Q5=H.withProps({size:`xs`,c:`dimmed`}),$5=H.withProps({size:`sm`,fw:500}),Kxe=1e5;function qxe(e){return`${e}ms`}function Jxe(e){return e.toISOString()}function Yxe(e){return e.toISOString().slice(11,19)}function Xxe(e){if(w5(e))return`gray`;if(e.error)return`red`;let t=e.responseStatus;return t===void 0?`gray`:t>=500?`red`:t>=400?`orange`:t>=300?`yellow`:t>=200?`green`:`gray`}function Zxe(e){return w5(e)?`Cancelled`:e.error?`Error`:e.responseStatus===void 0?`Pending`:e.responseStatusText?`${e.responseStatus} ${e.responseStatusText}`:`${e.responseStatus}`}function e7(e){return Wz(e.method,e.responseHeaders?.[`content-type`])}var Qxe=H.withProps({size:`xs`,ff:`monospace`,fw:500}),$xe=H.withProps({size:`xs`,ff:`monospace`,fw:600,c:`var(--inspector-mcp-header-accent)`}),eSe=H.withProps({size:`xs`,ff:`monospace`,variant:`monoBreak`}),tSe=H.withProps({size:`xs`,ff:`monospace`,variant:`monoBreak`,c:`var(--inspector-danger-text)`}),nSe=H.withProps({component:`span`,role:`img`,c:`var(--inspector-danger-text)`}),rSe=V.withProps({gap:`xs`,wrap:`nowrap`,align:`center`}),t7=y_.withProps({withArrow:!0,multiline:!0,w:280}),iSe=Vp.withProps({size:`xs`,color:`gray`,variant:`light`}),aSe=av.withProps({striped:!0,withColumnBorders:!0,fz:`xs`}),oSe=Vp.withProps({color:`violet`,variant:`light`}),sSe=V.withProps({gap:`xs`,wrap:`nowrap`,justify:`space-between`}),cSe=bl.withProps({scrollbarSize:6,flex:1,miw:0,viewportProps:{tabIndex:0}}),lSe=V.withProps({gap:`sm`,wrap:`nowrap`,miw:0,flex:1}),uSe=V.withProps({gap:`xs`,justify:`flex-end`}),dSe=H.withProps({span:!0,ff:`monospace`}),fSe=H.withProps({size:`xs`,ff:`monospace`,c:`red`});function pSe({name:e,value:t,consistency:n}){let r=x5(e)?S5(t):{value:t,encoded:!1,raw:t},i=n!==void 0&&!n.ok;return(0,R.jsxs)(rSe,{children:[i?(0,R.jsx)(tSe,{children:r.value}):(0,R.jsx)(eSe,{children:r.value}),r.encoded&&(0,R.jsx)(t7,{label:`base64 sentinel — raw: ${r.raw}`,children:(0,R.jsx)(iSe,{children:`base64`})}),i&&(0,R.jsx)(t7,{label:`Expected: ${n.expected}`,children:(0,R.jsx)(nSe,{"aria-label":`Header does not match body; expected ${n.expected}`,children:(0,R.jsx)(r3,{})})})]})}function n7({headers:e,consistency:t}){let n=Object.entries(e);if(n.length===0)return(0,R.jsx)(Q5,{children:`(none)`});let r=new Map((t??[]).map(e=>[e.header,e]));return(0,R.jsx)(aSe,{children:(0,R.jsx)(av.Tbody,{children:n.map(([e,t])=>(0,R.jsxs)(av.Tr,{children:[(0,R.jsx)(av.Td,{children:x5(e)?(0,R.jsx)($xe,{children:e}):(0,R.jsx)(Qxe,{children:e})}),(0,R.jsx)(av.Td,{children:(0,R.jsx)(pSe,{name:e,value:t,consistency:r.get(e.toLowerCase())})})]},e))})})}var mSe=Jd.withProps({variant:`light`,color:`gray`,title:`Request cancelled`,icon:(0,R.jsx)(r3,{})}),hSe=Xp.withProps({variant:`subtle`,size:`compact-xs`});function r7({body:e,contentType:t}){let[n,r]=(0,D.useState)(!1),i=e.length>Kxe,{masked:a,hasSecrets:o}=(0,D.useMemo)(()=>i?{masked:e,hasSecrets:!1}:Lxe(e,t),[i,e,t]);return i?(0,R.jsxs)(Q5,{children:[`Body too large to preview (`,e.length,` characters)`]}):o?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(Q5,{"aria-live":`polite`,children:n?`Secrets revealed`:`Secrets hidden`}),(0,R.jsx)(hSe,{onClick:()=>r(e=>!e),"aria-label":n?`Hide secrets in body`:`Reveal secrets in body`,children:n?`Hide`:`Reveal`})]}),(0,R.jsx)($4,{block:{type:`text`,text:n?e:a},copyable:!0})]}):(0,R.jsx)($4,{block:{type:`text`,text:e},copyable:!0})}function gSe({entry:e,isListExpanded:t,embedded:n=!1,revealed:r=!1,onRevealComplete:i}){let[a,o]=(0,D.useState)(t),s=(0,D.useRef)(null);(0,D.useEffect)(()=>{o(t)},[t]),(0,D.useEffect)(()=>{if(!r)return;o(!0);let e=requestAnimationFrame(()=>{s.current?.scrollIntoView({behavior:`smooth`,block:`center`}),i?.()});return()=>cancelAnimationFrame(e)},[r,i]);let c=e.category===`auth`?zxe(e.url):void 0,l=c?(0,R.jsx)(oSe,{children:Bxe(c)}):null,u=(0,D.useMemo)(()=>Obe(e),[e]),d=w5(e),f=(0,R.jsxs)(R.Fragment,{children:[e.duration!=null&&(0,R.jsx)(Gxe,{children:qxe(e.duration)}),e7(e)&&(0,R.jsx)(Vp,{color:`orange`,children:`SSE`}),(0,R.jsx)(Vp,{color:Xxe(e),variant:`status`,children:Zxe(e)})]}),p=(0,R.jsx)(D3,{expanded:a,onToggle:()=>o(e=>!e)});return(0,R.jsx)(Vxe,{ref:s,children:(0,R.jsxs)(U,{gap:`sm`,children:[n?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(Y5,{children:[(0,R.jsxs)(Wxe,{children:[(0,R.jsx)(X5,{children:Yxe(e.timestamp)}),(0,R.jsx)(v5,{method:e.method}),(0,R.jsx)(H5,{category:e.category}),l]}),(0,R.jsx)(Z5,{children:f})]}),(0,R.jsxs)(sSe,{children:[(0,R.jsx)(R4,{value:e.url}),(0,R.jsx)(cSe,{children:(0,R.jsx)(Uxe,{children:e.url})}),p]})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Y5,{children:[(0,R.jsxs)(lSe,{children:[(0,R.jsx)(X5,{children:Jxe(e.timestamp)}),(0,R.jsx)(v5,{method:e.method}),(0,R.jsx)(H5,{category:e.category}),l,(0,R.jsx)(R4,{value:e.url}),(0,R.jsx)(Hxe,{children:e.url})]}),(0,R.jsx)(Z5,{children:f})]}),(0,R.jsx)(uSe,{children:p})]}),(0,R.jsx)(ca,{in:a,children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(lm,{}),d&&(0,R.jsx)(mSe,{children:(0,R.jsxs)(H,{size:`xs`,children:[`Cancellation appears as a connection abort — the modern transport aborts the request stream instead of sending a`,` `,(0,R.jsx)(dSe,{children:`notifications/cancelled`}),` frame (SEP-2575).`]})}),(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Request Headers`}),(0,R.jsx)(n7,{headers:e.requestHeaders,consistency:u})]}),e.requestBody&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Request Body`}),(0,R.jsx)(r7,{body:e.requestBody,contentType:e.requestHeaders[`content-type`]},`${e.requestHeaders[`content-type`]??``}|${e.requestBody}`)]}),e.responseHeaders&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Response Headers`}),(0,R.jsx)(n7,{headers:e.responseHeaders})]}),e.responseStatus!==void 0&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($5,{children:`Response Body`}),e.responseBody?(0,R.jsx)(r7,{body:e.responseBody,contentType:e.responseHeaders?.[`content-type`]},`${e.responseHeaders?.[`content-type`]??``}|${e.responseBody}`):(0,R.jsx)(Q5,{children:e7(e)?`Long-lived stream — body not captured`:`(empty)`})]}),e.error&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)($5,{c:`red`,children:`Error`}),(0,R.jsx)(fSe,{children:e.error})]})]})})]})})}var _Se=kl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),vSe=U.withProps({flex:1,align:`center`,justify:`center`}),ySe=H.withProps({c:`dimmed`,ta:`center`}),bSe=V.withProps({justify:`space-between`,mb:`sm`});function xSe(e){return`Requests (${e})`}function i7(e){return e?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`
|
|
295
|
-
`):``}function SSe(e,t,n,r){if(!r&&!n[e.category])return!1;if(t){let n=t.toLowerCase(),r=e.responseStatus===void 0?``:String(e.responseStatus);if(![e.method,e.url,r,e.responseStatusText??``,i7(e.requestHeaders),i7(e.responseHeaders),e.requestBody??``,e.responseBody??``,e.error??``].some(e=>e.toLowerCase().includes(n)))return!1}return!0}function CSe({entries:e,filterText:t,visibleCategories:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,compact:s,onToggleCompact:c,embedded:l=!1,revealId:u,onRevealComplete:d}){let f=_3(`network-stream`),p=(0,D.useMemo)(()=>{let r=e.filter(e=>SSe(e,t,n,l)).sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime());return a===`newest-first`&&r.reverse(),r},[e,t,n,a,l]),m=e.length>0,h=p.length>0;return(0,R.jsxs)(_Se,{children:[(0,R.jsxs)(bSe,{children:[(0,R.jsx)(uv,{order:4,children:xSe(p.length)}),(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(i5,{value:a,onChange:o,"aria-label":`Network sort direction`}),(0,R.jsx)(Xp,{variant:`default`,onClick:r,disabled:!m,children:`Clear`}),(0,R.jsx)(Xp,{variant:`default`,onClick:i,disabled:!m,children:`Export`}),h&&(0,R.jsx)(c3,{compact:s,onToggle:c})]})]}),h?(0,R.jsx)(o5,{embedded:l,viewportRef:f,constrainContentWidth:!0,children:(0,R.jsx)(U,{gap:`md`,children:p.map(e=>(0,R.jsx)(gSe,{entry:e,isListExpanded:!s,embedded:l,revealed:e.id===u,onRevealComplete:d},e.id))})}):(0,R.jsx)(vSe,{children:(0,R.jsx)(ySe,{children:`No network requests`})})]})}var a7={auth:!0,transport:!0},wSe={auth:!1,transport:!1},TSe=Dd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),ESe=U.withProps({w:340,flex:`0 0 auto`}),DSe=tm.withProps({withBorder:!0,padding:`lg`});function o7({entries:e,ui:t,onUiChange:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,compact:s,onToggleCompact:c,embedded:l=!1,revealId:u,onRevealComplete:d}){let{filterText:f,visibleCategories:p}=t;function m(e,r){n({...t,visibleCategories:{...p,[e]:r}})}function h(){let e=Object.values(p).every(Boolean);n({...t,visibleCategories:e?wSe:a7})}return(0,R.jsxs)(TSe,{...l?{h:`100%`,pt:`md`}:{},children:[l?null:(0,R.jsx)(ESe,{children:(0,R.jsx)(DSe,{children:(0,R.jsx)(Mxe,{filterText:f,visibleCategories:p,onFilterChange:e=>n({...t,filterText:e}),onToggleCategory:m,onToggleAllCategories:h})})}),(0,R.jsx)(CSe,{entries:e,filterText:f,visibleCategories:p,onClear:r,onExport:i,sortDirection:a,onSortChange:o,compact:s,onToggleCompact:c,embedded:l,revealId:u,onRevealComplete:d})]})}var OSe=Dd.withProps({variant:`screen`,h:`calc(100dvh - var(--app-shell-header-height, 0px) - var(--app-shell-footer-height, 0px))`,gap:`md`,p:`xl`}),kSe=U.withProps({w:340,flex:`0 0 auto`}),ASe=tm.withProps({withBorder:!0,padding:`lg`}),jSe=kl.withProps({withBorder:!0,p:`lg`,flex:1,variant:`panel`}),MSe=V.withProps({justify:`space-between`,mb:`sm`}),NSe=ov.withProps({placeholder:`Search...`,rightSectionPointerEvents:`auto`}),PSe=U.withProps({flex:1,align:`center`,justify:`center`}),FSe=V.withProps({gap:`sm`,wrap:`nowrap`,align:`flex-start`}),ISe=H.withProps({size:`sm`,ff:`monospace`,c:`dimmed`,flex:`0 0 auto`}),LSe=H.withProps({size:`sm`,ff:`monospace`,variant:`consoleLine`,flex:1});function RSe(e){return e.toLocaleTimeString()}function zSe(e,t){return!t||e.message.toLowerCase().includes(t.toLowerCase())}function s7({entries:e,ui:t,onUiChange:n,onClear:r,onExport:i,sortDirection:a,onSortChange:o,embedded:s=!1}){let{filterText:c}=t,l=_3(`console-stream`),u=(0,D.useMemo)(()=>{let t=e.filter(e=>zSe(e,c)).sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime());return a===`newest-first`&&t.reverse(),t},[e,c,a]);return(0,R.jsxs)(OSe,{...s?{h:`100%`,pt:`md`}:{},children:[s?null:(0,R.jsx)(kSe,{children:(0,R.jsx)(ASe,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(uv,{order:4,children:`Console`}),(0,R.jsx)(NSe,{value:c,onChange:e=>n({filterText:e.currentTarget.value}),rightSection:c?(0,R.jsx)(d3,{onClick:()=>n({filterText:``})}):null})]})})}),(0,R.jsxs)(jSe,{children:[(0,R.jsxs)(MSe,{children:[(0,R.jsx)(uv,{order:4,children:`Server Console`}),(0,R.jsxs)(V,{children:[(0,R.jsx)(i5,{value:a,onChange:o,"aria-label":`Console sort direction`}),(0,R.jsx)(Xp,{variant:`default`,onClick:r,disabled:e.length===0,children:`Clear`}),(0,R.jsx)(Xp,{variant:`default`,onClick:i,disabled:e.length===0,children:`Export`})]})]}),u.length>0?(0,R.jsx)(o5,{embedded:s,viewportRef:l,children:(0,R.jsx)(U,{gap:`xs`,children:u.map((e,t)=>(0,R.jsxs)(FSe,{children:[(0,R.jsx)(ISe,{children:RSe(e.timestamp)}),(0,R.jsx)(LSe,{children:e.message})]},`${e.timestamp.getTime()}-${t}`))})}):(0,R.jsx)(PSe,{children:(0,R.jsx)(H,{c:`dimmed`,children:`No console output`})})]})]})}var BSe=Dd.withProps({direction:`column`,pos:`absolute`,top:0,left:0,right:0});function c7({active:e,children:t,fill:n=!1}){return(0,R.jsx)(Xl,{mounted:e,transition:`fade-up`,duration:350,exitDuration:250,timingFunction:`ease`,children:e=>(0,R.jsx)(BSe,{style:e,bottom:n?0:void 0,children:t})})}var VSe=V.withProps({wrap:`nowrap`,gap:`sm`,px:`xl`,py:`sm`}),HSe=ov.withProps({placeholder:`Search...`,size:`sm`,flex:1,miw:0,"aria-label":`Search`}),USe=C_.withProps({size:`sm`,"aria-label":`Monitoring screen`});function WSe({tabs:e,value:t,onChange:n,searchValue:r,onSearchChange:i}){return(0,R.jsxs)(VSe,{children:[(0,R.jsx)(USe,{value:t,onChange:n,data:e}),(0,R.jsx)(HSe,{value:r,onChange:e=>i(e.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:r?(0,R.jsx)(d3,{onClick:()=>i(``)}):null})]})}var GSe=U.withProps({h:`100%`,gap:0,pt:`md`}),KSe=U.withProps({pos:`relative`,flex:1,mih:0,gap:0});function qSe({tabs:e,value:t,onChange:n,searchValue:r,onSearchChange:i,screens:a}){return(0,R.jsxs)(GSe,{children:[(0,R.jsx)(WSe,{tabs:e,value:t,onChange:n,searchValue:r,onSearchChange:i}),(0,R.jsx)(KSe,{children:e.map(e=>(0,R.jsx)(c7,{active:e===t,fill:!0,children:a[e]},e))})]})}var JSe=Dd.withProps({role:`separator`,"aria-orientation":`vertical`,tabIndex:0,className:`resize-handle`});function l7(e,t,n){return Math.min(n,Math.max(t,e))}function YSe({value:e,min:t,max:n,step:r=16,onChange:i,onCommit:a,"aria-label":o=`Resize panel`}){let s=(0,D.useRef)(null);(0,D.useEffect)(()=>()=>document.body.classList.remove(`resizing-col`),[]);function c(t){s.current={startX:t.clientX,startWidth:e},t.currentTarget.setPointerCapture?.(t.pointerId),document.body.classList.add(`resizing-col`)}function l(e){s.current&&i(l7(s.current.startWidth+(s.current.startX-e.clientX),t,n))}function u(e){if(!s.current)return;let r=l7(s.current.startWidth+(s.current.startX-e.clientX),t,n);s.current=null,e.currentTarget.releasePointerCapture?.(e.pointerId),document.body.classList.remove(`resizing-col`),a(r)}function d(o){let s=o.key===`ArrowLeft`?r:o.key===`ArrowRight`?-r:0;if(s===0)return;o.preventDefault();let c=l7(e+s,t,n);i(c),a(c)}return(0,R.jsx)(JSe,{"aria-valuenow":e,"aria-valuemin":t,"aria-valuemax":n,"aria-label":o,onPointerDown:c,onPointerMove:l,onPointerUp:u,onPointerCancel:u,onKeyDown:d})}var u7=`Servers`,XSe=[`Apps`,`Tools`,`Prompts`,`Resources`,`Tasks`,`Logs`,`Protocol`,`Network`];function d7(e){return XSe.includes(e)}function f7(e){if(!e)return null;try{let t=JSON.parse(e);if(typeof t==`object`&&t&&!Array.isArray(t)&&`id`in t){let e=t.id;if(typeof e==`string`||typeof e==`number`)return e}}catch{}return null}function p7(e){let t=e.message;return`id`in t?t.id:void 0}function ZSe(e){let t=new Map;for(let n of e){if(n.category!==`transport`)continue;let e=f7(n.requestBody);if(e===null)continue;let r=Cbe(n.responseBody);r&&t.set(String(e),{jsonrpc:`2.0`,id:e,error:{code:r.code,message:r.message,...r.data===void 0?{}:{data:r.data}}})}return t}function QSe(e,t){let n=p7(e);if(n===void 0)return;let r;for(let e of t){if(e.category!==`transport`)continue;let t=f7(e.requestBody);t!==null&&String(t)===String(n)&&(r=e)}return r}function $Se(e,t){let n=new Set;for(let e of t){if(e.category!==`transport`)continue;let t=f7(e.requestBody);t!==null&&n.add(String(t))}let r=new Set;for(let t of e){let e=p7(t);e!==void 0&&n.has(String(e))&&r.add(t.id)}return r}function eCe(e,t){let n=new Map;for(let e of t){if(e.category!==`transport`||e.responseStatus===void 0)continue;let t=f7(e.requestBody);t!==null&&n.set(String(t),e.responseStatus)}let r=new Map;for(let t of e){let e=p7(t);if(e===void 0)continue;let i=n.get(String(e));i!==void 0&&r.set(t.id,i)}return r}function tCe(e,t){let n=ZSe(t);if(n.size===0)return e;let r=!1,i=e.map(e=>{if(e.direction!==`request`||e.response)return e;let t=p7(e);if(t===void 0)return e;let i=n.get(String(t));return i?(r=!0,{...e,response:i}):e});return r?i:e}var m7=`newest-first`;function nCe(e){return e===`oldest-first`||e===`newest-first`?e:m7}function rCe(e){return e}var h7=!0;function iCe(e){return e===`true`||e!==`false`&&h7}function aCe(e){return e?`true`:`false`}function g7(e){return dn({key:`inspector.sortDirection.${e}`,defaultValue:m7,deserialize:nCe,serialize:rCe,getInitialValueInEffect:!1})}function _7(e,t){return dn({key:`inspector.listCompact.${e}`,defaultValue:t,deserialize:iCe,serialize:aCe,getInitialValueInEffect:!1})}var v7=u7,y7=`Tasks`,b7=`Logs`,x7=`Protocol`,S7=`Network`,C7=`Console`;function oCe(e,t,n){if(e.name?.trim())return e;let r=t.find(e=>e.id===n)?.name;return r?{...e,name:r}:e}var sCe=[v7,`Apps`,`Tools`,`Prompts`,`Resources`,y7,b7,x7,S7,C7],w7=[y7,b7,x7,S7,C7];function T7(e){return e===y7||e===b7||e===x7||e===S7||e===C7}var E7=320,D7=720,O7=420,cCe=16;function lCe(e){return Math.min(D7,Math.max(E7,e))}var k7=!1;function uCe(e){return e===`true`||e!==`false`&&k7}function dCe(e){return e?`true`:`false`}var A7=b7;function fCe(e){return e!==void 0&&T7(e)?e:A7}function pCe(e){return e}function mCe(e){let t=e===void 0?NaN:Number.parseInt(e,10);return Number.isFinite(t)?lCe(t):O7}function hCe(e){return String(e)}var gCe=U.withProps({pos:`relative`,gap:0,flex:1,mih:`100%`,miw:0}),_Ce=Dd.withProps({direction:`row`,gap:0,h:`100%`,w:`100%`}),vCe=32,yCe=V.withProps({h:`100%`,px:`xl`,justify:`space-between`,align:`center`,wrap:`nowrap`}),bCe=U.withProps({flex:`0 0 auto`,h:`100%`,gap:0,miw:0}),j7=300,xCe={in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(100%)`},common:{transformOrigin:`right center`},transitionProperty:`transform, opacity`},SCe=V.withProps({wrap:`nowrap`,align:`stretch`,gap:0,h:`100%`,flex:`0 0 auto`});function CCe({deepLink:e,deepLinkStatus:t,servers:n,serverListWritable:r=!0,activeServer:i,erroredServerId:a,connectedServerId:o,version:s,connectionStatus:c,connectErrorMessage:l,initializeResult:u,latencyMs:d,tools:f,excludedTools:p=[],prompts:m,resources:h,resourceTemplates:g,toolsListChanged:_,promptsListChanged:v,resourcesListChanged:y,subscriptions:b,subscriptionStreamState:x,logs:S,tasks:C,progressByTaskId:w,protocol:T,protocolEra:E,network:O,stderrLogs:k,toolCallState:A,getPromptState:j,readResourceState:M,toolsUi:N,promptsUi:ee,resourcesUi:te,appsUi:P,tasksUi:F,logsUi:I,protocolUi:ne,networkUi:re,consoleUi:ie,currentLogLevel:ae,sandboxPath:oe,bridgeFactory:se,appRendererRef:ce,pinnedProtocolIds:le,onToggleTheme:ue,onOpenClientSettings:de,onToggleConnection:fe,onDisconnect:pe,onServerAdd:me,onServerImportConfig:he,onServerImportJson:ge,onServerExport:_e,onConnectionInfo:ve,onServerSettings:ye,onServerEdit:be,onServerClone:xe,onServerRemove:Se,onServerReorder:Ce,highlightedServerIds:we,onClearHighlight:Te,serverSupportsTaskToolCalls:Ee,onToolsUiChange:De,onCallTool:Oe,onCancelToolCall:ke,onClearToolResult:Ae,onReadResourceContents:je,onRefreshTools:Me,toolsPagination:Ne,promptsPagination:Pe,resourcesPagination:Fe,onPromptsUiChange:Ie,onGetPrompt:Le,onCopyPromptMessages:Re,onRefreshPrompts:ze,onResourcesUiChange:Be,onReadResource:Ve,onSubscribeResource:He,onUnsubscribeResource:Ue,onRefreshResources:We,onCompleteArgument:Ge,completionsSupported:Ke,subscriptionsSupported:qe,onTasksUiChange:Je,onCancelTask:Ye,onClearCompletedTasks:Xe,onRefreshTasks:Ze,onSetLogLevel:Qe,modernLogLevel:$e=null,onSetModernLogLevel:L,onLogsUiChange:et,onClearLogs:tt,onExportLogs:nt,onProtocolUiChange:rt,onClearProtocol:it,onExportProtocol:at,onClearProtocolSection:ot,onExportProtocolSection:st,onReplayProtocol:ct,onTogglePinProtocol:lt,onNetworkUiChange:ut,onClearNetwork:dt,onExportNetwork:ft,onConsoleUiChange:pt,onClearConsole:mt,onExportConsole:ht,onAppsUiChange:gt,onSelectApp:_t,onOpenApp:vt,onCloseApp:yt,onAppError:bt,onRefreshApps:xt,activeTab:St,onActiveTabChange:Ct}){let[wt,Tt]=g7(`logs`),[Et,Dt]=g7(`protocol`),[Ot,kt]=g7(`network`),[At,jt]=g7(`console`),[Mt,Nt]=_7(`protocol`,h7),[Pt,Ft]=_7(`network`,h7),[It,Lt]=_7(`servers`,!1),[Rt,zt]=_7(`resources`,!1),[Bt,Vt]=dn({key:`inspector.monitor.pinned`,defaultValue:k7,deserialize:uCe,serialize:dCe,getInitialValueInEffect:!1}),[Ht,Ut]=dn({key:`inspector.monitor.tab`,defaultValue:A7,deserialize:fCe,serialize:pCe,getInitialValueInEffect:!1}),[Wt,Gt]=dn({key:`inspector.monitor.width`,defaultValue:O7,deserialize:mCe,serialize:hCe,getInitialValueInEffect:!1}),[Kt,qt]=(0,D.useState)(null),Jt=Kt??Wt,Yt=(0,D.useRef)(c);(0,D.useEffect)(()=>{let e=Yt.current;Yt.current=c,(c===`connected`&&e!==`connected`||c===`error`&&e!==`error`&&e!==`connected`)&&Vt(!0)},[c,Vt]);let Xt=(0,D.useMemo)(()=>f.filter(e=>{try{return dK(e)}catch{return!1}}),[f]),Zt=(0,D.useMemo)(()=>{if(c!==`connected`)return[v7];let e=n.find(e=>e.id===i),t=e?SN(e.config)===`stdio`:!1,r=u?.capabilities,a=r?.tools!==void 0,o=a&&Xt.length>0,s=r?.prompts!==void 0,l=r?.resources!==void 0,d=r?.tasks!==void 0||r?.extensions?.[`io.modelcontextprotocol/tasks`]!==void 0,f=r?.logging!==void 0;return sCe.filter(e=>!(e===S7&&t||e===C7&&!t||e===`Tools`&&!a||e===`Apps`&&!o||e===`Prompts`&&!s||e===`Resources`&&!l||e===`Tasks`&&!d||e===`Logs`&&!f))},[c,n,i,u,Xt]),Qt=c===`connected`,$t=c===`error`&&a!==void 0,en=(0,D.useMemo)(()=>{if(Qt)return Zt.filter(e=>w7.includes(e));if($t){let e=[];return k.length>0&&e.push(C7),O.length>0&&e.push(S7),T.length>0&&e.push(x7),e}return[]},[Qt,$t,Zt,k,O,T]),tn=(Qt||$t)&&en.length>0,nn=Bt&&tn,rn=(0,D.useMemo)(()=>nn?Zt.filter(e=>!w7.includes(e)):Zt,[nn,Zt]),an=rn.find(e=>e!==v7)??v7,on=rn.includes(St)?St:nn?an:v7,sn=(0,D.useRef)(!1);(0,D.useEffect)(()=>{if(!e?.openApp||sn.current||c!==`connected`||!Zt.includes(`Apps`))return;let t=Xt.find(t=>t.name===e.openApp);if(!t)return;sn.current=!0;let n={...y3(v3(t.inputSchema)??{}),...e.appArgs};Ct(`Apps`),gt({...P,selectedAppName:t.name,formValues:n}),_t(t.name)},[e,c,Zt,Xt,P,Ct,gt,_t]);let cn=en.includes(Ht)&&T7(Ht)?Ht:en.find(T7)??b7;function ln(e){Ut(e),Vt(!0)}function un(e){let t=T.find(t=>t.id===e);if(!t)return;let n=QSe(t,O);n&&(ut({filterText:``,visibleCategories:{...re.visibleCategories,[n.category]:!0}}),vn(``),nn?ln(S7):Ct(S7),bn(n.id))}function fn(e){T7(e)&&Ut(e)}function pn(){Ct(on),Vt(!1)}function mn(){nn?pn():ln(cn)}let hn=tn?{open:nn,onToggle:mn}:void 0;function gn(e){Gt(e),qt(null)}let[_n,vn]=(0,D.useState)(``),[yn,bn]=(0,D.useState)(void 0),xn=(0,D.useMemo)(()=>$Se(T,O),[T,O]),Sn=(0,D.useMemo)(()=>eCe(T,O),[T,O]),Cn=(0,D.useMemo)(()=>n.map(e=>e.id===i?{...e,connection:{status:c,...u?.protocolVersion?{protocolVersion:u.protocolVersion}:{}}}:{...e,connection:{status:`disconnected`}}),[n,i,c,u]),wn=wN(c)?void 0:i,Tn={entries:S,currentLevel:ae,ui:I,onUiChange:et,onSetLevel:Qe,protocolEra:E,modernLogLevel:$e,onSetModernLogLevel:L,onClear:tt,onExport:nt,sortDirection:wt,onSortChange:Tt},En={entries:T,protocolEra:E,pinnedIds:le??new Set,ui:ne,onUiChange:rt,onClearAll:it,onExport:at,onClearSection:ot,onExportSection:st,onReplay:ct,onTogglePin:lt,sortDirection:Et,onSortChange:Dt,compact:Mt,onToggleCompact:()=>Nt(e=>!e),onRevealInNetwork:un,revealableIds:xn,correlatedStatusById:Sn},Dn={entries:O,ui:re,onUiChange:ut,onClear:dt,onExport:ft,sortDirection:Ot,onSortChange:kt,compact:Pt,onToggleCompact:()=>Ft(e=>!e),revealId:yn,onRevealComplete:()=>bn(void 0)},On={entries:k,ui:ie,onUiChange:pt,onClear:mt,onExport:ht,sortDirection:At,onSortChange:jt},kn={tasks:C,progressByTaskId:w,ui:F,onUiChange:Je,onRefresh:Ze,onClearCompleted:Xe,onCancel:Ye},An={[y7]:(0,R.jsx)(_5,{...kn,ui:{...F,search:_n},embedded:!0}),[b7]:(0,R.jsx)(c5,{...Tn,ui:{...I,filterText:_n},embedded:!0}),[x7]:(0,R.jsx)(B5,{...En,ui:{...ne,search:_n},embedded:!0}),[S7]:(0,R.jsx)(o7,{...Dn,ui:{...re,filterText:_n},embedded:!0}),[C7]:(0,R.jsx)(s7,{...On,ui:{filterText:_n},embedded:!0})};return(0,R.jsxs)(Ef,{header:{height:60},footer:{height:vCe},padding:0,children:[(0,R.jsx)(Ef.Header,{"data-testid":`connection-status`,"data-status":c,"data-error-message":l,"data-deeplink":t,children:c===`connected`&&u?(0,R.jsx)(mq,{connected:!0,serverInfo:oCe(u.serverInfo,n,i),status:c,latencyMs:d,activeTab:on,availableTabs:rn,onTabChange:Ct,onDisconnect:pe,onToggleTheme:ue,onOpenClientSettings:de,monitorToggle:hn}):(0,R.jsx)(mq,{connected:!1,onToggleTheme:ue,onOpenClientSettings:de,monitorToggle:hn})}),(0,R.jsx)(Ef.Main,{children:(0,R.jsxs)(_Ce,{children:[(0,R.jsxs)(gCe,{children:[(0,R.jsx)(c7,{active:on===v7,children:(0,R.jsx)(ufe,{servers:Cn,writable:r,activeServer:wn,erroredServerId:a,connectedServerId:o,onAddManually:me,onImportConfig:he,onImportServerJson:ge,onExport:_e,onToggleConnection:fe,onConnectionInfo:ve,onSettings:ye,onEdit:be,onClone:xe,onRemove:Se,onReorder:Ce,highlightedServerIds:we,onClearHighlight:Te,compact:It,onToggleCompact:()=>Lt(e=>!e)})}),(0,R.jsx)(c7,{active:on===`Tools`,children:(0,R.jsx)(Qpe,{tools:f,excludedTools:p,callState:A,ui:N,listChanged:_,serverSupportsTaskToolCalls:Ee,modernTasks:E===`modern`&&u?.capabilities?.extensions?.[`io.modelcontextprotocol/tasks`]!==void 0,onUiChange:De,onRefreshList:Me,pagination:Ne,onCallTool:Oe,onCancelCall:ke,onClearResult:Ae,onReadResource:je})}),(0,R.jsx)(c7,{active:on===`Apps`,children:(0,R.jsx)($ge,{tools:Xt,listChanged:_,sandboxPath:oe,bridgeFactory:se,rendererRef:ce,ui:P,onUiChange:gt,onRefreshList:xt,onSelectApp:_t,onOpenApp:vt,onCloseApp:yt,onError:bt,autoOpen:!!(e?.openApp&&e.autoOpen)})}),(0,R.jsx)(c7,{active:on===`Prompts`,children:(0,R.jsx)(N_e,{prompts:m,getPromptState:j,ui:ee,listChanged:v,completionsSupported:Ke,onUiChange:Ie,onRefreshList:ze,pagination:Pe,onGetPrompt:Le,onCopyMessages:Re,onCompleteArgument:Ge})}),(0,R.jsx)(c7,{active:on===`Resources`,children:(0,R.jsx)(Lve,{resources:h,templates:g,subscriptions:b,subscriptionStreamState:x,protocolEra:E,readState:M,ui:te,listChanged:y,completionsSupported:Ke,subscriptionsSupported:qe,onUiChange:Be,onRefreshList:We,pagination:Fe,onReadResource:Ve,onSubscribeResource:He,onUnsubscribeResource:Ue,onCompleteArgument:Ge,compact:Rt,onCompactChange:zt})}),(0,R.jsx)(c7,{active:on===y7,children:(0,R.jsx)(_5,{...kn})}),(0,R.jsx)(c7,{active:on===b7,children:(0,R.jsx)(c5,{...Tn})}),(0,R.jsx)(c7,{active:on===x7,children:(0,R.jsx)(B5,{...En})}),(0,R.jsx)(c7,{active:on===S7,children:(0,R.jsx)(o7,{...Dn})}),(0,R.jsx)(c7,{active:on===C7,children:(0,R.jsx)(s7,{...On})})]}),(0,R.jsx)(Xl,{mounted:nn,transition:xCe,duration:j7,exitDuration:j7,timingFunction:`ease`,children:e=>(0,R.jsxs)(SCe,{style:e,children:[(0,R.jsx)(YSe,{value:Jt,min:E7,max:D7,step:cCe,onChange:qt,onCommit:gn,"aria-label":`Resize monitoring sidebar`}),(0,R.jsx)(bCe,{w:Jt,children:(0,R.jsx)(qSe,{tabs:en,value:cn,onChange:fn,searchValue:_n,onSearchChange:vn,screens:An})})]})})]})}),(0,R.jsx)(Ef.Footer,{children:(0,R.jsxs)(yCe,{children:[(0,R.jsx)(gq,{version:s}),(0,R.jsx)(yq,{})]})})]})}var M7={selectedToolName:void 0,formValues:{},search:``,runAsTask:!1},N7={selectedPromptName:void 0,argumentValues:{},submittedFor:void 0,search:``},P7={selectedResourceUri:void 0,selectedTemplateUri:void 0,originatingTemplateUri:void 0,search:``,openSections:void 0},F7={selectedAppName:void 0,formValues:{},search:``},I7={search:``,statusFilter:void 0},L7={filterText:``,visibleLevels:s5},R7={search:``,methodFilter:void 0,visibleDirections:{client:!0,server:!0}},z7={filterText:``,visibleCategories:a7},B7={filterText:``},wCe=/^[a-zA-Z0-9_-]+$/,TCe=U.withProps({gap:`md`}),ECe=U.withProps({gap:`sm`}),DCe=V.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),OCe=H.withProps({fw:700,span:!0}),kCe=_h.withProps({size:`lg`,centered:!0}),ACe=H.withProps({c:`red`,size:`sm`,role:`alert`}),V7=ov.withProps({required:!0,rightSectionPointerEvents:`auto`}),jCe=ov.withProps({rightSectionPointerEvents:`auto`}),MCe=Mm.withProps({autosize:!0,minRows:3,rightSectionPointerEvents:`auto`}),NCe=Mm.withProps({autosize:!0,minRows:2,rightSectionPointerEvents:`auto`}),PCe={add:`Add server`,edit:`Edit server`,clone:`Clone server`};function FCe(e,t,n){let r=n===`edit`?e??``:``,i=t?.type===void 0?`stdio`:t.type;if(!t)return{id:r,transport:`stdio`,command:``,argsText:``,envText:``,cwd:``,url:``};if(i===`stdio`){let e=t;return{id:r,transport:i,command:e.command??``,argsText:(e.args??[]).join(`
|
|
296
|
-
`),envText:Object.entries(e.env??{}).map(([e,t])=>`${e}=${t}`).join(`
|
|
297
|
-
`),cwd:e.cwd??``,url:``}}return{id:r,transport:i,command:``,argsText:``,envText:``,cwd:``,url:(t.type===`sse`||t.type===`streamable-http`?t.url:``)??``}}function ICe(e){return e.split(`
|
|
298
|
-
`).map(e=>e.trim()).filter(e=>e.length>0)}function LCe(e){let t={},n=e.split(`
|
|
299
|
-
`).map(e=>e.trim()).filter(e=>e.length>0);for(let e of n){let n=e.indexOf(`=`);if(n<=0)return{ok:!1,error:`Invalid env line "${e}". Use KEY=VALUE.`};let r=e.slice(0,n).trim(),i=e.slice(n+1);if(!r)return{ok:!1,error:`Invalid env line "${e}". Empty key.`};t[r]=i}return{ok:!0,value:t}}function RCe({opened:e,mode:t,initialId:n,initialConfig:r,existingIds:i,onClose:a,onSubmit:o}){let s=(0,D.useMemo)(()=>FCe(n,r,t),[n,r,t]),[c,l]=(0,D.useState)(s),[u,d]=(0,D.useState)(void 0),[f,p]=(0,D.useState)(!1),m=e=>t=>{let n=t.currentTarget.value;l(t=>({...t,[e]:n}))},h=e=>()=>l(t=>({...t,[e]:``}));(0,D.useEffect)(()=>{e&&(l(s),d(void 0),p(!1))},[e,s]);let g=c.id.trim(),_=wCe.test(g),v=g.length>0&&i.includes(g),y=g?_?v?`A server with this id already exists.`:void 0:`Use only letters, numbers, hyphens, and underscores.`:void 0;function b(){if(c.transport===`stdio`){if(!c.command.trim())return{ok:!1,error:`Command is required for stdio.`};let e=LCe(c.envText);if(!e.ok)return e;let t={type:`stdio`,command:c.command.trim()},n=ICe(c.argsText);n.length>0&&(t.args=n),Object.keys(e.value).length>0&&(t.env=e.value);let r=c.cwd.trim();return r&&(t.cwd=r),{ok:!0,config:t}}if(!c.url.trim())return{ok:!1,error:`URL is required for sse / streamable-http.`};let e={url:c.url.trim()};return{ok:!0,config:c.transport===`sse`?{type:`sse`,...e}:{type:`streamable-http`,...e}}}async function x(){if(d(void 0),!g){d(`Server id is required.`);return}if(y){d(y);return}let e=b();if(!e.ok){d(e.error);return}p(!0);try{await o(g,e.config),a()}catch(e){d(e instanceof Error?e.message:String(e))}finally{p(!1)}}let S=c.transport===`stdio`;return(0,R.jsx)(kCe,{opened:e,onClose:a,title:(0,R.jsx)(OCe,{children:PCe[t]}),children:(0,R.jsxs)(TCe,{children:[(0,R.jsxs)(ECe,{children:[(0,R.jsx)(V7,{label:`Server ID`,description:`Used as the key in mcp.json. Letters, numbers, hyphens, underscores.`,placeholder:`my-server`,value:c.id,onChange:m(`id`),error:y,"data-autofocus":!0,disabled:f,rightSection:c.id?(0,R.jsx)(d3,{disabled:f,onClick:h(`id`)}):null}),(0,R.jsx)(T_,{label:`Transport`,data:[{value:`stdio`,label:`stdio (local process)`},{value:`sse`,label:`sse (Server-Sent Events)`},{value:`streamable-http`,label:`streamable-http`}],value:c.transport,onChange:e=>l(t=>({...t,transport:e??`stdio`})),allowDeselect:!1,disabled:f}),S?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(V7,{label:`Command`,placeholder:`npx`,value:c.command,onChange:m(`command`),disabled:f,rightSection:c.command?(0,R.jsx)(d3,{disabled:f,onClick:h(`command`)}):null}),(0,R.jsx)(MCe,{label:`Arguments`,description:`One argument per line.`,placeholder:`-y
|
|
300
|
-
@modelcontextprotocol/server-everything`,value:c.argsText,onChange:m(`argsText`),disabled:f,rightSection:c.argsText?(0,R.jsx)(d3,{disabled:f,onClick:h(`argsText`)}):null}),(0,R.jsx)(NCe,{label:`Environment`,description:`KEY=VALUE per line.`,placeholder:`DEBUG=1`,value:c.envText,onChange:m(`envText`),disabled:f,rightSection:c.envText?(0,R.jsx)(d3,{disabled:f,onClick:h(`envText`)}):null}),(0,R.jsx)(jCe,{label:`Working directory`,placeholder:`(inherit)`,value:c.cwd,onChange:m(`cwd`),disabled:f,rightSection:c.cwd?(0,R.jsx)(d3,{disabled:f,onClick:h(`cwd`)}):null})]}):(0,R.jsx)(V7,{label:`URL`,placeholder:`https://example.com/mcp`,value:c.url,onChange:m(`url`),disabled:f,rightSection:c.url?(0,R.jsx)(d3,{disabled:f,onClick:h(`url`)}):null})]}),u?(0,R.jsx)(ACe,{children:u}):null,(0,R.jsxs)(DCe,{children:[(0,R.jsx)(Xp,{variant:`default`,onClick:a,disabled:f,children:`Cancel`}),(0,R.jsx)(Xp,{onClick:()=>{x()},loading:f,children:t===`edit`?`Save`:`Add`})]})]})})}function zCe(e,t,n){return e.advertisedExtensions?.[t]??n}var H7=[{value:`legacy`,label:`Legacy (2025-11-25 handshake)`},{value:`auto`,label:`Auto (probe, fall back to legacy)`},{value:`modern`,label:`Modern (2026-07-28, sessionless)`}],BCe=new Set(H7.map(e=>e.value));function VCe(e){return e!==null&&BCe.has(e)}var HCe=DN.map(e=>({value:e,label:e===`off`?`Off (no logs)`:e})),UCe=new Set(DN);function WCe(e){return e!==null&&UCe.has(e)}var U7=ov.withProps({rightSectionPointerEvents:`auto`}),W7=Og.withProps({min:0,step:100}),G7=Og.withProps({suffix:` ms`}),GCe=H.withProps({size:`xs`,c:`var(--inspector-text-secondary)`}),KCe=Dd.withProps({align:`flex-start`,gap:`sm`,wrap:`wrap`}),K7=Eu.withProps({color:`red`,variant:`subtle`}),q7=Xp.withProps({size:`xs`,variant:`light`}),J7=H.withProps({size:`sm`,c:`dimmed`}),Y7=H.withProps({size:`sm`,c:`dimmed`,fs:`italic`}),qCe=Xp.withProps({variant:`light`,color:`red`,size:`compact-sm`,flex:`0 0 auto`}),JCe=H.withProps({size:`sm`,c:`dimmed`,flex:1,miw:`12rem`});function X7({items:e,onChange:t,onRemove:n}){return e.length===0?null:(0,R.jsx)(R.Fragment,{children:e.map((e,r)=>(0,R.jsxs)(V,{grow:!0,children:[(0,R.jsx)(U7,{placeholder:`Key`,value:e.key,onChange:n=>t(r,n.currentTarget.value,e.value),rightSection:e.key?(0,R.jsx)(d3,{onClick:()=>t(r,``,e.value)}):null}),(0,R.jsx)(U7,{placeholder:`Value`,value:e.value,onChange:n=>t(r,e.key,n.currentTarget.value),rightSection:e.value?(0,R.jsx)(d3,{onClick:()=>t(r,e.key,``)}):null}),(0,R.jsx)(K7,{onClick:()=>n(r),children:`X`})]},r))})}function YCe({roots:e,onChange:t,onRemove:n}){return e.length===0?null:(0,R.jsx)(R.Fragment,{children:e.map((e,r)=>(0,R.jsxs)(V,{grow:!0,children:[(0,R.jsx)(U7,{placeholder:`URI (e.g. file:///path)`,value:e.uri,onChange:n=>t(r,n.currentTarget.value,e.name??``),rightSection:e.uri?(0,R.jsx)(d3,{onClick:()=>t(r,``,e.name??``)}):null}),(0,R.jsx)(U7,{placeholder:`Name (optional)`,value:e.name??``,onChange:n=>t(r,e.uri,n.currentTarget.value),rightSection:e.name?(0,R.jsx)(d3,{onClick:()=>t(r,e.uri,``)}):null}),(0,R.jsx)(K7,{onClick:()=>n(r),children:`X`})]},r))})}function XCe({settings:e,serverType:t=`streamable-http`,isStdio:n,expandedSections:r,onExpandedSectionsChange:i,onAddHeader:a,onRemoveHeader:o,onHeaderChange:s,onAddEnv:c,onRemoveEnv:l,onEnvChange:u,onCwdChange:d,onAddMetadata:f,onRemoveMetadata:p,onMetadataChange:m,onTimeoutChange:h,onAutoRefreshChange:g,onPaginatedListsChange:_,onAdvertisedExtensionChange:v,onMaxFetchRequestsChange:y,onProtocolEraChange:b,onModernLogLevelChange:x,negotiatedEra:S,onOAuthChange:C,onClearStoredOAuth:w,onAddRoot:T,onRemoveRoot:E,onRootChange:D}){let O=CN(t),k=e.enterpriseManaged??!1,A=k?`Resource AS Client ID`:`Client ID`,j=k?`Resource AS Client Secret`:`Client Secret`,M=k?`The resource authorization server's registered client credential (EMA leg 3) — not the app client id/secret, which belong in Client Settings.`:void 0,N=e.protocolEra??`legacy`,ee=N===`modern`||N===`auto`&&S!==`legacy`,te=t=>{if(typeof t==`number`){y(t);return}let n=parseInt(t,10);y(Number.isNaN(n)?e.maxFetchRequests:n)},P=e=>t=>{h(e,typeof t==`string`?parseInt(t,10)||0:t)};function F(){return{clientId:e.oauthClientId??``,clientSecret:e.oauthClientSecret??``,scopes:e.oauthScopes??``,enterpriseManaged:e.enterpriseManaged??!1,onInsufficientScope:e.oauthOnInsufficientScope}}return(0,R.jsxs)(Gd,{multiple:!0,variant:`separated`,value:r,onChange:e=>i(e),children:[(0,R.jsxs)(Gd.Item,{value:`options`,children:[(0,R.jsx)(Gd.Control,{children:`Options`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(T_,{label:`Protocol Era`,description:`Which MCP protocol era to negotiate with this server (independent of the transport). Legacy uses the 2025-11-25 initialize handshake; Auto probes server/discover and falls back to legacy; Modern pins the 2026-07-28 sessionless protocol. Defaults to Legacy — debugging tools should not auto-probe.`,data:H7,value:e.protocolEra??`legacy`,onChange:e=>{VCe(e)&&b(e)},allowDeselect:!1}),ee&&(0,R.jsx)(T_,{label:`Log Level per Request`,description:`Modern-era only. On 2026-07-28 servers there is no logging/setLevel — the client opts into logs per request by stamping this level in each request's _meta, and logs arrive on the originating request's stream. Off requests no logs. Defaults to Debug so a modern connection surfaces server logs out of the box. Legacy servers ignore this and use Set Active Level.`,data:HCe,value:e.modernLogLevel??`debug`,onChange:e=>{WCe(e)&&x(e)},allowDeselect:!1}),(0,R.jsx)(Ap,{label:`Auto Refresh on List Changed Notifications`,description:`When checked, tool/prompt/resource lists refresh automatically when the server sends a */list_changed notification. When unchecked, the list-changed indicator appears and you refresh on demand.`,checked:e.autoRefreshOnListChanged??!1,onChange:e=>g(e.currentTarget.checked)}),(0,R.jsx)(Ap,{label:`Fetch Lists One Page at a Time`,description:`When checked, the Tools, Resources, and Prompts lists load a single page and reveal a “Load next page” control instead of auto-loading every page. Useful defensively for servers with very large lists. The per-list sidebar toggle sets this too.`,checked:e.paginatedLists??!1,onChange:e=>_(e.currentTarget.checked)}),(0,R.jsx)(W7,{label:`Network Log Size`,description:`Maximum number of HTTP requests kept in the Network log for this server. Older entries rotate out past this limit; a response body that arrives after its entry rotated out is dropped. Use 0 for unlimited (not recommended). Applies immediately to the active connection.`,value:e.maxFetchRequests,onChange:te}),n?(0,R.jsx)(U7,{label:`Working Directory`,description:`Directory the stdio server process is launched in. Leave empty to inherit the Inspector's working directory.`,placeholder:`(inherit)`,value:e.cwd??``,onChange:e=>d(e.currentTarget.value),rightSection:e.cwd?(0,R.jsx)(d3,{onClick:()=>d(``)}):null}):null]})})]}),(0,R.jsxs)(Gd.Item,{value:`extensions`,children:[(0,R.jsx)(Gd.Control,{children:`Advertised Extensions`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(GCe,{children:`Which extensions the Inspector declares to this server in its client capabilities. A server may register different tools depending on what the client advertises — toggle these to debug that. Takes effect on the next connect.`}),iL.map(t=>(0,R.jsx)(Ap,{label:t.label,checked:zCe(e,t.key,t.defaultAdvertised),onChange:e=>v(t.key,e.currentTarget.checked)},t.key))]})})]}),n?(0,R.jsxs)(Gd.Item,{value:`environment`,children:[(0,R.jsx)(Gd.Control,{children:`Environment Variables`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(J7,{children:`Environment variables passed to the stdio server process.`}),(0,R.jsx)(q7,{onClick:c,children:`+ Add Environment Variable`})]}),e.env.length===0?(0,R.jsx)(Y7,{children:`No environment variables configured`}):(0,R.jsx)(X7,{items:e.env,onChange:u,onRemove:l})]})})]}):null,(0,R.jsxs)(Gd.Item,{value:`headers`,children:[(0,R.jsx)(Gd.Control,{children:`Custom Headers`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(J7,{children:"Headers sent with every HTTP request to this server. If OAuth is configured below, the `Authorization` header is owned by the OAuth flow and any value set here is ignored."}),(0,R.jsx)(q7,{onClick:a,children:`+ Add Header`})]}),e.headers.length===0?(0,R.jsx)(Y7,{children:`No custom headers configured`}):(0,R.jsx)(X7,{items:e.headers,onChange:s,onRemove:o})]})})]}),(0,R.jsxs)(Gd.Item,{value:`metadata`,children:[(0,R.jsx)(Gd.Control,{children:`Request Metadata`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(J7,{children:`Metadata sent with every MCP request (included in _meta field)`}),(0,R.jsx)(q7,{onClick:f,children:`+ Add Metadata`})]}),e.metadata.length===0?(0,R.jsx)(Y7,{children:`No request metadata configured`}):(0,R.jsx)(X7,{items:e.metadata,onChange:m,onRemove:p})]})})]}),(0,R.jsxs)(Gd.Item,{value:`timeouts`,children:[(0,R.jsx)(Gd.Control,{children:`Timeouts`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(V,{children:[(0,R.jsx)(G7,{label:`Connection Timeout`,value:e.connectionTimeout,onChange:P(`connectionTimeout`)}),(0,R.jsx)(G7,{label:`Request Timeout`,value:e.requestTimeout,onChange:P(`requestTimeout`)}),(0,R.jsx)(G7,{label:`Task TTL`,min:1,value:e.taskTtl,onChange:P(`taskTtl`)})]})})]}),(0,R.jsxs)(Gd.Item,{value:`roots`,children:[(0,R.jsx)(Gd.Control,{children:`Roots`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(V,{justify:`space-between`,children:[(0,R.jsx)(J7,{children:`Configure the root directories that the server can access. Each root needs a URI; the name is optional.`}),(0,R.jsx)(q7,{onClick:T,children:`+ Add Root`})]}),e.roots.length===0?(0,R.jsx)(Y7,{children:`No roots configured`}):(0,R.jsx)(YCe,{roots:e.roots,onChange:D,onRemove:E})]})})]}),O?(0,R.jsxs)(Gd.Item,{value:`oauth`,children:[(0,R.jsx)(Gd.Control,{children:`OAuth Settings`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(Ap,{label:`Enterprise-managed authorization`,description:`Connect via the configured enterprise IdP instead of interactive OAuth to the MCP authorization server. OAuth fields below are resource authorization server credentials.`,checked:k,onChange:e=>C({...F(),enterpriseManaged:e.currentTarget.checked})}),(0,R.jsx)(J7,{children:`Pre-configure OAuth credentials for servers requiring authentication`}),(0,R.jsx)(U7,{label:A,description:M,value:e.oauthClientId??``,onChange:e=>C({...F(),clientId:e.currentTarget.value}),rightSection:e.oauthClientId?(0,R.jsx)(d3,{onClick:()=>C({...F(),clientId:``})}):null}),(0,R.jsx)(U7,{label:j,description:M,value:e.oauthClientSecret??``,type:`password`,onChange:e=>C({...F(),clientSecret:e.currentTarget.value}),rightSection:e.oauthClientSecret?(0,R.jsx)(d3,{onClick:()=>C({...F(),clientSecret:``})}):null}),(0,R.jsx)(U7,{label:`Scopes`,description:`Space-separated OAuth scopes (RFC 6749). Do not use commas — a comma-separated entry is sent as one invalid token and rejected by the authorization server.`,placeholder:`mcp tools:read env:read`,value:e.oauthScopes??``,onChange:e=>C({...F(),scopes:e.currentTarget.value}),rightSection:e.oauthScopes?(0,R.jsx)(d3,{onClick:()=>C({...F(),scopes:``})}):null}),(0,R.jsx)(T_,{label:`Insufficient-scope response`,description:`On a 403 insufficient_scope challenge (SEP-2350): re-authorize with the accumulated scope union, or surface the error to you.`,data:[{value:`reauthorize`,label:`Re-authorize (union scopes)`},{value:`throw`,label:`Throw (surface the error)`}],value:e.oauthOnInsufficientScope??`reauthorize`,onChange:e=>C({...F(),onInsufficientScope:e===`throw`?`throw`:`reauthorize`}),allowDeselect:!1}),w?(0,R.jsxs)(KCe,{children:[(0,R.jsx)(qCe,{onClick:w,children:`Clear stored OAuth state`}),(0,R.jsx)(JCe,{children:`Removes stored tokens and client registration for this server. Disconnects if this server is currently connected.`})]}):null]})})]}):null]})}function ZCe(e,t){return[`options`,`extensions`,...t?[`environment`]:[],`headers`,`metadata`,`timeouts`,...CN(e)?[`oauth`]:[],`roots`]}var QCe=_h.Root.withProps({size:`lg`,centered:!0,scrollAreaComponent:bl.Autosize}),$Ce=V.withProps({justify:`space-between`,wrap:`nowrap`,w:`100%`}),ewe=_h.Title.withProps({ta:`center`,flex:1});function twe({opened:e,settings:t,serverType:n,isStdio:r,negotiatedEra:i,onClose:a,onSettingsChange:o,onClearStoredOAuth:s}){let c=ZCe(n,r),[l,u]=(0,D.useState)([`options`]),d=l.length===c.length;function f(){u(d?[]:c)}function p(){o({...t,headers:[...t.headers,{key:``,value:``}]})}function m(e){o({...t,headers:t.headers.filter((t,n)=>n!==e)})}function h(e,n,r){let i=t.headers.map((t,i)=>i===e?{key:n,value:r}:t);o({...t,headers:i})}function g(){o({...t,env:[...t.env,{key:``,value:``}]})}function _(e){o({...t,env:t.env.filter((t,n)=>n!==e)})}function v(e,n,r){let i=t.env.map((t,i)=>i===e?{key:n,value:r}:t);o({...t,env:i})}function y(e){o({...t,cwd:e})}function b(){o({...t,metadata:[...t.metadata,{key:``,value:``}]})}function x(e){o({...t,metadata:t.metadata.filter((t,n)=>n!==e)})}function S(e,n,r){let i=t.metadata.map((t,i)=>i===e?{key:n,value:r}:t);o({...t,metadata:i})}function C(e,n){o({...t,[e]:n})}function w(e){o({...t,oauthClientId:e.clientId,oauthClientSecret:e.clientSecret,oauthScopes:e.scopes,enterpriseManaged:e.enterpriseManaged?!0:void 0,oauthOnInsufficientScope:e.onInsufficientScope===`throw`?`throw`:void 0})}function T(e){o({...t,autoRefreshOnListChanged:e})}function E(e){o({...t,paginatedLists:e})}function O(e,n){let r={...t.advertisedExtensions},i=iL.find(t=>t.key===e);i&&n===i.defaultAdvertised?delete r[e]:r[e]=n,o({...t,advertisedExtensions:Object.keys(r).length>0?r:void 0})}function k(e){o({...t,maxFetchRequests:e})}function A(e){o({...t,protocolEra:e})}function j(e){o({...t,modernLogLevel:e})}function M(){o({...t,roots:[...t.roots,{uri:``,name:``}]})}function N(e){o({...t,roots:t.roots.filter((t,n)=>n!==e)})}function ee(e,n,r){let i=t.roots.map((t,i)=>i===e?{...t,uri:n,name:r}:t);o({...t,roots:i})}return(0,R.jsxs)(QCe,{opened:e,onClose:a,children:[(0,R.jsx)(_h.Overlay,{}),(0,R.jsxs)(_h.Content,{children:[(0,R.jsx)(_h.Header,{children:(0,R.jsxs)($Ce,{children:[(0,R.jsx)(c3,{compact:!d,variant:`subtle`,onToggle:f}),(0,R.jsx)(ewe,{children:`Server Settings`}),(0,R.jsx)(ju,{"aria-label":`Close`,onClick:a})]})}),(0,R.jsx)(_h.Body,{children:(0,R.jsx)(XCe,{settings:t,serverType:n,isStdio:r,expandedSections:l,onExpandedSectionsChange:u,onAddHeader:p,onRemoveHeader:m,onHeaderChange:h,onAddEnv:g,onRemoveEnv:_,onEnvChange:v,onCwdChange:y,onAddMetadata:b,onRemoveMetadata:x,onMetadataChange:S,onTimeoutChange:C,onAutoRefreshChange:T,onPaginatedListsChange:E,onAdvertisedExtensionChange:O,onMaxFetchRequestsChange:k,onProtocolEraChange:A,onModernLogLevelChange:j,negotiatedEra:i,onOAuthChange:w,onClearStoredOAuth:s,onAddRoot:M,onRemoveRoot:N,onRootChange:ee})})]})]})}var nwe=`Must be an http(s) URL, like https://idp.example.com`,rwe=`Issuer is required when enterprise IdP configuration is enabled`,iwe=`Client ID is required when enterprise IdP configuration is enabled`,awe=`Metadata document URL is required when CIMD is enabled`;function Z7(e,t={}){let n={};if(e.emaEnabled&&(e.issuer.trim()===``?t.requireComplete&&(n.issuer=rwe):iH(e.issuer)||(n.issuer=nwe),t.requireComplete&&e.clientId.trim()===``&&(n.clientId=iwe)),e.cimdEnabled)if(e.clientMetadataUrl.trim()===``)t.requireComplete&&(n.clientMetadataUrl=awe);else{let t=uH(e.clientMetadataUrl);t&&(n.clientMetadataUrl=t)}return n}var owe={emaEnabled:!1,issuer:``,clientId:``,clientSecret:``,cimdEnabled:!1,clientMetadataUrl:``};function swe(e){let t=e.enterpriseManagedAuth,n=t?.idp,r=e.cimd;return{emaEnabled:n?t.enabled!==!1:!1,issuer:n?.issuer??``,clientId:n?.clientId??``,clientSecret:n?.clientSecret??``,cimdEnabled:r?.enabled===!0,clientMetadataUrl:r?.clientMetadataUrl??``}}function cwe(e){return e.issuer.trim()!==``||e.clientId.trim()!==``||e.clientSecret!==``}function lwe(e){let t={cimd:{enabled:e.cimdEnabled,clientMetadataUrl:e.clientMetadataUrl.trim()}};return(cwe(e)||e.emaEnabled)&&(t.enterpriseManagedAuth={enabled:e.emaEnabled,idp:{issuer:e.issuer.trim(),clientId:e.clientId.trim(),clientSecret:e.clientSecret}}),t}function uwe(e){return Object.keys(Z7(e,{requireComplete:!0})).length===0}var Q7=H.withProps({size:`sm`,c:`dimmed`}),dwe=Jd.withProps({color:`red`,variant:`light`,title:`Client registration was rejected`}),$7=ov.withProps({rightSectionPointerEvents:`auto`}),fwe=V.withProps({justify:`space-between`,align:`flex-start`,wrap:`nowrap`}),pwe=U.withProps({gap:4,flex:1}),mwe=H.withProps({size:`sm`,fw:500}),e9=Vp.withProps({w:`fit-content`,variant:`light`}),hwe=Xp.withProps({variant:`light`,color:`red`,size:`compact-sm`});function gwe(e){let t=[e.error,e.errorDescription,e.status?`HTTP ${e.status}`:void 0].filter(Boolean);return t.length>0?t.join(` — `):`The authorization server rejected client registration.`}function _we({settings:e,expandedSections:t,onExpandedSectionsChange:n,onSettingsChange:r,emaIdpLoginState:i=`none`,onEmaIdpLogout:a,revealErrors:o=!1,registrationError:s}){function c(e){r(t=>({...t,...e}))}let[l,u]=(0,D.useState)(!1),[d,f]=(0,D.useState)(!1),p=Z7(e),m=Z7(e,{requireComplete:!0}),h=o?m.issuer:l?p.issuer:void 0,g=o?m.clientId:void 0,_=o?m.clientMetadataUrl:d?p.clientMetadataUrl:void 0,v=e.emaEnabled&&e.issuer.trim()!==``&&i!==`none`;return(0,R.jsxs)(U,{gap:`md`,children:[s&&(0,R.jsx)(dwe,{children:(0,R.jsxs)(U,{gap:4,children:[(0,R.jsx)(H,{size:`sm`,children:gwe(s)}),(0,R.jsx)(Q7,{children:`Inspector registers as a native client (application_type "native") so authorization servers accept its localhost redirect URI (SEP-837). If the server still rejects Dynamic Client Registration, use a Client ID Metadata Document (below) or a preregistered client instead.`})]})}),(0,R.jsxs)(Gd,{multiple:!0,variant:`separated`,value:t,onChange:e=>n(e),children:[(0,R.jsxs)(Gd.Item,{value:`ema`,children:[(0,R.jsx)(Gd.Control,{children:`Enterprise-Managed Authorization`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(Ap,{label:`Enable enterprise IdP configuration`,description:`Enterprise-managed authorization signs you in through your organization's IdP instead of each MCP server's own OAuth login. Enable enterprise-managed authorization on participating MCP server's settings.`,checked:e.emaEnabled,onChange:e=>c({emaEnabled:e.currentTarget.checked})}),e.emaEnabled&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Q7,{children:[`Register this redirect URI with your IdP:`,` `,typeof window<`u`?`${window.location.origin}/oauth/callback`:`http://localhost:6274/oauth/callback`]}),(0,R.jsx)($7,{label:`Issuer`,description:`Your enterprise IdP issuer URL.`,value:e.issuer,onChange:e=>c({issuer:e.currentTarget.value}),onBlur:()=>u(!0),error:h,rightSection:e.issuer?(0,R.jsx)(d3,{onClick:()=>c({issuer:``})}):null}),(0,R.jsx)($7,{label:`IdP Client ID`,description:`Client id registered with your enterprise IdP (EMA legs 1–2) — not the per-server resource authorization server credentials, which go in Server Settings → OAuth Settings.`,value:e.clientId,onChange:e=>c({clientId:e.currentTarget.value}),error:g,rightSection:e.clientId?(0,R.jsx)(d3,{onClick:()=>c({clientId:``})}):null}),(0,R.jsx)($7,{label:`IdP Client Secret`,description:`Client secret for your enterprise IdP, if required (EMA legs 1–2) — not the per-server resource authorization server credentials, which go in Server Settings → OAuth Settings.`,type:`password`,value:e.clientSecret,onChange:e=>c({clientSecret:e.currentTarget.value}),rightSection:e.clientSecret?(0,R.jsx)(d3,{onClick:()=>c({clientSecret:``})}):null}),e.issuer.trim()!==``&&(0,R.jsxs)(fwe,{children:[(0,R.jsxs)(pwe,{children:[(0,R.jsx)(mwe,{children:`IdP sign-in`}),i===`logged_in`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(e9,{color:`green`,children:`Signed in`}),(0,R.jsx)(Q7,{children:`Your enterprise IdP session is active. Connecting to EMA-enabled MCP servers will not prompt for IdP login until you sign out or the session expires.`})]}):i===`expired`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(e9,{color:`yellow`,children:`Session expired`}),(0,R.jsx)(Q7,{children:`Your cached IdP session has expired. The next connect to an EMA-enabled server will prompt for IdP login.`})]}):(0,R.jsx)(Q7,{children:`Not signed in to your enterprise IdP. Connecting to an EMA-enabled MCP server will open IdP login.`})]}),v&&a?(0,R.jsx)(hwe,{onClick:a,children:`Sign out`}):null]})]})]})})]}),(0,R.jsxs)(Gd.Item,{value:`cimd`,children:[(0,R.jsx)(Gd.Control,{children:`OAuth Client ID Metadata Document`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(Q7,{children:`CIMD is the preferred client-identity mechanism in the 2026-07-28 spec. Dynamic Client Registration still works and is used by default when CIMD is off, but it is now deprecated in favor of CIMD (SEP-991).`}),(0,R.jsx)(Ap,{label:`Use Client ID Metadata Document`,description:`When the authorization server supports CIMD, Inspector uses this metadata document URL as the client id. The server fetches and verifies the document during OAuth.`,checked:e.cimdEnabled,onChange:e=>c({cimdEnabled:e.currentTarget.checked})}),e.cimdEnabled&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Q7,{children:[`The metadata document must be served over HTTPS and list this redirect URI:`,` `,typeof window<`u`?`${window.location.origin}/oauth/callback`:`http://localhost:6274/oauth/callback`]}),(0,R.jsx)($7,{label:`Client ID metadata document URL`,description:`Public HTTPS URL of your OAuth client metadata JSON document.`,value:e.clientMetadataUrl,onChange:e=>c({clientMetadataUrl:e.currentTarget.value}),onBlur:()=>f(!0),error:_,rightSection:e.clientMetadataUrl?(0,R.jsx)(d3,{onClick:()=>c({clientMetadataUrl:``})}):null})]})]})})]})]})]})}var t9=[`ema`,`cimd`],vwe=_h.Root.withProps({size:`lg`,centered:!0,scrollAreaComponent:bl.Autosize}),ywe=V.withProps({justify:`space-between`,wrap:`nowrap`,w:`100%`}),bwe=_h.Title.withProps({ta:`center`,flex:1});function xwe({opened:e,settings:t,onClose:n,onSettingsChange:r,emaIdpLoginState:i,onEmaIdpLogout:a}){let[o,s]=(0,D.useState)([`ema`]),[c,l]=(0,D.useState)(!1),u=o.length===t9.length;function d(){s(u?[]:t9)}function f(){let e=Z7(t,{requireComplete:!0});if(Object.keys(e).length>0){l(!0);return}n()}return(0,R.jsxs)(vwe,{opened:e,onClose:f,children:[(0,R.jsx)(_h.Overlay,{}),(0,R.jsxs)(_h.Content,{children:[(0,R.jsx)(_h.Header,{children:(0,R.jsxs)(ywe,{children:[(0,R.jsx)(c3,{compact:!u,variant:`subtle`,onToggle:d}),(0,R.jsx)(bwe,{children:`Client Settings`}),(0,R.jsx)(ju,{"aria-label":`Close`,onClick:f})]})}),(0,R.jsx)(_h.Body,{children:(0,R.jsx)(_we,{settings:t,expandedSections:o,onExpandedSectionsChange:s,onSettingsChange:r,emaIdpLoginState:i,onEmaIdpLogout:a,revealErrors:c})})]})]})}function n9(e){let t;try{t=JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Invalid JSON: ${t}`)}if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`Expected a JSON object at the top level`);return t}function r9(e){let t={};for(let[n,r]of Object.entries(e))!r||typeof r!=`object`||Array.isArray(r)||(t[n]=AN(r));return t}function i9(e){let t=n9(e).mcpServers;if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`No 'mcpServers' object found in config file`);return{mcpServers:r9(t)}}function a9(e){let t=n9(e).servers;if(!t||typeof t!=`object`||Array.isArray(t))throw Error(`No 'servers' object found in VS Code config file`);return{mcpServers:r9(t)}}function Swe(e){try{return i9(e)}catch(t){try{return a9(e)}catch{throw t instanceof Error?t:Error(String(t))}}}function o9(e){return/^[a-zA-Z0-9_-]+$/.test(e)&&e.length>0}function s9(e,t,n){return e[t]===void 0?e[n]:e[t]}function c9(e){return typeof e==`string`?e:void 0}function l9(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:void 0}function u9(e){return Array.isArray(e)?e:[]}function Cwe(e){return(e.split(`/`).pop()??e).replace(/[^A-Za-z0-9_-]/g,`-`).replace(/^-+|-+$/g,``)||`server`}function wwe(e){let t=[];for(let n of e){let e=l9(n);if(!e)continue;let r=c9(e.name);if(!r)continue;let i=!!s9(e,`isRequired`,`is_required`),a=!!s9(e,`isSecret`,`is_secret`),o=c9(e.default)??c9(e.value);t.push({name:r,description:c9(e.description),required:i,...o===void 0?{}:{default:o},...a?{isSecret:!0}:{}})}return t}function d9(e){let t=[];for(let n of e){let e=l9(n);if(!e)continue;let r=c9(e.type)??`positional`,i=c9(e.value)??c9(e.default);if(r===`named`){let n=c9(e.name);if(!n)continue;t.push(n),i!==void 0&&t.push(i)}else i!==void 0&&t.push(i)}return t}function Twe(e){let t={};for(let n of e)n.default!==void 0&&(t[n.name]=n.default);return t}function Ewe(e,t,n){let r=e=>n?`${t}${e}${n}`:t;switch(e){case`npm`:return{command:`npx`,runtimeHint:`npx`,ref:r(`@`)};case`pypi`:return{command:`uvx`,runtimeHint:`uvx`,ref:t};case`oci`:return{command:`docker`,runtimeHint:`docker`,ref:t};case`nuget`:return{command:`dnx`,runtimeHint:`dnx`,ref:r(`@`)};default:return null}}function Dwe(e){let t=c9(s9(e,`registryType`,`registry_type`))??``,n=c9(e.identifier)??``;if(!t||!n)return null;let r=Ewe(t,n,c9(e.version));if(!r)return null;let i=wwe(u9(s9(e,`environmentVariables`,`environment_variables`))),a=d9(u9(s9(e,`runtimeArguments`,`runtime_arguments`))),o=d9(u9(s9(e,`packageArguments`,`package_arguments`))),s=Twe(i),c=i.flatMap(e=>[`-e`,e.name]),l=r.command===`docker`?[`run`,`-i`,`--rm`,...a,...c,r.ref,...o]:t===`npm`?[...a,`-y`,r.ref,...o]:[...a,r.ref,...o],u={type:`stdio`,command:r.command,...l.length>0?{args:l}:{},...Object.keys(s).length>0?{env:s}:{}};return{registryType:t,identifier:n,runtimeHint:r.runtimeHint,baseConfig:u,envVars:i}}function Owe(e,t){return t?e.replace(/\{([^}]+)\}/g,(e,n)=>{let r=l9(t[n]);return(r?c9(r.default):void 0)??e}):e}function kwe(e){let t=c9(e.type),n=c9(e.url);if(!n)return null;let r=t===`sse`?`sse`:`streamable-http`,i=Owe(n,l9(e.variables));return{registryType:`remote`,identifier:i,runtimeHint:r,baseConfig:r===`sse`?{type:`sse`,url:i}:{type:`streamable-http`,url:i},envVars:[]}}function Awe(e){let t;try{t=JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Invalid JSON: ${t}`)}let n=l9(t);if(!n)throw Error(`Expected a JSON object at the top level`);let r=l9(n.server)??n,i=c9(r.name);if(!i)throw Error(`server.json is missing a 'name' field`);let a=[];for(let e of u9(r.packages)){let t=l9(e);if(!t)continue;let n=Dwe(t);n&&a.push(n)}for(let e of u9(r.remotes)){let t=l9(e);if(!t)continue;let n=kwe(t);n&&a.push(n)}if(a.length===0)throw Error(`No runnable package or remote found in server.json (mcpb-only or unsupported registry types are not importable)`);return{serverName:Cwe(i),fullName:i,options:a}}function jwe(e,t){if(e.baseConfig.type!==`stdio`)return{...e.baseConfig};let n={...e.baseConfig.env??{}};for(let[e,r]of Object.entries(t))r===``?delete n[e]:n[e]=r;let{env:r,...i}=e.baseConfig;return{...i,...Object.keys(n).length>0?{env:n}:{}}}function Mwe(e,t){return(t??``).trim()||e.serverName}function f9(e,t={}){let n=Math.min(t.selectedIndex??0,Math.max(e.options.length-1,0)),r=Mwe(e,t.idOverride);return{selectedIndex:n,selectedOption:e.options[n],serverId:r,idIsValid:o9(r),idIsDuplicate:(t.existingIds??[]).includes(r)}}function Nwe(e,t){let n={};for(let r of e.envVars){let e=t[r.name];e!==void 0&&(n[r.name]=e)}return jwe(e,n)}function p9(...e){return e.map((e,t)=>t===0?e.replace(/\/+$/,``):e.replace(/^\/+|\/+$/g,``)).filter(e=>e.length>0).join(`/`)}function Pwe(e){return p9(e,`AppData`,`Roaming`)}function m9(e,t,n){return e===`darwin`?p9(t,`Library`,`Application Support`,n):e===`win32`?p9(Pwe(t),n):p9(t,`.config`,n)}var h9=[{id:`claude-desktop`,label:`Claude Desktop`,defaultPaths:(e,t)=>[p9(m9(e,t,`Claude`),`claude_desktop_config.json`)],parse:i9},{id:`cursor`,label:`Cursor`,defaultPaths:(e,t)=>[p9(t,`.cursor`,`mcp.json`)],parse:i9},{id:`cline`,label:`Cline`,defaultPaths:(e,t)=>[p9(m9(e,t,`Code`),`User`,`globalStorage`,`saoudrizwan.claude-dev`,`settings`,`cline_mcp_settings.json`),p9(t,`Documents`,`Cline`,`MCP`,`cline_mcp_settings.json`)],parse:i9},{id:`vscode`,label:`VS Code`,defaultPaths:(e,t)=>[p9(m9(e,t,`Code`),`User`,`mcp.json`)],parse:a9}];Object.fromEntries(h9.map(e=>[e.id,e]));function g9(e,t){let n=new Set(t),r=[],i=[];for(let[t,a]of Object.entries(e.mcpServers))n.has(t)?i.push({id:t,config:a}):r.push({id:t,config:a});return{additions:r,conflicts:i}}function Fwe(e,t){let n=new Set(t),r=e.replace(/[^A-Za-z0-9_-]/g,`-`).replace(/^-+|-+$/g,``)||`server`;if(!n.has(r))return r;for(let e=2;;e++){let t=`${r}-${e}`;if(!n.has(t))return t}}function Iwe({opened:e,existingIds:t,onFetchSource:n,onAddServer:r,onUpdateServer:i}){let[a,o]=(0,D.useState)(`select`),[s,c]=(0,D.useState)(void 0),[l,u]=(0,D.useState)(void 0),[d,f]=(0,D.useState)(null),[p,m]=(0,D.useState)({}),[h,g]=(0,D.useState)({}),[_,v]=(0,D.useState)([]),[y,b]=(0,D.useState)(null),[x,S]=(0,D.useState)(e);e!==x&&(S(e),e&&(o(`select`),c(void 0),u(void 0),f(null),m({}),g({}),v([]),b(null)));let C=(0,D.useMemo)(()=>d?g9(d,t):null,[d,t]);function w(e){let n=g9(e,t);if(n.additions.length===0&&n.conflicts.length===0){c(`No servers found in the selected source.`),o(`select`);return}let r=[...t,...n.additions.map(e=>e.id)],i={};for(let e of n.conflicts)i[e.id]={action:`skip`,renameTo:Fwe(e.id,r)};let a={};for(let e of n.additions)a[e.id]=`import`;f(e),m(i),g(a),c(void 0),o(`review`)}async function T(e){o(`loading`),c(void 0),u(void 0);try{let t=await n(e);if(t.error){c(t.error),o(`select`);return}if(!t.found||!t.config){u(`No config found. Searched: ${t.searched.join(`, `)}. Try uploading a file instead.`),o(`select`);return}w(t.config)}catch(e){c(e instanceof Error?e.message:String(e)),o(`select`)}}async function E(e){if(e){c(void 0),u(void 0);try{w(Swe(await e.text()))}catch(e){c(e instanceof Error?e.message:String(e))}}}function O(e,t){m(n=>({...n,[e]:{...n[e],action:t}}))}function k(e,t){m(n=>({...n,[e]:{...n[e],renameTo:t}}))}function A(e,t){g(n=>({...n,[e]:t}))}async function j(e,t,n){try{return await n(),{id:e,status:t}}catch(t){return{id:e,status:`failed`,detail:t instanceof Error?t.message:String(t)}}}async function M(){if(!C)return;o(`loading`);let e=[];for(let t of C.additions){if((h[t.id]??`import`)===`skip`){e.push({id:t.id,status:`skipped`});continue}e.push(await j(t.id,`added`,()=>Promise.resolve(r(t.id,t.config))))}for(let t of C.conflicts){let n=p[t.id]??{action:`skip`,renameTo:t.id};if(n.action===`skip`)e.push({id:t.id,status:`skipped`});else if(n.action===`overwrite`)e.push(await j(t.id,`overwritten`,()=>i(t.id,t.id,t.config)));else{let i=n.renameTo.trim()||t.id;e.push(await j(i,`renamed`,()=>Promise.resolve(r(i,t.config))))}}v(e),o(`summary`)}let N=C?C.additions.filter(e=>(h[e.id]??`import`)===`import`).length+C.conflicts.filter(e=>(p[e.id]?.action??`skip`)!==`skip`).length:0,ee=(0,D.useMemo)(()=>{if(!C)return{};let e={};for(let n of C.conflicts){let r=p[n.id];if(r?.action!==`rename`)continue;let i=r.renameTo.trim();if(!i){e[n.id]=`A new id is required.`;continue}if(!o9(i)){e[n.id]=`Use only letters, numbers, hyphens, underscores.`;continue}let a=new Set(t);for(let e of C.additions)(h[e.id]??`import`)===`import`&&a.add(e.id);for(let e of C.conflicts){if(e.id===n.id)continue;let t=p[e.id];t?.action===`rename`&&a.add(t.renameTo.trim())}a.has(i)&&(e[n.id]=`"${i}" is already in use.`)}return e},[C,p,h,t]);return{phase:a,error:s,notice:l,plan:C,resolutions:p,additionActions:h,outcomes:_,selectedType:y,importCount:N,renameErrors:ee,canImport:N>0&&Object.keys(ee).length===0,setSelectedType:b,pickSource:T,pickFile:E,setResolution:O,setRenameTo:k,setAdditionAction:A,runImport:M,back:()=>o(`select`)}}var _9=U.withProps({gap:`md`}),Lwe=V.withProps({gap:`sm`,align:`flex-end`,wrap:`nowrap`}),v9=V.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),y9=V.withProps({justify:`space-between`,wrap:`nowrap`,gap:`sm`}),Rwe=H.withProps({size:`sm`,c:`dimmed`}),zwe=H.withProps({fw:700,span:!0}),b9=H.withProps({fw:600,size:`sm`}),Bwe=_h.withProps({size:`lg`,centered:!0}),Vwe=H.withProps({size:`xs`,c:`var(--inspector-status-error)`}),Hwe=Jd.withProps({color:`red`,title:`Import error`}),Uwe=Bh.withProps({label:`Client`,flex:1}),Wwe=[{value:``,label:`Select a client…`},...h9.map(e=>({value:e.id,label:e.label}))],Gwe=[{value:`overwrite`,label:`Overwrite`},{value:`skip`,label:`Skip`},{value:`rename`,label:`Rename`}],Kwe=[{value:`import`,label:`Import`},{value:`skip`,label:`Skip`}],qwe={added:{label:`Imported`,color:`green`},overwritten:{label:`Overwritten`,color:`blue`},renamed:{label:`Renamed`,color:`blue`},skipped:{label:`Skipped`,color:`gray`},failed:{label:`Failed`,color:`red`}};function Jwe({opened:e,existingIds:t,onClose:n,onFetchSource:r,onAddServer:i,onUpdateServer:a}){let o=Iwe({opened:e,existingIds:t,onFetchSource:r,onAddServer:i,onUpdateServer:a}),{plan:s}=o;return(0,R.jsx)(Bwe,{opened:e,onClose:n,title:(0,R.jsx)(zwe,{children:`Import from client config`}),children:(0,R.jsxs)(_9,{children:[o.error?(0,R.jsx)(Hwe,{children:o.error}):null,o.notice?(0,R.jsx)(Jd,{variant:`warning`,children:o.notice}):null,o.phase===`select`?(0,R.jsxs)(_9,{children:[(0,R.jsx)(Rwe,{children:`Import MCP servers from another client. Choose a known client (read on this machine) or upload its config file.`}),(0,R.jsxs)(Lwe,{children:[(0,R.jsx)(Uwe,{data:Wwe,value:o.selectedType??``,onChange:e=>o.setSelectedType(e.currentTarget.value||null)}),(0,R.jsx)(Xp,{disabled:!o.selectedType,onClick:()=>{o.selectedType&&o.pickSource(o.selectedType)},children:`Import`}),(0,R.jsx)(dm,{accept:`application/json,.json`,onChange:e=>void o.pickFile(e),children:e=>(0,R.jsx)(Xp,{...e,variant:`default`,children:`From file…`})})]})]}):null,o.phase===`loading`?(0,R.jsxs)(V,{gap:`sm`,children:[(0,R.jsx)(vu,{size:`sm`}),(0,R.jsx)(H,{size:`sm`,children:`Working…`})]}):null,o.phase===`review`&&s?(0,R.jsxs)(_9,{children:[s.additions.length>0?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(b9,{children:[`New servers (`,s.additions.length,`)`]}),s.additions.map(e=>(0,R.jsxs)(y9,{children:[(0,R.jsx)(H,{size:`sm`,children:e.id}),(0,R.jsx)(C_,{size:`xs`,data:Kwe,value:o.additionActions[e.id]??`import`,onChange:t=>o.setAdditionAction(e.id,t)})]},e.id))]}):null,s.conflicts.length>0?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(b9,{children:[`Already exists (`,s.conflicts.length,`)`]}),s.conflicts.map(e=>{let t=o.resolutions[e.id];return(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(y9,{children:[(0,R.jsx)(H,{size:`sm`,children:e.id}),(0,R.jsx)(C_,{size:`xs`,data:Gwe,value:t?.action??`skip`,onChange:t=>o.setResolution(e.id,t)})]}),t?.action===`rename`?(0,R.jsx)(ov,{size:`xs`,"aria-label":`New id for ${e.id}`,value:t.renameTo,error:o.renameErrors[e.id],onChange:t=>o.setRenameTo(e.id,t.currentTarget.value)}):null]},e.id)})]}):null,(0,R.jsxs)(v9,{children:[(0,R.jsx)(Xp,{variant:`default`,onClick:o.back,children:`Back`}),(0,R.jsxs)(Xp,{onClick:()=>void o.runImport(),disabled:!o.canImport,children:[`Import `,o.importCount,` server`,o.importCount===1?``:`s`]})]})]}):null,o.phase===`summary`?(0,R.jsxs)(_9,{children:[(0,R.jsx)(b9,{children:`Import complete`}),o.outcomes.map(e=>{let t=qwe[e.status];return(0,R.jsxs)(U,{gap:2,children:[(0,R.jsxs)(y9,{children:[(0,R.jsx)(H,{size:`sm`,children:e.id}),(0,R.jsx)(Vp,{color:t.color,variant:`light`,children:t.label})]}),e.detail?(0,R.jsx)(Vwe,{children:e.detail}):null]},`${e.id}-${e.status}`)}),(0,R.jsx)(v9,{children:(0,R.jsx)(Xp,{onClick:n,children:`Done`})})]}):null]})})}var Ywe=1e3,x9={rawText:``,envOverrides:{}};function S9(e){if(!e.trim())return{ok:null};try{return{ok:!0,parsed:Awe(e)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function Xwe({opened:e,existingIds:t,onAddServer:n}){let[r,i]=(0,D.useState)(x9),[a,o]=(0,D.useState)(void 0),[s,c]=(0,D.useState)(x9.rawText),[l,u]=(0,D.useState)(!0),[d,f]=(0,D.useState)(!1),[p,m]=(0,D.useState)(e);e!==p&&(m(e),e&&(i(x9),o(void 0),c(x9.rawText),u(!0),f(!1))),(0,D.useEffect)(()=>{let e=setTimeout(()=>c(r.rawText),300);return()=>clearTimeout(e)},[r.rawText]),(0,D.useEffect)(()=>{if(!r.rawText.trim())return;let e,t=setTimeout(()=>{f(!0),e=setTimeout(()=>{f(!1),u(!1)},250)},Ywe);return()=>{clearTimeout(t),e&&clearTimeout(e)}},[r.rawText]);let h=(0,D.useMemo)(()=>S9(s),[s]),g=(0,D.useMemo)(()=>{if(h.ok===!0)return f9(h.parsed,{selectedIndex:r.selectedPackageIndex,idOverride:r.nameOverride,existingIds:t})},[h,r.selectedPackageIndex,r.nameOverride,t]),_=g?.selectedIndex??0,v=g?.selectedOption,y=h.ok===!0?h.parsed:void 0,b=g!==void 0&&g.idIsValid&&!g.idIsDuplicate,x=y?.options.map(e=>({registryType:e.registryType,identifier:e.identifier,runtimeHint:e.runtimeHint})),S=(v?.envVars??[]).map(e=>({name:e.name,description:e.description,required:e.required,value:r.envOverrides[e.name]??e.default??``})),C=(0,D.useMemo)(()=>{if(h.ok===null)return[{type:`info`,message:`Paste server.json content to validate.`}];if(h.ok===!1)return[{type:`error`,message:h.error}];let e=[{type:`success`,message:`Valid server.json for "${h.parsed.fullName}".`},{type:`info`,message:`${h.parsed.options.length} runnable option(s) found.`}];return g&&!g.idIsValid?e.push({type:`error`,message:`Server id must use only letters, numbers, hyphens, underscores.`}):g?.idIsDuplicate&&e.push({type:`warning`,message:`A server with id "${g.serverId}" already exists.`}),e},[h,g]),w=a?[...C,{type:`error`,message:a}]:C;function T(e){o(void 0),i(t=>({...t,rawText:e})),f(!1),e.trim()||u(!0)}function E(e){i(t=>({...t,selectedPackageIndex:e}))}function O(e,t){i(n=>({...n,envOverrides:{...n.envOverrides,[e]:t}}))}function k(e){i(t=>({...t,nameOverride:e}))}async function A(e){if(e){o(void 0),f(!1);try{let t=await e.text();i(e=>({...e,rawText:t}))}catch(e){o(e instanceof Error?e.message:String(e))}}}async function j(){o(void 0);let e=S9(r.rawText);if(e.ok!==!0)return o(`Fix the validation errors before adding the server.`),!1;let i=f9(e.parsed,{selectedIndex:r.selectedPackageIndex,idOverride:r.nameOverride,existingIds:t});if(!i.idIsValid||i.idIsDuplicate)return o(`Fix the validation errors before adding the server.`),!1;let a=Nwe(i.selectedOption,r.envOverrides);try{return await n(i.serverId,a),!0}catch(e){return o(e instanceof Error?e.message:String(e)),!1}}return{draft:{...r,selectedPackageIndex:_},validation:w,packages:x,envVars:S,canAdd:b,defaultServerName:y?.serverName??``,fileContentsOpen:l,fileContentsHighlight:d,setRawText:T,selectPackage:E,setEnvVar:O,setServerName:k,pickFile:A,setFileContentsOpen:u,submit:j}}var Zwe={success:{icon:`✓`,color:`green`},warning:{icon:`⚠`,color:`yellow`},info:{icon:`ℹ`,color:`blue`},error:{icon:`✗`,color:`red`}},Qwe=H.withProps({size:`sm`,c:`dimmed`}),$we=V.withProps({justify:`space-between`,align:`center`,wrap:`nowrap`}),eTe=Xp.withProps({variant:`default`,size:`xs`}),tTe=Mm.withProps({"aria-label":`File Contents`,ff:`monospace`,autosize:!0,minRows:8,maxRows:15,rightSectionPointerEvents:`auto`}),nTe=ov.withProps({label:`From configuration`,description:`The id derived from the server.json name.`,readOnly:!0}),rTe=ov.withProps({label:`Override`,description:`Optional. Used instead of the name above.`,rightSectionPointerEvents:`auto`});function iTe(e){return`${e.registryType}: ${e.identifier} (${e.runtimeHint})`}function aTe({draft:e,validation:t,packages:n,envVars:r,onJsonChange:i,onSelectPackage:a,onEnvVarChange:o,onServerNameChange:s,defaultServerName:c,onAddServer:l,addDisabled:u,fileContentsOpen:d,onFileContentsChange:f,fileContentsHighlight:p,onPickFile:m}){let h=e.rawText.trim().length>0;return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)($we,{children:[(0,R.jsx)(Qwe,{children:`Paste server.json content, or load it from a file:`}),m?(0,R.jsx)(dm,{accept:`application/json,.json`,onChange:m,children:e=>(0,R.jsx)(eTe,{...e,children:`Choose file…`})}):null]}),(0,R.jsx)(Gd,{variant:`separated`,transitionDuration:325,...f?{value:d?`file-contents`:null,onChange:e=>f(e===`file-contents`)}:{defaultValue:`file-contents`},children:(0,R.jsxs)(Gd.Item,{value:`file-contents`,children:[(0,R.jsx)(Gd.Control,{bg:p?`var(--mantine-color-default-hover)`:void 0,children:`File Contents`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsx)(tTe,{value:e.rawText,onChange:e=>i(e.currentTarget.value),rightSection:e.rawText?(0,R.jsx)(d3,{onClick:()=>i(``)}):null})})]})}),h&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Gd,{variant:`separated`,defaultValue:`validation`,children:(0,R.jsxs)(Gd.Item,{value:`validation`,children:[(0,R.jsx)(Gd.Control,{children:`Validation Results`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsx)(U,{gap:`xs`,children:t.map((e,t)=>{let{icon:n,color:r}=Zwe[e.type];return(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(H,{c:r,children:n}),(0,R.jsx)(H,{size:`sm`,children:e.message})]},t)})})})]})}),n&&n.length>1&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(lm,{}),(0,R.jsx)(uv,{order:5,children:`Package Selection:`}),(0,R.jsx)(t_.Group,{value:String(e.selectedPackageIndex??0),onChange:e=>a(Number(e)),children:(0,R.jsx)(U,{gap:`xs`,children:n.map((e,t)=>(0,R.jsx)(t_,{value:String(t),label:iTe(e)},t))})})]}),r.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(lm,{}),(0,R.jsx)(uv,{order:5,children:`Environment Variables:`}),r.map(e=>(0,R.jsx)(ov,{label:e.name,description:e.description,withAsterisk:e.required,value:e.value,onChange:t=>o(e.name,t.currentTarget.value),rightSectionPointerEvents:`auto`,rightSection:e.value?(0,R.jsx)(d3,{onClick:()=>o(e.name,``)}):null},e.name))]}),(0,R.jsx)(Gd,{variant:`separated`,defaultValue:`server-name`,children:(0,R.jsxs)(Gd.Item,{value:`server-name`,children:[(0,R.jsx)(Gd.Control,{children:`Server Name`}),(0,R.jsx)(Gd.Panel,{children:(0,R.jsxs)(U,{gap:`sm`,children:[(0,R.jsx)(nTe,{value:c??``}),(0,R.jsx)(rTe,{value:e.nameOverride??``,onChange:e=>s(e.currentTarget.value),rightSection:e.nameOverride?(0,R.jsx)(d3,{onClick:()=>s(``)}):null})]})})]})})]}),(0,R.jsx)(V,{justify:`flex-end`,children:(0,R.jsx)(Xp,{onClick:l,disabled:u,children:`Add Server`})})]})}var oTe=H.withProps({fw:700,span:!0}),sTe=_h.withProps({size:`lg`,centered:!0});function cTe({opened:e,existingIds:t,onClose:n,onAddServer:r}){let i=Xwe({opened:e,existingIds:t,onAddServer:r});return(0,R.jsx)(sTe,{opened:e,onClose:n,title:(0,R.jsx)(oTe,{children:`Import from registry config`}),children:(0,R.jsx)(aTe,{draft:i.draft,validation:i.validation,packages:i.packages,envVars:i.envVars,addDisabled:!i.canAdd,fileContentsOpen:i.fileContentsOpen,onFileContentsChange:i.setFileContentsOpen,fileContentsHighlight:i.fileContentsHighlight,onJsonChange:i.setRawText,onSelectPackage:i.selectPackage,onEnvVarChange:i.setEnvVar,onServerNameChange:i.setServerName,defaultServerName:i.defaultServerName,onAddServer:()=>{i.submit().then(e=>{e&&n()})},onPickFile:e=>void i.pickFile(e)})})}var lTe={tools:`Tools`,resources:`Resources`,prompts:`Prompts`,logging:`Logging`,completions:`Completions`,tasks:`Tasks`,experimental:`Experimental`,roots:`Roots`,sampling:`Sampling`,elicitation:`Elicitation`};function C9({capability:e,supported:t,count:n}){let r=lTe[e]??String(e),i=n==null?r:`${r} (${n})`;return(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(H,{c:t?`green`:`red`,children:t?`✓`:`✗`}),(0,R.jsx)(H,{children:i})]})}var uTe=Dd.withProps({justify:`space-between`,align:`center`,gap:`sm`,wrap:`nowrap`}),dTe=H.withProps({size:`sm`}),fTe=Dd.withProps({gap:4,align:`center`,wrap:`nowrap`}),w9=Xp.withProps({variant:`subtle`,size:`compact-xs`}),pTe=Dd.withProps({align:`flex-start`,gap:4,wrap:`nowrap`}),mTe=Dd.withProps({flex:1,miw:0,direction:`column`}),hTe=im.withProps({block:!0,py:`xs`,ps:`xs`,pe:0,variant:`wrapping`});function gTe({token:e}){return(0,R.jsx)(R.Fragment,{children:e.split(`.`).map((e,t)=>(0,R.jsxs)(D.Fragment,{children:[t>0&&`.`,e]},t))})}function _Te({accessToken:e,onClear:t,clearLabel:n=`Clear`}){let[r,i]=(0,D.useState)(!1),a=aB(e),o=(0,D.useMemo)(()=>a?oB(e):void 0,[e,a]),s=(0,D.useMemo)(()=>{if(o)return JSON.stringify({header:o.header,payload:o.payload},null,2)},[o]);return(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(uTe,{children:[(0,R.jsx)(dTe,{children:`Access Token`}),(0,R.jsxs)(fTe,{children:[o&&(0,R.jsx)(w9,{onClick:()=>i(e=>!e),"aria-pressed":r,children:r?`Show token`:`Decode JWT`}),t&&(0,R.jsx)(w9,{color:`red`,onClick:t,children:n})]})]}),(0,R.jsxs)(pTe,{children:[(0,R.jsx)(mTe,{children:(0,R.jsx)(hTe,{children:r&&s?s:a?(0,R.jsx)(gTe,{token:e}):e})}),(0,R.jsx)(R4,{value:r&&s?s:e,flush:!0})]})]})}var T9=H.withProps({size:`sm`,fw:600}),E9=`— (not reported by server)`,D9=uv.withProps({order:3,size:`h5`,variant:`section`}),O9=im.withProps({variant:`wrapping`}),vTe=Xp.withProps({variant:`subtle`,color:`red`,size:`compact-xs`});function yTe(e){return e.join(`, `)}function bTe(e){return e===`ema`?`Enterprise-managed`:`Standard`}function xTe(e){switch(e){case`logged_in`:return`Signed in`;case`expired`:return`Session expired`;default:return`Not signed in`}}function STe(e){switch(e){case`static`:return`Static (preregistered)`;case`dcr`:return`Dynamic (DCR)`;case`cimd`:return`Client ID Metadata (CIMD)`}}function CTe(e,t){return t===`stdio`?`N/A (stdio)`:R8(e)?`Sessionless`:`Session-based`}function k9(e){let t=e?Object.keys(e):[];return t.length>0?t.join(`, `):`—`}var wTe=[`tools`,`resources`,`prompts`,`logging`,`completions`,`tasks`,`experimental`],TTe=[`roots`,`sampling`,`elicitation`,`experimental`];function A9(e,t){return t.map(t=>({capability:t,supported:t in e&&e[t]!=null}))}function ETe({initializeResult:e,serverInfoReported:t=!0,clientCapabilities:n,transport:r,protocolEra:i,discoverResult:a,oauth:o,onClearOAuth:s}){let{serverInfo:c,protocolVersion:l,capabilities:u,instructions:d}=e,f=t?c.name?.trim()||`—`:E9,p=t?c.version?.trim()||`—`:E9,m=A9(u,wTe),h=A9(n,TTe);return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Server Implementation`}),(0,R.jsxs)(N_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Name`}),(0,R.jsx)(T9,{children:f}),(0,R.jsx)(H,{size:`sm`,children:`Version`}),(0,R.jsx)(T9,{children:p}),(0,R.jsx)(H,{size:`sm`,children:`Protocol`}),(0,R.jsx)(T9,{children:l||`—`}),(0,R.jsx)(H,{size:`sm`,children:`Transport`}),(0,R.jsx)(Vp,{variant:`outline`,children:r}),(0,R.jsx)(H,{size:`sm`,children:`Era`}),(0,R.jsx)(I5,{era:i}),(0,R.jsx)(H,{size:`sm`,children:`Session`}),(0,R.jsx)(T9,{children:CTe(i,r)})]})]}),a&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Discovery`}),(0,R.jsxs)(N_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Supported versions`}),(0,R.jsx)(T9,{children:a.supportedVersions.length>0?a.supportedVersions.join(`, `):`—`})]})]}),(0,R.jsxs)(N_,{cols:2,children:[(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Server Capabilities`}),m.map(e=>(0,R.jsx)(C9,{capability:e.capability,supported:e.supported},e.capability))]}),(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Client Capabilities`}),h.map(e=>(0,R.jsx)(C9,{capability:e.capability,supported:e.supported},e.capability))]})]}),(0,R.jsxs)(N_,{cols:2,children:[(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Server Extensions`}),(0,R.jsx)(T9,{children:k9(u.extensions)})]}),(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Client Advertised Extensions`}),(0,R.jsx)(T9,{children:k9(n.extensions)})]})]}),d&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`Server Instructions`}),(0,R.jsx)(bl.Autosize,{mah:280,children:(0,R.jsx)($4,{block:{type:`text`,text:d},copyable:!0})})]}),o&&(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(D9,{children:`OAuth Details`}),(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsxs)(N_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Protocol`}),(0,R.jsx)(T9,{children:bTe(o.protocol)}),(0,R.jsx)(H,{size:`sm`,children:`Status`}),(0,R.jsx)(Vp,{variant:`outline`,color:o.authorized?`green`:`gray`,children:o.authorized?`Authorized`:`Not authorized`})]}),o.clientId&&(0,R.jsxs)(N_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Client ID`}),(0,R.jsx)(O9,{children:o.clientId})]}),o.clientRegistrationKind&&(0,R.jsxs)(N_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Client registration`}),(0,R.jsx)(T9,{children:STe(o.clientRegistrationKind)})]}),o.protocol===`ema`&&o.idpSession&&(0,R.jsxs)(N_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`IdP session`}),(0,R.jsx)(T9,{children:xTe(o.idpSession)})]}),o.authUrl&&(0,R.jsxs)(N_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Auth URL`}),(0,R.jsx)(O9,{children:o.authUrl})]}),o.scopes&&o.scopes.length>0&&(0,R.jsxs)(N_,{cols:2,children:[(0,R.jsx)(H,{size:`sm`,children:`Scopes`}),(0,R.jsx)(T9,{children:yTe(o.scopes)})]}),o.accessToken?(0,R.jsx)(_Te,{accessToken:o.accessToken,onClear:s,clearLabel:`Clear OAuth state and disconnect`}):s&&(0,R.jsx)(Dd,{justify:`flex-end`,children:(0,R.jsx)(vTe,{onClick:s,children:`Clear OAuth state and disconnect`})})]})]})]})}var DTe=_h.Root.withProps({size:`lg`,centered:!0,scrollAreaComponent:bl.Autosize}),OTe=V.withProps({justify:`space-between`,wrap:`nowrap`,w:`100%`});function kTe({opened:e,onClose:t,initializeResult:n,serverInfoReported:r,clientCapabilities:i,transport:a,protocolEra:o,discoverResult:s,oauth:c,onClearOAuth:l}){return(0,R.jsxs)(DTe,{opened:e,onClose:t,children:[(0,R.jsx)(_h.Overlay,{}),(0,R.jsxs)(_h.Content,{children:[(0,R.jsx)(_h.Header,{children:(0,R.jsxs)(OTe,{children:[(0,R.jsx)(_h.Title,{flex:1,children:`Connection Info`}),(0,R.jsx)(ju,{"aria-label":`Close`,onClick:t})]})}),(0,R.jsx)(_h.Body,{children:(0,R.jsx)(ETe,{initializeResult:n,serverInfoReported:r,clientCapabilities:i,transport:a,protocolEra:o,discoverResult:s,oauth:c,onClearOAuth:l})})]})]})}function ATe(e){let t=(e.grantedScope??e.configuredScope)?.split(` `).filter(Boolean);return{protocol:e.protocol,authorized:e.authorized,...e.client?.clientId&&{clientId:e.client.clientId},...e.client?.registrationKind&&{clientRegistrationKind:e.client.registrationKind},...e.authorizationServerMetadata?.authorization_endpoint&&{authUrl:e.authorizationServerMetadata.authorization_endpoint},...t&&t.length>0&&{scopes:t},...e.tokens?.access_token&&{accessToken:e.tokens.access_token},...e.protocol===`ema`&&e.ema?.idpSession&&{idpSession:e.ema.idpSession}}}var jTe=_h.withProps({withCloseButton:!1,size:`lg`,centered:!0}),MTe=V.withProps({justify:`space-between`,wrap:`nowrap`}),NTe=H.withProps({size:`sm`,c:`dimmed`}),PTe=Mm.withProps({"aria-label":`Validation details`,readOnly:!0,autosize:!0,minRows:6,maxRows:18});function FTe({opened:e,onClose:t,toolName:n,message:r}){return(0,R.jsx)(jTe,{opened:e,onClose:t,children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(MTe,{children:[(0,R.jsx)(_h.Title,{flex:1,children:`Output schema validation`}),(0,R.jsx)(ju,{"aria-label":`Close`,onClick:t})]}),(0,R.jsx)(NTe,{children:n?`"${n}" returned structuredContent that does not match its declared outputSchema. The inspector renders the app anyway, but strict MCP clients may refuse to display it.`:`The tool result's structuredContent does not match the declared outputSchema. The inspector renders the app anyway, but strict MCP clients may refuse to display it.`}),(0,R.jsx)(PTe,{value:r??``})]})})}var ITe=_h.withProps({withCloseButton:!1,size:`lg`,centered:!0}),LTe=V.withProps({justify:`space-between`,wrap:`nowrap`}),RTe=H.withProps({size:`sm`,c:`dimmed`}),zTe=Mm.withProps({"aria-label":`Error details`,readOnly:!0,autosize:!0,minRows:6,maxRows:18});function BTe({opened:e,onClose:t,toolName:n,details:r}){return(0,R.jsx)(ITe,{opened:e,onClose:t,children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(LTe,{children:[(0,R.jsx)(_h.Title,{flex:1,children:`URL elicitation required`}),(0,R.jsx)(ju,{"aria-label":`Close`,onClick:t})]}),(0,R.jsx)(RTe,{children:n?`"${n}" returned a URLElicitationRequired (-32042) error with no required elicitations. Per the MCP spec the error must list the URL elicitations to complete before retrying, so the inspector has nothing to open.`:`The server returned a URLElicitationRequired (-32042) error with no required elicitations. Per the MCP spec the error must list the URL elicitations to complete before retrying, so the inspector has nothing to open.`}),(0,R.jsx)(zTe,{value:r??``})]})})}var VTe=V.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),HTe=kl.withProps({p:`sm`,radius:`sm`,bg:`var(--inspector-surface-subtle)`,withBorder:!0}),UTe=_h.withProps({size:`md`,centered:!0,title:`Remove server?`}),WTe=H.withProps({component:`span`,fw:600}),GTe=H.withProps({size:`sm`,fw:600}),KTe=H.withProps({size:`xs`,c:`dimmed`}),qTe=H.withProps({c:`red`,size:`sm`,role:`alert`});function JTe(e){return e?`url`in e?e.url:[e.command,...e.args??[]].join(` `):``}function YTe({opened:e,target:t,onConfirm:n,onCancel:r}){let[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(void 0);async function c(){if(t){s(void 0),a(!0);try{await n()}catch(e){s(e instanceof Error?e.message:String(e))}finally{a(!1)}}}return(0,R.jsx)(UTe,{opened:e,onClose:r,children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(H,{size:`sm`,children:[`The entry will be removed from`,` `,(0,R.jsx)(WTe,{children:`~/.mcp-inspector/mcp.json`}),`. You can add it back at any time.`]}),t?(0,R.jsx)(HTe,{children:(0,R.jsxs)(U,{gap:4,children:[(0,R.jsx)(GTe,{children:t.id}),(0,R.jsxs)(KTe,{children:[t.config.type??`stdio`,` · `,JTe(t.config)]})]})}):null,o?(0,R.jsx)(qTe,{children:o}):null,(0,R.jsxs)(VTe,{children:[(0,R.jsx)(Xp,{variant:`default`,onClick:r,disabled:i,children:`Cancel`}),(0,R.jsx)(Xp,{color:`red`,onClick:()=>{c()},loading:i,children:`Remove`})]})]})})}var XTe=V.withProps({justify:`flex-end`,gap:`sm`,mt:`md`}),j9=H.withProps({component:`span`,ff:`monospace`,size:`sm`}),ZTe=_h.withProps({size:`md`,centered:!0}),M9=H.withProps({size:`sm`,fw:600}),QTe=H.withProps({size:`xs`,c:`dimmed`}),$Te=Vm.withProps({size:`sm`,spacing:`xs`,listStyleType:`none`}),eEe=Vm.withProps({size:`sm`,spacing:`xs`}),tEe=V.withProps({gap:`xs`,wrap:`nowrap`}),nEe=Vp.withProps({size:`xs`,variant:`light`});function rEe({opened:e,challenge:t,authorizationScopes:n,enterpriseManaged:r,onAuthorize:i,onCancel:a}){let o=t?oV(t):[],s=r===!0,c=()=>void i(),l=new Set(o),u=n??o,d=u.filter(e=>!l.has(e)),f=!s&&d.length>0;return(0,R.jsx)(ZTe,{opened:e,onClose:a,title:nV({enterpriseManaged:s}),children:(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsxs)(H,{size:`sm`,children:[eV(t||{reason:`insufficient_scope`},{enterpriseManaged:s}),` `,tV({enterpriseManaged:s})]}),f?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(M9,{children:`Scopes to authorize`}),(0,R.jsx)(QTe,{children:`Re-authorizing with the union of your previously granted scopes and the ones this operation requires, so the new token keeps every grant (SEP-2350).`}),(0,R.jsx)($Te,{children:u.map(e=>(0,R.jsx)(Vm.Item,{children:(0,R.jsxs)(tEe,{children:[(0,R.jsx)(j9,{children:e}),(0,R.jsx)(nEe,{color:l.has(e)?`blue`:`gray`,children:l.has(e)?`new`:`already granted`})]})},e))})]}):o.length>0?(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(M9,{children:s?`Additional permissions needed`:`Additional scopes needed`}),(0,R.jsx)(eEe,{children:o.map(e=>(0,R.jsx)(Vm.Item,{children:(0,R.jsx)(j9,{children:e})},e))})]}):null,(0,R.jsxs)(XTe,{children:[(0,R.jsx)(Xp,{variant:`default`,onClick:a,children:`Cancel`}),(0,R.jsx)(Xp,{onClick:c,children:`Authorize`})]})]})})}var iEe=`Re-authentication required`,aEe=`Re-authenticate`,oEe=Jd.withProps({color:`red`,variant:`reauth`,withCloseButton:!0,closeButtonLabel:`Dismiss`}),sEe=V.withProps({justify:`space-between`,align:`center`,wrap:`nowrap`,gap:`md`}),cEe=H.withProps({component:`span`,size:`sm`}),lEe=Xp.withProps({size:`xs`,variant:`filled`});function uEe({message:e,title:t=iEe,actionLabel:n=aEe,onReauthenticate:r,onDismiss:i}){return(0,R.jsx)(oEe,{title:t,onClose:i,children:(0,R.jsxs)(sEe,{children:[(0,R.jsx)(cEe,{children:e}),(0,R.jsx)(lEe,{onClick:r,children:n})]})})}var dEe=V.withProps({gap:`xs`,align:`center`,wrap:`nowrap`}),fEe=H.withProps({size:`xs`,c:`dimmed`}),pEe=Vp.withProps({variant:`outline`,color:`blue`}),mEe={"input-required":`The server returned input_required; your answer is sent back as a retry of the original request (MRTR).`,"task-input-required":`This task reached input_required; your answer is submitted via a tasks/update request (SEP-2663), not a retry.`};function N9({origin:e=`server-request`}){let t=mEe[e];return t?(0,R.jsxs)(dEe,{children:[(0,R.jsx)(pEe,{children:`input_required`}),(0,R.jsx)(fEe,{children:t})]}):null}function P9(e){return e<.4?`low (${e})`:e<=.7?`medium (${e})`:`high (${e})`}function F9(e,t){return e===void 0?t:String(e)}function hEe(e){return JSON.stringify(e)}var I9=uv.withProps({order:3,size:`h5`}),gEe=H.withProps({size:`sm`,c:`dimmed`}),_Ee=bl.Autosize.withProps({mah:`calc(90dvh - 10rem)`,scrollbars:`y`,offsetScrollbars:!0}),vEe=U.withProps({gap:`md`}),yEe=kl.withProps({p:`sm`,withBorder:!0}),bEe=Xp.withProps({variant:`light`,color:`red`}),xEe=Mm.withProps({"aria-label":`Response`,autosize:!0,minRows:3,rightSectionPointerEvents:`auto`}),SEe=ov.withProps({label:`Model Used`,rightSectionPointerEvents:`auto`}),CEe=T_.withProps({label:`Stop Reason`,data:[`endTurn`,`stopSequence`,`maxTokens`]});function wEe({request:e,draftResult:t,onResultChange:n,onSend:r,onReject:i,origin:a=`server-request`,busy:o=!1}){let{messages:s,modelPreferences:c,maxTokens:l,stopSequences:u,temperature:d,includeContext:f}=e,p=c?.hints?.map(e=>e.name).filter(Boolean)??[];return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(_Ee,{children:(0,R.jsxs)(vEe,{children:[(0,R.jsx)(gEe,{children:`The server is requesting an LLM completion.`}),(0,R.jsx)(N9,{origin:a}),(0,R.jsx)(I9,{children:`Messages:`}),s.map((e,t)=>(0,R.jsx)(N8,{index:t,message:e},t)),c&&(0,R.jsx)(yEe,{children:(0,R.jsxs)(U,{gap:`xs`,children:[(0,R.jsx)(I9,{children:`Model Preferences:`}),p.length>0&&(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(H,{size:`sm`,children:`Hints:`}),p.map(e=>(0,R.jsx)(Vp,{children:e},e))]}),c?.costPriority!==void 0&&(0,R.jsxs)(H,{size:`sm`,children:[`Cost Priority:`,` `,P9(c.costPriority)]}),c?.speedPriority!==void 0&&(0,R.jsxs)(H,{size:`sm`,children:[`Speed Priority:`,` `,P9(c.speedPriority)]}),c?.intelligencePriority!==void 0&&(0,R.jsxs)(H,{size:`sm`,children:[`Intelligence Priority:`,` `,P9(c.intelligencePriority)]})]})}),(0,R.jsx)(I9,{children:`Parameters:`}),(0,R.jsxs)(H,{size:`sm`,children:[`Max Tokens: `,F9(l,`not specified`)]}),(0,R.jsxs)(H,{size:`sm`,children:[`Stop Sequences:`,` `,u?hEe(u):`not specified`]}),(0,R.jsxs)(H,{size:`sm`,children:[`Temperature: `,F9(d,`not specified`)]}),f&&(0,R.jsxs)(V,{gap:`xs`,children:[(0,R.jsx)(H,{size:`sm`,children:`Include Context:`}),(0,R.jsx)(Vp,{children:f})]}),(0,R.jsx)(lm,{}),(0,R.jsx)(I9,{children:`Response:`}),(0,R.jsx)(xEe,{value:t.content.type===`text`?t.content.text:``,onChange:e=>n({...t,content:{type:`text`,text:e.currentTarget.value}}),rightSection:t.content.type===`text`&&t.content.text?(0,R.jsx)(d3,{onClick:()=>n({...t,content:{type:`text`,text:``}})}):null}),(0,R.jsxs)(V,{children:[(0,R.jsx)(SEe,{value:t.model,onChange:e=>n({...t,model:e.currentTarget.value}),rightSection:t.model?(0,R.jsx)(d3,{onClick:()=>n({...t,model:``})}):null}),(0,R.jsx)(CEe,{value:t.stopReason??null,onChange:e=>n({...t,stopReason:e??void 0})})]})]})}),(0,R.jsxs)(V,{justify:`flex-end`,children:[(0,R.jsx)(bEe,{onClick:i,disabled:o,children:`Reject`}),(0,R.jsx)(Xp,{onClick:r,disabled:o,children:`Send Response`})]})]})}var TEe=H.withProps({size:`md`,fs:`italic`}),EEe=bl.Autosize.withProps({mah:`calc(90dvh - 22rem)`,scrollbars:`y`,offsetScrollbars:!0}),DEe=Jd.withProps({variant:`warning`,title:`Warning`}),OEe=Xp.withProps({variant:`light`,color:`red`});function kEe(e){return`\u201C${e}\u201D`}function AEe(e){return`Only provide information you trust this server with. The server \u201C${e}\u201D is requesting this data.`}function jEe({request:e,serverName:t,values:n,onChange:r,onSubmit:i,onDecline:a,onCancel:o,origin:s=`server-request`,busy:c=!1}){let l=e.requestedSchema,u=c||b3(l,n);return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(TEe,{children:kEe(e.message)}),(0,R.jsx)(N9,{origin:s}),(0,R.jsx)(lm,{}),(0,R.jsx)(EEe,{children:(0,R.jsx)(E3,{schema:l,values:n,onChange:r,disabled:c})}),(0,R.jsx)(DEe,{children:AEe(t)}),(0,R.jsxs)(V,{justify:`flex-end`,children:[(0,R.jsx)(Xp,{variant:`light`,onClick:o,disabled:c,children:`Cancel`}),(0,R.jsx)(OEe,{onClick:a,disabled:c,children:`Decline`}),(0,R.jsx)(Xp,{onClick:i,disabled:u,children:`Submit`})]})]})}var MEe=H.withProps({size:`md`,fs:`italic`}),NEe=im.withProps({block:!0,variant:`wrapping`}),PEe=H.withProps({size:`sm`,c:`dimmed`}),FEe=H.withProps({size:`xs`,c:`dimmed`}),IEe=Jd.withProps({variant:`warning`,title:`Warning`});function LEe(e){return`Request ID: ${e}`}function REe({message:e,url:t,requestId:n,isWaiting:r,onCopyUrl:i,onOpenInBrowser:a,onComplete:o,onCancel:s,origin:c=`server-request`,busy:l=!1}){return(0,R.jsxs)(U,{gap:`md`,children:[(0,R.jsx)(MEe,{children:e}),(0,R.jsx)(N9,{origin:c}),(0,R.jsx)(lm,{}),(0,R.jsx)(H,{size:`sm`,children:`The server is requesting you visit:`}),(0,R.jsx)(NEe,{children:t}),(0,R.jsxs)(V,{children:[(0,R.jsx)(Xp,{variant:`light`,onClick:i,children:`Copy URL`}),(0,R.jsx)(Xp,{variant:`light`,onClick:a,disabled:l,children:r?`Reopen in Browser`:`Open in Browser`})]}),(0,R.jsx)(lm,{}),r&&(0,R.jsxs)(V,{children:[(0,R.jsx)(vu,{size:`sm`}),(0,R.jsx)(PEe,{children:`Waiting for completion...`})]}),(0,R.jsx)(FEe,{children:LEe(n)}),(0,R.jsx)(IEe,{children:`This will open an external URL. Verify the domain before proceeding.`}),(0,R.jsxs)(V,{justify:`flex-end`,children:[(0,R.jsx)(Xp,{variant:`light`,onClick:s,disabled:l,children:`Cancel`}),r&&(0,R.jsx)(Xp,{onClick:o,disabled:l,children:`I've completed it`})]})]})}var zEe=V.withProps({justify:`space-between`,gap:`md`,w:`100%`,wrap:`nowrap`}),BEe=H.withProps({fw:600}),VEe=H.withProps({size:`xs`,c:`dimmed`}),HEe=_h.withProps({withCloseButton:!1,closeOnClickOutside:!1,closeOnEscape:!1,size:`lg`});function UEe(){return{model:`stub-model`,stopReason:`endTurn`,role:`assistant`,content:{type:`text`,text:``}}}function WEe(e){return e.kind===`sampling`?`Sampling Request`:`Elicitation Request`}function GEe(){}function L9(){let[e,t]=(0,D.useState)(!1),n=(0,D.useRef)(!1);return{responded:e,once:e=>()=>{n.current||(n.current=!0,t(!0),e())}}}function KEe({request:e,origin:t,onRespond:n,onReject:r}){let[i,a]=(0,D.useState)(UEe),{responded:o,once:s}=L9();return(0,R.jsx)(wEe,{request:e,origin:t,draftResult:i,onResultChange:a,onSend:s(()=>n(i)),onReject:s(r),busy:o})}function qEe({request:e,serverName:t,origin:n,onRespond:r}){let[i,a]=(0,D.useState)(()=>y3(e.requestedSchema)),{responded:o,once:s}=L9();return(0,R.jsx)(jEe,{request:e,serverName:t,origin:n,values:i,onChange:a,onSubmit:s(()=>r({action:`accept`,content:i})),onDecline:s(()=>r({action:`decline`})),onCancel:s(()=>r({action:`cancel`})),busy:o})}function JEe({id:e,message:t,url:n,origin:r,onRespond:i}){let[a,o]=(0,D.useState)(!1),{responded:s,once:c}=L9();return(0,R.jsx)(REe,{message:t,url:n,origin:r,requestId:e,isWaiting:a,onCopyUrl:()=>{navigator.clipboard?.writeText(n),o(!0)},onOpenInBrowser:()=>{window.open(n,`_blank`,`noopener,noreferrer`),o(!0)},onComplete:c(()=>i({action:`accept`})),onCancel:c(()=>i({action:`cancel`})),busy:s})}function YEe({request:e,serverName:t,queuePosition:n,onSamplingRespond:r,onSamplingReject:i,onElicitationRespond:a}){return(0,R.jsxs)(HEe,{opened:e!==null,onClose:GEe,title:e&&(0,R.jsxs)(zEe,{children:[(0,R.jsx)(BEe,{children:WEe(e)}),n&&(0,R.jsx)(VEe,{children:n})]}),children:[e?.kind===`sampling`&&(0,R.jsx)(KEe,{request:e.request,origin:e.origin,onRespond:r,onReject:i},e.id),e?.kind===`elicitation-form`&&(0,R.jsx)(qEe,{request:e.request,serverName:t,origin:e.origin,onRespond:a},e.id),e?.kind===`elicitation-url`&&(0,R.jsx)(JEe,{id:e.id,message:e.message,url:e.url,origin:e.origin,onRespond:a},e.id)]})}var XEe=`deep-link`,ZEe=new Set([`http`,`sse`]);function QEe(e){if(!e)return{};let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=t+`=`.repeat((4-t.length%4)%4),r;try{r=atob(n)}catch{return{}}try{let e=JSON.parse(r);return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}catch{return{}}}function $Ee(e){let t;try{t=new URL(e)}catch{return}if(!(t.protocol!==`http:`&&t.protocol!==`https:`))return t.href}function eDe(e,t){return e.type===t.type&&(`url`in e?e.url:void 0)===(`url`in t?t.url:void 0)}function tDe(e,t){if(t)return`parsed`;let n=new URLSearchParams(e);return n.has(`serverUrl`)||n.has(`autoConnect`)?`rejected`:`none`}function nDe(e,t){let n=new URLSearchParams(e),r=n.get(`serverUrl`),i=n.get(`autoConnect`);if(!r||!i||!t||i!==t)return;let a=$Ee(r);if(!a)return;let o=n.get(`transport`)??`http`;return{serverId:XEe,serverConfig:(ZEe.has(o)?o:`http`)===`sse`?{type:`sse`,url:a}:{type:`streamable-http`,url:a},openApp:n.get(`openApp`)??void 0,appArgs:QEe(n.get(`appArgs`)),autoOpen:n.get(`autoOpen`)===t}}var rDe=`/oauth/callback`,R9=`mcp-inspector:oauth-pending-server-id`,z9=`mcp-inspector:oauth-resume`;function iDe(e){return{Apps:e.appsUi,Tools:e.toolsUi,Prompts:e.promptsUi,Resources:e.resourcesUi,Tasks:e.tasksUi,Logs:e.logsUi,Protocol:e.protocolUi,Network:e.networkUi}}function aDe(e,t){if(e)for(let n of Object.keys(e)){if(!d7(n))continue;let r=e[n];switch(n){case`Tools`:t.setToolsUi(r??M7);break;case`Prompts`:t.setPromptsUi(r??N7);break;case`Resources`:t.setResourcesUi(r??P7);break;case`Apps`:t.setAppsUi(r??F7);break;case`Tasks`:t.setTasksUi(r??I7);break;case`Logs`:t.setLogsUi(r??L7);break;case`Protocol`:t.setProtocolUi(r??R7);break;case`Network`:t.setNetworkUi(r??z7);break;default:}}}function oDe(e){if(!(typeof window>`u`))try{window.sessionStorage.setItem(z9,JSON.stringify(e))}catch{}}function sDe(){if(!(typeof window>`u`))try{let e=window.sessionStorage.getItem(z9);if(!e)return cDe();let t=JSON.parse(e);return t?.version!==1||typeof t.serverId!=`string`||!dDe(t.authKind)||typeof t.activeTab!=`string`||!fDe(t.tabUi)?void 0:t}catch{return}}function B9(){let e=sDe();return e&&V9(),e}function cDe(){try{let e=window.sessionStorage.getItem(R9);return e?{version:1,serverId:e,activeTab:u7,authKind:`reauth`,tabUi:{}}:void 0}catch{return}}function V9(){if(!(typeof window>`u`))try{window.sessionStorage.removeItem(z9),window.sessionStorage.removeItem(R9)}catch{}}function lDe(e,t){return JB(e,t)}function uDe(e){return sV(e)}function dDe(e){return e===`step_up`||e===`reauth`}function fDe(e){return e===void 0?!0:typeof e!=`object`||!e||Array.isArray(e)?!1:Object.keys(e).every(e=>d7(e))}function pDe(e,t){aDe(e.tabUi,t),t.setActiveTab(e.activeTab),t.clearToolCallState(),t.clearGetPromptState(),t.clearReadResourceState()}var mDe=class extends Kz{constructor(e,t){super(n=>{if(typeof window>`u`)throw Error(`BrowserNavigation requires browser environment`);return t?.(n),window.location.href=n.href,e?.(n)})}};function hDe(e,t,n){let r=`${window.location.protocol}//${window.location.host}`,i=(...e)=>globalThis.fetch(...e),a=FH({baseUrl:r,authToken:e,fetchFn:i});return{environment:{transport:kH({baseUrl:r,authToken:e,fetchFn:i}),fetch:MH({baseUrl:r,authToken:e,fetchFn:i}),logger:a,oauth:{storage:oU(e),navigation:new mDe(void 0,n),redirectUrlProvider:t}},logger:a}}async function H9(e){let t=Hre(e.config);return t?(e.isActiveConnection&&e.inspectorClient?await e.inspectorClient.clearOAuthTokens():await e.oauthStorage.clear(t),!0):!1}function U9(){return typeof document<`u`&&document.visibilityState===`visible`}function gDe(e){if(typeof document>`u`)return()=>{};let t=()=>{document.visibilityState===`visible`&&e()};return document.addEventListener(`visibilitychange`,t),()=>document.removeEventListener(`visibilitychange`,t)}var _De={getRedirectUrl:()=>`${window.location.origin}${rDe}`};function W9(){if(typeof window>`u`)return;let e=zV.AUTH_TOKEN,t=t=>{try{window.sessionStorage.setItem(e,t)}catch{}},n=ON(window)[BV];if(typeof n==`string`&&n)return t(n),n;let r=new URLSearchParams(window.location.search).get(zV.AUTH_TOKEN);if(r)return t(r),r;try{return window.sessionStorage.getItem(e)??void 0}catch{return}}function vDe(e){let t=[];for(let n of e){if(n.direction!==`notification`||!(`method`in n.message)||n.message.method!==`notifications/message`)continue;let e=n.message.params;t.push({receivedAt:n.timestamp,params:e})}return t}async function yDe(e,t,n,r){if(!E5(t))return`Replay isn't supported for "${t}".`;let i=typeof n?.cursor==`string`?n.cursor:void 0;switch(t){case`tools/call`:{let t=typeof n?.name==`string`?n.name:void 0,i=r.find(e=>e.name===t);return i?(await e.callTool(i,n?.arguments??{}),null):`Tool "${t??`?`}" is no longer available to replay.`}case`prompts/get`:{let t=typeof n?.name==`string`?n.name:void 0;return t?(await e.getPrompt(t,n?.arguments??{}),null):`Prompt name is missing; cannot replay.`}case`resources/read`:{let t=typeof n?.uri==`string`?n.uri:void 0;return t?(await e.readResource(t),null):`Resource URI is missing; cannot replay.`}case`tools/list`:return await e.listTools(i),null;case`prompts/list`:return await e.listPrompts(i),null;case`resources/list`:return await e.listResources(i),null;case`resources/templates/list`:return await e.listResourceTemplates(i),null;case`tasks/list`:return await e.listRequestorTasks(i),null;case`ping`:return await e.ping(),null;default:return`Replay isn't supported for "${t}".`}}var G9={headers:[],env:[],metadata:[],connectionTimeout:0,requestTimeout:0,taskTtl:Ure,autoRefreshOnListChanged:!1,paginatedLists:!1,maxFetchRequests:Wre,roots:[]};function K9(e){return`fetch-body-dropped-${e}`}var bDe=`client-config-load-error`,xDe=Vm.withProps({size:`sm`,spacing:2}),q9=tf.withProps({component:`button`,type:`button`,size:`sm`}),SDe=kl.withProps({px:`md`,pt:`xs`,pos:`sticky`,top:60,bg:`var(--mantine-color-body)`,shadow:`sm`,styles:{root:{zIndex:200}},radius:0}),CDe=({maxFetchRequests:e,onAdjust:t})=>(0,R.jsxs)(U,{gap:4,children:[(0,R.jsxs)(H,{size:`sm`,children:[`A response body arrived after its Network log entry had already rotated out (the log hit its `,e,`-request limit), so the body couldn't be shown. This usually indicates:`]}),(0,R.jsxs)(xDe,{children:[(0,R.jsx)(Vm.Item,{children:`a chatty or misbehaving server (notification storms, rapid polling)`}),(0,R.jsx)(Vm.Item,{children:`an SSE/transport reconnect or retry storm`}),(0,R.jsx)(Vm.Item,{children:`a slow streaming call racing against high request volume`}),(0,R.jsx)(Vm.Item,{children:`the Network Log Size set too low for this server's traffic`})]}),(0,R.jsx)(q9,{onClick:t,children:`Adjust Network Log Size for this server`})]}),wDe=({onViewDetails:e})=>(0,R.jsxs)(U,{gap:4,children:[(0,R.jsx)(H,{size:`sm`,children:`The tool result's structuredContent doesn't match the tool's outputSchema. The inspector renders it anyway, but strict MCP clients may not.`}),(0,R.jsx)(q9,{onClick:e,children:`View validation details`})]}),TDe=({onViewDetails:e})=>(0,R.jsxs)(U,{gap:4,children:[(0,R.jsx)(H,{size:`sm`,children:`The server reported a URLElicitationRequired error but listed no required elicitations, so there's nothing to open.`}),(0,R.jsx)(q9,{onClick:e,children:`View error details`})]});function J9(e){return e instanceof Error?e.message:String(e)}function EDe(e){if(e&&typeof e==`object`){let t=e.code;if(typeof t==`number`)return t}}function DDe(e){if(e&&typeof e==`object`){let t=e;if(t.code!==void 0||t.data!==void 0)return JSON.stringify({code:t.code,message:t.message,data:t.data},null,2)}return J9(e)}var Y9=5e3,ODe=5e3;function kDe(e){return`progress-${String(e??`default`)}`}function ADe(e){let{progress:t,total:n,message:r}=e,i=n!==void 0&&n>0?`${t} / ${n} (${Math.round(t/n*100)}%)`:`${t}`;return r?`${r} — ${i}`:i}var jDe=new Set([`completed`,`failed`,`cancelled`]);function MDe(e){return jDe.has(e)}function X9(e){return`task-${e}`}function Z9(e){switch(e){case`completed`:return`green`;case`failed`:return`red`;case`cancelled`:return`gray`;case`input_required`:return`yellow`;default:return`blue`}}function NDe(e){return e.statusMessage??`Task ${e.status}`}function Q9(e,t){return QB(e,{enterpriseManaged:t?.settings?.enterpriseManaged})}function $9(e,t){return $B(e,{enterpriseManaged:t?.settings?.enterpriseManaged})}function PDe(){let{setColorScheme:e}=ui(),t=di(`light`)===`dark`,n=(0,D.useCallback)(()=>{e(t?`light`:`dark`)},[t,e]),{servers:r,addServer:i,updateServer:a,updateServerSettings:o,removeServer:s,reorderServers:c,importSource:l}=VH({baseUrl:typeof window<`u`?window.location.origin:`http://localhost`,authToken:W9()}),[u,d]=(0,D.useState)(null),[f,p]=(0,D.useState)(!1),[m,h]=(0,D.useState)(!1),[g,_]=(0,D.useState)([]),v=(0,D.useCallback)(e=>_(t=>t.filter(t=>t!==e)),[]),[y,b]=(0,D.useState)(void 0),[x,S]=(0,D.useState)(!1),[C,w]=(0,D.useState)(!1),[T,E]=(0,D.useState)(null),[O,k]=(0,D.useState)(null),[A,j]=(0,D.useState)(null),[M,N]=(0,D.useState)(void 0),[ee,te]=(0,D.useState)(void 0),[P,F]=(0,D.useState)(void 0),[I,ne]=(0,D.useState)(null),re=(0,D.useRef)(null),ie=typeof window<`u`?window.location.origin:`http://localhost`,{sandboxUrl:ae,writable:oe,version:se}=xU({baseUrl:ie,authToken:W9()}),[ce,le]=(0,D.useState)({});(0,D.useEffect)(()=>{typeof window>`u`||vH({baseUrl:ie,authToken:W9()}).then(le).catch(e=>{le({}),mv.show({id:bDe,title:`Could not load Client Settings`,message:`${_H(e)}\n\nCheck ~/.mcp-inspector/storage/client.json or re-enter settings in Client Settings.`,color:`red`,autoClose:!1})})},[ie]);let ue=(0,D.useMemo)(()=>cge({getClient:()=>I?.getAppRendererClient()??null,readResource:async e=>{if(!I)throw Error(`No MCP client connected.`);return(await I.readResource(e)).result},onResourceError:e=>{mv.show({title:`App resource failed to load`,message:e.message,color:`red`})}}),[I]),[de,fe]=(0,D.useState)(null),[pe,me]=(0,D.useState)(null),[he,ge]=(0,D.useState)(null),[_e,ve]=(0,D.useState)(null),[ye,be]=(0,D.useState)(null),[xe,Se]=(0,D.useState)(null),[Ce,we]=(0,D.useState)(null),[Te,Ee]=(0,D.useState)(null),[De,Oe]=(0,D.useState)(null),[ke,Ae]=(0,D.useState)(null),[je,Me]=(0,D.useState)(null),[Ne,Pe]=(0,D.useState)(null),[Fe,Ie]=(0,D.useState)(`info`),[Le,Re]=(0,D.useState)(null),[ze,Be]=(0,D.useState)(void 0),[Ve,He]=(0,D.useState)(void 0),[Ue,We]=(0,D.useState)(void 0),[Ge,Ke]=(0,D.useState)(M7),[qe,Je]=(0,D.useState)(N7),[Ye,Xe]=(0,D.useState)(P7),[Ze,Qe]=(0,D.useState)(F7),[$e,L]=(0,D.useState)(I7),[et,tt]=(0,D.useState)(L7),[nt,rt]=(0,D.useState)(R7),[it,at]=(0,D.useState)(()=>new Set),[ot,st]=(0,D.useState)(z7),[ct,lt]=(0,D.useState)(B7),[ut,dt]=(0,D.useState)(u7),[ft,pt]=(0,D.useState)(null),mt=(0,D.useRef)(ft),ht=(0,D.useRef)(null);(0,D.useEffect)(()=>{mt.current=ft},[ft]);let[gt,_t]=(0,D.useState)(null),[vt,yt]=(0,D.useState)(null),bt=(0,D.useRef)(vt);(0,D.useEffect)(()=>{bt.current=vt},[vt]);let xt=(0,D.useRef)(!1),St=(0,D.useRef)(!1);(0,D.useEffect)(()=>{let e=bt.current;e&&e.serverId!==M&&yt(null);let t=mt.current;t&&t.serverId!==M&&pt(null)},[M]);let Ct=(0,D.useCallback)(e=>mt.current===null?(pt(e),!0):(mv.show({title:`Step-up authorization in progress`,message:`Complete or cancel the current step-up prompt before starting another.`,color:`yellow`,autoClose:5e3}),!1),[]),wt=(0,D.useRef)(void 0),[Tt,Et]=(0,D.useState)(void 0),Dt=(0,D.useRef)(!1),Ot=(0,D.useRef)(!1),kt=(0,D.useRef)(!1),At=(0,D.useRef)(new Set),jt=(0,D.useRef)(new Set),Mt=(0,D.useRef)(void 0),[Nt,Pt]=(0,D.useState)({}),{status:Ft,capabilities:It,clientCapabilities:Lt,serverInfo:Rt,instructions:zt,protocolVersion:Bt,protocolEra:Vt,discoverResult:Ht,excludedTools:Ut,lastError:Wt}=RH(I),{tools:Gt,listChanged:Kt,refresh:qt,clearListChanged:Jt}=sU(I,de),{prompts:Yt,listChanged:Xt,refresh:Zt,clearListChanged:Qt}=cU(I,pe),{resources:$t,listChanged:en,refresh:tn,clearListChanged:nn}=lU(I,he),{resourceTemplates:rn,refresh:an}=mU(I,Ce),{tools:on,nextCursor:sn,pageCount:cn,loadPage:ln}=uU(I,_e),{prompts:un,nextCursor:dn,pageCount:fn,loadPage:pn}=dU(I,ye),{resources:mn,nextCursor:hn,pageCount:gn,loadPage:_n}=fU(I,xe),vn=r.find(e=>e.id===M)?.settings?.paginatedLists??!1,[yn,bn]=(0,D.useState)(null);(0,D.useEffect)(()=>{bn(null)},[vn,M]);let xn=yn??vn,Sn=Ft===`connected`,Cn=pU({connected:Sn,paginated:xn,managedItems:Gt,managedRefresh:qt,pagedItems:on,pagedNextCursor:sn,pagedPageCount:cn,loadPage:ln}),wn=pU({connected:Sn,paginated:xn,managedItems:Yt,managedRefresh:Zt,pagedItems:un,pagedNextCursor:dn,pagedPageCount:fn,loadPage:pn}),Tn=pU({connected:Sn,paginated:xn,managedItems:$t,managedRefresh:tn,pagedItems:mn,pagedNextCursor:hn,pagedPageCount:gn,loadPage:_n}),En=Cn.items,Dn=wn.items,On=Tn.items,{tasks:kn,refresh:An,clearCompleted:jn}=hU(I,Te),{subscriptions:Mn,streamState:Nn}=gU(De),{messages:Pn}=_U(ke),{fetchRequests:Fn}=vU(je),{stderrLogs:In}=yU(Ne),Ln=(0,D.useMemo)(()=>tCe(Pn,Fn),[Pn,Fn]);(0,D.useEffect)(()=>{if(!je||M===void 0)return;let e=e=>{mv.show({id:K9(M),title:`Network log: response body dropped`,color:`yellow`,autoClose:!1,message:(0,R.jsx)(CDe,{maxFetchRequests:e.detail.maxFetchRequests,onAdjust:()=>{mv.hide(K9(M)),b(M)}})})};return je.addEventListener(`fetchRequestBodyDropped`,e),()=>{je.removeEventListener(`fetchRequestBodyDropped`,e)}},[je,M]);let{pendingSamples:Rn,pendingElicitations:zn}=SU(I);(0,D.useEffect)(()=>{Ft===`connected`&&wt.current!==void 0?(Et(Date.now()-wt.current),wt.current=void 0):Ft!==`connected`&&Et(void 0)},[Ft]),(0,D.useEffect)(()=>{F(Ft===`connected`?M:void 0)},[Ft,M]),(0,D.useEffect)(()=>()=>{I&&I.disconnect()},[I]);let Bn=(0,D.useCallback)(()=>{V9(),kt.current=!1},[]),Vn=(0,D.useCallback)(()=>{Bn(),dt(u7)},[Bn]),Hn=(0,D.useCallback)(()=>{Be(void 0),He(void 0),We(void 0),Ke(M7),Je(N7),Xe(P7),Qe(F7),L(I7),tt(L7),rt(R7),at(new Set),st(z7),lt(B7),Pt({}),Ie(`info`);let e=Jn.current.find(e=>e.id===qn.current);Re(e?EN(e.settings)??null:null),pt(null),yt(null),_t(null),Tfe()},[]);(0,D.useEffect)(()=>{if(!I)return;let e=()=>{N(void 0),w(!1),Hn()};return I.addEventListener(`disconnect`,e),()=>{I.removeEventListener(`disconnect`,e)}},[I,Hn]),(0,D.useEffect)(()=>{if(!I)return;let e=At.current,t=t=>{let n=t.detail,r=kDe(n.progressToken),i=ADe(n);if(e.has(r)){mv.update({id:r,title:`Tool progress`,message:i,color:`blue`,autoClose:Y9});return}e.add(r),mv.show({id:r,title:`Tool progress`,message:i,color:`blue`,autoClose:Y9,onClose:()=>e.delete(r)})};return I.addEventListener(`progressNotification`,t),()=>{I.removeEventListener(`progressNotification`,t),e.forEach(e=>mv.hide(e)),e.clear()}},[I]),(0,D.useEffect)(()=>{if(!I)return;let e=e=>{let{taskId:t,progress:n}=e.detail;Pt(e=>({...e,[t]:{progress:n.progress,total:n.total,message:n.message}}))};return I.addEventListener(`requestorTaskProgress`,e),()=>{I.removeEventListener(`requestorTaskProgress`,e)}},[I]),(0,D.useEffect)(()=>{if(!I)return;let e=e=>{Mt.current=e.detail.taskId};return I.addEventListener(`toolCallTaskUpdated`,e),()=>{I.removeEventListener(`toolCallTaskUpdated`,e)}},[I]),(0,D.useEffect)(()=>{if(!I)return;let e=jt.current,t=(t,n)=>{let r=X9(t),i=MDe(n.status),a=`Task ${n.status}`,o=NDe(n),s=Z9(n.status);if(i&&Pt(e=>{if(!(t in e))return e;let n={...e};return delete n[t],n}),e.has(r)){mv.update({id:r,title:a,message:o,color:s}),i&&(mv.hide(r),e.delete(r));return}i||(e.add(r),mv.show({id:r,title:a,message:o,color:s,autoClose:!1,onClose:()=>e.delete(r)}))},n=e=>{t(e.detail.taskId,e.detail.task)},r=e=>{t(e.detail.taskId,e.detail.task)},i=t=>{let{taskId:n}=t.detail;Pt(e=>{if(!(n in e))return e;let t={...e};return delete t[n],t});let r=X9(n),i={id:r,title:`Task cancelled`,message:`The task was cancelled.`,color:Z9(`cancelled`),autoClose:ODe};e.has(r)?(mv.update(i),e.delete(r)):mv.show(i)};return I.addEventListener(`taskStatusChange`,n),I.addEventListener(`requestorTaskUpdated`,r),I.addEventListener(`taskCancelled`,i),()=>{I.removeEventListener(`taskStatusChange`,n),I.removeEventListener(`requestorTaskUpdated`,r),I.removeEventListener(`taskCancelled`,i),e.forEach(e=>mv.hide(e)),e.clear()}},[I]);let Un=(0,D.useMemo)(()=>r.find(e=>e.id===M),[r,M]),Wn=Rt!==void 0,Gn=(0,D.useMemo)(()=>{if(Ft!==`connected`)return;let e=Rt??{name:Un?.name??``,version:``};return{protocolVersion:Bt??``,capabilities:It??{},serverInfo:e,...zt?{instructions:zt}:{}}},[Ft,It,Rt,zt,Bt,Un]),Kn=(0,D.useRef)(void 0),qn=(0,D.useRef)(M),Jn=(0,D.useRef)(r);(0,D.useEffect)(()=>{Un&&(Kn.current=Un.name),qn.current=M,Jn.current=r},[Un,M,r]);let[Yn,Xn]=(0,D.useState)(void 0),Zn=(0,D.useCallback)(e=>{Xn(e)},[]),[Qn,$n]=(0,D.useMemo)(()=>{if(typeof window>`u`)return[void 0,`none`];let e=window.location.search,t=nDe(e,W9());return[t,tDe(e,t)]},[]),er=(0,D.useRef)(!1),tr=(0,D.useRef)(!1),nr=(0,D.useRef)(!1),rr=(0,D.useCallback)((e,t,n)=>{let r=vV({serverName:Jn.current.find(t=>t.id===e)?.name,detail:t===void 0?void 0:dz(t)}),i=n?.reason;if(i!==void 0&&!lV(i)){mv.show({title:`Authorization required`,message:r,color:`yellow`,autoClose:!1});return}_t({serverId:e,message:r})},[]);(0,D.useEffect)(()=>{if(!Wt)return;let e=Kn.current;mv.show({title:e?`Connection to "${e}" lost`:`Connection lost`,message:Wt,color:`red`})},[Wt]);let ir=Un?.config.type??`stdio`,[ar,or]=(0,D.useState)(void 0),sr=Ft===`connected`&&I?ar:void 0;(0,D.useEffect)(()=>{if(Ft!==`connected`||!I)return;let e=!1,t=()=>{I.getOAuthState().then(t=>{e||or(t?ATe(t):void 0)})},n=()=>{let e=Kn.current;mv.show({title:e?`Refreshing authorization for "${e}"`:`Refreshing authorization`,message:`Refreshing authorization…`,color:`blue`,autoClose:4e3})};return t(),I.addEventListener(`oauthComplete`,t),I.addEventListener(`authChallengeAmbient`,n),()=>{e=!0,I.removeEventListener(`oauthComplete`,t),I.removeEventListener(`authChallengeAmbient`,n)}},[Ft,I]);let cr=Ft===`connected`&&!!I&&(ir===`streamable-http`||ir===`sse`),lr=(0,D.useMemo)(()=>vDe(Pn),[Pn]),ur=(0,D.useMemo)(()=>oU(W9()),[]),dr=(0,D.useMemo)(()=>new IH({baseUrl:typeof window<`u`?window.location.origin:`http://localhost`,authToken:W9()}),[]),fr=(0,D.useRef)(null),pr=(0,D.useCallback)(e=>{let t=e.searchParams.get(`state`),n=t?hz(t)?.authId??void 0:void 0;if(!n)return;let r=fr.current?.getFetchRequests()??[];if(r.length===0)return;let i=Date.now();dr.saveSession(n,{fetchRequests:r,createdAt:i,updatedAt:i}).catch(()=>{})},[dr]),mr=(0,D.useCallback)(({serverId:e,authKind:t,authorizationUrl:n,authChallenge:r,recoverySource:i,preRedirectContext:a,client:o})=>{_t(null);let s=Jn.current.find(t=>t.id===e),c=cV(t,{serverName:s?.name,enterpriseManaged:s?.settings?.enterpriseManaged,context:a});c&&mv.show({title:c.title,message:c.message,color:`blue`,autoClose:4e3});let l=o??I,u=l?.getRemoteBackendSessionId();pr(n),oDe({version:1,serverId:e,activeTab:ut,authKind:t,tabUi:iDe({toolsUi:Ge,promptsUi:qe,resourcesUi:Ye,appsUi:Ze,tasksUi:$e,logsUi:et,protocolUi:nt,networkUi:ot}),...u&&{remoteSessionId:u},...t===`step_up`&&r&&{authChallenge:r},...i&&{recoverySource:i}}),l?.beginInteractiveAuthorization(n)},[I,ut,Ge,qe,Ye,Ze,$e,et,nt,ot,pr]),hr=(0,D.useCallback)(async(e,t,n)=>await e.checkAuthChallengeSatisfied(t)?(await e.pushRemoteAuthState(),mv.show({title:`Authorization restored`,message:YB({recoverySource:n}),color:`green`,autoClose:4e3}),!0):!1,[]),gr=(0,D.useCallback)(({serverId:e,challenge:t,authorizationUrl:n,source:r=`ambient`})=>{let i=Jn.current.find(t=>t.id===e);if($9(t,i)){Ct({challenge:t,authorizationUrl:n,serverId:e,source:r,enterpriseManaged:Q9(t,i)});return}mr({serverId:e,authKind:`reauth`,authorizationUrl:n,recoverySource:r})},[mr,Ct]),_r=(0,D.useCallback)(e=>{bt.current?mv.show({title:`Authorization update pending`,message:`A new authorization request replaced the previous deferred recovery.`,color:`yellow`,autoClose:5e3}):mv.show({title:`Authorization pending`,message:`Return to this tab to continue authorization.`,color:`blue`,autoClose:5e3}),yt(e)},[]),vr=(0,D.useCallback)(async(e,t)=>{if(!I)return!1;let n=Jn.current.find(e=>e.id===t.serverId);return e.emaStepUpConfirm||$9(e.authChallenge,n)?await hr(I,e.authChallenge,t.source)?!0:(ht.current=t.retryOperation??null,Ct({challenge:e.authChallenge,authorizationUrl:e.authorizationUrl,serverId:t.serverId,source:t.source,enterpriseManaged:Q9(e.authChallenge,n)}),!1):await hr(I,e.authChallenge,t.source)?!0:(mr({serverId:t.serverId,authKind:`reauth`,authorizationUrl:e.authorizationUrl,recoverySource:t.source}),!1)},[I,mr,hr,Ct]),yr=(0,D.useCallback)(async(e,t)=>{if(!I||!M)return e();try{return await e()}catch(n){if(n instanceof xz)return await vr(n,{serverId:M,source:t,retryOperation:e})?e():void 0;throw n}},[I,M,vr]),br=(0,D.useCallback)(async e=>{if(xt.current)return;let t=I;if(t&&Ft===`connected`&&e.serverId===qn.current){xt.current=!0,yt(null);try{if(await hr(t,e.challenge,e.source))return;if(e.authKind===`step_up`){gr({serverId:e.serverId,challenge:e.challenge,authorizationUrl:e.authorizationUrl,source:e.source});return}let n=await t.handleAuthChallenge(e.challenge);if(n.kind===`satisfied`){await t.pushRemoteAuthState(),mv.show({title:`Authorization restored`,message:YB({recoverySource:e.source}),color:`green`,autoClose:4e3});return}if(n.kind===`interactive`){gr({serverId:e.serverId,challenge:n.challenge,authorizationUrl:n.authorizationUrl,source:e.source});return}n.kind===`failed`&&rr(e.serverId,n.error,{reason:e.challenge.reason})}finally{xt.current=!1}}},[I,Ft,hr,gr,rr]);(0,D.useEffect)(()=>{if(Ft!==`connected`||!I)return;let e=e=>{(async()=>{let{challenge:t,authorizationUrl:n}=e.detail,r=qn.current;if(!r)return;let i=$9(t,Jn.current.find(e=>e.id===r))?`step_up`:`reauth`;if(!U9()){_r({serverId:r,challenge:t,authorizationUrl:n,authKind:i,source:`ambient`});return}await hr(I,t)||gr({serverId:r,challenge:t,authorizationUrl:n,source:`ambient`})})()};return I.addEventListener(`authChallengeInteractive`,e),()=>{I.removeEventListener(`authChallengeInteractive`,e)}},[Ft,I,hr,gr,_r]),(0,D.useEffect)(()=>gDe(()=>{let e=bt.current;e&&br(e)}),[br]),(0,D.useEffect)(()=>{if(Ft!==`connected`||!I||!U9())return;let e=bt.current;e&&br(e)},[Ft,I,br]),(0,D.useEffect)(()=>{if(Ft!==`connected`||!I)return;let e=e=>{let t=qn.current;t&&rr(t,e.detail.error)};return I.addEventListener(`oauthError`,e),()=>{I.removeEventListener(`oauthError`,e)}},[Ft,I,rr]),(0,D.useEffect)(()=>{if(Ot.current||typeof window>`u`||window.location.pathname===`/oauth/callback`||r.length===0)return;Ot.current=!0;let e=B9();e&&queueMicrotask(()=>{if(e.authKind===`reauth`){rr(e.serverId,XB(e.authKind));return}e.authKind===`step_up`&&rr(e.serverId,XB(e.authKind,{recoverySource:e.recoverySource}))})},[r,rr]);let xr=(0,D.useCallback)((e,t)=>{de?.destroy(),pe?.destroy(),he?.destroy(),_e?.destroy(),ye?.destroy(),xe?.destroy(),Ce?.destroy(),Te?.destroy(),De?.destroy(),ke?.destroy(),je?.destroy(),Ne?.destroy();let{environment:n,logger:r}=hDe(W9(),_De,pr),i=e.settings,a=tH(ce),o=rH(ce),s=i?.metadata?Object.fromEntries(i.metadata.filter(e=>e.key.trim()!==``).map(e=>[e.key,e.value])):void 0,c=i&&(i.oauthClientId||i.oauthClientSecret||i.oauthScopes||i.enterpriseManaged)?{...i.oauthClientId&&{clientId:i.oauthClientId},...i.oauthClientSecret&&{clientSecret:i.oauthClientSecret},...i.oauthScopes&&{scope:i.oauthScopes},...i.enterpriseManaged&&{enterpriseManaged:!0}}:void 0,l=c||o?{...c??{},...o&&{clientMetadataUrl:o}}:void 0,u=new RV(e.config,{environment:n,receiverTasks:!0,elicit:{form:!0,url:!0},roots:jN(i?.roots??[]),...i&&i.requestTimeout>0&&{timeout:i.requestTimeout},...s&&Object.keys(s).length>0&&{defaultMetadata:s},...l&&{oauth:l},...a&&{enterpriseManagedAuth:{idp:a}},...ce.enterpriseManagedAuth&&{installEnterpriseManagedAuth:ce.enterpriseManagedAuth},...i&&{serverSettings:i},...i?.protocolEra&&{versionNegotiation:qre(i.protocolEra)},...i?.advertisedExtensions&&Object.keys(i.advertisedExtensions).length>0&&{advertisedExtensions:i.advertisedExtensions},...t&&{sessionId:t}});ne(u),Re(EN(i)??null),fe(new HV(u)),ve(new GV(u)),be(new KV(u)),Se(new qV(u)),me(new UV(u));let d=new WV(u);ge(d),we(new JV(u)),Ee(new QV(u)),Oe(new $V(u,d)),Ae(new bH(u));let f=new xH(u,{sessionStorage:dr,logger:r,maxFetchRequests:i?.maxFetchRequests??1e3,...t&&{sessionId:t}});return fr.current=f,Me(f),Pe(new SH(u)),u},[de,pe,he,_e,ye,xe,Ce,Te,De,ke,je,Ne,dr,pr,ce]);(0,D.useEffect)(()=>{if(typeof window>`u`||window.location.pathname!==`/oauth/callback`||Dt.current||r.length===0)return;Dt.current=!0;let e=pz(window.location.search),t=new URLSearchParams(window.location.search).get(`state`),n=t?hz(t):null,i=t!==null&&n===null,a=n?.authId??void 0,o=B9();if(window.history.replaceState({},``,`/`),i){mv.show({title:`OAuth callback rejected`,message:`OAuth callback carried an unrecognized state parameter that did not originate from this session. Please try connecting again.`,color:`red`});return}if(o&&e.successful&&(e=>{kt.current||=(pDe(e,{setToolsUi:Ke,setPromptsUi:Je,setResourcesUi:Xe,setAppsUi:Qe,setTasksUi:L,setLogsUi:tt,setProtocolUi:rt,setNetworkUi:st,setActiveTab:dt,clearToolCallState:()=>Be(void 0),clearGetPromptState:()=>He(void 0),clearReadResourceState:()=>We(void 0)}),!0)})(o),!e.successful){let t=o?.serverId;t?queueMicrotask(()=>{rr(t,gz(e))}):mv.show({title:`OAuth authorization failed`,message:gz(e),color:`red`});return}let s=o?.serverId,c=s?r.find(e=>e.id===s):void 0;if(!c){mv.show({title:`OAuth callback could not be matched`,message:`Could not determine which server started the OAuth flow. Please try connecting again.`,color:`red`});return}(async()=>{try{await ur.load()}catch(e){wt.current=void 0,queueMicrotask(()=>{rr(c.id,e instanceof Error?e:String(e))});return}let t=xr(c,a);N(c.id);try{wt.current=Date.now(),await t.resumeAfterOAuth(e.code,{remoteSessionId:o?.remoteSessionId,iss:e.iss})}catch(e){if(wt.current=void 0,$z(e)){mv.show({title:`Cannot connect to "${c.name}"`,message:e.message,color:`red`,autoClose:!1});return}let t=EH(e);if(t){let e=_V(t,{serverName:c.name});t.kind===`lost_authorization_state`?_t({serverId:c.id,message:e.message,kind:`lost_authorization_state`,title:e.title,actionLabel:fV()}):mv.show({title:e.title,message:e.message,color:`red`,autoClose:!1});return}queueMicrotask(()=>{rr(c.id,e instanceof Error?e:String(e))});return}if(_t(null),o){let e=o.authKind===`step_up`?o.authChallenge:void 0,n=!e||await t.checkAuthChallengeSatisfied(e);if(e&&!n){mv.show({title:`Additional permissions not granted`,message:uDe(e),color:`yellow`,autoClose:!1});return}mv.show({title:`Authorization complete`,message:lDe(o.authKind,{recoverySource:o.recoverySource}),color:`green`,autoClose:6e3})}})()},[r,xr,rr,ur]);let Sr=(0,D.useCallback)(async e=>{if(e===M&&Ft===`connected`&&I){try{await I.disconnect()}finally{Vn()}return}let t=Jn.current.find(t=>t.id===e);if(!t)return;let n=xr(t);e!==M&&N(e),te(void 0),Xn(void 0),wt.current=Date.now();try{await n.connect()}catch(r){if(wt.current=void 0,$z(r)){mv.show({title:`Cannot connect to "${t.name}"`,message:r.message,color:`red`,autoClose:!1});return}if(r instanceof xz){if(await n.checkAuthChallengeSatisfied(r.authChallenge)){wt.current=Date.now(),await n.connect();return}mr({serverId:e,authKind:`reauth`,authorizationUrl:r.authorizationUrl,preRedirectContext:`connect`,client:n});return}if(_z(r))try{let t=await n.authenticate();t===void 0?(wt.current=Date.now(),await n.connect()):mr({serverId:e,authKind:`reauth`,authorizationUrl:t,preRedirectContext:`connect`,client:n});return}catch(e){if(V9(),await n.disconnect().catch(()=>{}),$z(e)){mv.show({title:`Cannot connect to "${t.name}"`,message:e.message,color:`red`,autoClose:!1});return}let r=e instanceof Error?e.message:String(e);Xn(r),mv.show({title:`OAuth authorization failed for "${t.name}"`,message:r,color:`red`});return}te(e);let i=r instanceof Error?r.message:String(r);Xn(i),mv.show({title:`Failed to connect to "${t.name}"`,message:i,color:`red`})}},[M,Ft,I,xr,mr,Vn]),Cr=(0,D.useCallback)(async()=>{if(I)try{await I.disconnect()}finally{Vn()}},[I,Vn]);(0,D.useEffect)(()=>{if(!Qn||window.location.pathname===`/oauth/callback`)return;let e=r.find(e=>e.id===Qn.serverId);if(!e){if(er.current)return;er.current=!0,i(Qn.serverId,Qn.serverConfig).catch(e=>{let t=e instanceof Error?e.message:String(e);t.includes(`already exists`)||Zn(t)});return}if(!eDe(e.config,Qn.serverConfig)){if(tr.current)return;tr.current=!0,a(Qn.serverId,Qn.serverId,Qn.serverConfig).catch(e=>{let t=e instanceof Error?e.message:String(e);Zn(t)});return}nr.current||(nr.current=!0,M===Qn.serverId&&Ft===`connected`||Sr(Qn.serverId).catch(e=>{let t=e instanceof Error?e.message:String(e);Zn(t)}))},[Qn,r,M,Ft,i,a,Sr,Zn]);let wr=(0,D.useCallback)(()=>{if(!gt)return;let e=gt.serverId,t=gt.kind;if(_t(null),t===`lost_authorization_state`){(async()=>{let t=Jn.current.find(t=>t.id===e);if(t)try{await H9({config:t.config,inspectorClient:e===M?I:null,isActiveConnection:e===M,oauthStorage:ur})}catch(e){mv.show({title:`Could not clear the stored authorization state`,message:e instanceof Error?e.message:String(e),color:`red`,autoClose:!1});return}await Sr(e)})();return}if(e===M&&Ft===`connected`&&I){(async()=>{let t=r.find(t=>t.id===e);try{let t=await I.authenticate();if(t===void 0){await I.pushRemoteAuthState(),mv.show({title:`Authorization restored`,message:YB(),color:`green`,autoClose:4e3});return}mr({serverId:e,authKind:`reauth`,authorizationUrl:t})}catch(e){let n=e instanceof Error?e.message:String(e);mv.show({title:t?`OAuth authorization failed for "${t.name}"`:`OAuth authorization failed`,message:n,color:`red`})}})();return}Sr(e)},[gt,M,Ft,I,r,mr,Sr,ur]),Tr=(0,D.useCallback)(async(e,t,n)=>{if(!I)return;let r=En.find(t=>t.name===e);if(!r)return;let i=(!!It?.tasks?.requests?.tools?.call||I.isTasksExtensionNegotiated())&&(n||r.execution?.taskSupport===`required`);Mt.current=void 0,Be({status:`pending`});try{let e=i?await I.callToolStream(r,t,void 0,void 0,{ttl:Un?.settings?.taskTtl||6e4}):await I.callTool(r,t);Be({status:e.success?`ok`:`error`,result:e.result??void 0,error:e.error})}catch(t){if(t instanceof xz){Be(void 0),M&&await vr(t,{serverId:M,source:`tool`});return}if(t instanceof cz){Be(void 0),mv.show({title:`Tool call cancelled`,message:`A cancellation request was sent to the server.`,color:`gray`,autoClose:3e3});return}if(t instanceof oz){Be({status:`error`,error:t.message}),mv.show({autoClose:!1,title:`URL elicitation loop`,color:`yellow`,message:(0,R.jsxs)(H,{size:`sm`,children:[`The server requested the same URL again after you completed it (`,t.url,`), so the call was cancelled to avoid an endless loop.`]})});return}let n=sz(t);if(n!==null&&n.length===0){let n={toolName:e,details:DDe(t)};Be({status:`error`,error:J9(t)}),mv.show({autoClose:!1,title:`URL elicitation required`,color:`yellow`,message:(0,R.jsx)(TDe,{onViewDetails:()=>j(n)})});return}Be({status:`error`,error:J9(t),errorCode:EDe(t)})}},[I,En,Un,It,M,vr]),Er=(0,D.useCallback)(()=>{Be(void 0)},[]),Dr=(0,D.useCallback)(e=>{e.selectedToolName!==Ge.selectedToolName&&Be(void 0),Ke(e)},[Ge.selectedToolName]),Or=(0,D.useCallback)(e=>{mv.show({title:`MCP App error`,message:e.message,color:`red`})},[]),kr=(0,D.useCallback)(()=>{},[]),Ar=(0,D.useCallback)(async(e,t)=>{if(!I)return;let n=En.find(t=>t.name===e);if(n){await Promise.resolve(),re.current?.sendToolInput(t);try{let e=await I.callTool(n,t,void 0,void 0,void 0,{skipOutputValidation:!0});if(e.success&&e.result&&re.current?.sendToolResult(e.result),e.outputValidationError){let t={toolName:n.name,message:e.outputValidationError};mv.show({autoClose:!1,title:`App output doesn't match its schema`,color:`yellow`,message:(0,R.jsx)(wDe,{onViewDetails:()=>k(t)})})}}catch(e){if(e instanceof xz){M&&(await vr(e,{serverId:M,source:`app`})||Or(Error(`Authorization required. Complete sign-in, then reopen the app.`)));return}Or(e instanceof Error?e:Error(String(e)))}}},[I,En,Or,M,vr]),jr=(0,D.useCallback)(()=>{re.current?.teardown()},[]),Mr=(0,D.useCallback)(async(e,t)=>{if(I){He({status:`pending`,promptName:e});try{let n=await I.getPrompt(e,t);He({status:`ok`,promptName:e,result:n.result})}catch(t){if(t instanceof xz){He(void 0),M&&await vr(t,{serverId:M,source:`prompt`});return}He({status:`error`,promptName:e,error:t instanceof Error?t.message:String(t)})}}},[I,M,vr]),Nr=(0,D.useCallback)(async e=>{if(I){We({status:`pending`,uri:e});try{let t=await I.readResource(e);We({status:`ok`,uri:e,result:t.result,lastUpdated:t.timestamp})}catch(t){if(t instanceof xz){We(void 0),M&&await vr(t,{serverId:M,source:`resource`});return}We({status:`error`,uri:e,error:t instanceof Error?t.message:String(t)})}}},[I,M,vr]),Pr=(0,D.useCallback)(async e=>{if(!I)throw Error(`Client is not connected`);let t=()=>I.readResource(e);try{return(await t()).result}catch(e){if(e instanceof xz&&M&&await vr(e,{serverId:M,source:`resource`}))return(await t()).result;throw e}},[I,M,vr]),Fr=(0,D.useCallback)(e=>{I&&I.subscribeToResource(e)},[I]),Ir=(0,D.useCallback)(e=>{I&&I.unsubscribeFromResource(e)},[I]),Lr=(0,D.useCallback)(async(e,t,n,r)=>I?(await yr(()=>I.getCompletions(e,t,n,r),`tool`))?.values??[]:[],[I,yr]),Rr=(0,D.useCallback)(async e=>{if(I)try{await yr(()=>I.cancelRequestorTask(e),`tool`)}catch(e){if(e instanceof xz)return;mv.show({title:`Failed to cancel task`,message:e instanceof Error?e.message:String(e),color:`red`})}},[I,yr]),zr=(0,D.useCallback)(()=>{if(!I)return;let e=Mt.current;if(e){Mt.current=void 0,Rr(e);return}I.cancelToolCall()},[I,Rr]),Br=(0,D.useCallback)(()=>{jn()},[jn]),Vr=(0,D.useCallback)(e=>{Ie(e),I&&yr(()=>I.setLoggingLevel(e),`ambient`)},[I,yr]),Hr=(0,D.useCallback)(e=>{Re(e),I?.setModernLogLevel(e??void 0)},[I]),Ur=(0,D.useCallback)(()=>{xn?(Jt(),yr(()=>Cn.onRefresh(),`ambient`)):yr(()=>qt(),`ambient`)},[xn,Cn,qt,Jt,yr]),Wr=(0,D.useCallback)(()=>{xn?(Qt(),yr(()=>wn.onRefresh(),`ambient`)):yr(()=>Zt(),`ambient`)},[xn,wn,Zt,Qt,yr]),Gr=(0,D.useCallback)(()=>{xn?(nn(),yr(()=>Tn.onRefresh(),`ambient`),yr(()=>an(),`ambient`)):yr(async()=>{await tn(),await an()},`ambient`)},[xn,Tn,tn,an,nn,yr]),Kr=(0,D.useCallback)(e=>{bn(e);let t=r.find(e=>e.id===M);if(!t||M===void 0)return;let n=t.settings??G9,i={...n,paginatedLists:e};I?.setServerSettings(i),Sn&&(e?(yr(()=>ln(void 0),`ambient`),yr(()=>pn(void 0),`ambient`),yr(()=>_n(void 0),`ambient`)):(yr(()=>qt(),`ambient`),yr(()=>Zt(),`ambient`),yr(()=>tn(),`ambient`))),o(M,i).catch(e=>{bn(null),I?.setServerSettings(n),mv.show({title:`Failed to save pagination setting`,message:e instanceof Error?e.message:String(e),color:`red`})})},[r,M,I,o,Sn,ln,pn,_n,qt,Zt,tn,yr]),qr=(0,D.useCallback)(()=>void yr(()=>Cn.onLoadMore(),`ambient`),[Cn,yr]),Jr=(0,D.useCallback)(()=>void yr(()=>wn.onLoadMore(),`ambient`),[wn,yr]),Yr=(0,D.useCallback)(()=>void yr(()=>Tn.onLoadMore(),`ambient`),[Tn,yr]),Xr={paginated:Cn.paginated,onPaginatedChange:Kr,canLoadMore:Cn.canLoadMore,loadedPages:Cn.loadedPages,onLoadMore:qr},Zr={paginated:wn.paginated,onPaginatedChange:Kr,canLoadMore:wn.canLoadMore,loadedPages:wn.loadedPages,onLoadMore:Jr},Qr={paginated:Tn.paginated,onPaginatedChange:Kr,canLoadMore:Tn.canLoadMore,loadedPages:Tn.loadedPages,onLoadMore:Yr},$r=(0,D.useCallback)(()=>{yr(()=>An(),`ambient`)?.catch(e=>{mv.show({title:`Failed to refresh tasks`,message:e instanceof Error?e.message:String(e),color:`red`})})},[An,yr]),ei=(0,D.useCallback)(()=>{ke&&ke.clearMessages(e=>e.direction===`notification`&&`method`in e.message&&e.message.method===`notifications/message`)},[ke]),ti=(0,D.useCallback)(()=>{ke?.clearMessages(e=>!it.has(e.id))},[ke,it]),ni=(0,D.useCallback)(()=>{je?.clearFetchRequests()},[je]),ri=(0,D.useCallback)(()=>{Fn.length!==0&&g8(v8(`network`,M),JSON.stringify(Fn,null,2))},[Fn,M]),ii=(0,D.useCallback)(()=>{Pn.length!==0&&g8(v8(`protocol`,M),JSON.stringify(Pn,null,2))},[Pn,M]),ai=(0,D.useCallback)(e=>{let t=e===`pinned`;ke?.clearMessages(e=>t?it.has(e.id):!it.has(e.id)),t&&at(new Set)},[ke,it]),oi=(0,D.useCallback)(e=>{let t=e===`pinned`,n=Pn.filter(e=>t?it.has(e.id):!it.has(e.id));n.length!==0&&g8(v8(t?`protocol-pinned`:`protocol-unpinned`,M),JSON.stringify(n,null,2))},[Pn,it,M]),si=(0,D.useCallback)(e=>{at(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ci=(0,D.useCallback)(e=>{if(!I)return;let t=Pn.find(t=>t.id===e);if(!t||!(`method`in t.message))return;let{method:n}=t.message,r=`params`in t.message?t.message.params:void 0;yDe(I,n,r,En).then(e=>{e&&mv.show({title:`Can't replay`,message:e,color:`yellow`})}).catch(e=>{mv.show({title:`Replay failed`,message:e instanceof Error?e.message:String(e),color:`red`})})},[I,Pn,En]),li=(0,D.useCallback)(()=>{lr.length!==0&&g8(v8(`logs`,M),JSON.stringify(lr,null,2))},[lr,M]),z=(0,D.useCallback)(()=>{Ne?.clearStderrLogs()},[Ne]),fi=(0,D.useCallback)(()=>{In.length!==0&&g8(v8(`console`,M),JSON.stringify(In,null,2))},[In,M]),pi=(0,D.useCallback)(()=>{r.length!==0&&g8(`mcp.json`,aie(r))},[r]),mi=(0,D.useCallback)(async()=>{if(!T)return;let e=T.id;e===M&&(I&&await I.disconnect(),de?.destroy(),pe?.destroy(),he?.destroy(),_e?.destroy(),ye?.destroy(),xe?.destroy(),Ce?.destroy(),Te?.destroy(),De?.destroy(),ke?.destroy(),je?.destroy(),Ne?.destroy(),ne(null),fe(null),me(null),ge(null),ve(null),be(null),Se(null),we(null),Ee(null),Oe(null),Ae(null),Me(null),Pe(null),N(void 0)),await s(e),E(null)},[T,M,I,de,pe,he,_e,ye,xe,Ce,Te,De,ke,je,Ne,s]),hi=(0,D.useCallback)(async(e,t)=>{await i(e,t),_(t=>t.includes(e)?t:[...t,e])},[i]),gi=(0,D.useCallback)(async(e,t)=>{if(u?.mode===`edit`&&u.targetId){let n=u.targetId;await a(n,e,t),n===M&&e!==n&&N(e);return}await hi(e,t)},[u,hi,a,M]),_i=(0,D.useMemo)(()=>{let e=r.map(e=>e.id);return u?.mode===`edit`&&u.targetId?e.filter(e=>e!==u.targetId):e},[r,u]),vi=(0,D.useMemo)(()=>{if(u?.targetId)return r.find(e=>e.id===u.targetId)},[u,r]),yi=(0,D.useMemo)(()=>{if(y)return r.find(e=>e.id===y)},[y,r]),bi=yi?SN(yi.config):`stdio`,{draft:xi,onChange:Si,flush:Ci}=HH({targetId:y,resolveInitial:e=>r.find(t=>t.id===e)?.settings??G9,onPersist:o,onError:(e,t)=>{mv.show({title:`Failed to save settings for "${e}"`,message:t instanceof Error?t.message:String(t),color:`red`})}}),wi=xi??G9,{draft:Ti,onChange:Ei,flush:Di}=UH({opened:x,resolveInitial:()=>swe(ce),onPersist:async e=>{if(!uwe(e))return;let t=lwe(e);await yH(t,{baseUrl:ie,authToken:W9()}),le(t)},onError:e=>{mv.show({title:`Failed to save client settings`,message:_H(e),color:`red`})}}),Oi=Ti??owe,{loginState:ki,logout:Ai}=WH(ur,Oi.emaEnabled?Oi.issuer:void 0,x),ji=(0,D.useCallback)(()=>{Di(),S(!1)},[Di]),Mi=bi===`stdio`,Ni=(0,D.useCallback)(async e=>{let t=e.id===M;if(await H9({config:e.config,inspectorClient:t?I:null,isActiveConnection:t,oauthStorage:ur})){if(t&&I)try{await I.disconnect()}finally{or(void 0),Vn()}else Bn();mv.show({title:`OAuth state cleared`,message:t?`Stored tokens and client registration were removed. Reconnect to run a fresh authorization flow.`:`Stored OAuth state was removed for "${e.name}". Connect to authorize again.`,color:`blue`})}},[M,I,ur,Vn,Bn]),Pi=(0,D.useCallback)(()=>{Un&&Ni(Un)},[Un,Ni]),Fi=(0,D.useCallback)(()=>{yi&&Ni(yi)},[yi,Ni]),Ii=(0,D.useCallback)(()=>{if(Ci(),I&&y!==void 0&&y===M&&xi){I.setServerSettings(xi),fr.current?.setMaxFetchRequests(xi.maxFetchRequests);let e=jN(xi.roots),t=jN(I.getRoots());JSON.stringify(e)!==JSON.stringify(t)&&I.setRoots(e).catch(()=>{})}b(void 0)},[Ci,I,y,M,xi]),Li=(0,D.useMemo)(()=>{if(!Ue)return;if(!Ue.uri)return Ue;let e=Mn.some(e=>e.resource.uri===Ue.uri);return{...Ue,isSubscribed:e}},[Ue,Mn]),Ri=Rn.length+zn.length,zi=(0,D.useMemo)(()=>{let e=Rn[0];if(e)return{kind:`sampling`,id:e.id,request:e.request.params,origin:e.origin};let t=zn[0];if(t){let e=t.request.params;return`url`in e?{kind:`elicitation-url`,id:t.id,message:e.message,url:e.url,origin:t.origin}:{kind:`elicitation-form`,id:t.id,request:e,origin:t.origin}}return null},[Rn,zn]),Bi=Ri>1?`${Ri} pending`:``,Vi=(0,D.useCallback)(e=>{Rn[0]?.respond(e)},[Rn]),Hi=(0,D.useCallback)(()=>{Rn[0]?.reject(Error(`Sampling request rejected by user.`))},[Rn]),Ui=(0,D.useCallback)(e=>{let t=zn[0];if(t){if(e.action===`cancel`&&t.origin===`task-input-required`&&t.taskId&&I){I.cancelRequestorTask(t.taskId);return}t.respond(e)}},[zn,I]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(B,{children:[gt?(0,R.jsx)(SDe,{children:(0,R.jsx)(uEe,{message:gt.message,title:gt.title,actionLabel:gt.actionLabel,onReauthenticate:wr,onDismiss:()=>_t(null)})}):null,(0,R.jsx)(CCe,{deepLink:Qn,deepLinkStatus:$n,servers:r,serverListWritable:oe,activeServer:M,erroredServerId:ee,connectedServerId:P,version:se,connectionStatus:Ft,connectErrorMessage:Yn,initializeResult:Gn,latencyMs:Tt,tools:En,excludedTools:Ut,prompts:Dn,resources:On,resourceTemplates:rn,toolsListChanged:Kt,promptsListChanged:Xt,resourcesListChanged:en,subscriptions:Mn,subscriptionStreamState:Nn,logs:lr,tasks:kn,progressByTaskId:Nt,protocol:Ln,protocolEra:Vt,network:Fn,stderrLogs:In,toolCallState:ze,getPromptState:Ve,readResourceState:Li,toolsUi:Ge,promptsUi:qe,resourcesUi:Ye,appsUi:Ze,tasksUi:$e,logsUi:et,protocolUi:nt,networkUi:ot,consoleUi:ct,activeTab:ut,onActiveTabChange:dt,currentLogLevel:Fe,sandboxPath:ae,bridgeFactory:ue,appRendererRef:re,onToggleTheme:n,onOpenClientSettings:()=>S(!0),onToggleConnection:e=>{Sr(e)},onDisconnect:()=>{Cr()},onServerAdd:()=>{_([]),d({mode:`add`})},onServerImportConfig:()=>{_([]),p(!0)},onServerImportJson:()=>{_([]),h(!0)},onServerExport:pi,onConnectionInfo:()=>w(!0),onServerSettings:e=>b(e),onServerEdit:e=>d({mode:`edit`,targetId:e}),onServerClone:e=>{_([]),d({mode:`clone`,targetId:e})},onServerRemove:e=>{let t=r.find(t=>t.id===e);t&&E(t)},onServerReorder:e=>{c(e).catch(e=>{mv.show({title:`Failed to reorder servers`,message:e instanceof Error?e.message:String(e),color:`red`})})},highlightedServerIds:g,onClearHighlight:v,serverSupportsTaskToolCalls:!!It?.tasks?.requests?.tools?.call||(I?.isTasksExtensionNegotiated()??!1),onToolsUiChange:Dr,onCallTool:(e,t,n)=>{Tr(e,t,n)},onCancelToolCall:zr,onClearToolResult:Er,onReadResourceContents:Pr,onRefreshTools:Ur,toolsPagination:Xr,promptsPagination:Zr,resourcesPagination:Qr,onPromptsUiChange:Je,onGetPrompt:(e,t)=>{Mr(e,t)},onRefreshPrompts:Wr,onResourcesUiChange:Xe,onReadResource:e=>{Nr(e)},onSubscribeResource:Fr,onUnsubscribeResource:Ir,onRefreshResources:Gr,onCompleteArgument:Lr,completionsSupported:It?.completions!==void 0,subscriptionsSupported:It?.resources?.subscribe===!0,onTasksUiChange:L,onCancelTask:e=>{Rr(e)},onClearCompletedTasks:Br,onRefreshTasks:$r,onSetLogLevel:Vr,modernLogLevel:Le,onSetModernLogLevel:Hr,onLogsUiChange:tt,onClearLogs:ei,onExportLogs:li,onProtocolUiChange:rt,onClearProtocol:ti,onExportProtocol:ii,onClearProtocolSection:ai,onExportProtocolSection:oi,onReplayProtocol:ci,onTogglePinProtocol:si,pinnedProtocolIds:it,onNetworkUiChange:st,onClearNetwork:ni,onExportNetwork:ri,onConsoleUiChange:lt,onClearConsole:z,onExportConsole:fi,onAppsUiChange:Qe,onSelectApp:kr,onOpenApp:(e,t)=>{Ar(e,t)},onCloseApp:jr,onAppError:Or,onRefreshApps:Ur})]}),(0,R.jsx)(RCe,{opened:u!==null,mode:u?.mode??`add`,initialId:vi?.id,initialConfig:vi?.config,existingIds:_i,onClose:()=>d(null),onSubmit:gi}),(0,R.jsx)(Jwe,{opened:f,existingIds:_i,onClose:()=>p(!1),onFetchSource:l,onAddServer:hi,onUpdateServer:a}),(0,R.jsx)(cTe,{opened:m,existingIds:_i,onClose:()=>h(!1),onAddServer:hi}),(0,R.jsx)(twe,{opened:y!==void 0,settings:wi,serverType:bi,isStdio:Mi,negotiatedEra:Ft===`connected`&&y===M?Vt:void 0,onClose:Ii,onSettingsChange:Si,onClearStoredOAuth:Mi?void 0:Fi},y??`server-settings-closed`),(0,R.jsx)(xwe,{opened:x,settings:Oi,onClose:ji,onSettingsChange:Ei,emaIdpLoginState:ki,onEmaIdpLogout:Ai},x?`client-settings-open`:`client-settings-closed`),Gn&&Un&&(0,R.jsx)(kTe,{opened:C,onClose:()=>w(!1),initializeResult:Gn,serverInfoReported:Wn,clientCapabilities:Lt,transport:ir,protocolEra:Vt,discoverResult:Ht,oauth:sr,onClearOAuth:cr?Pi:void 0}),(0,R.jsx)(YTe,{opened:T!==null,target:T,onCancel:()=>E(null),onConfirm:mi}),(0,R.jsx)(FTe,{opened:O!==null,toolName:O?.toolName,message:O?.message,onClose:()=>k(null)}),(0,R.jsx)(BTe,{opened:A!==null,toolName:A?.toolName,details:A?.details,onClose:()=>j(null)}),(0,R.jsx)(YEe,{request:zi,serverName:Un?.name??`this server`,queuePosition:Bi,onSamplingRespond:Vi,onSamplingReject:Hi,onElicitationRespond:Ui}),(0,R.jsx)(rEe,{opened:ft!==null&&ft.serverId===M,challenge:ft?.challenge??null,authorizationScopes:ft?.challenge?.authorizationScopes,enterpriseManaged:ft?.enterpriseManaged,onAuthorize:async()=>{if(!ft||St.current)return;let e=ft,t=I;if(t){if(e.enterpriseManaged){St.current=!0,pt(null),mv.show({title:`Organization permissions`,message:rV(),color:`blue`,autoClose:4e3});try{let n=await t.handleAuthChallenge(e.challenge,{confirmedStepUp:!0});if(n.kind===`satisfied`){await t.pushRemoteAuthState(),mv.show({title:`Permissions updated`,message:iV({recoverySource:e.source}),color:`green`,autoClose:5e3});let n=ht.current;ht.current=null,n&&await n();return}if(n.kind===`interactive`){mr({serverId:e.serverId,authKind:`step_up`,authorizationUrl:n.authorizationUrl,authChallenge:n.challenge,recoverySource:e.source});return}if(n.kind===`failed`){let t=aV(n.error.message);switch(mv.show({title:`Organization permissions`,message:t,color:`red`,autoClose:6e3}),e.source){case`tool`:Be({status:`error`,error:t});break;case`prompt`:He(e=>e&&{...e,status:`error`,error:t});break;case`resource`:We(e=>e&&{...e,status:`error`,error:t});break;default:break}}}finally{St.current=!1}return}St.current=!0,mr({serverId:e.serverId,authKind:`step_up`,authorizationUrl:e.authorizationUrl,authChallenge:e.challenge,recoverySource:e.source}),pt(null),ht.current=null,St.current=!1}},onCancel:()=>{let e=mt.current;if(pt(null),ht.current=null,!e)return;let t=`Authorization cancelled.`;switch(e.source){case`tool`:Be({status:`error`,error:t});break;case`prompt`:He(e=>e&&{...e,status:`error`,error:t});break;case`resource`:We(e=>e&&{...e,status:`error`,error:t});break;case`app`:mv.show({title:`Authorization cancelled`,message:t,color:`gray`,autoClose:4e3});break;case`ambient`:break}}})]})}(0,Iv.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(D.StrictMode,{children:(0,R.jsxs)(Hr,{theme:Lv,defaultColorScheme:`auto`,cssVariablesResolver:()=>({variables:{},light:{},dark:{"--mantine-color-body":`var(--mantine-color-dark-9)`}}),children:[(0,R.jsx)(Fv,{position:`bottom-right`}),(0,R.jsx)(PDe,{})]})}));export{DZ as a,gm as c,l as d,jZ as i,hm as l,MZ as n,$X as o,AZ as r,HX as s,OQ as t,f as u};
|