@agent-deck/backend 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/lib/mcp-connection-error.d.ts +2 -0
- package/dist/lib/mcp-connection-error.d.ts.map +1 -1
- package/dist/lib/mcp-connection-error.js +46 -4
- package/dist/lib/mcp-connection-error.js.map +1 -1
- package/dist/lib/paths.d.ts +2 -8
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/lib/paths.js +5 -27
- package/dist/lib/paths.js.map +1 -1
- package/dist/mcp-server.d.ts +3 -0
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +86 -40
- package/dist/mcp-server.js.map +1 -1
- package/dist/mcp-session-binding.d.ts.map +1 -1
- package/dist/mcp-session-binding.js +5 -1
- package/dist/mcp-session-binding.js.map +1 -1
- package/dist/routes/scope.d.ts.map +1 -1
- package/dist/routes/scope.js +23 -0
- package/dist/routes/scope.js.map +1 -1
- package/dist/scope/bindings-sidecar.d.ts +4 -0
- package/dist/scope/bindings-sidecar.d.ts.map +1 -0
- package/dist/scope/bindings-sidecar.js +43 -0
- package/dist/scope/bindings-sidecar.js.map +1 -0
- package/dist/scope/display.d.ts +5 -0
- package/dist/scope/display.d.ts.map +1 -0
- package/dist/scope/display.js +48 -0
- package/dist/scope/display.js.map +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/mcp-client-manager.d.ts +2 -0
- package/dist/services/mcp-client-manager.d.ts.map +1 -1
- package/dist/services/mcp-client-manager.js +54 -47
- package/dist/services/mcp-client-manager.js.map +1 -1
- package/dist/services/service-manager.d.ts +4 -1
- package/dist/services/service-manager.d.ts.map +1 -1
- package/dist/services/service-manager.js +17 -3
- package/dist/services/service-manager.js.map +1 -1
- package/dist/vault/credential-auth-headers.d.ts +4 -0
- package/dist/vault/credential-auth-headers.d.ts.map +1 -0
- package/dist/vault/credential-auth-headers.js +22 -0
- package/dist/vault/credential-auth-headers.js.map +1 -0
- package/dist/vault/credential-manager.d.ts +2 -0
- package/dist/vault/credential-manager.d.ts.map +1 -1
- package/dist/vault/credential-manager.js +13 -0
- package/dist/vault/credential-manager.js.map +1 -1
- package/package.json +5 -5
- package/static-ui/assets/index-B3Nd-uz9.js +404 -0
- package/static-ui/index.html +1 -1
- package/static-ui/assets/index-O6tnGAUZ.js +0 -372
|
@@ -1,372 +0,0 @@
|
|
|
1
|
-
var OC=Object.defineProperty;var Eg=t=>{throw TypeError(t)};var IC=(t,e,r)=>e in t?OC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Ln=(t,e,r)=>IC(t,typeof e!="symbol"?e+"":e,r),rf=(t,e,r)=>e.has(t)||Eg("Cannot "+r);var I=(t,e,r)=>(rf(t,e,"read from private field"),r?r.call(t):e.get(t)),Se=(t,e,r)=>e.has(t)?Eg("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ue=(t,e,r,s)=>(rf(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r),Le=(t,e,r)=>(rf(t,e,"access private method"),r);var nc=(t,e,r,s)=>({set _(n){ue(t,e,n,r)},get _(){return I(t,e,s)}});function DC(t,e){for(var r=0;r<e.length;r++){const s=e[r];if(typeof s!="string"&&!Array.isArray(s)){for(const n in s)if(n!=="default"&&!(n in t)){const a=Object.getOwnPropertyDescriptor(s,n);a&&Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>s[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function r(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(n){if(n.ep)return;n.ep=!0;const a=r(n);fetch(n.href,a)}})();var MC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var yx={exports:{}},ld={},xx={exports:{}},He={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ml=Symbol.for("react.element"),$C=Symbol.for("react.portal"),FC=Symbol.for("react.fragment"),LC=Symbol.for("react.strict_mode"),UC=Symbol.for("react.profiler"),zC=Symbol.for("react.provider"),VC=Symbol.for("react.context"),HC=Symbol.for("react.forward_ref"),qC=Symbol.for("react.suspense"),BC=Symbol.for("react.memo"),WC=Symbol.for("react.lazy"),Cg=Symbol.iterator;function KC(t){return t===null||typeof t!="object"?null:(t=Cg&&t[Cg]||t["@@iterator"],typeof t=="function"?t:null)}var wx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bx=Object.assign,Sx={};function yi(t,e,r){this.props=t,this.context=e,this.refs=Sx,this.updater=r||wx}yi.prototype.isReactComponent={};yi.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};yi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function _x(){}_x.prototype=yi.prototype;function gm(t,e,r){this.props=t,this.context=e,this.refs=Sx,this.updater=r||wx}var ym=gm.prototype=new _x;ym.constructor=gm;bx(ym,yi.prototype);ym.isPureReactComponent=!0;var Pg=Array.isArray,Ex=Object.prototype.hasOwnProperty,xm={current:null},Cx={key:!0,ref:!0,__self:!0,__source:!0};function Px(t,e,r){var s,n={},a=null,o=null;if(e!=null)for(s in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(a=""+e.key),e)Ex.call(e,s)&&!Cx.hasOwnProperty(s)&&(n[s]=e[s]);var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];n.children=c}if(t&&t.defaultProps)for(s in l=t.defaultProps,l)n[s]===void 0&&(n[s]=l[s]);return{$$typeof:Ml,type:t,key:a,ref:o,props:n,_owner:xm.current}}function QC(t,e){return{$$typeof:Ml,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function wm(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ml}function GC(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var kg=/\/+/g;function nf(t,e){return typeof t=="object"&&t!==null&&t.key!=null?GC(""+t.key):e.toString(36)}function Mc(t,e,r,s,n){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Ml:case $C:o=!0}}if(o)return o=t,n=n(o),t=s===""?"."+nf(o,0):s,Pg(n)?(r="",t!=null&&(r=t.replace(kg,"$&/")+"/"),Mc(n,e,r,"",function(u){return u})):n!=null&&(wm(n)&&(n=QC(n,r+(!n.key||o&&o.key===n.key?"":(""+n.key).replace(kg,"$&/")+"/")+t)),e.push(n)),1;if(o=0,s=s===""?".":s+":",Pg(t))for(var l=0;l<t.length;l++){a=t[l];var c=s+nf(a,l);o+=Mc(a,e,r,c,n)}else if(c=KC(t),typeof c=="function")for(t=c.call(t),l=0;!(a=t.next()).done;)a=a.value,c=s+nf(a,l++),o+=Mc(a,e,r,c,n);else if(a==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function sc(t,e,r){if(t==null)return t;var s=[],n=0;return Mc(t,s,"","",function(a){return e.call(r,a,n++)}),s}function ZC(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var sr={current:null},$c={transition:null},YC={ReactCurrentDispatcher:sr,ReactCurrentBatchConfig:$c,ReactCurrentOwner:xm};function kx(){throw Error("act(...) is not supported in production builds of React.")}He.Children={map:sc,forEach:function(t,e,r){sc(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return sc(t,function(){e++}),e},toArray:function(t){return sc(t,function(e){return e})||[]},only:function(t){if(!wm(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};He.Component=yi;He.Fragment=FC;He.Profiler=UC;He.PureComponent=gm;He.StrictMode=LC;He.Suspense=qC;He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=YC;He.act=kx;He.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var s=bx({},t.props),n=t.key,a=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(a=e.ref,o=xm.current),e.key!==void 0&&(n=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(c in e)Ex.call(e,c)&&!Cx.hasOwnProperty(c)&&(s[c]=e[c]===void 0&&l!==void 0?l[c]:e[c])}var c=arguments.length-2;if(c===1)s.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:Ml,type:t.type,key:n,ref:a,props:s,_owner:o}};He.createContext=function(t){return t={$$typeof:VC,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:zC,_context:t},t.Consumer=t};He.createElement=Px;He.createFactory=function(t){var e=Px.bind(null,t);return e.type=t,e};He.createRef=function(){return{current:null}};He.forwardRef=function(t){return{$$typeof:HC,render:t}};He.isValidElement=wm;He.lazy=function(t){return{$$typeof:WC,_payload:{_status:-1,_result:t},_init:ZC}};He.memo=function(t,e){return{$$typeof:BC,type:t,compare:e===void 0?null:e}};He.startTransition=function(t){var e=$c.transition;$c.transition={};try{t()}finally{$c.transition=e}};He.unstable_act=kx;He.useCallback=function(t,e){return sr.current.useCallback(t,e)};He.useContext=function(t){return sr.current.useContext(t)};He.useDebugValue=function(){};He.useDeferredValue=function(t){return sr.current.useDeferredValue(t)};He.useEffect=function(t,e){return sr.current.useEffect(t,e)};He.useId=function(){return sr.current.useId()};He.useImperativeHandle=function(t,e,r){return sr.current.useImperativeHandle(t,e,r)};He.useInsertionEffect=function(t,e){return sr.current.useInsertionEffect(t,e)};He.useLayoutEffect=function(t,e){return sr.current.useLayoutEffect(t,e)};He.useMemo=function(t,e){return sr.current.useMemo(t,e)};He.useReducer=function(t,e,r){return sr.current.useReducer(t,e,r)};He.useRef=function(t){return sr.current.useRef(t)};He.useState=function(t){return sr.current.useState(t)};He.useSyncExternalStore=function(t,e,r){return sr.current.useSyncExternalStore(t,e,r)};He.useTransition=function(){return sr.current.useTransition()};He.version="18.3.1";xx.exports=He;var x=xx.exports;const vn=vm(x),bm=DC({__proto__:null,default:vn},[x]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var JC=x,XC=Symbol.for("react.element"),eP=Symbol.for("react.fragment"),tP=Object.prototype.hasOwnProperty,rP=JC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nP={key:!0,ref:!0,__self:!0,__source:!0};function Nx(t,e,r){var s,n={},a=null,o=null;r!==void 0&&(a=""+r),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(o=e.ref);for(s in e)tP.call(e,s)&&!nP.hasOwnProperty(s)&&(n[s]=e[s]);if(t&&t.defaultProps)for(s in e=t.defaultProps,e)n[s]===void 0&&(n[s]=e[s]);return{$$typeof:XC,type:t,key:a,ref:o,props:n,_owner:rP.current}}ld.Fragment=eP;ld.jsx=Nx;ld.jsxs=Nx;yx.exports=ld;var i=yx.exports,jx={exports:{}},kr={},Rx={exports:{}},Tx={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(t){function e($,F){var V=$.length;$.push(F);e:for(;0<V;){var ae=V-1>>>1,se=$[ae];if(0<n(se,F))$[ae]=F,$[V]=se,V=ae;else break e}}function r($){return $.length===0?null:$[0]}function s($){if($.length===0)return null;var F=$[0],V=$.pop();if(V!==F){$[0]=V;e:for(var ae=0,se=$.length,W=se>>>1;ae<W;){var L=2*(ae+1)-1,Q=$[L],oe=L+1,Z=$[oe];if(0>n(Q,V))oe<se&&0>n(Z,Q)?($[ae]=Z,$[oe]=V,ae=oe):($[ae]=Q,$[L]=V,ae=L);else if(oe<se&&0>n(Z,V))$[ae]=Z,$[oe]=V,ae=oe;else break e}}return F}function n($,F){var V=$.sortIndex-F.sortIndex;return V!==0?V:$.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,h=null,v=3,p=!1,w=!1,f=!1,m=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b($){for(var F=r(u);F!==null;){if(F.callback===null)s(u);else if(F.startTime<=$)s(u),F.sortIndex=F.expirationTime,e(c,F);else break;F=r(u)}}function S($){if(f=!1,b($),!w)if(r(c)!==null)w=!0,U(E);else{var F=r(u);F!==null&&K(S,F.startTime-$)}}function E($,F){w=!1,f&&(f=!1,g(T),T=-1),p=!0;var V=v;try{for(b(F),h=r(c);h!==null&&(!(h.expirationTime>F)||$&&!j());){var ae=h.callback;if(typeof ae=="function"){h.callback=null,v=h.priorityLevel;var se=ae(h.expirationTime<=F);F=t.unstable_now(),typeof se=="function"?h.callback=se:h===r(c)&&s(c),b(F)}else s(c);h=r(c)}if(h!==null)var W=!0;else{var L=r(u);L!==null&&K(S,L.startTime-F),W=!1}return W}finally{h=null,v=V,p=!1}}var P=!1,R=null,T=-1,N=5,O=-1;function j(){return!(t.unstable_now()-O<N)}function _(){if(R!==null){var $=t.unstable_now();O=$;var F=!0;try{F=R(!0,$)}finally{F?A():(P=!1,R=null)}}else P=!1}var A;if(typeof y=="function")A=function(){y(_)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,z=C.port2;C.port1.onmessage=_,A=function(){z.postMessage(null)}}else A=function(){m(_,0)};function U($){R=$,P||(P=!0,A())}function K($,F){T=m(function(){$(t.unstable_now())},F)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function($){$.callback=null},t.unstable_continueExecution=function(){w||p||(w=!0,U(E))},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function($){switch(v){case 1:case 2:case 3:var F=3;break;default:F=v}var V=v;v=F;try{return $()}finally{v=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function($,F){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var V=v;v=$;try{return F()}finally{v=V}},t.unstable_scheduleCallback=function($,F,V){var ae=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?ae+V:ae):V=ae,$){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=V+se,$={id:d++,callback:F,priorityLevel:$,startTime:V,expirationTime:se,sortIndex:-1},V>ae?($.sortIndex=V,e(u,$),r(c)===null&&$===r(u)&&(f?(g(T),T=-1):f=!0,K(S,V-ae))):($.sortIndex=se,e(c,$),w||p||(w=!0,U(E))),$},t.unstable_shouldYield=j,t.unstable_wrapCallback=function($){var F=v;return function(){var V=v;v=F;try{return $.apply(this,arguments)}finally{v=V}}}})(Tx);Rx.exports=Tx;var sP=Rx.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var aP=x,Pr=sP;function Y(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Ax=new Set,ul={};function ro(t,e){si(t,e),si(t+"Capture",e)}function si(t,e){for(ul[t]=e,t=0;t<e.length;t++)Ax.add(e[t])}var ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sh=Object.prototype.hasOwnProperty,oP=/^[: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]*$/,Ng={},jg={};function iP(t){return sh.call(jg,t)?!0:sh.call(Ng,t)?!1:oP.test(t)?jg[t]=!0:(Ng[t]=!0,!1)}function lP(t,e,r,s){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function cP(t,e,r,s){if(e===null||typeof e>"u"||lP(t,e,r,s))return!0;if(s)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ar(t,e,r,s,n,a,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=s,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=o}var qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){qt[t]=new ar(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];qt[e]=new ar(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){qt[t]=new ar(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){qt[t]=new ar(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){qt[t]=new ar(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){qt[t]=new ar(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){qt[t]=new ar(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){qt[t]=new ar(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){qt[t]=new ar(t,5,!1,t.toLowerCase(),null,!1,!1)});var Sm=/[\-:]([a-z])/g;function _m(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Sm,_m);qt[e]=new ar(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Sm,_m);qt[e]=new ar(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Sm,_m);qt[e]=new ar(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){qt[t]=new ar(t,1,!1,t.toLowerCase(),null,!1,!1)});qt.xlinkHref=new ar("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){qt[t]=new ar(t,1,!1,t.toLowerCase(),null,!0,!0)});function Em(t,e,r,s){var n=qt.hasOwnProperty(e)?qt[e]:null;(n!==null?n.type!==0:s||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(cP(e,r,n,s)&&(r=null),s||n===null?iP(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):n.mustUseProperty?t[n.propertyName]=r===null?n.type===3?!1:"":r:(e=n.attributeName,s=n.attributeNamespace,r===null?t.removeAttribute(e):(n=n.type,r=n===3||n===4&&r===!0?"":""+r,s?t.setAttributeNS(s,e,r):t.setAttribute(e,r))))}var ds=aP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ac=Symbol.for("react.element"),xo=Symbol.for("react.portal"),wo=Symbol.for("react.fragment"),Cm=Symbol.for("react.strict_mode"),ah=Symbol.for("react.profiler"),Ox=Symbol.for("react.provider"),Ix=Symbol.for("react.context"),Pm=Symbol.for("react.forward_ref"),oh=Symbol.for("react.suspense"),ih=Symbol.for("react.suspense_list"),km=Symbol.for("react.memo"),_s=Symbol.for("react.lazy"),Dx=Symbol.for("react.offscreen"),Rg=Symbol.iterator;function Ri(t){return t===null||typeof t!="object"?null:(t=Rg&&t[Rg]||t["@@iterator"],typeof t=="function"?t:null)}var gt=Object.assign,sf;function zi(t){if(sf===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);sf=e&&e[1]||""}return`
|
|
34
|
-
`+sf+t}var af=!1;function of(t,e){if(!t||af)return"";af=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var s=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){s=u}t.call(e.prototype)}else{try{throw Error()}catch(u){s=u}t()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var n=u.stack.split(`
|
|
35
|
-
`),a=s.stack.split(`
|
|
36
|
-
`),o=n.length-1,l=a.length-1;1<=o&&0<=l&&n[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(n[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||n[o]!==a[l]){var c=`
|
|
37
|
-
`+n[o].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=o&&0<=l);break}}}finally{af=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?zi(t):""}function uP(t){switch(t.tag){case 5:return zi(t.type);case 16:return zi("Lazy");case 13:return zi("Suspense");case 19:return zi("SuspenseList");case 0:case 2:case 15:return t=of(t.type,!1),t;case 11:return t=of(t.type.render,!1),t;case 1:return t=of(t.type,!0),t;default:return""}}function lh(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case wo:return"Fragment";case xo:return"Portal";case ah:return"Profiler";case Cm:return"StrictMode";case oh:return"Suspense";case ih:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Ix:return(t.displayName||"Context")+".Consumer";case Ox:return(t._context.displayName||"Context")+".Provider";case Pm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case km:return e=t.displayName||null,e!==null?e:lh(t.type)||"Memo";case _s:e=t._payload,t=t._init;try{return lh(t(e))}catch{}}return null}function dP(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return lh(e);case 8:return e===Cm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function na(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Mx(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function fP(t){var e=Mx(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),s=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,a=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return n.call(this)},set:function(o){s=""+o,a.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function oc(t){t._valueTracker||(t._valueTracker=fP(t))}function $x(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),s="";return t&&(s=Mx(t)?t.checked?"true":"false":t.value),t=s,t!==r?(e.setValue(t),!0):!1}function ou(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ch(t,e){var r=e.checked;return gt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Tg(t,e){var r=e.defaultValue==null?"":e.defaultValue,s=e.checked!=null?e.checked:e.defaultChecked;r=na(e.value!=null?e.value:r),t._wrapperState={initialChecked:s,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Fx(t,e){e=e.checked,e!=null&&Em(t,"checked",e,!1)}function uh(t,e){Fx(t,e);var r=na(e.value),s=e.type;if(r!=null)s==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(s==="submit"||s==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?dh(t,e.type,r):e.hasOwnProperty("defaultValue")&&dh(t,e.type,na(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Ag(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var s=e.type;if(!(s!=="submit"&&s!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function dh(t,e,r){(e!=="number"||ou(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Vi=Array.isArray;function Io(t,e,r,s){if(t=t.options,e){e={};for(var n=0;n<r.length;n++)e["$"+r[n]]=!0;for(r=0;r<t.length;r++)n=e.hasOwnProperty("$"+t[r].value),t[r].selected!==n&&(t[r].selected=n),n&&s&&(t[r].defaultSelected=!0)}else{for(r=""+na(r),e=null,n=0;n<t.length;n++){if(t[n].value===r){t[n].selected=!0,s&&(t[n].defaultSelected=!0);return}e!==null||t[n].disabled||(e=t[n])}e!==null&&(e.selected=!0)}}function fh(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Y(91));return gt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Og(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(Y(92));if(Vi(r)){if(1<r.length)throw Error(Y(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:na(r)}}function Lx(t,e){var r=na(e.value),s=na(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),s!=null&&(t.defaultValue=""+s)}function Ig(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Ux(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function hh(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Ux(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var ic,zx=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,s,n){MSApp.execUnsafeLocalFunction(function(){return t(e,r,s,n)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(ic=ic||document.createElement("div"),ic.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=ic.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function dl(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Yi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hP=["Webkit","ms","Moz","O"];Object.keys(Yi).forEach(function(t){hP.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Yi[e]=Yi[t]})});function Vx(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Yi.hasOwnProperty(t)&&Yi[t]?(""+e).trim():e+"px"}function Hx(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var s=r.indexOf("--")===0,n=Vx(r,e[r],s);r==="float"&&(r="cssFloat"),s?t.setProperty(r,n):t[r]=n}}var pP=gt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ph(t,e){if(e){if(pP[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Y(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Y(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Y(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Y(62))}}function mh(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 vh=null;function Nm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var gh=null,Do=null,Mo=null;function Dg(t){if(t=Ll(t)){if(typeof gh!="function")throw Error(Y(280));var e=t.stateNode;e&&(e=hd(e),gh(t.stateNode,t.type,e))}}function qx(t){Do?Mo?Mo.push(t):Mo=[t]:Do=t}function Bx(){if(Do){var t=Do,e=Mo;if(Mo=Do=null,Dg(t),e)for(t=0;t<e.length;t++)Dg(e[t])}}function Wx(t,e){return t(e)}function Kx(){}var lf=!1;function Qx(t,e,r){if(lf)return t(e,r);lf=!0;try{return Wx(t,e,r)}finally{lf=!1,(Do!==null||Mo!==null)&&(Kx(),Bx())}}function fl(t,e){var r=t.stateNode;if(r===null)return null;var s=hd(r);if(s===null)return null;r=s[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(t=t.type,s=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!s;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(Y(231,e,typeof r));return r}var yh=!1;if(ns)try{var Ti={};Object.defineProperty(Ti,"passive",{get:function(){yh=!0}}),window.addEventListener("test",Ti,Ti),window.removeEventListener("test",Ti,Ti)}catch{yh=!1}function mP(t,e,r,s,n,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(d){this.onError(d)}}var Ji=!1,iu=null,lu=!1,xh=null,vP={onError:function(t){Ji=!0,iu=t}};function gP(t,e,r,s,n,a,o,l,c){Ji=!1,iu=null,mP.apply(vP,arguments)}function yP(t,e,r,s,n,a,o,l,c){if(gP.apply(this,arguments),Ji){if(Ji){var u=iu;Ji=!1,iu=null}else throw Error(Y(198));lu||(lu=!0,xh=u)}}function no(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function Gx(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function Mg(t){if(no(t)!==t)throw Error(Y(188))}function xP(t){var e=t.alternate;if(!e){if(e=no(t),e===null)throw Error(Y(188));return e!==t?null:t}for(var r=t,s=e;;){var n=r.return;if(n===null)break;var a=n.alternate;if(a===null){if(s=n.return,s!==null){r=s;continue}break}if(n.child===a.child){for(a=n.child;a;){if(a===r)return Mg(n),t;if(a===s)return Mg(n),e;a=a.sibling}throw Error(Y(188))}if(r.return!==s.return)r=n,s=a;else{for(var o=!1,l=n.child;l;){if(l===r){o=!0,r=n,s=a;break}if(l===s){o=!0,s=n,r=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===r){o=!0,r=a,s=n;break}if(l===s){o=!0,s=a,r=n;break}l=l.sibling}if(!o)throw Error(Y(189))}}if(r.alternate!==s)throw Error(Y(190))}if(r.tag!==3)throw Error(Y(188));return r.stateNode.current===r?t:e}function Zx(t){return t=xP(t),t!==null?Yx(t):null}function Yx(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Yx(t);if(e!==null)return e;t=t.sibling}return null}var Jx=Pr.unstable_scheduleCallback,$g=Pr.unstable_cancelCallback,wP=Pr.unstable_shouldYield,bP=Pr.unstable_requestPaint,_t=Pr.unstable_now,SP=Pr.unstable_getCurrentPriorityLevel,jm=Pr.unstable_ImmediatePriority,Xx=Pr.unstable_UserBlockingPriority,cu=Pr.unstable_NormalPriority,_P=Pr.unstable_LowPriority,ew=Pr.unstable_IdlePriority,cd=null,kn=null;function EP(t){if(kn&&typeof kn.onCommitFiberRoot=="function")try{kn.onCommitFiberRoot(cd,t,void 0,(t.current.flags&128)===128)}catch{}}var rn=Math.clz32?Math.clz32:kP,CP=Math.log,PP=Math.LN2;function kP(t){return t>>>=0,t===0?32:31-(CP(t)/PP|0)|0}var lc=64,cc=4194304;function Hi(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function uu(t,e){var r=t.pendingLanes;if(r===0)return 0;var s=0,n=t.suspendedLanes,a=t.pingedLanes,o=r&268435455;if(o!==0){var l=o&~n;l!==0?s=Hi(l):(a&=o,a!==0&&(s=Hi(a)))}else o=r&~n,o!==0?s=Hi(o):a!==0&&(s=Hi(a));if(s===0)return 0;if(e!==0&&e!==s&&!(e&n)&&(n=s&-s,a=e&-e,n>=a||n===16&&(a&4194240)!==0))return e;if(s&4&&(s|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=s;0<e;)r=31-rn(e),n=1<<r,s|=t[r],e&=~n;return s}function NP(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jP(t,e){for(var r=t.suspendedLanes,s=t.pingedLanes,n=t.expirationTimes,a=t.pendingLanes;0<a;){var o=31-rn(a),l=1<<o,c=n[o];c===-1?(!(l&r)||l&s)&&(n[o]=NP(l,e)):c<=e&&(t.expiredLanes|=l),a&=~l}}function wh(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function tw(){var t=lc;return lc<<=1,!(lc&4194240)&&(lc=64),t}function cf(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function $l(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-rn(e),t[e]=r}function RP(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var s=t.eventTimes;for(t=t.expirationTimes;0<r;){var n=31-rn(r),a=1<<n;e[n]=0,s[n]=-1,t[n]=-1,r&=~a}}function Rm(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var s=31-rn(r),n=1<<s;n&e|t[s]&e&&(t[s]|=e),r&=~n}}var Xe=0;function rw(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var nw,Tm,sw,aw,ow,bh=!1,uc=[],Bs=null,Ws=null,Ks=null,hl=new Map,pl=new Map,Ns=[],TP="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Fg(t,e){switch(t){case"focusin":case"focusout":Bs=null;break;case"dragenter":case"dragleave":Ws=null;break;case"mouseover":case"mouseout":Ks=null;break;case"pointerover":case"pointerout":hl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":pl.delete(e.pointerId)}}function Ai(t,e,r,s,n,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:r,eventSystemFlags:s,nativeEvent:a,targetContainers:[n]},e!==null&&(e=Ll(e),e!==null&&Tm(e)),t):(t.eventSystemFlags|=s,e=t.targetContainers,n!==null&&e.indexOf(n)===-1&&e.push(n),t)}function AP(t,e,r,s,n){switch(e){case"focusin":return Bs=Ai(Bs,t,e,r,s,n),!0;case"dragenter":return Ws=Ai(Ws,t,e,r,s,n),!0;case"mouseover":return Ks=Ai(Ks,t,e,r,s,n),!0;case"pointerover":var a=n.pointerId;return hl.set(a,Ai(hl.get(a)||null,t,e,r,s,n)),!0;case"gotpointercapture":return a=n.pointerId,pl.set(a,Ai(pl.get(a)||null,t,e,r,s,n)),!0}return!1}function iw(t){var e=Pa(t.target);if(e!==null){var r=no(e);if(r!==null){if(e=r.tag,e===13){if(e=Gx(r),e!==null){t.blockedOn=e,ow(t.priority,function(){sw(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Fc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=Sh(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var s=new r.constructor(r.type,r);vh=s,r.target.dispatchEvent(s),vh=null}else return e=Ll(r),e!==null&&Tm(e),t.blockedOn=r,!1;e.shift()}return!0}function Lg(t,e,r){Fc(t)&&r.delete(e)}function OP(){bh=!1,Bs!==null&&Fc(Bs)&&(Bs=null),Ws!==null&&Fc(Ws)&&(Ws=null),Ks!==null&&Fc(Ks)&&(Ks=null),hl.forEach(Lg),pl.forEach(Lg)}function Oi(t,e){t.blockedOn===e&&(t.blockedOn=null,bh||(bh=!0,Pr.unstable_scheduleCallback(Pr.unstable_NormalPriority,OP)))}function ml(t){function e(n){return Oi(n,t)}if(0<uc.length){Oi(uc[0],t);for(var r=1;r<uc.length;r++){var s=uc[r];s.blockedOn===t&&(s.blockedOn=null)}}for(Bs!==null&&Oi(Bs,t),Ws!==null&&Oi(Ws,t),Ks!==null&&Oi(Ks,t),hl.forEach(e),pl.forEach(e),r=0;r<Ns.length;r++)s=Ns[r],s.blockedOn===t&&(s.blockedOn=null);for(;0<Ns.length&&(r=Ns[0],r.blockedOn===null);)iw(r),r.blockedOn===null&&Ns.shift()}var $o=ds.ReactCurrentBatchConfig,du=!0;function IP(t,e,r,s){var n=Xe,a=$o.transition;$o.transition=null;try{Xe=1,Am(t,e,r,s)}finally{Xe=n,$o.transition=a}}function DP(t,e,r,s){var n=Xe,a=$o.transition;$o.transition=null;try{Xe=4,Am(t,e,r,s)}finally{Xe=n,$o.transition=a}}function Am(t,e,r,s){if(du){var n=Sh(t,e,r,s);if(n===null)xf(t,e,s,fu,r),Fg(t,s);else if(AP(n,t,e,r,s))s.stopPropagation();else if(Fg(t,s),e&4&&-1<TP.indexOf(t)){for(;n!==null;){var a=Ll(n);if(a!==null&&nw(a),a=Sh(t,e,r,s),a===null&&xf(t,e,s,fu,r),a===n)break;n=a}n!==null&&s.stopPropagation()}else xf(t,e,s,null,r)}}var fu=null;function Sh(t,e,r,s){if(fu=null,t=Nm(s),t=Pa(t),t!==null)if(e=no(t),e===null)t=null;else if(r=e.tag,r===13){if(t=Gx(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return fu=t,null}function lw(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(SP()){case jm:return 1;case Xx:return 4;case cu:case _P:return 16;case ew:return 536870912;default:return 16}default:return 16}}var Us=null,Om=null,Lc=null;function cw(){if(Lc)return Lc;var t,e=Om,r=e.length,s,n="value"in Us?Us.value:Us.textContent,a=n.length;for(t=0;t<r&&e[t]===n[t];t++);var o=r-t;for(s=1;s<=o&&e[r-s]===n[a-s];s++);return Lc=n.slice(t,1<s?1-s:void 0)}function Uc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function dc(){return!0}function Ug(){return!1}function Nr(t){function e(r,s,n,a,o){this._reactName=r,this._targetInst=n,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(r=t[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?dc:Ug,this.isPropagationStopped=Ug,this}return gt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=dc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=dc)},persist:function(){},isPersistent:dc}),e}var xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Im=Nr(xi),Fl=gt({},xi,{view:0,detail:0}),MP=Nr(Fl),uf,df,Ii,ud=gt({},Fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dm,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ii&&(Ii&&t.type==="mousemove"?(uf=t.screenX-Ii.screenX,df=t.screenY-Ii.screenY):df=uf=0,Ii=t),uf)},movementY:function(t){return"movementY"in t?t.movementY:df}}),zg=Nr(ud),$P=gt({},ud,{dataTransfer:0}),FP=Nr($P),LP=gt({},Fl,{relatedTarget:0}),ff=Nr(LP),UP=gt({},xi,{animationName:0,elapsedTime:0,pseudoElement:0}),zP=Nr(UP),VP=gt({},xi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),HP=Nr(VP),qP=gt({},xi,{data:0}),Vg=Nr(qP),BP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},WP={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"},KP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QP(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=KP[t])?!!e[t]:!1}function Dm(){return QP}var GP=gt({},Fl,{key:function(t){if(t.key){var e=BP[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Uc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?WP[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dm,charCode:function(t){return t.type==="keypress"?Uc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Uc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ZP=Nr(GP),YP=gt({},ud,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hg=Nr(YP),JP=gt({},Fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dm}),XP=Nr(JP),ek=gt({},xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),tk=Nr(ek),rk=gt({},ud,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),nk=Nr(rk),sk=[9,13,27,32],Mm=ns&&"CompositionEvent"in window,Xi=null;ns&&"documentMode"in document&&(Xi=document.documentMode);var ak=ns&&"TextEvent"in window&&!Xi,uw=ns&&(!Mm||Xi&&8<Xi&&11>=Xi),qg=" ",Bg=!1;function dw(t,e){switch(t){case"keyup":return sk.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fw(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var bo=!1;function ok(t,e){switch(t){case"compositionend":return fw(e);case"keypress":return e.which!==32?null:(Bg=!0,qg);case"textInput":return t=e.data,t===qg&&Bg?null:t;default:return null}}function ik(t,e){if(bo)return t==="compositionend"||!Mm&&dw(t,e)?(t=cw(),Lc=Om=Us=null,bo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return uw&&e.locale!=="ko"?null:e.data;default:return null}}var lk={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 Wg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!lk[t.type]:e==="textarea"}function hw(t,e,r,s){qx(s),e=hu(e,"onChange"),0<e.length&&(r=new Im("onChange","change",null,r,s),t.push({event:r,listeners:e}))}var el=null,vl=null;function ck(t){Ew(t,0)}function dd(t){var e=Eo(t);if($x(e))return t}function uk(t,e){if(t==="change")return e}var pw=!1;if(ns){var hf;if(ns){var pf="oninput"in document;if(!pf){var Kg=document.createElement("div");Kg.setAttribute("oninput","return;"),pf=typeof Kg.oninput=="function"}hf=pf}else hf=!1;pw=hf&&(!document.documentMode||9<document.documentMode)}function Qg(){el&&(el.detachEvent("onpropertychange",mw),vl=el=null)}function mw(t){if(t.propertyName==="value"&&dd(vl)){var e=[];hw(e,vl,t,Nm(t)),Qx(ck,e)}}function dk(t,e,r){t==="focusin"?(Qg(),el=e,vl=r,el.attachEvent("onpropertychange",mw)):t==="focusout"&&Qg()}function fk(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return dd(vl)}function hk(t,e){if(t==="click")return dd(e)}function pk(t,e){if(t==="input"||t==="change")return dd(e)}function mk(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var sn=typeof Object.is=="function"?Object.is:mk;function gl(t,e){if(sn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),s=Object.keys(e);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var n=r[s];if(!sh.call(e,n)||!sn(t[n],e[n]))return!1}return!0}function Gg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Zg(t,e){var r=Gg(t);t=0;for(var s;r;){if(r.nodeType===3){if(s=t+r.textContent.length,t<=e&&s>=e)return{node:r,offset:e-t};t=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Gg(r)}}function vw(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?vw(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function gw(){for(var t=window,e=ou();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=ou(t.document)}return e}function $m(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function vk(t){var e=gw(),r=t.focusedElem,s=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&vw(r.ownerDocument.documentElement,r)){if(s!==null&&$m(r)){if(e=s.start,t=s.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var n=r.textContent.length,a=Math.min(s.start,n);s=s.end===void 0?a:Math.min(s.end,n),!t.extend&&a>s&&(n=s,s=a,a=n),n=Zg(r,a);var o=Zg(r,s);n&&o&&(t.rangeCount!==1||t.anchorNode!==n.node||t.anchorOffset!==n.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(n.node,n.offset),t.removeAllRanges(),a>s?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var gk=ns&&"documentMode"in document&&11>=document.documentMode,So=null,_h=null,tl=null,Eh=!1;function Yg(t,e,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Eh||So==null||So!==ou(s)||(s=So,"selectionStart"in s&&$m(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),tl&&gl(tl,s)||(tl=s,s=hu(_h,"onSelect"),0<s.length&&(e=new Im("onSelect","select",null,e,r),t.push({event:e,listeners:s}),e.target=So)))}function fc(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var _o={animationend:fc("Animation","AnimationEnd"),animationiteration:fc("Animation","AnimationIteration"),animationstart:fc("Animation","AnimationStart"),transitionend:fc("Transition","TransitionEnd")},mf={},yw={};ns&&(yw=document.createElement("div").style,"AnimationEvent"in window||(delete _o.animationend.animation,delete _o.animationiteration.animation,delete _o.animationstart.animation),"TransitionEvent"in window||delete _o.transitionend.transition);function fd(t){if(mf[t])return mf[t];if(!_o[t])return t;var e=_o[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in yw)return mf[t]=e[r];return t}var xw=fd("animationend"),ww=fd("animationiteration"),bw=fd("animationstart"),Sw=fd("transitionend"),_w=new Map,Jg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function la(t,e){_w.set(t,e),ro(e,[t])}for(var vf=0;vf<Jg.length;vf++){var gf=Jg[vf],yk=gf.toLowerCase(),xk=gf[0].toUpperCase()+gf.slice(1);la(yk,"on"+xk)}la(xw,"onAnimationEnd");la(ww,"onAnimationIteration");la(bw,"onAnimationStart");la("dblclick","onDoubleClick");la("focusin","onFocus");la("focusout","onBlur");la(Sw,"onTransitionEnd");si("onMouseEnter",["mouseout","mouseover"]);si("onMouseLeave",["mouseout","mouseover"]);si("onPointerEnter",["pointerout","pointerover"]);si("onPointerLeave",["pointerout","pointerover"]);ro("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ro("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ro("onBeforeInput",["compositionend","keypress","textInput","paste"]);ro("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ro("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ro("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="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(" "),wk=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function Xg(t,e,r){var s=t.type||"unknown-event";t.currentTarget=r,yP(s,e,void 0,t),t.currentTarget=null}function Ew(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var s=t[r],n=s.event;s=s.listeners;e:{var a=void 0;if(e)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&n.isPropagationStopped())break e;Xg(n,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&n.isPropagationStopped())break e;Xg(n,l,u),a=c}}}if(lu)throw t=xh,lu=!1,xh=null,t}function lt(t,e){var r=e[jh];r===void 0&&(r=e[jh]=new Set);var s=t+"__bubble";r.has(s)||(Cw(e,t,2,!1),r.add(s))}function yf(t,e,r){var s=0;e&&(s|=4),Cw(r,t,s,e)}var hc="_reactListening"+Math.random().toString(36).slice(2);function yl(t){if(!t[hc]){t[hc]=!0,Ax.forEach(function(r){r!=="selectionchange"&&(wk.has(r)||yf(r,!1,t),yf(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[hc]||(e[hc]=!0,yf("selectionchange",!1,e))}}function Cw(t,e,r,s){switch(lw(e)){case 1:var n=IP;break;case 4:n=DP;break;default:n=Am}r=n.bind(null,e,r,t),n=void 0,!yh||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(n=!0),s?n!==void 0?t.addEventListener(e,r,{capture:!0,passive:n}):t.addEventListener(e,r,!0):n!==void 0?t.addEventListener(e,r,{passive:n}):t.addEventListener(e,r,!1)}function xf(t,e,r,s,n){var a=s;if(!(e&1)&&!(e&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===n||l.nodeType===8&&l.parentNode===n)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===n||c.nodeType===8&&c.parentNode===n))return;o=o.return}for(;l!==null;){if(o=Pa(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}Qx(function(){var u=a,d=Nm(r),h=[];e:{var v=_w.get(t);if(v!==void 0){var p=Im,w=t;switch(t){case"keypress":if(Uc(r)===0)break e;case"keydown":case"keyup":p=ZP;break;case"focusin":w="focus",p=ff;break;case"focusout":w="blur",p=ff;break;case"beforeblur":case"afterblur":p=ff;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=zg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=FP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=XP;break;case xw:case ww:case bw:p=zP;break;case Sw:p=tk;break;case"scroll":p=MP;break;case"wheel":p=nk;break;case"copy":case"cut":case"paste":p=HP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Hg}var f=(e&4)!==0,m=!f&&t==="scroll",g=f?v!==null?v+"Capture":null:v;f=[];for(var y=u,b;y!==null;){b=y;var S=b.stateNode;if(b.tag===5&&S!==null&&(b=S,g!==null&&(S=fl(y,g),S!=null&&f.push(xl(y,S,b)))),m)break;y=y.return}0<f.length&&(v=new p(v,w,null,r,d),h.push({event:v,listeners:f}))}}if(!(e&7)){e:{if(v=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",v&&r!==vh&&(w=r.relatedTarget||r.fromElement)&&(Pa(w)||w[ss]))break e;if((p||v)&&(v=d.window===d?d:(v=d.ownerDocument)?v.defaultView||v.parentWindow:window,p?(w=r.relatedTarget||r.toElement,p=u,w=w?Pa(w):null,w!==null&&(m=no(w),w!==m||w.tag!==5&&w.tag!==6)&&(w=null)):(p=null,w=u),p!==w)){if(f=zg,S="onMouseLeave",g="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(f=Hg,S="onPointerLeave",g="onPointerEnter",y="pointer"),m=p==null?v:Eo(p),b=w==null?v:Eo(w),v=new f(S,y+"leave",p,r,d),v.target=m,v.relatedTarget=b,S=null,Pa(d)===u&&(f=new f(g,y+"enter",w,r,d),f.target=b,f.relatedTarget=m,S=f),m=S,p&&w)t:{for(f=p,g=w,y=0,b=f;b;b=lo(b))y++;for(b=0,S=g;S;S=lo(S))b++;for(;0<y-b;)f=lo(f),y--;for(;0<b-y;)g=lo(g),b--;for(;y--;){if(f===g||g!==null&&f===g.alternate)break t;f=lo(f),g=lo(g)}f=null}else f=null;p!==null&&ey(h,v,p,f,!1),w!==null&&m!==null&&ey(h,m,w,f,!0)}}e:{if(v=u?Eo(u):window,p=v.nodeName&&v.nodeName.toLowerCase(),p==="select"||p==="input"&&v.type==="file")var E=uk;else if(Wg(v))if(pw)E=pk;else{E=fk;var P=dk}else(p=v.nodeName)&&p.toLowerCase()==="input"&&(v.type==="checkbox"||v.type==="radio")&&(E=hk);if(E&&(E=E(t,u))){hw(h,E,r,d);break e}P&&P(t,v,u),t==="focusout"&&(P=v._wrapperState)&&P.controlled&&v.type==="number"&&dh(v,"number",v.value)}switch(P=u?Eo(u):window,t){case"focusin":(Wg(P)||P.contentEditable==="true")&&(So=P,_h=u,tl=null);break;case"focusout":tl=_h=So=null;break;case"mousedown":Eh=!0;break;case"contextmenu":case"mouseup":case"dragend":Eh=!1,Yg(h,r,d);break;case"selectionchange":if(gk)break;case"keydown":case"keyup":Yg(h,r,d)}var R;if(Mm)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else bo?dw(t,r)&&(T="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(T="onCompositionStart");T&&(uw&&r.locale!=="ko"&&(bo||T!=="onCompositionStart"?T==="onCompositionEnd"&&bo&&(R=cw()):(Us=d,Om="value"in Us?Us.value:Us.textContent,bo=!0)),P=hu(u,T),0<P.length&&(T=new Vg(T,t,null,r,d),h.push({event:T,listeners:P}),R?T.data=R:(R=fw(r),R!==null&&(T.data=R)))),(R=ak?ok(t,r):ik(t,r))&&(u=hu(u,"onBeforeInput"),0<u.length&&(d=new Vg("onBeforeInput","beforeinput",null,r,d),h.push({event:d,listeners:u}),d.data=R))}Ew(h,e)})}function xl(t,e,r){return{instance:t,listener:e,currentTarget:r}}function hu(t,e){for(var r=e+"Capture",s=[];t!==null;){var n=t,a=n.stateNode;n.tag===5&&a!==null&&(n=a,a=fl(t,r),a!=null&&s.unshift(xl(t,a,n)),a=fl(t,e),a!=null&&s.push(xl(t,a,n))),t=t.return}return s}function lo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function ey(t,e,r,s,n){for(var a=e._reactName,o=[];r!==null&&r!==s;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,n?(c=fl(r,a),c!=null&&o.unshift(xl(r,c,l))):n||(c=fl(r,a),c!=null&&o.push(xl(r,c,l)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var bk=/\r\n?/g,Sk=/\u0000|\uFFFD/g;function ty(t){return(typeof t=="string"?t:""+t).replace(bk,`
|
|
38
|
-
`).replace(Sk,"")}function pc(t,e,r){if(e=ty(e),ty(t)!==e&&r)throw Error(Y(425))}function pu(){}var Ch=null,Ph=null;function kh(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Nh=typeof setTimeout=="function"?setTimeout:void 0,_k=typeof clearTimeout=="function"?clearTimeout:void 0,ry=typeof Promise=="function"?Promise:void 0,Ek=typeof queueMicrotask=="function"?queueMicrotask:typeof ry<"u"?function(t){return ry.resolve(null).then(t).catch(Ck)}:Nh;function Ck(t){setTimeout(function(){throw t})}function wf(t,e){var r=e,s=0;do{var n=r.nextSibling;if(t.removeChild(r),n&&n.nodeType===8)if(r=n.data,r==="/$"){if(s===0){t.removeChild(n),ml(e);return}s--}else r!=="$"&&r!=="$?"&&r!=="$!"||s++;r=n}while(r);ml(e)}function Qs(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function ny(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var wi=Math.random().toString(36).slice(2),wn="__reactFiber$"+wi,wl="__reactProps$"+wi,ss="__reactContainer$"+wi,jh="__reactEvents$"+wi,Pk="__reactListeners$"+wi,kk="__reactHandles$"+wi;function Pa(t){var e=t[wn];if(e)return e;for(var r=t.parentNode;r;){if(e=r[ss]||r[wn]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=ny(t);t!==null;){if(r=t[wn])return r;t=ny(t)}return e}t=r,r=t.parentNode}return null}function Ll(t){return t=t[wn]||t[ss],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Eo(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(Y(33))}function hd(t){return t[wl]||null}var Rh=[],Co=-1;function ca(t){return{current:t}}function ct(t){0>Co||(t.current=Rh[Co],Rh[Co]=null,Co--)}function st(t,e){Co++,Rh[Co]=t.current,t.current=e}var sa={},Zt=ca(sa),mr=ca(!1),Ua=sa;function ai(t,e){var r=t.type.contextTypes;if(!r)return sa;var s=t.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===e)return s.__reactInternalMemoizedMaskedChildContext;var n={},a;for(a in r)n[a]=e[a];return s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=n),n}function vr(t){return t=t.childContextTypes,t!=null}function mu(){ct(mr),ct(Zt)}function sy(t,e,r){if(Zt.current!==sa)throw Error(Y(168));st(Zt,e),st(mr,r)}function Pw(t,e,r){var s=t.stateNode;if(e=e.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var n in s)if(!(n in e))throw Error(Y(108,dP(t)||"Unknown",n));return gt({},r,s)}function vu(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||sa,Ua=Zt.current,st(Zt,t),st(mr,mr.current),!0}function ay(t,e,r){var s=t.stateNode;if(!s)throw Error(Y(169));r?(t=Pw(t,e,Ua),s.__reactInternalMemoizedMergedChildContext=t,ct(mr),ct(Zt),st(Zt,t)):ct(mr),st(mr,r)}var Bn=null,pd=!1,bf=!1;function kw(t){Bn===null?Bn=[t]:Bn.push(t)}function Nk(t){pd=!0,kw(t)}function ua(){if(!bf&&Bn!==null){bf=!0;var t=0,e=Xe;try{var r=Bn;for(Xe=1;t<r.length;t++){var s=r[t];do s=s(!0);while(s!==null)}Bn=null,pd=!1}catch(n){throw Bn!==null&&(Bn=Bn.slice(t+1)),Jx(jm,ua),n}finally{Xe=e,bf=!1}}return null}var Po=[],ko=0,gu=null,yu=0,Or=[],Ir=0,za=null,Zn=1,Yn="";function ba(t,e){Po[ko++]=yu,Po[ko++]=gu,gu=t,yu=e}function Nw(t,e,r){Or[Ir++]=Zn,Or[Ir++]=Yn,Or[Ir++]=za,za=t;var s=Zn;t=Yn;var n=32-rn(s)-1;s&=~(1<<n),r+=1;var a=32-rn(e)+n;if(30<a){var o=n-n%5;a=(s&(1<<o)-1).toString(32),s>>=o,n-=o,Zn=1<<32-rn(e)+n|r<<n|s,Yn=a+t}else Zn=1<<a|r<<n|s,Yn=t}function Fm(t){t.return!==null&&(ba(t,1),Nw(t,1,0))}function Lm(t){for(;t===gu;)gu=Po[--ko],Po[ko]=null,yu=Po[--ko],Po[ko]=null;for(;t===za;)za=Or[--Ir],Or[Ir]=null,Yn=Or[--Ir],Or[Ir]=null,Zn=Or[--Ir],Or[Ir]=null}var Er=null,_r=null,ht=!1,en=null;function jw(t,e){var r=Mr(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function oy(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Er=t,_r=Qs(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Er=t,_r=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=za!==null?{id:Zn,overflow:Yn}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=Mr(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,Er=t,_r=null,!0):!1;default:return!1}}function Th(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Ah(t){if(ht){var e=_r;if(e){var r=e;if(!oy(t,e)){if(Th(t))throw Error(Y(418));e=Qs(r.nextSibling);var s=Er;e&&oy(t,e)?jw(s,r):(t.flags=t.flags&-4097|2,ht=!1,Er=t)}}else{if(Th(t))throw Error(Y(418));t.flags=t.flags&-4097|2,ht=!1,Er=t}}}function iy(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Er=t}function mc(t){if(t!==Er)return!1;if(!ht)return iy(t),ht=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!kh(t.type,t.memoizedProps)),e&&(e=_r)){if(Th(t))throw Rw(),Error(Y(418));for(;e;)jw(t,e),e=Qs(e.nextSibling)}if(iy(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Y(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){_r=Qs(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}_r=null}}else _r=Er?Qs(t.stateNode.nextSibling):null;return!0}function Rw(){for(var t=_r;t;)t=Qs(t.nextSibling)}function oi(){_r=Er=null,ht=!1}function Um(t){en===null?en=[t]:en.push(t)}var jk=ds.ReactCurrentBatchConfig;function Di(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Y(309));var s=r.stateNode}if(!s)throw Error(Y(147,t));var n=s,a=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===a?e.ref:(e=function(o){var l=n.refs;o===null?delete l[a]:l[a]=o},e._stringRef=a,e)}if(typeof t!="string")throw Error(Y(284));if(!r._owner)throw Error(Y(290,t))}return t}function vc(t,e){throw t=Object.prototype.toString.call(e),Error(Y(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function ly(t){var e=t._init;return e(t._payload)}function Tw(t){function e(g,y){if(t){var b=g.deletions;b===null?(g.deletions=[y],g.flags|=16):b.push(y)}}function r(g,y){if(!t)return null;for(;y!==null;)e(g,y),y=y.sibling;return null}function s(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function n(g,y){return g=Js(g,y),g.index=0,g.sibling=null,g}function a(g,y,b){return g.index=b,t?(b=g.alternate,b!==null?(b=b.index,b<y?(g.flags|=2,y):b):(g.flags|=2,y)):(g.flags|=1048576,y)}function o(g){return t&&g.alternate===null&&(g.flags|=2),g}function l(g,y,b,S){return y===null||y.tag!==6?(y=Nf(b,g.mode,S),y.return=g,y):(y=n(y,b),y.return=g,y)}function c(g,y,b,S){var E=b.type;return E===wo?d(g,y,b.props.children,S,b.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===_s&&ly(E)===y.type)?(S=n(y,b.props),S.ref=Di(g,y,b),S.return=g,S):(S=Kc(b.type,b.key,b.props,null,g.mode,S),S.ref=Di(g,y,b),S.return=g,S)}function u(g,y,b,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=jf(b,g.mode,S),y.return=g,y):(y=n(y,b.children||[]),y.return=g,y)}function d(g,y,b,S,E){return y===null||y.tag!==7?(y=Fa(b,g.mode,S,E),y.return=g,y):(y=n(y,b),y.return=g,y)}function h(g,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Nf(""+y,g.mode,b),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ac:return b=Kc(y.type,y.key,y.props,null,g.mode,b),b.ref=Di(g,null,y),b.return=g,b;case xo:return y=jf(y,g.mode,b),y.return=g,y;case _s:var S=y._init;return h(g,S(y._payload),b)}if(Vi(y)||Ri(y))return y=Fa(y,g.mode,b,null),y.return=g,y;vc(g,y)}return null}function v(g,y,b,S){var E=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return E!==null?null:l(g,y,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case ac:return b.key===E?c(g,y,b,S):null;case xo:return b.key===E?u(g,y,b,S):null;case _s:return E=b._init,v(g,y,E(b._payload),S)}if(Vi(b)||Ri(b))return E!==null?null:d(g,y,b,S,null);vc(g,b)}return null}function p(g,y,b,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(b)||null,l(y,g,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case ac:return g=g.get(S.key===null?b:S.key)||null,c(y,g,S,E);case xo:return g=g.get(S.key===null?b:S.key)||null,u(y,g,S,E);case _s:var P=S._init;return p(g,y,b,P(S._payload),E)}if(Vi(S)||Ri(S))return g=g.get(b)||null,d(y,g,S,E,null);vc(y,S)}return null}function w(g,y,b,S){for(var E=null,P=null,R=y,T=y=0,N=null;R!==null&&T<b.length;T++){R.index>T?(N=R,R=null):N=R.sibling;var O=v(g,R,b[T],S);if(O===null){R===null&&(R=N);break}t&&R&&O.alternate===null&&e(g,R),y=a(O,y,T),P===null?E=O:P.sibling=O,P=O,R=N}if(T===b.length)return r(g,R),ht&&ba(g,T),E;if(R===null){for(;T<b.length;T++)R=h(g,b[T],S),R!==null&&(y=a(R,y,T),P===null?E=R:P.sibling=R,P=R);return ht&&ba(g,T),E}for(R=s(g,R);T<b.length;T++)N=p(R,g,T,b[T],S),N!==null&&(t&&N.alternate!==null&&R.delete(N.key===null?T:N.key),y=a(N,y,T),P===null?E=N:P.sibling=N,P=N);return t&&R.forEach(function(j){return e(g,j)}),ht&&ba(g,T),E}function f(g,y,b,S){var E=Ri(b);if(typeof E!="function")throw Error(Y(150));if(b=E.call(b),b==null)throw Error(Y(151));for(var P=E=null,R=y,T=y=0,N=null,O=b.next();R!==null&&!O.done;T++,O=b.next()){R.index>T?(N=R,R=null):N=R.sibling;var j=v(g,R,O.value,S);if(j===null){R===null&&(R=N);break}t&&R&&j.alternate===null&&e(g,R),y=a(j,y,T),P===null?E=j:P.sibling=j,P=j,R=N}if(O.done)return r(g,R),ht&&ba(g,T),E;if(R===null){for(;!O.done;T++,O=b.next())O=h(g,O.value,S),O!==null&&(y=a(O,y,T),P===null?E=O:P.sibling=O,P=O);return ht&&ba(g,T),E}for(R=s(g,R);!O.done;T++,O=b.next())O=p(R,g,T,O.value,S),O!==null&&(t&&O.alternate!==null&&R.delete(O.key===null?T:O.key),y=a(O,y,T),P===null?E=O:P.sibling=O,P=O);return t&&R.forEach(function(_){return e(g,_)}),ht&&ba(g,T),E}function m(g,y,b,S){if(typeof b=="object"&&b!==null&&b.type===wo&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case ac:e:{for(var E=b.key,P=y;P!==null;){if(P.key===E){if(E=b.type,E===wo){if(P.tag===7){r(g,P.sibling),y=n(P,b.props.children),y.return=g,g=y;break e}}else if(P.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===_s&&ly(E)===P.type){r(g,P.sibling),y=n(P,b.props),y.ref=Di(g,P,b),y.return=g,g=y;break e}r(g,P);break}else e(g,P);P=P.sibling}b.type===wo?(y=Fa(b.props.children,g.mode,S,b.key),y.return=g,g=y):(S=Kc(b.type,b.key,b.props,null,g.mode,S),S.ref=Di(g,y,b),S.return=g,g=S)}return o(g);case xo:e:{for(P=b.key;y!==null;){if(y.key===P)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){r(g,y.sibling),y=n(y,b.children||[]),y.return=g,g=y;break e}else{r(g,y);break}else e(g,y);y=y.sibling}y=jf(b,g.mode,S),y.return=g,g=y}return o(g);case _s:return P=b._init,m(g,y,P(b._payload),S)}if(Vi(b))return w(g,y,b,S);if(Ri(b))return f(g,y,b,S);vc(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(r(g,y.sibling),y=n(y,b),y.return=g,g=y):(r(g,y),y=Nf(b,g.mode,S),y.return=g,g=y),o(g)):r(g,y)}return m}var ii=Tw(!0),Aw=Tw(!1),xu=ca(null),wu=null,No=null,zm=null;function Vm(){zm=No=wu=null}function Hm(t){var e=xu.current;ct(xu),t._currentValue=e}function Oh(t,e,r){for(;t!==null;){var s=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,s!==null&&(s.childLanes|=e)):s!==null&&(s.childLanes&e)!==e&&(s.childLanes|=e),t===r)break;t=t.return}}function Fo(t,e){wu=t,zm=No=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(pr=!0),t.firstContext=null)}function Fr(t){var e=t._currentValue;if(zm!==t)if(t={context:t,memoizedValue:e,next:null},No===null){if(wu===null)throw Error(Y(308));No=t,wu.dependencies={lanes:0,firstContext:t}}else No=No.next=t;return e}var ka=null;function qm(t){ka===null?ka=[t]:ka.push(t)}function Ow(t,e,r,s){var n=e.interleaved;return n===null?(r.next=r,qm(e)):(r.next=n.next,n.next=r),e.interleaved=r,as(t,s)}function as(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Es=!1;function Bm(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Iw(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function es(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Gs(t,e,r){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,Ze&2){var n=s.pending;return n===null?e.next=e:(e.next=n.next,n.next=e),s.pending=e,as(t,r)}return n=s.interleaved,n===null?(e.next=e,qm(s)):(e.next=n.next,n.next=e),s.interleaved=e,as(t,r)}function zc(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var s=e.lanes;s&=t.pendingLanes,r|=s,e.lanes=r,Rm(t,r)}}function cy(t,e){var r=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var n=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?n=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?n=a=e:a=a.next=e}else n=a=e;r={baseState:s.baseState,firstBaseUpdate:n,lastBaseUpdate:a,shared:s.shared,effects:s.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function bu(t,e,r,s){var n=t.updateQueue;Es=!1;var a=n.firstBaseUpdate,o=n.lastBaseUpdate,l=n.shared.pending;if(l!==null){n.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=t.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var h=n.baseState;o=0,d=u=c=null,l=a;do{var v=l.lane,p=l.eventTime;if((s&v)===v){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=t,f=l;switch(v=e,p=r,f.tag){case 1:if(w=f.payload,typeof w=="function"){h=w.call(p,h,v);break e}h=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=f.payload,v=typeof w=="function"?w.call(p,h,v):w,v==null)break e;h=gt({},h,v);break e;case 2:Es=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,v=n.effects,v===null?n.effects=[l]:v.push(l))}else p={eventTime:p,lane:v,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=h):d=d.next=p,o|=v;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;v=l,l=v.next,v.next=null,n.lastBaseUpdate=v,n.shared.pending=null}}while(!0);if(d===null&&(c=h),n.baseState=c,n.firstBaseUpdate=u,n.lastBaseUpdate=d,e=n.shared.interleaved,e!==null){n=e;do o|=n.lane,n=n.next;while(n!==e)}else a===null&&(n.shared.lanes=0);Ha|=o,t.lanes=o,t.memoizedState=h}}function uy(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var s=t[e],n=s.callback;if(n!==null){if(s.callback=null,s=r,typeof n!="function")throw Error(Y(191,n));n.call(s)}}}var Ul={},Nn=ca(Ul),bl=ca(Ul),Sl=ca(Ul);function Na(t){if(t===Ul)throw Error(Y(174));return t}function Wm(t,e){switch(st(Sl,e),st(bl,t),st(Nn,Ul),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:hh(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=hh(e,t)}ct(Nn),st(Nn,e)}function li(){ct(Nn),ct(bl),ct(Sl)}function Dw(t){Na(Sl.current);var e=Na(Nn.current),r=hh(e,t.type);e!==r&&(st(bl,t),st(Nn,r))}function Km(t){bl.current===t&&(ct(Nn),ct(bl))}var mt=ca(0);function Su(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Sf=[];function Qm(){for(var t=0;t<Sf.length;t++)Sf[t]._workInProgressVersionPrimary=null;Sf.length=0}var Vc=ds.ReactCurrentDispatcher,_f=ds.ReactCurrentBatchConfig,Va=0,vt=null,Rt=null,$t=null,_u=!1,rl=!1,_l=0,Rk=0;function Kt(){throw Error(Y(321))}function Gm(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!sn(t[r],e[r]))return!1;return!0}function Zm(t,e,r,s,n,a){if(Va=a,vt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Vc.current=t===null||t.memoizedState===null?Ik:Dk,t=r(s,n),rl){a=0;do{if(rl=!1,_l=0,25<=a)throw Error(Y(301));a+=1,$t=Rt=null,e.updateQueue=null,Vc.current=Mk,t=r(s,n)}while(rl)}if(Vc.current=Eu,e=Rt!==null&&Rt.next!==null,Va=0,$t=Rt=vt=null,_u=!1,e)throw Error(Y(300));return t}function Ym(){var t=_l!==0;return _l=0,t}function pn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?vt.memoizedState=$t=t:$t=$t.next=t,$t}function Lr(){if(Rt===null){var t=vt.alternate;t=t!==null?t.memoizedState:null}else t=Rt.next;var e=$t===null?vt.memoizedState:$t.next;if(e!==null)$t=e,Rt=t;else{if(t===null)throw Error(Y(310));Rt=t,t={memoizedState:Rt.memoizedState,baseState:Rt.baseState,baseQueue:Rt.baseQueue,queue:Rt.queue,next:null},$t===null?vt.memoizedState=$t=t:$t=$t.next=t}return $t}function El(t,e){return typeof e=="function"?e(t):e}function Ef(t){var e=Lr(),r=e.queue;if(r===null)throw Error(Y(311));r.lastRenderedReducer=t;var s=Rt,n=s.baseQueue,a=r.pending;if(a!==null){if(n!==null){var o=n.next;n.next=a.next,a.next=o}s.baseQueue=n=a,r.pending=null}if(n!==null){a=n.next,s=s.baseState;var l=o=null,c=null,u=a;do{var d=u.lane;if((Va&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:t(s,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=h,o=s):c=c.next=h,vt.lanes|=d,Ha|=d}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,sn(s,e.memoizedState)||(pr=!0),e.memoizedState=s,e.baseState=o,e.baseQueue=c,r.lastRenderedState=s}if(t=r.interleaved,t!==null){n=t;do a=n.lane,vt.lanes|=a,Ha|=a,n=n.next;while(n!==t)}else n===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function Cf(t){var e=Lr(),r=e.queue;if(r===null)throw Error(Y(311));r.lastRenderedReducer=t;var s=r.dispatch,n=r.pending,a=e.memoizedState;if(n!==null){r.pending=null;var o=n=n.next;do a=t(a,o.action),o=o.next;while(o!==n);sn(a,e.memoizedState)||(pr=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),r.lastRenderedState=a}return[a,s]}function Mw(){}function $w(t,e){var r=vt,s=Lr(),n=e(),a=!sn(s.memoizedState,n);if(a&&(s.memoizedState=n,pr=!0),s=s.queue,Jm(Uw.bind(null,r,s,t),[t]),s.getSnapshot!==e||a||$t!==null&&$t.memoizedState.tag&1){if(r.flags|=2048,Cl(9,Lw.bind(null,r,s,n,e),void 0,null),Lt===null)throw Error(Y(349));Va&30||Fw(r,e,n)}return n}function Fw(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=vt.updateQueue,e===null?(e={lastEffect:null,stores:null},vt.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function Lw(t,e,r,s){e.value=r,e.getSnapshot=s,zw(e)&&Vw(t)}function Uw(t,e,r){return r(function(){zw(e)&&Vw(t)})}function zw(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!sn(t,r)}catch{return!0}}function Vw(t){var e=as(t,1);e!==null&&nn(e,t,1,-1)}function dy(t){var e=pn();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:El,lastRenderedState:t},e.queue=t,t=t.dispatch=Ok.bind(null,vt,t),[e.memoizedState,t]}function Cl(t,e,r,s){return t={tag:t,create:e,destroy:r,deps:s,next:null},e=vt.updateQueue,e===null?(e={lastEffect:null,stores:null},vt.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(s=r.next,r.next=t,t.next=s,e.lastEffect=t)),t}function Hw(){return Lr().memoizedState}function Hc(t,e,r,s){var n=pn();vt.flags|=t,n.memoizedState=Cl(1|e,r,void 0,s===void 0?null:s)}function md(t,e,r,s){var n=Lr();s=s===void 0?null:s;var a=void 0;if(Rt!==null){var o=Rt.memoizedState;if(a=o.destroy,s!==null&&Gm(s,o.deps)){n.memoizedState=Cl(e,r,a,s);return}}vt.flags|=t,n.memoizedState=Cl(1|e,r,a,s)}function fy(t,e){return Hc(8390656,8,t,e)}function Jm(t,e){return md(2048,8,t,e)}function qw(t,e){return md(4,2,t,e)}function Bw(t,e){return md(4,4,t,e)}function Ww(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function Kw(t,e,r){return r=r!=null?r.concat([t]):null,md(4,4,Ww.bind(null,e,t),r)}function Xm(){}function Qw(t,e){var r=Lr();e=e===void 0?null:e;var s=r.memoizedState;return s!==null&&e!==null&&Gm(e,s[1])?s[0]:(r.memoizedState=[t,e],t)}function Gw(t,e){var r=Lr();e=e===void 0?null:e;var s=r.memoizedState;return s!==null&&e!==null&&Gm(e,s[1])?s[0]:(t=t(),r.memoizedState=[t,e],t)}function Zw(t,e,r){return Va&21?(sn(r,e)||(r=tw(),vt.lanes|=r,Ha|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,pr=!0),t.memoizedState=r)}function Tk(t,e){var r=Xe;Xe=r!==0&&4>r?r:4,t(!0);var s=_f.transition;_f.transition={};try{t(!1),e()}finally{Xe=r,_f.transition=s}}function Yw(){return Lr().memoizedState}function Ak(t,e,r){var s=Ys(t);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},Jw(t))Xw(e,r);else if(r=Ow(t,e,r,s),r!==null){var n=rr();nn(r,t,s,n),eb(r,e,s)}}function Ok(t,e,r){var s=Ys(t),n={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(Jw(t))Xw(e,n);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var o=e.lastRenderedState,l=a(o,r);if(n.hasEagerState=!0,n.eagerState=l,sn(l,o)){var c=e.interleaved;c===null?(n.next=n,qm(e)):(n.next=c.next,c.next=n),e.interleaved=n;return}}catch{}finally{}r=Ow(t,e,n,s),r!==null&&(n=rr(),nn(r,t,s,n),eb(r,e,s))}}function Jw(t){var e=t.alternate;return t===vt||e!==null&&e===vt}function Xw(t,e){rl=_u=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function eb(t,e,r){if(r&4194240){var s=e.lanes;s&=t.pendingLanes,r|=s,e.lanes=r,Rm(t,r)}}var Eu={readContext:Fr,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useInsertionEffect:Kt,useLayoutEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useMutableSource:Kt,useSyncExternalStore:Kt,useId:Kt,unstable_isNewReconciler:!1},Ik={readContext:Fr,useCallback:function(t,e){return pn().memoizedState=[t,e===void 0?null:e],t},useContext:Fr,useEffect:fy,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Hc(4194308,4,Ww.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Hc(4194308,4,t,e)},useInsertionEffect:function(t,e){return Hc(4,2,t,e)},useMemo:function(t,e){var r=pn();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var s=pn();return e=r!==void 0?r(e):e,s.memoizedState=s.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},s.queue=t,t=t.dispatch=Ak.bind(null,vt,t),[s.memoizedState,t]},useRef:function(t){var e=pn();return t={current:t},e.memoizedState=t},useState:dy,useDebugValue:Xm,useDeferredValue:function(t){return pn().memoizedState=t},useTransition:function(){var t=dy(!1),e=t[0];return t=Tk.bind(null,t[1]),pn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var s=vt,n=pn();if(ht){if(r===void 0)throw Error(Y(407));r=r()}else{if(r=e(),Lt===null)throw Error(Y(349));Va&30||Fw(s,e,r)}n.memoizedState=r;var a={value:r,getSnapshot:e};return n.queue=a,fy(Uw.bind(null,s,a,t),[t]),s.flags|=2048,Cl(9,Lw.bind(null,s,a,r,e),void 0,null),r},useId:function(){var t=pn(),e=Lt.identifierPrefix;if(ht){var r=Yn,s=Zn;r=(s&~(1<<32-rn(s)-1)).toString(32)+r,e=":"+e+"R"+r,r=_l++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=Rk++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Dk={readContext:Fr,useCallback:Qw,useContext:Fr,useEffect:Jm,useImperativeHandle:Kw,useInsertionEffect:qw,useLayoutEffect:Bw,useMemo:Gw,useReducer:Ef,useRef:Hw,useState:function(){return Ef(El)},useDebugValue:Xm,useDeferredValue:function(t){var e=Lr();return Zw(e,Rt.memoizedState,t)},useTransition:function(){var t=Ef(El)[0],e=Lr().memoizedState;return[t,e]},useMutableSource:Mw,useSyncExternalStore:$w,useId:Yw,unstable_isNewReconciler:!1},Mk={readContext:Fr,useCallback:Qw,useContext:Fr,useEffect:Jm,useImperativeHandle:Kw,useInsertionEffect:qw,useLayoutEffect:Bw,useMemo:Gw,useReducer:Cf,useRef:Hw,useState:function(){return Cf(El)},useDebugValue:Xm,useDeferredValue:function(t){var e=Lr();return Rt===null?e.memoizedState=t:Zw(e,Rt.memoizedState,t)},useTransition:function(){var t=Cf(El)[0],e=Lr().memoizedState;return[t,e]},useMutableSource:Mw,useSyncExternalStore:$w,useId:Yw,unstable_isNewReconciler:!1};function Gr(t,e){if(t&&t.defaultProps){e=gt({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function Ih(t,e,r,s){e=t.memoizedState,r=r(s,e),r=r==null?e:gt({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var vd={isMounted:function(t){return(t=t._reactInternals)?no(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var s=rr(),n=Ys(t),a=es(s,n);a.payload=e,r!=null&&(a.callback=r),e=Gs(t,a,n),e!==null&&(nn(e,t,n,s),zc(e,t,n))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var s=rr(),n=Ys(t),a=es(s,n);a.tag=1,a.payload=e,r!=null&&(a.callback=r),e=Gs(t,a,n),e!==null&&(nn(e,t,n,s),zc(e,t,n))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=rr(),s=Ys(t),n=es(r,s);n.tag=2,e!=null&&(n.callback=e),e=Gs(t,n,s),e!==null&&(nn(e,t,s,r),zc(e,t,s))}};function hy(t,e,r,s,n,a,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(s,a,o):e.prototype&&e.prototype.isPureReactComponent?!gl(r,s)||!gl(n,a):!0}function tb(t,e,r){var s=!1,n=sa,a=e.contextType;return typeof a=="object"&&a!==null?a=Fr(a):(n=vr(e)?Ua:Zt.current,s=e.contextTypes,a=(s=s!=null)?ai(t,n):sa),e=new e(r,a),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=vd,t.stateNode=e,e._reactInternals=t,s&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=a),e}function py(t,e,r,s){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,s),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,s),e.state!==t&&vd.enqueueReplaceState(e,e.state,null)}function Dh(t,e,r,s){var n=t.stateNode;n.props=r,n.state=t.memoizedState,n.refs={},Bm(t);var a=e.contextType;typeof a=="object"&&a!==null?n.context=Fr(a):(a=vr(e)?Ua:Zt.current,n.context=ai(t,a)),n.state=t.memoizedState,a=e.getDerivedStateFromProps,typeof a=="function"&&(Ih(t,e,a,r),n.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(e=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),e!==n.state&&vd.enqueueReplaceState(n,n.state,null),bu(t,r,n,s),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308)}function ci(t,e){try{var r="",s=e;do r+=uP(s),s=s.return;while(s);var n=r}catch(a){n=`
|
|
39
|
-
Error generating stack: `+a.message+`
|
|
40
|
-
`+a.stack}return{value:t,source:e,stack:n,digest:null}}function Pf(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function Mh(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var $k=typeof WeakMap=="function"?WeakMap:Map;function rb(t,e,r){r=es(-1,r),r.tag=3,r.payload={element:null};var s=e.value;return r.callback=function(){Pu||(Pu=!0,Wh=s),Mh(t,e)},r}function nb(t,e,r){r=es(-1,r),r.tag=3;var s=t.type.getDerivedStateFromError;if(typeof s=="function"){var n=e.value;r.payload=function(){return s(n)},r.callback=function(){Mh(t,e)}}var a=t.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Mh(t,e),typeof s!="function"&&(Zs===null?Zs=new Set([this]):Zs.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function my(t,e,r){var s=t.pingCache;if(s===null){s=t.pingCache=new $k;var n=new Set;s.set(e,n)}else n=s.get(e),n===void 0&&(n=new Set,s.set(e,n));n.has(r)||(n.add(r),t=Yk.bind(null,t,e,r),e.then(t,t))}function vy(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function gy(t,e,r,s,n){return t.mode&1?(t.flags|=65536,t.lanes=n,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=es(-1,1),e.tag=2,Gs(r,e,1))),r.lanes|=1),t)}var Fk=ds.ReactCurrentOwner,pr=!1;function er(t,e,r,s){e.child=t===null?Aw(e,null,r,s):ii(e,t.child,r,s)}function yy(t,e,r,s,n){r=r.render;var a=e.ref;return Fo(e,n),s=Zm(t,e,r,s,a,n),r=Ym(),t!==null&&!pr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n,os(t,e,n)):(ht&&r&&Fm(e),e.flags|=1,er(t,e,s,n),e.child)}function xy(t,e,r,s,n){if(t===null){var a=r.type;return typeof a=="function"&&!iv(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=a,sb(t,e,a,s,n)):(t=Kc(r.type,null,s,e,e.mode,n),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!(t.lanes&n)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:gl,r(o,s)&&t.ref===e.ref)return os(t,e,n)}return e.flags|=1,t=Js(a,s),t.ref=e.ref,t.return=e,e.child=t}function sb(t,e,r,s,n){if(t!==null){var a=t.memoizedProps;if(gl(a,s)&&t.ref===e.ref)if(pr=!1,e.pendingProps=s=a,(t.lanes&n)!==0)t.flags&131072&&(pr=!0);else return e.lanes=t.lanes,os(t,e,n)}return $h(t,e,r,s,n)}function ab(t,e,r){var s=e.pendingProps,n=s.children,a=t!==null?t.memoizedState:null;if(s.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},st(Ro,br),br|=r;else{if(!(r&1073741824))return t=a!==null?a.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,st(Ro,br),br|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:r,st(Ro,br),br|=s}else a!==null?(s=a.baseLanes|r,e.memoizedState=null):s=r,st(Ro,br),br|=s;return er(t,e,n,r),e.child}function ob(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function $h(t,e,r,s,n){var a=vr(r)?Ua:Zt.current;return a=ai(e,a),Fo(e,n),r=Zm(t,e,r,s,a,n),s=Ym(),t!==null&&!pr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n,os(t,e,n)):(ht&&s&&Fm(e),e.flags|=1,er(t,e,r,n),e.child)}function wy(t,e,r,s,n){if(vr(r)){var a=!0;vu(e)}else a=!1;if(Fo(e,n),e.stateNode===null)qc(t,e),tb(e,r,s),Dh(e,r,s,n),s=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Fr(u):(u=vr(r)?Ua:Zt.current,u=ai(e,u));var d=r.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&py(e,o,s,u),Es=!1;var v=e.memoizedState;o.state=v,bu(e,s,o,n),c=e.memoizedState,l!==s||v!==c||mr.current||Es?(typeof d=="function"&&(Ih(e,r,d,s),c=e.memoizedState),(l=Es||hy(e,r,l,s,v,c,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=s,e.memoizedState=c),o.props=s,o.state=c,o.context=u,s=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),s=!1)}else{o=e.stateNode,Iw(t,e),l=e.memoizedProps,u=e.type===e.elementType?l:Gr(e.type,l),o.props=u,h=e.pendingProps,v=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Fr(c):(c=vr(r)?Ua:Zt.current,c=ai(e,c));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||v!==c)&&py(e,o,s,c),Es=!1,v=e.memoizedState,o.state=v,bu(e,s,o,n);var w=e.memoizedState;l!==h||v!==w||mr.current||Es?(typeof p=="function"&&(Ih(e,r,p,s),w=e.memoizedState),(u=Es||hy(e,r,u,s,v,w,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,w,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,w,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&v===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&v===t.memoizedState||(e.flags|=1024),e.memoizedProps=s,e.memoizedState=w),o.props=s,o.state=w,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&v===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&v===t.memoizedState||(e.flags|=1024),s=!1)}return Fh(t,e,r,s,a,n)}function Fh(t,e,r,s,n,a){ob(t,e);var o=(e.flags&128)!==0;if(!s&&!o)return n&&ay(e,r,!1),os(t,e,a);s=e.stateNode,Fk.current=e;var l=o&&typeof r.getDerivedStateFromError!="function"?null:s.render();return e.flags|=1,t!==null&&o?(e.child=ii(e,t.child,null,a),e.child=ii(e,null,l,a)):er(t,e,l,a),e.memoizedState=s.state,n&&ay(e,r,!0),e.child}function ib(t){var e=t.stateNode;e.pendingContext?sy(t,e.pendingContext,e.pendingContext!==e.context):e.context&&sy(t,e.context,!1),Wm(t,e.containerInfo)}function by(t,e,r,s,n){return oi(),Um(n),e.flags|=256,er(t,e,r,s),e.child}var Lh={dehydrated:null,treeContext:null,retryLane:0};function Uh(t){return{baseLanes:t,cachePool:null,transitions:null}}function lb(t,e,r){var s=e.pendingProps,n=mt.current,a=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(n&2)!==0),l?(a=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(n|=1),st(mt,n&1),t===null)return Ah(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=s.children,t=s.fallback,a?(s=e.mode,a=e.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=xd(o,s,0,null),t=Fa(t,s,r,null),a.return=e,t.return=e,a.sibling=t,e.child=a,e.child.memoizedState=Uh(r),e.memoizedState=Lh,t):ev(e,o));if(n=t.memoizedState,n!==null&&(l=n.dehydrated,l!==null))return Lk(t,e,o,s,l,n,r);if(a){a=s.fallback,o=e.mode,n=t.child,l=n.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&e.child!==n?(s=e.child,s.childLanes=0,s.pendingProps=c,e.deletions=null):(s=Js(n,c),s.subtreeFlags=n.subtreeFlags&14680064),l!==null?a=Js(l,a):(a=Fa(a,o,r,null),a.flags|=2),a.return=e,s.return=e,s.sibling=a,e.child=s,s=a,a=e.child,o=t.child.memoizedState,o=o===null?Uh(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=t.childLanes&~r,e.memoizedState=Lh,s}return a=t.child,t=a.sibling,s=Js(a,{mode:"visible",children:s.children}),!(e.mode&1)&&(s.lanes=r),s.return=e,s.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=s,e.memoizedState=null,s}function ev(t,e){return e=xd({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function gc(t,e,r,s){return s!==null&&Um(s),ii(e,t.child,null,r),t=ev(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Lk(t,e,r,s,n,a,o){if(r)return e.flags&256?(e.flags&=-257,s=Pf(Error(Y(422))),gc(t,e,o,s)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(a=s.fallback,n=e.mode,s=xd({mode:"visible",children:s.children},n,0,null),a=Fa(a,n,o,null),a.flags|=2,s.return=e,a.return=e,s.sibling=a,e.child=s,e.mode&1&&ii(e,t.child,null,o),e.child.memoizedState=Uh(o),e.memoizedState=Lh,a);if(!(e.mode&1))return gc(t,e,o,null);if(n.data==="$!"){if(s=n.nextSibling&&n.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(Y(419)),s=Pf(a,s,void 0),gc(t,e,o,s)}if(l=(o&t.childLanes)!==0,pr||l){if(s=Lt,s!==null){switch(o&-o){case 4:n=2;break;case 16:n=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(s.suspendedLanes|o)?0:n,n!==0&&n!==a.retryLane&&(a.retryLane=n,as(t,n),nn(s,t,n,-1))}return ov(),s=Pf(Error(Y(421))),gc(t,e,o,s)}return n.data==="$?"?(e.flags|=128,e.child=t.child,e=Jk.bind(null,t),n._reactRetry=e,null):(t=a.treeContext,_r=Qs(n.nextSibling),Er=e,ht=!0,en=null,t!==null&&(Or[Ir++]=Zn,Or[Ir++]=Yn,Or[Ir++]=za,Zn=t.id,Yn=t.overflow,za=e),e=ev(e,s.children),e.flags|=4096,e)}function Sy(t,e,r){t.lanes|=e;var s=t.alternate;s!==null&&(s.lanes|=e),Oh(t.return,e,r)}function kf(t,e,r,s,n){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:n}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=r,a.tailMode=n)}function cb(t,e,r){var s=e.pendingProps,n=s.revealOrder,a=s.tail;if(er(t,e,s.children,r),s=mt.current,s&2)s=s&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Sy(t,r,e);else if(t.tag===19)Sy(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}s&=1}if(st(mt,s),!(e.mode&1))e.memoizedState=null;else switch(n){case"forwards":for(r=e.child,n=null;r!==null;)t=r.alternate,t!==null&&Su(t)===null&&(n=r),r=r.sibling;r=n,r===null?(n=e.child,e.child=null):(n=r.sibling,r.sibling=null),kf(e,!1,n,r,a);break;case"backwards":for(r=null,n=e.child,e.child=null;n!==null;){if(t=n.alternate,t!==null&&Su(t)===null){e.child=n;break}t=n.sibling,n.sibling=r,r=n,n=t}kf(e,!0,r,null,a);break;case"together":kf(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function qc(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function os(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Ha|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Y(153));if(e.child!==null){for(t=e.child,r=Js(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Js(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Uk(t,e,r){switch(e.tag){case 3:ib(e),oi();break;case 5:Dw(e);break;case 1:vr(e.type)&&vu(e);break;case 4:Wm(e,e.stateNode.containerInfo);break;case 10:var s=e.type._context,n=e.memoizedProps.value;st(xu,s._currentValue),s._currentValue=n;break;case 13:if(s=e.memoizedState,s!==null)return s.dehydrated!==null?(st(mt,mt.current&1),e.flags|=128,null):r&e.child.childLanes?lb(t,e,r):(st(mt,mt.current&1),t=os(t,e,r),t!==null?t.sibling:null);st(mt,mt.current&1);break;case 19:if(s=(r&e.childLanes)!==0,t.flags&128){if(s)return cb(t,e,r);e.flags|=128}if(n=e.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),st(mt,mt.current),s)break;return null;case 22:case 23:return e.lanes=0,ab(t,e,r)}return os(t,e,r)}var ub,zh,db,fb;ub=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};zh=function(){};db=function(t,e,r,s){var n=t.memoizedProps;if(n!==s){t=e.stateNode,Na(Nn.current);var a=null;switch(r){case"input":n=ch(t,n),s=ch(t,s),a=[];break;case"select":n=gt({},n,{value:void 0}),s=gt({},s,{value:void 0}),a=[];break;case"textarea":n=fh(t,n),s=fh(t,s),a=[];break;default:typeof n.onClick!="function"&&typeof s.onClick=="function"&&(t.onclick=pu)}ph(r,s);var o;r=null;for(u in n)if(!s.hasOwnProperty(u)&&n.hasOwnProperty(u)&&n[u]!=null)if(u==="style"){var l=n[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ul.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=n!=null?n[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(a||(a=[]),a.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ul.hasOwnProperty(u)?(c!=null&&u==="onScroll"&<("scroll",t),a||l===c||(a=[])):(a=a||[]).push(u,c))}r&&(a=a||[]).push("style",r);var u=a;(e.updateQueue=u)&&(e.flags|=4)}};fb=function(t,e,r,s){r!==s&&(e.flags|=4)};function Mi(t,e){if(!ht)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:s.sibling=null}}function Qt(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,s=0;if(e)for(var n=t.child;n!==null;)r|=n.lanes|n.childLanes,s|=n.subtreeFlags&14680064,s|=n.flags&14680064,n.return=t,n=n.sibling;else for(n=t.child;n!==null;)r|=n.lanes|n.childLanes,s|=n.subtreeFlags,s|=n.flags,n.return=t,n=n.sibling;return t.subtreeFlags|=s,t.childLanes=r,e}function zk(t,e,r){var s=e.pendingProps;switch(Lm(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qt(e),null;case 1:return vr(e.type)&&mu(),Qt(e),null;case 3:return s=e.stateNode,li(),ct(mr),ct(Zt),Qm(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(mc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,en!==null&&(Gh(en),en=null))),zh(t,e),Qt(e),null;case 5:Km(e);var n=Na(Sl.current);if(r=e.type,t!==null&&e.stateNode!=null)db(t,e,r,s,n),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!s){if(e.stateNode===null)throw Error(Y(166));return Qt(e),null}if(t=Na(Nn.current),mc(e)){s=e.stateNode,r=e.type;var a=e.memoizedProps;switch(s[wn]=e,s[wl]=a,t=(e.mode&1)!==0,r){case"dialog":lt("cancel",s),lt("close",s);break;case"iframe":case"object":case"embed":lt("load",s);break;case"video":case"audio":for(n=0;n<qi.length;n++)lt(qi[n],s);break;case"source":lt("error",s);break;case"img":case"image":case"link":lt("error",s),lt("load",s);break;case"details":lt("toggle",s);break;case"input":Tg(s,a),lt("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},lt("invalid",s);break;case"textarea":Og(s,a),lt("invalid",s)}ph(r,a),n=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&pc(s.textContent,l,t),n=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&pc(s.textContent,l,t),n=["children",""+l]):ul.hasOwnProperty(o)&&l!=null&&o==="onScroll"&<("scroll",s)}switch(r){case"input":oc(s),Ag(s,a,!0);break;case"textarea":oc(s),Ig(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=pu)}s=n,e.updateQueue=s,s!==null&&(e.flags|=4)}else{o=n.nodeType===9?n:n.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Ux(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof s.is=="string"?t=o.createElement(r,{is:s.is}):(t=o.createElement(r),r==="select"&&(o=t,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):t=o.createElementNS(t,r),t[wn]=e,t[wl]=s,ub(t,e,!1,!1),e.stateNode=t;e:{switch(o=mh(r,s),r){case"dialog":lt("cancel",t),lt("close",t),n=s;break;case"iframe":case"object":case"embed":lt("load",t),n=s;break;case"video":case"audio":for(n=0;n<qi.length;n++)lt(qi[n],t);n=s;break;case"source":lt("error",t),n=s;break;case"img":case"image":case"link":lt("error",t),lt("load",t),n=s;break;case"details":lt("toggle",t),n=s;break;case"input":Tg(t,s),n=ch(t,s),lt("invalid",t);break;case"option":n=s;break;case"select":t._wrapperState={wasMultiple:!!s.multiple},n=gt({},s,{value:void 0}),lt("invalid",t);break;case"textarea":Og(t,s),n=fh(t,s),lt("invalid",t);break;default:n=s}ph(r,n),l=n;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?Hx(t,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&zx(t,c)):a==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&dl(t,c):typeof c=="number"&&dl(t,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(ul.hasOwnProperty(a)?c!=null&&a==="onScroll"&<("scroll",t):c!=null&&Em(t,a,c,o))}switch(r){case"input":oc(t),Ag(t,s,!1);break;case"textarea":oc(t),Ig(t);break;case"option":s.value!=null&&t.setAttribute("value",""+na(s.value));break;case"select":t.multiple=!!s.multiple,a=s.value,a!=null?Io(t,!!s.multiple,a,!1):s.defaultValue!=null&&Io(t,!!s.multiple,s.defaultValue,!0);break;default:typeof n.onClick=="function"&&(t.onclick=pu)}switch(r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Qt(e),null;case 6:if(t&&e.stateNode!=null)fb(t,e,t.memoizedProps,s);else{if(typeof s!="string"&&e.stateNode===null)throw Error(Y(166));if(r=Na(Sl.current),Na(Nn.current),mc(e)){if(s=e.stateNode,r=e.memoizedProps,s[wn]=e,(a=s.nodeValue!==r)&&(t=Er,t!==null))switch(t.tag){case 3:pc(s.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&pc(s.nodeValue,r,(t.mode&1)!==0)}a&&(e.flags|=4)}else s=(r.nodeType===9?r:r.ownerDocument).createTextNode(s),s[wn]=e,e.stateNode=s}return Qt(e),null;case 13:if(ct(mt),s=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ht&&_r!==null&&e.mode&1&&!(e.flags&128))Rw(),oi(),e.flags|=98560,a=!1;else if(a=mc(e),s!==null&&s.dehydrated!==null){if(t===null){if(!a)throw Error(Y(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(Y(317));a[wn]=e}else oi(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Qt(e),a=!1}else en!==null&&(Gh(en),en=null),a=!0;if(!a)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(s=s!==null,s!==(t!==null&&t.memoizedState!==null)&&s&&(e.child.flags|=8192,e.mode&1&&(t===null||mt.current&1?Ot===0&&(Ot=3):ov())),e.updateQueue!==null&&(e.flags|=4),Qt(e),null);case 4:return li(),zh(t,e),t===null&&yl(e.stateNode.containerInfo),Qt(e),null;case 10:return Hm(e.type._context),Qt(e),null;case 17:return vr(e.type)&&mu(),Qt(e),null;case 19:if(ct(mt),a=e.memoizedState,a===null)return Qt(e),null;if(s=(e.flags&128)!==0,o=a.rendering,o===null)if(s)Mi(a,!1);else{if(Ot!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Su(t),o!==null){for(e.flags|=128,Mi(a,!1),s=o.updateQueue,s!==null&&(e.updateQueue=s,e.flags|=4),e.subtreeFlags=0,s=r,r=e.child;r!==null;)a=r,t=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=t,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,t=o.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return st(mt,mt.current&1|2),e.child}t=t.sibling}a.tail!==null&&_t()>ui&&(e.flags|=128,s=!0,Mi(a,!1),e.lanes=4194304)}else{if(!s)if(t=Su(o),t!==null){if(e.flags|=128,s=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Mi(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ht)return Qt(e),null}else 2*_t()-a.renderingStartTime>ui&&r!==1073741824&&(e.flags|=128,s=!0,Mi(a,!1),e.lanes=4194304);a.isBackwards?(o.sibling=e.child,e.child=o):(r=a.last,r!==null?r.sibling=o:e.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=_t(),e.sibling=null,r=mt.current,st(mt,s?r&1|2:r&1),e):(Qt(e),null);case 22:case 23:return av(),s=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==s&&(e.flags|=8192),s&&e.mode&1?br&1073741824&&(Qt(e),e.subtreeFlags&6&&(e.flags|=8192)):Qt(e),null;case 24:return null;case 25:return null}throw Error(Y(156,e.tag))}function Vk(t,e){switch(Lm(e),e.tag){case 1:return vr(e.type)&&mu(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return li(),ct(mr),ct(Zt),Qm(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Km(e),null;case 13:if(ct(mt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Y(340));oi()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ct(mt),null;case 4:return li(),null;case 10:return Hm(e.type._context),null;case 22:case 23:return av(),null;case 24:return null;default:return null}}var yc=!1,Gt=!1,Hk=typeof WeakSet=="function"?WeakSet:Set,he=null;function jo(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){xt(t,e,s)}else r.current=null}function Vh(t,e,r){try{r()}catch(s){xt(t,e,s)}}var _y=!1;function qk(t,e){if(Ch=du,t=gw(),$m(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var n=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=t,v=null;t:for(;;){for(var p;h!==r||n!==0&&h.nodeType!==3||(l=o+n),h!==a||s!==0&&h.nodeType!==3||(c=o+s),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)v=h,h=p;for(;;){if(h===t)break t;if(v===r&&++u===n&&(l=o),v===a&&++d===s&&(c=o),(p=h.nextSibling)!==null)break;h=v,v=h.parentNode}h=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ph={focusedElem:t,selectionRange:r},du=!1,he=e;he!==null;)if(e=he,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,he=t;else for(;he!==null;){e=he;try{var w=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var f=w.memoizedProps,m=w.memoizedState,g=e.stateNode,y=g.getSnapshotBeforeUpdate(e.elementType===e.type?f:Gr(e.type,f),m);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Y(163))}}catch(S){xt(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,he=t;break}he=e.return}return w=_y,_y=!1,w}function nl(t,e,r){var s=e.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var n=s=s.next;do{if((n.tag&t)===t){var a=n.destroy;n.destroy=void 0,a!==void 0&&Vh(e,r,a)}n=n.next}while(n!==s)}}function gd(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var s=r.create;r.destroy=s()}r=r.next}while(r!==e)}}function Hh(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function hb(t){var e=t.alternate;e!==null&&(t.alternate=null,hb(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[wn],delete e[wl],delete e[jh],delete e[Pk],delete e[kk])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function pb(t){return t.tag===5||t.tag===3||t.tag===4}function Ey(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||pb(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function qh(t,e,r){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=pu));else if(s!==4&&(t=t.child,t!==null))for(qh(t,e,r),t=t.sibling;t!==null;)qh(t,e,r),t=t.sibling}function Bh(t,e,r){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(s!==4&&(t=t.child,t!==null))for(Bh(t,e,r),t=t.sibling;t!==null;)Bh(t,e,r),t=t.sibling}var Vt=null,Xr=!1;function ys(t,e,r){for(r=r.child;r!==null;)mb(t,e,r),r=r.sibling}function mb(t,e,r){if(kn&&typeof kn.onCommitFiberUnmount=="function")try{kn.onCommitFiberUnmount(cd,r)}catch{}switch(r.tag){case 5:Gt||jo(r,e);case 6:var s=Vt,n=Xr;Vt=null,ys(t,e,r),Vt=s,Xr=n,Vt!==null&&(Xr?(t=Vt,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Vt.removeChild(r.stateNode));break;case 18:Vt!==null&&(Xr?(t=Vt,r=r.stateNode,t.nodeType===8?wf(t.parentNode,r):t.nodeType===1&&wf(t,r),ml(t)):wf(Vt,r.stateNode));break;case 4:s=Vt,n=Xr,Vt=r.stateNode.containerInfo,Xr=!0,ys(t,e,r),Vt=s,Xr=n;break;case 0:case 11:case 14:case 15:if(!Gt&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){n=s=s.next;do{var a=n,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Vh(r,e,o),n=n.next}while(n!==s)}ys(t,e,r);break;case 1:if(!Gt&&(jo(r,e),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(l){xt(r,e,l)}ys(t,e,r);break;case 21:ys(t,e,r);break;case 22:r.mode&1?(Gt=(s=Gt)||r.memoizedState!==null,ys(t,e,r),Gt=s):ys(t,e,r);break;default:ys(t,e,r)}}function Cy(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Hk),e.forEach(function(s){var n=Xk.bind(null,t,s);r.has(s)||(r.add(s),s.then(n,n))})}}function Wr(t,e){var r=e.deletions;if(r!==null)for(var s=0;s<r.length;s++){var n=r[s];try{var a=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:Vt=l.stateNode,Xr=!1;break e;case 3:Vt=l.stateNode.containerInfo,Xr=!0;break e;case 4:Vt=l.stateNode.containerInfo,Xr=!0;break e}l=l.return}if(Vt===null)throw Error(Y(160));mb(a,o,n),Vt=null,Xr=!1;var c=n.alternate;c!==null&&(c.return=null),n.return=null}catch(u){xt(n,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)vb(e,t),e=e.sibling}function vb(t,e){var r=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Wr(e,t),fn(t),s&4){try{nl(3,t,t.return),gd(3,t)}catch(f){xt(t,t.return,f)}try{nl(5,t,t.return)}catch(f){xt(t,t.return,f)}}break;case 1:Wr(e,t),fn(t),s&512&&r!==null&&jo(r,r.return);break;case 5:if(Wr(e,t),fn(t),s&512&&r!==null&&jo(r,r.return),t.flags&32){var n=t.stateNode;try{dl(n,"")}catch(f){xt(t,t.return,f)}}if(s&4&&(n=t.stateNode,n!=null)){var a=t.memoizedProps,o=r!==null?r.memoizedProps:a,l=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&Fx(n,a),mh(l,o);var u=mh(l,a);for(o=0;o<c.length;o+=2){var d=c[o],h=c[o+1];d==="style"?Hx(n,h):d==="dangerouslySetInnerHTML"?zx(n,h):d==="children"?dl(n,h):Em(n,d,h,u)}switch(l){case"input":uh(n,a);break;case"textarea":Lx(n,a);break;case"select":var v=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!a.multiple;var p=a.value;p!=null?Io(n,!!a.multiple,p,!1):v!==!!a.multiple&&(a.defaultValue!=null?Io(n,!!a.multiple,a.defaultValue,!0):Io(n,!!a.multiple,a.multiple?[]:"",!1))}n[wl]=a}catch(f){xt(t,t.return,f)}}break;case 6:if(Wr(e,t),fn(t),s&4){if(t.stateNode===null)throw Error(Y(162));n=t.stateNode,a=t.memoizedProps;try{n.nodeValue=a}catch(f){xt(t,t.return,f)}}break;case 3:if(Wr(e,t),fn(t),s&4&&r!==null&&r.memoizedState.isDehydrated)try{ml(e.containerInfo)}catch(f){xt(t,t.return,f)}break;case 4:Wr(e,t),fn(t);break;case 13:Wr(e,t),fn(t),n=t.child,n.flags&8192&&(a=n.memoizedState!==null,n.stateNode.isHidden=a,!a||n.alternate!==null&&n.alternate.memoizedState!==null||(nv=_t())),s&4&&Cy(t);break;case 22:if(d=r!==null&&r.memoizedState!==null,t.mode&1?(Gt=(u=Gt)||d,Wr(e,t),Gt=u):Wr(e,t),fn(t),s&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(he=t,d=t.child;d!==null;){for(h=he=d;he!==null;){switch(v=he,p=v.child,v.tag){case 0:case 11:case 14:case 15:nl(4,v,v.return);break;case 1:jo(v,v.return);var w=v.stateNode;if(typeof w.componentWillUnmount=="function"){s=v,r=v.return;try{e=s,w.props=e.memoizedProps,w.state=e.memoizedState,w.componentWillUnmount()}catch(f){xt(s,r,f)}}break;case 5:jo(v,v.return);break;case 22:if(v.memoizedState!==null){ky(h);continue}}p!==null?(p.return=v,he=p):ky(h)}d=d.sibling}e:for(d=null,h=t;;){if(h.tag===5){if(d===null){d=h;try{n=h.stateNode,u?(a=n.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Vx("display",o))}catch(f){xt(t,t.return,f)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(f){xt(t,t.return,f)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Wr(e,t),fn(t),s&4&&Cy(t);break;case 21:break;default:Wr(e,t),fn(t)}}function fn(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(pb(r)){var s=r;break e}r=r.return}throw Error(Y(160))}switch(s.tag){case 5:var n=s.stateNode;s.flags&32&&(dl(n,""),s.flags&=-33);var a=Ey(t);Bh(t,a,n);break;case 3:case 4:var o=s.stateNode.containerInfo,l=Ey(t);qh(t,l,o);break;default:throw Error(Y(161))}}catch(c){xt(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Bk(t,e,r){he=t,gb(t)}function gb(t,e,r){for(var s=(t.mode&1)!==0;he!==null;){var n=he,a=n.child;if(n.tag===22&&s){var o=n.memoizedState!==null||yc;if(!o){var l=n.alternate,c=l!==null&&l.memoizedState!==null||Gt;l=yc;var u=Gt;if(yc=o,(Gt=c)&&!u)for(he=n;he!==null;)o=he,c=o.child,o.tag===22&&o.memoizedState!==null?Ny(n):c!==null?(c.return=o,he=c):Ny(n);for(;a!==null;)he=a,gb(a),a=a.sibling;he=n,yc=l,Gt=u}Py(t)}else n.subtreeFlags&8772&&a!==null?(a.return=n,he=a):Py(t)}}function Py(t){for(;he!==null;){var e=he;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Gt||gd(5,e);break;case 1:var s=e.stateNode;if(e.flags&4&&!Gt)if(r===null)s.componentDidMount();else{var n=e.elementType===e.type?r.memoizedProps:Gr(e.type,r.memoizedProps);s.componentDidUpdate(n,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=e.updateQueue;a!==null&&uy(e,a,s);break;case 3:var o=e.updateQueue;if(o!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}uy(e,o,r)}break;case 5:var l=e.stateNode;if(r===null&&e.flags&4){r=l;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&ml(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Y(163))}Gt||e.flags&512&&Hh(e)}catch(v){xt(e,e.return,v)}}if(e===t){he=null;break}if(r=e.sibling,r!==null){r.return=e.return,he=r;break}he=e.return}}function ky(t){for(;he!==null;){var e=he;if(e===t){he=null;break}var r=e.sibling;if(r!==null){r.return=e.return,he=r;break}he=e.return}}function Ny(t){for(;he!==null;){var e=he;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{gd(4,e)}catch(c){xt(e,r,c)}break;case 1:var s=e.stateNode;if(typeof s.componentDidMount=="function"){var n=e.return;try{s.componentDidMount()}catch(c){xt(e,n,c)}}var a=e.return;try{Hh(e)}catch(c){xt(e,a,c)}break;case 5:var o=e.return;try{Hh(e)}catch(c){xt(e,o,c)}}}catch(c){xt(e,e.return,c)}if(e===t){he=null;break}var l=e.sibling;if(l!==null){l.return=e.return,he=l;break}he=e.return}}var Wk=Math.ceil,Cu=ds.ReactCurrentDispatcher,tv=ds.ReactCurrentOwner,$r=ds.ReactCurrentBatchConfig,Ze=0,Lt=null,kt=null,Ht=0,br=0,Ro=ca(0),Ot=0,Pl=null,Ha=0,yd=0,rv=0,sl=null,fr=null,nv=0,ui=1/0,qn=null,Pu=!1,Wh=null,Zs=null,xc=!1,zs=null,ku=0,al=0,Kh=null,Bc=-1,Wc=0;function rr(){return Ze&6?_t():Bc!==-1?Bc:Bc=_t()}function Ys(t){return t.mode&1?Ze&2&&Ht!==0?Ht&-Ht:jk.transition!==null?(Wc===0&&(Wc=tw()),Wc):(t=Xe,t!==0||(t=window.event,t=t===void 0?16:lw(t.type)),t):1}function nn(t,e,r,s){if(50<al)throw al=0,Kh=null,Error(Y(185));$l(t,r,s),(!(Ze&2)||t!==Lt)&&(t===Lt&&(!(Ze&2)&&(yd|=r),Ot===4&&js(t,Ht)),gr(t,s),r===1&&Ze===0&&!(e.mode&1)&&(ui=_t()+500,pd&&ua()))}function gr(t,e){var r=t.callbackNode;jP(t,e);var s=uu(t,t===Lt?Ht:0);if(s===0)r!==null&&$g(r),t.callbackNode=null,t.callbackPriority=0;else if(e=s&-s,t.callbackPriority!==e){if(r!=null&&$g(r),e===1)t.tag===0?Nk(jy.bind(null,t)):kw(jy.bind(null,t)),Ek(function(){!(Ze&6)&&ua()}),r=null;else{switch(rw(s)){case 1:r=jm;break;case 4:r=Xx;break;case 16:r=cu;break;case 536870912:r=ew;break;default:r=cu}r=Cb(r,yb.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function yb(t,e){if(Bc=-1,Wc=0,Ze&6)throw Error(Y(327));var r=t.callbackNode;if(Lo()&&t.callbackNode!==r)return null;var s=uu(t,t===Lt?Ht:0);if(s===0)return null;if(s&30||s&t.expiredLanes||e)e=Nu(t,s);else{e=s;var n=Ze;Ze|=2;var a=wb();(Lt!==t||Ht!==e)&&(qn=null,ui=_t()+500,$a(t,e));do try{Gk();break}catch(l){xb(t,l)}while(!0);Vm(),Cu.current=a,Ze=n,kt!==null?e=0:(Lt=null,Ht=0,e=Ot)}if(e!==0){if(e===2&&(n=wh(t),n!==0&&(s=n,e=Qh(t,n))),e===1)throw r=Pl,$a(t,0),js(t,s),gr(t,_t()),r;if(e===6)js(t,s);else{if(n=t.current.alternate,!(s&30)&&!Kk(n)&&(e=Nu(t,s),e===2&&(a=wh(t),a!==0&&(s=a,e=Qh(t,a))),e===1))throw r=Pl,$a(t,0),js(t,s),gr(t,_t()),r;switch(t.finishedWork=n,t.finishedLanes=s,e){case 0:case 1:throw Error(Y(345));case 2:Sa(t,fr,qn);break;case 3:if(js(t,s),(s&130023424)===s&&(e=nv+500-_t(),10<e)){if(uu(t,0)!==0)break;if(n=t.suspendedLanes,(n&s)!==s){rr(),t.pingedLanes|=t.suspendedLanes&n;break}t.timeoutHandle=Nh(Sa.bind(null,t,fr,qn),e);break}Sa(t,fr,qn);break;case 4:if(js(t,s),(s&4194240)===s)break;for(e=t.eventTimes,n=-1;0<s;){var o=31-rn(s);a=1<<o,o=e[o],o>n&&(n=o),s&=~a}if(s=n,s=_t()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Wk(s/1960))-s,10<s){t.timeoutHandle=Nh(Sa.bind(null,t,fr,qn),s);break}Sa(t,fr,qn);break;case 5:Sa(t,fr,qn);break;default:throw Error(Y(329))}}}return gr(t,_t()),t.callbackNode===r?yb.bind(null,t):null}function Qh(t,e){var r=sl;return t.current.memoizedState.isDehydrated&&($a(t,e).flags|=256),t=Nu(t,e),t!==2&&(e=fr,fr=r,e!==null&&Gh(e)),t}function Gh(t){fr===null?fr=t:fr.push.apply(fr,t)}function Kk(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var s=0;s<r.length;s++){var n=r[s],a=n.getSnapshot;n=n.value;try{if(!sn(a(),n))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function js(t,e){for(e&=~rv,e&=~yd,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-rn(e),s=1<<r;t[r]=-1,e&=~s}}function jy(t){if(Ze&6)throw Error(Y(327));Lo();var e=uu(t,0);if(!(e&1))return gr(t,_t()),null;var r=Nu(t,e);if(t.tag!==0&&r===2){var s=wh(t);s!==0&&(e=s,r=Qh(t,s))}if(r===1)throw r=Pl,$a(t,0),js(t,e),gr(t,_t()),r;if(r===6)throw Error(Y(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Sa(t,fr,qn),gr(t,_t()),null}function sv(t,e){var r=Ze;Ze|=1;try{return t(e)}finally{Ze=r,Ze===0&&(ui=_t()+500,pd&&ua())}}function qa(t){zs!==null&&zs.tag===0&&!(Ze&6)&&Lo();var e=Ze;Ze|=1;var r=$r.transition,s=Xe;try{if($r.transition=null,Xe=1,t)return t()}finally{Xe=s,$r.transition=r,Ze=e,!(Ze&6)&&ua()}}function av(){br=Ro.current,ct(Ro)}function $a(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,_k(r)),kt!==null)for(r=kt.return;r!==null;){var s=r;switch(Lm(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&mu();break;case 3:li(),ct(mr),ct(Zt),Qm();break;case 5:Km(s);break;case 4:li();break;case 13:ct(mt);break;case 19:ct(mt);break;case 10:Hm(s.type._context);break;case 22:case 23:av()}r=r.return}if(Lt=t,kt=t=Js(t.current,null),Ht=br=e,Ot=0,Pl=null,rv=yd=Ha=0,fr=sl=null,ka!==null){for(e=0;e<ka.length;e++)if(r=ka[e],s=r.interleaved,s!==null){r.interleaved=null;var n=s.next,a=r.pending;if(a!==null){var o=a.next;a.next=n,s.next=o}r.pending=s}ka=null}return t}function xb(t,e){do{var r=kt;try{if(Vm(),Vc.current=Eu,_u){for(var s=vt.memoizedState;s!==null;){var n=s.queue;n!==null&&(n.pending=null),s=s.next}_u=!1}if(Va=0,$t=Rt=vt=null,rl=!1,_l=0,tv.current=null,r===null||r.return===null){Ot=1,Pl=e,kt=null;break}e:{var a=t,o=r.return,l=r,c=e;if(e=Ht,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var v=d.alternate;v?(d.updateQueue=v.updateQueue,d.memoizedState=v.memoizedState,d.lanes=v.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=vy(o);if(p!==null){p.flags&=-257,gy(p,o,l,a,e),p.mode&1&&my(a,u,e),e=p,c=u;var w=e.updateQueue;if(w===null){var f=new Set;f.add(c),e.updateQueue=f}else w.add(c);break e}else{if(!(e&1)){my(a,u,e),ov();break e}c=Error(Y(426))}}else if(ht&&l.mode&1){var m=vy(o);if(m!==null){!(m.flags&65536)&&(m.flags|=256),gy(m,o,l,a,e),Um(ci(c,l));break e}}a=c=ci(c,l),Ot!==4&&(Ot=2),sl===null?sl=[a]:sl.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,e&=-e,a.lanes|=e;var g=rb(a,c,e);cy(a,g);break e;case 1:l=c;var y=a.type,b=a.stateNode;if(!(a.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Zs===null||!Zs.has(b)))){a.flags|=65536,e&=-e,a.lanes|=e;var S=nb(a,l,e);cy(a,S);break e}}a=a.return}while(a!==null)}Sb(r)}catch(E){e=E,kt===r&&r!==null&&(kt=r=r.return);continue}break}while(!0)}function wb(){var t=Cu.current;return Cu.current=Eu,t===null?Eu:t}function ov(){(Ot===0||Ot===3||Ot===2)&&(Ot=4),Lt===null||!(Ha&268435455)&&!(yd&268435455)||js(Lt,Ht)}function Nu(t,e){var r=Ze;Ze|=2;var s=wb();(Lt!==t||Ht!==e)&&(qn=null,$a(t,e));do try{Qk();break}catch(n){xb(t,n)}while(!0);if(Vm(),Ze=r,Cu.current=s,kt!==null)throw Error(Y(261));return Lt=null,Ht=0,Ot}function Qk(){for(;kt!==null;)bb(kt)}function Gk(){for(;kt!==null&&!wP();)bb(kt)}function bb(t){var e=Eb(t.alternate,t,br);t.memoizedProps=t.pendingProps,e===null?Sb(t):kt=e,tv.current=null}function Sb(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=Vk(r,e),r!==null){r.flags&=32767,kt=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ot=6,kt=null;return}}else if(r=zk(r,e,br),r!==null){kt=r;return}if(e=e.sibling,e!==null){kt=e;return}kt=e=t}while(e!==null);Ot===0&&(Ot=5)}function Sa(t,e,r){var s=Xe,n=$r.transition;try{$r.transition=null,Xe=1,Zk(t,e,r,s)}finally{$r.transition=n,Xe=s}return null}function Zk(t,e,r,s){do Lo();while(zs!==null);if(Ze&6)throw Error(Y(327));r=t.finishedWork;var n=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(Y(177));t.callbackNode=null,t.callbackPriority=0;var a=r.lanes|r.childLanes;if(RP(t,a),t===Lt&&(kt=Lt=null,Ht=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||xc||(xc=!0,Cb(cu,function(){return Lo(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=$r.transition,$r.transition=null;var o=Xe;Xe=1;var l=Ze;Ze|=4,tv.current=null,qk(t,r),vb(r,t),vk(Ph),du=!!Ch,Ph=Ch=null,t.current=r,Bk(r),bP(),Ze=l,Xe=o,$r.transition=a}else t.current=r;if(xc&&(xc=!1,zs=t,ku=n),a=t.pendingLanes,a===0&&(Zs=null),EP(r.stateNode),gr(t,_t()),e!==null)for(s=t.onRecoverableError,r=0;r<e.length;r++)n=e[r],s(n.value,{componentStack:n.stack,digest:n.digest});if(Pu)throw Pu=!1,t=Wh,Wh=null,t;return ku&1&&t.tag!==0&&Lo(),a=t.pendingLanes,a&1?t===Kh?al++:(al=0,Kh=t):al=0,ua(),null}function Lo(){if(zs!==null){var t=rw(ku),e=$r.transition,r=Xe;try{if($r.transition=null,Xe=16>t?16:t,zs===null)var s=!1;else{if(t=zs,zs=null,ku=0,Ze&6)throw Error(Y(331));var n=Ze;for(Ze|=4,he=t.current;he!==null;){var a=he,o=a.child;if(he.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(he=u;he!==null;){var d=he;switch(d.tag){case 0:case 11:case 15:nl(8,d,a)}var h=d.child;if(h!==null)h.return=d,he=h;else for(;he!==null;){d=he;var v=d.sibling,p=d.return;if(hb(d),d===u){he=null;break}if(v!==null){v.return=p,he=v;break}he=p}}}var w=a.alternate;if(w!==null){var f=w.child;if(f!==null){w.child=null;do{var m=f.sibling;f.sibling=null,f=m}while(f!==null)}}he=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,he=o;else e:for(;he!==null;){if(a=he,a.flags&2048)switch(a.tag){case 0:case 11:case 15:nl(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,he=g;break e}he=a.return}}var y=t.current;for(he=y;he!==null;){o=he;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,he=b;else e:for(o=y;he!==null;){if(l=he,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:gd(9,l)}}catch(E){xt(l,l.return,E)}if(l===o){he=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,he=S;break e}he=l.return}}if(Ze=n,ua(),kn&&typeof kn.onPostCommitFiberRoot=="function")try{kn.onPostCommitFiberRoot(cd,t)}catch{}s=!0}return s}finally{Xe=r,$r.transition=e}}return!1}function Ry(t,e,r){e=ci(r,e),e=rb(t,e,1),t=Gs(t,e,1),e=rr(),t!==null&&($l(t,1,e),gr(t,e))}function xt(t,e,r){if(t.tag===3)Ry(t,t,r);else for(;e!==null;){if(e.tag===3){Ry(e,t,r);break}else if(e.tag===1){var s=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Zs===null||!Zs.has(s))){t=ci(r,t),t=nb(e,t,1),e=Gs(e,t,1),t=rr(),e!==null&&($l(e,1,t),gr(e,t));break}}e=e.return}}function Yk(t,e,r){var s=t.pingCache;s!==null&&s.delete(e),e=rr(),t.pingedLanes|=t.suspendedLanes&r,Lt===t&&(Ht&r)===r&&(Ot===4||Ot===3&&(Ht&130023424)===Ht&&500>_t()-nv?$a(t,0):rv|=r),gr(t,e)}function _b(t,e){e===0&&(t.mode&1?(e=cc,cc<<=1,!(cc&130023424)&&(cc=4194304)):e=1);var r=rr();t=as(t,e),t!==null&&($l(t,e,r),gr(t,r))}function Jk(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),_b(t,r)}function Xk(t,e){var r=0;switch(t.tag){case 13:var s=t.stateNode,n=t.memoizedState;n!==null&&(r=n.retryLane);break;case 19:s=t.stateNode;break;default:throw Error(Y(314))}s!==null&&s.delete(e),_b(t,r)}var Eb;Eb=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||mr.current)pr=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return pr=!1,Uk(t,e,r);pr=!!(t.flags&131072)}else pr=!1,ht&&e.flags&1048576&&Nw(e,yu,e.index);switch(e.lanes=0,e.tag){case 2:var s=e.type;qc(t,e),t=e.pendingProps;var n=ai(e,Zt.current);Fo(e,r),n=Zm(null,e,s,t,n,r);var a=Ym();return e.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,vr(s)?(a=!0,vu(e)):a=!1,e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,Bm(e),n.updater=vd,e.stateNode=n,n._reactInternals=e,Dh(e,s,t,r),e=Fh(null,e,s,!0,a,r)):(e.tag=0,ht&&a&&Fm(e),er(null,e,n,r),e=e.child),e;case 16:s=e.elementType;e:{switch(qc(t,e),t=e.pendingProps,n=s._init,s=n(s._payload),e.type=s,n=e.tag=tN(s),t=Gr(s,t),n){case 0:e=$h(null,e,s,t,r);break e;case 1:e=wy(null,e,s,t,r);break e;case 11:e=yy(null,e,s,t,r);break e;case 14:e=xy(null,e,s,Gr(s.type,t),r);break e}throw Error(Y(306,s,""))}return e;case 0:return s=e.type,n=e.pendingProps,n=e.elementType===s?n:Gr(s,n),$h(t,e,s,n,r);case 1:return s=e.type,n=e.pendingProps,n=e.elementType===s?n:Gr(s,n),wy(t,e,s,n,r);case 3:e:{if(ib(e),t===null)throw Error(Y(387));s=e.pendingProps,a=e.memoizedState,n=a.element,Iw(t,e),bu(e,s,null,r);var o=e.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){n=ci(Error(Y(423)),e),e=by(t,e,s,r,n);break e}else if(s!==n){n=ci(Error(Y(424)),e),e=by(t,e,s,r,n);break e}else for(_r=Qs(e.stateNode.containerInfo.firstChild),Er=e,ht=!0,en=null,r=Aw(e,null,s,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(oi(),s===n){e=os(t,e,r);break e}er(t,e,s,r)}e=e.child}return e;case 5:return Dw(e),t===null&&Ah(e),s=e.type,n=e.pendingProps,a=t!==null?t.memoizedProps:null,o=n.children,kh(s,n)?o=null:a!==null&&kh(s,a)&&(e.flags|=32),ob(t,e),er(t,e,o,r),e.child;case 6:return t===null&&Ah(e),null;case 13:return lb(t,e,r);case 4:return Wm(e,e.stateNode.containerInfo),s=e.pendingProps,t===null?e.child=ii(e,null,s,r):er(t,e,s,r),e.child;case 11:return s=e.type,n=e.pendingProps,n=e.elementType===s?n:Gr(s,n),yy(t,e,s,n,r);case 7:return er(t,e,e.pendingProps,r),e.child;case 8:return er(t,e,e.pendingProps.children,r),e.child;case 12:return er(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(s=e.type._context,n=e.pendingProps,a=e.memoizedProps,o=n.value,st(xu,s._currentValue),s._currentValue=o,a!==null)if(sn(a.value,o)){if(a.children===n.children&&!mr.current){e=os(t,e,r);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=es(-1,r&-r),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=r,c=a.alternate,c!==null&&(c.lanes|=r),Oh(a.return,r,e),l.lanes|=r;break}c=c.next}}else if(a.tag===10)o=a.type===e.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(Y(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Oh(o,r,e),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===e){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}er(t,e,n.children,r),e=e.child}return e;case 9:return n=e.type,s=e.pendingProps.children,Fo(e,r),n=Fr(n),s=s(n),e.flags|=1,er(t,e,s,r),e.child;case 14:return s=e.type,n=Gr(s,e.pendingProps),n=Gr(s.type,n),xy(t,e,s,n,r);case 15:return sb(t,e,e.type,e.pendingProps,r);case 17:return s=e.type,n=e.pendingProps,n=e.elementType===s?n:Gr(s,n),qc(t,e),e.tag=1,vr(s)?(t=!0,vu(e)):t=!1,Fo(e,r),tb(e,s,n),Dh(e,s,n,r),Fh(null,e,s,!0,t,r);case 19:return cb(t,e,r);case 22:return ab(t,e,r)}throw Error(Y(156,e.tag))};function Cb(t,e){return Jx(t,e)}function eN(t,e,r,s){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mr(t,e,r,s){return new eN(t,e,r,s)}function iv(t){return t=t.prototype,!(!t||!t.isReactComponent)}function tN(t){if(typeof t=="function")return iv(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Pm)return 11;if(t===km)return 14}return 2}function Js(t,e){var r=t.alternate;return r===null?(r=Mr(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Kc(t,e,r,s,n,a){var o=2;if(s=t,typeof t=="function")iv(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case wo:return Fa(r.children,n,a,e);case Cm:o=8,n|=8;break;case ah:return t=Mr(12,r,e,n|2),t.elementType=ah,t.lanes=a,t;case oh:return t=Mr(13,r,e,n),t.elementType=oh,t.lanes=a,t;case ih:return t=Mr(19,r,e,n),t.elementType=ih,t.lanes=a,t;case Dx:return xd(r,n,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ox:o=10;break e;case Ix:o=9;break e;case Pm:o=11;break e;case km:o=14;break e;case _s:o=16,s=null;break e}throw Error(Y(130,t==null?t:typeof t,""))}return e=Mr(o,r,e,n),e.elementType=t,e.type=s,e.lanes=a,e}function Fa(t,e,r,s){return t=Mr(7,t,s,e),t.lanes=r,t}function xd(t,e,r,s){return t=Mr(22,t,s,e),t.elementType=Dx,t.lanes=r,t.stateNode={isHidden:!1},t}function Nf(t,e,r){return t=Mr(6,t,null,e),t.lanes=r,t}function jf(t,e,r){return e=Mr(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function rN(t,e,r,s,n){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cf(0),this.expirationTimes=cf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cf(0),this.identifierPrefix=s,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function lv(t,e,r,s,n,a,o,l,c){return t=new rN(t,e,r,l,c),e===1?(e=1,a===!0&&(e|=8)):e=0,a=Mr(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bm(a),t}function nN(t,e,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xo,key:s==null?null:""+s,children:t,containerInfo:e,implementation:r}}function Pb(t){if(!t)return sa;t=t._reactInternals;e:{if(no(t)!==t||t.tag!==1)throw Error(Y(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(vr(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Y(171))}if(t.tag===1){var r=t.type;if(vr(r))return Pw(t,r,e)}return e}function kb(t,e,r,s,n,a,o,l,c){return t=lv(r,s,!0,t,n,a,o,l,c),t.context=Pb(null),r=t.current,s=rr(),n=Ys(r),a=es(s,n),a.callback=e??null,Gs(r,a,n),t.current.lanes=n,$l(t,n,s),gr(t,s),t}function wd(t,e,r,s){var n=e.current,a=rr(),o=Ys(n);return r=Pb(r),e.context===null?e.context=r:e.pendingContext=r,e=es(a,o),e.payload={element:t},s=s===void 0?null:s,s!==null&&(e.callback=s),t=Gs(n,e,o),t!==null&&(nn(t,n,o,a),zc(t,n,o)),o}function ju(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Ty(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function cv(t,e){Ty(t,e),(t=t.alternate)&&Ty(t,e)}function sN(){return null}var Nb=typeof reportError=="function"?reportError:function(t){console.error(t)};function uv(t){this._internalRoot=t}bd.prototype.render=uv.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Y(409));wd(t,e,null,null)};bd.prototype.unmount=uv.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;qa(function(){wd(null,t,null,null)}),e[ss]=null}};function bd(t){this._internalRoot=t}bd.prototype.unstable_scheduleHydration=function(t){if(t){var e=aw();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Ns.length&&e!==0&&e<Ns[r].priority;r++);Ns.splice(r,0,t),r===0&&iw(t)}};function dv(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Sd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Ay(){}function aN(t,e,r,s,n){if(n){if(typeof s=="function"){var a=s;s=function(){var u=ju(o);a.call(u)}}var o=kb(e,s,t,0,null,!1,!1,"",Ay);return t._reactRootContainer=o,t[ss]=o.current,yl(t.nodeType===8?t.parentNode:t),qa(),o}for(;n=t.lastChild;)t.removeChild(n);if(typeof s=="function"){var l=s;s=function(){var u=ju(c);l.call(u)}}var c=lv(t,0,!1,null,null,!1,!1,"",Ay);return t._reactRootContainer=c,t[ss]=c.current,yl(t.nodeType===8?t.parentNode:t),qa(function(){wd(e,c,r,s)}),c}function _d(t,e,r,s,n){var a=r._reactRootContainer;if(a){var o=a;if(typeof n=="function"){var l=n;n=function(){var c=ju(o);l.call(c)}}wd(e,o,t,n)}else o=aN(r,e,t,n,s);return ju(o)}nw=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=Hi(e.pendingLanes);r!==0&&(Rm(e,r|1),gr(e,_t()),!(Ze&6)&&(ui=_t()+500,ua()))}break;case 13:qa(function(){var s=as(t,1);if(s!==null){var n=rr();nn(s,t,1,n)}}),cv(t,1)}};Tm=function(t){if(t.tag===13){var e=as(t,134217728);if(e!==null){var r=rr();nn(e,t,134217728,r)}cv(t,134217728)}};sw=function(t){if(t.tag===13){var e=Ys(t),r=as(t,e);if(r!==null){var s=rr();nn(r,t,e,s)}cv(t,e)}};aw=function(){return Xe};ow=function(t,e){var r=Xe;try{return Xe=t,e()}finally{Xe=r}};gh=function(t,e,r){switch(e){case"input":if(uh(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var s=r[e];if(s!==t&&s.form===t.form){var n=hd(s);if(!n)throw Error(Y(90));$x(s),uh(s,n)}}}break;case"textarea":Lx(t,r);break;case"select":e=r.value,e!=null&&Io(t,!!r.multiple,e,!1)}};Wx=sv;Kx=qa;var oN={usingClientEntryPoint:!1,Events:[Ll,Eo,hd,qx,Bx,sv]},$i={findFiberByHostInstance:Pa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},iN={bundleType:$i.bundleType,version:$i.version,rendererPackageName:$i.rendererPackageName,rendererConfig:$i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ds.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Zx(t),t===null?null:t.stateNode},findFiberByHostInstance:$i.findFiberByHostInstance||sN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wc.isDisabled&&wc.supportsFiber)try{cd=wc.inject(iN),kn=wc}catch{}}kr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oN;kr.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dv(e))throw Error(Y(200));return nN(t,e,null,r)};kr.createRoot=function(t,e){if(!dv(t))throw Error(Y(299));var r=!1,s="",n=Nb;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(s=e.identifierPrefix),e.onRecoverableError!==void 0&&(n=e.onRecoverableError)),e=lv(t,1,!1,null,null,r,!1,s,n),t[ss]=e.current,yl(t.nodeType===8?t.parentNode:t),new uv(e)};kr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Y(188)):(t=Object.keys(t).join(","),Error(Y(268,t)));return t=Zx(e),t=t===null?null:t.stateNode,t};kr.flushSync=function(t){return qa(t)};kr.hydrate=function(t,e,r){if(!Sd(e))throw Error(Y(200));return _d(null,t,e,!0,r)};kr.hydrateRoot=function(t,e,r){if(!dv(t))throw Error(Y(405));var s=r!=null&&r.hydratedSources||null,n=!1,a="",o=Nb;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=kb(e,null,t,1,r??null,n,!1,a,o),t[ss]=e.current,yl(t),s)for(t=0;t<s.length;t++)r=s[t],n=r._getVersion,n=n(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,n]:e.mutableSourceEagerHydrationData.push(r,n);return new bd(e)};kr.render=function(t,e,r){if(!Sd(e))throw Error(Y(200));return _d(null,t,e,!1,r)};kr.unmountComponentAtNode=function(t){if(!Sd(t))throw Error(Y(40));return t._reactRootContainer?(qa(function(){_d(null,null,t,!1,function(){t._reactRootContainer=null,t[ss]=null})}),!0):!1};kr.unstable_batchedUpdates=sv;kr.unstable_renderSubtreeIntoContainer=function(t,e,r,s){if(!Sd(r))throw Error(Y(200));if(t==null||t._reactInternals===void 0)throw Error(Y(38));return _d(t,e,r,!1,s)};kr.version="18.3.1-next-f1338f8080-20240426";function jb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jb)}catch(t){console.error(t)}}jb(),jx.exports=kr;var so=jx.exports;const lN=vm(so);var Rb,Oy=so;Rb=Oy.createRoot,Oy.hydrateRoot;function cN(t,e){if(t instanceof RegExp)return{keys:!1,pattern:t};var r,s,n,a,o=[],l="",c=t.split("/");for(c[0]||c.shift();n=c.shift();)r=n[0],r==="*"?(o.push(r),l+=n[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(s=n.indexOf("?",1),a=n.indexOf(".",1),o.push(n.substring(1,~s?s:~a?a:n.length)),l+=~s&&!~a?"(?:/([^/]+?))?":"/([^/]+?)",~a&&(l+=(~s?"?":"")+"\\"+n.substring(a))):l+="/"+n;return{keys:o,pattern:new RegExp("^"+l+(e?"(?=$|/)":"/?$"),"i")}}var Tb={exports:{}},Ab={};/**
|
|
41
|
-
* @license React
|
|
42
|
-
* use-sync-external-store-shim.production.js
|
|
43
|
-
*
|
|
44
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the MIT license found in the
|
|
47
|
-
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var di=x;function uN(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var dN=typeof Object.is=="function"?Object.is:uN,fN=di.useState,hN=di.useEffect,pN=di.useLayoutEffect,mN=di.useDebugValue;function vN(t,e){var r=e(),s=fN({inst:{value:r,getSnapshot:e}}),n=s[0].inst,a=s[1];return pN(function(){n.value=r,n.getSnapshot=e,Rf(n)&&a({inst:n})},[t,r,e]),hN(function(){return Rf(n)&&a({inst:n}),t(function(){Rf(n)&&a({inst:n})})},[t]),mN(r),r}function Rf(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!dN(t,r)}catch{return!0}}function gN(t,e){return e()}var yN=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?gN:vN;Ab.useSyncExternalStore=di.useSyncExternalStore!==void 0?di.useSyncExternalStore:yN;Tb.exports=Ab;var xN=Tb.exports;const wN=bm.useInsertionEffect,bN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",SN=bN?x.useLayoutEffect:x.useEffect,_N=wN||SN,Ob=t=>{const e=x.useRef([t,(...r)=>e[0](...r)]).current;return _N(()=>{e[0]=t}),e[1]},EN="popstate",fv="pushState",hv="replaceState",CN="hashchange",Iy=[EN,fv,hv,CN],PN=t=>{for(const e of Iy)addEventListener(e,t);return()=>{for(const e of Iy)removeEventListener(e,t)}},Ib=(t,e)=>xN.useSyncExternalStore(PN,t,e),kN=()=>location.search,NN=({ssrSearch:t=""}={})=>Ib(kN,()=>t),Dy=()=>location.pathname,jN=({ssrPath:t}={})=>Ib(Dy,t?()=>t:Dy),RN=(t,{replace:e=!1,state:r=null}={})=>history[e?hv:fv](r,"",t),TN=(t={})=>[jN(t),RN],My=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[My]>"u"){for(const t of[fv,hv]){const e=history[t];history[t]=function(){const r=e.apply(this,arguments),s=new Event(t);return s.arguments=arguments,dispatchEvent(s),r}}Object.defineProperty(window,My,{value:!0})}const AN=(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())?"~"+e:e.slice(t.length)||"/",Db=(t="")=>t==="/"?"":t,ON=(t,e)=>t[0]==="~"?t.slice(1):Db(e)+t,IN=(t="",e)=>AN($y(Db(t)),$y(e)),$y=t=>{try{return decodeURI(t)}catch{return t}},Mb={hook:TN,searchHook:NN,parser:cN,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:t=>t},$b=x.createContext(Mb),zl=()=>x.useContext($b),Fb={},Lb=x.createContext(Fb),DN=()=>x.useContext(Lb),Ed=t=>{const[e,r]=t.hook(t);return[IN(t.base,e),Ob((s,n)=>r(ON(s,t.base),n))]},MN=()=>Ed(zl()),Ub=(t,e,r,s)=>{const{pattern:n,keys:a}=e instanceof RegExp?{keys:!1,pattern:e}:t(e||"*",s),o=n.exec(r)||[],[l,...c]=o;return l!==void 0?[!0,(()=>{const u=a!==!1?Object.fromEntries(a.map((h,v)=>[h,c[v]])):o.groups;let d={...c};return u&&Object.assign(d,u),d})(),...s?[l]:[]]:[!1,null]},$N=({children:t,...e})=>{var d,h;const r=zl(),s=e.hook?Mb:r;let n=s;const[a,o]=((d=e.ssrPath)==null?void 0:d.split("?"))??[];o&&(e.ssrSearch=o,e.ssrPath=a),e.hrefs=e.hrefs??((h=e.hook)==null?void 0:h.hrefs);let l=x.useRef({}),c=l.current,u=c;for(let v in s){const p=v==="base"?s[v]+(e[v]||""):e[v]||s[v];c===u&&p!==u[v]&&(l.current=u={...u}),u[v]=p,(p!==s[v]||p!==n[v])&&(n=u)}return x.createElement($b.Provider,{value:n,children:t})},Fy=({children:t,component:e},r)=>e?x.createElement(e,{params:r}):typeof t=="function"?t(r):t,FN=t=>{let e=x.useRef(Fb);const r=e.current;return e.current=Object.keys(t).length!==Object.keys(r).length||Object.entries(t).some(([s,n])=>n!==r[s])?t:r},bc=({path:t,nest:e,match:r,...s})=>{const n=zl(),[a]=Ed(n),[o,l,c]=r??Ub(n.parser,t,a,e),u=FN({...DN(),...l});if(!o)return null;const d=c?x.createElement($N,{base:c},Fy(s,u)):Fy(s,u);return x.createElement(Lb.Provider,{value:u,children:d})};x.forwardRef((t,e)=>{const r=zl(),[s,n]=Ed(r),{to:a="",href:o=a,onClick:l,asChild:c,children:u,className:d,replace:h,state:v,...p}=t,w=Ob(m=>{m.ctrlKey||m.metaKey||m.altKey||m.shiftKey||m.button!==0||(l==null||l(m),m.defaultPrevented||(m.preventDefault(),n(o,t)))}),f=r.hrefs(o[0]==="~"?o.slice(1):r.base+o,r);return c&&x.isValidElement(u)?x.cloneElement(u,{onClick:w,href:f}):x.createElement("a",{...p,onClick:w,href:f,className:d!=null&&d.call?d(s===o):d,children:u,ref:e})});const zb=t=>Array.isArray(t)?t.flatMap(e=>zb(e&&e.type===x.Fragment?e.props.children:e)):[t],LN=({children:t,location:e})=>{const r=zl(),[s]=Ed(r);for(const n of zb(t)){let a=0;if(x.isValidElement(n)&&(a=Ub(r.parser,n.props.path,e||s,n.props.nest))[0])return x.cloneElement(n,{match:a})}return null};var bi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ba=typeof window>"u"||"Deno"in globalThis;function tr(){}function UN(t,e){return typeof t=="function"?t(e):t}function Zh(t){return typeof t=="number"&&t>=0&&t!==1/0}function Vb(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Xs(t,e){return typeof t=="function"?t(e):t}function Ar(t,e){return typeof t=="function"?t(e):t}function Ly(t,e){const{type:r="all",exact:s,fetchStatus:n,predicate:a,queryKey:o,stale:l}=t;if(o){if(s){if(e.queryHash!==pv(o,e.options))return!1}else if(!kl(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||n&&n!==e.state.fetchStatus||a&&!a(e))}function Uy(t,e){const{exact:r,status:s,predicate:n,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(r){if(Wa(e.options.mutationKey)!==Wa(a))return!1}else if(!kl(e.options.mutationKey,a))return!1}return!(s&&e.state.status!==s||n&&!n(e))}function pv(t,e){return((e==null?void 0:e.queryKeyHashFn)||Wa)(t)}function Wa(t){return JSON.stringify(t,(e,r)=>Yh(r)?Object.keys(r).sort().reduce((s,n)=>(s[n]=r[n],s),{}):r)}function kl(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>kl(t[r],e[r])):!1}function Hb(t,e){if(t===e)return t;const r=zy(t)&&zy(e);if(r||Yh(t)&&Yh(e)){const s=r?t:Object.keys(t),n=s.length,a=r?e:Object.keys(e),o=a.length,l=r?[]:{},c=new Set(s);let u=0;for(let d=0;d<o;d++){const h=r?d:a[d];(!r&&c.has(h)||r)&&t[h]===void 0&&e[h]===void 0?(l[h]=void 0,u++):(l[h]=Hb(t[h],e[h]),l[h]===t[h]&&t[h]!==void 0&&u++)}return n===o&&u===n?t:l}return e}function Ru(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function zy(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Yh(t){if(!Vy(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Vy(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Vy(t){return Object.prototype.toString.call(t)==="[object Object]"}function zN(t){return new Promise(e=>{setTimeout(e,t)})}function Jh(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Hb(t,e):e}function VN(t,e,r=0){const s=[...t,e];return r&&s.length>r?s.slice(1):s}function HN(t,e,r=0){const s=[e,...t];return r&&s.length>r?s.slice(0,-1):s}var mv=Symbol();function qb(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===mv?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Bb(t,e){return typeof t=="function"?t(...e):!!t}var ja,Ts,Bo,lx,qN=(lx=class extends bi{constructor(){super();Se(this,ja);Se(this,Ts);Se(this,Bo);ue(this,Bo,e=>{if(!Ba&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){I(this,Ts)||this.setEventListener(I(this,Bo))}onUnsubscribe(){var e;this.hasListeners()||((e=I(this,Ts))==null||e.call(this),ue(this,Ts,void 0))}setEventListener(e){var r;ue(this,Bo,e),(r=I(this,Ts))==null||r.call(this),ue(this,Ts,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){I(this,ja)!==e&&(ue(this,ja,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof I(this,ja)=="boolean"?I(this,ja):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},ja=new WeakMap,Ts=new WeakMap,Bo=new WeakMap,lx),vv=new qN,Wo,As,Ko,cx,BN=(cx=class extends bi{constructor(){super();Se(this,Wo,!0);Se(this,As);Se(this,Ko);ue(this,Ko,e=>{if(!Ba&&window.addEventListener){const r=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}}})}onSubscribe(){I(this,As)||this.setEventListener(I(this,Ko))}onUnsubscribe(){var e;this.hasListeners()||((e=I(this,As))==null||e.call(this),ue(this,As,void 0))}setEventListener(e){var r;ue(this,Ko,e),(r=I(this,As))==null||r.call(this),ue(this,As,e(this.setOnline.bind(this)))}setOnline(e){I(this,Wo)!==e&&(ue(this,Wo,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return I(this,Wo)}},Wo=new WeakMap,As=new WeakMap,Ko=new WeakMap,cx),Tu=new BN;function Xh(){let t,e;const r=new Promise((n,a)=>{t=n,e=a});r.status="pending",r.catch(()=>{});function s(n){Object.assign(r,n),delete r.resolve,delete r.reject}return r.resolve=n=>{s({status:"fulfilled",value:n}),t(n)},r.reject=n=>{s({status:"rejected",reason:n}),e(n)},r}function WN(t){return Math.min(1e3*2**t,3e4)}function Wb(t){return(t??"online")==="online"?Tu.isOnline():!0}var Kb=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Qb(t){let e=!1,r=0,s;const n=Xh(),a=()=>n.status!=="pending",o=f=>{var m;a()||(v(new Kb(f)),(m=t.abort)==null||m.call(t))},l=()=>{e=!0},c=()=>{e=!1},u=()=>vv.isFocused()&&(t.networkMode==="always"||Tu.isOnline())&&t.canRun(),d=()=>Wb(t.networkMode)&&t.canRun(),h=f=>{a()||(s==null||s(),n.resolve(f))},v=f=>{a()||(s==null||s(),n.reject(f))},p=()=>new Promise(f=>{var m;s=g=>{(a()||u())&&f(g)},(m=t.onPause)==null||m.call(t)}).then(()=>{var f;s=void 0,a()||(f=t.onContinue)==null||f.call(t)}),w=()=>{if(a())return;let f;const m=r===0?t.initialPromise:void 0;try{f=m??t.fn()}catch(g){f=Promise.reject(g)}Promise.resolve(f).then(h).catch(g=>{var P;if(a())return;const y=t.retry??(Ba?0:3),b=t.retryDelay??WN,S=typeof b=="function"?b(r,g):b,E=y===!0||typeof y=="number"&&r<y||typeof y=="function"&&y(r,g);if(e||!E){v(g);return}r++,(P=t.onFail)==null||P.call(t,r,g),zN(S).then(()=>u()?void 0:p()).then(()=>{e?v(g):w()})})};return{promise:n,status:()=>n.status,cancel:o,continue:()=>(s==null||s(),n),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?w():p().then(w),n)}}var KN=t=>setTimeout(t,0);function QN(){let t=[],e=0,r=l=>{l()},s=l=>{l()},n=KN;const a=l=>{e?t.push(l):n(()=>{r(l)})},o=()=>{const l=t;t=[],l.length&&n(()=>{s(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;e++;try{c=l()}finally{e--,e||o()}return c},batchCalls:l=>(...c)=>{a(()=>{l(...c)})},schedule:a,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{s=l},setScheduler:l=>{n=l}}}var Tt=QN(),Ra,ux,Gb=(ux=class{constructor(){Se(this,Ra)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Zh(this.gcTime)&&ue(this,Ra,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ba?1/0:5*60*1e3))}clearGcTimeout(){I(this,Ra)&&(clearTimeout(I(this,Ra)),ue(this,Ra,void 0))}},Ra=new WeakMap,ux),Qo,Go,Tr,Ta,Mt,Al,Aa,Yr,zn,dx,GN=(dx=class extends Gb{constructor(e){super();Se(this,Yr);Se(this,Qo);Se(this,Go);Se(this,Tr);Se(this,Ta);Se(this,Mt);Se(this,Al);Se(this,Aa);ue(this,Aa,!1),ue(this,Al,e.defaultOptions),this.setOptions(e.options),this.observers=[],ue(this,Ta,e.client),ue(this,Tr,I(this,Ta).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,ue(this,Qo,ZN(this.options)),this.state=e.state??I(this,Qo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=I(this,Mt))==null?void 0:e.promise}setOptions(e){this.options={...I(this,Al),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&I(this,Tr).remove(this)}setData(e,r){const s=Jh(this.state.data,e,this.options);return Le(this,Yr,zn).call(this,{data:s,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),s}setState(e,r){Le(this,Yr,zn).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var s,n;const r=(s=I(this,Mt))==null?void 0:s.promise;return(n=I(this,Mt))==null||n.cancel(e),r?r.then(tr).catch(tr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(I(this,Qo))}isActive(){return this.observers.some(e=>Ar(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Xs(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Vb(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=I(this,Mt))==null||r.continue()}onOnline(){var r;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=I(this,Mt))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),I(this,Tr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(I(this,Mt)&&(I(this,Aa)?I(this,Mt).cancel({revert:!0}):I(this,Mt).cancelRetry()),this.scheduleGc()),I(this,Tr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Le(this,Yr,zn).call(this,{type:"invalidate"})}async fetch(e,r){var c,u,d,h,v,p,w,f,m,g,y,b;if(this.state.fetchStatus!=="idle"&&((c=I(this,Mt))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(I(this,Mt))return I(this,Mt).continueRetry(),I(this,Mt).promise}if(e&&this.setOptions(e),!this.options.queryFn){const S=this.observers.find(E=>E.options.queryFn);S&&this.setOptions(S.options)}const s=new AbortController,n=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(ue(this,Aa,!0),s.signal)})},a=()=>{const S=qb(this.options,r),P=(()=>{const R={client:I(this,Ta),queryKey:this.queryKey,meta:this.meta};return n(R),R})();return ue(this,Aa,!1),this.options.persister?this.options.persister(S,P,this):S(P)},l=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:I(this,Ta),state:this.state,fetchFn:a};return n(S),S})();(u=this.options.behavior)==null||u.onFetch(l,this),ue(this,Go,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&Le(this,Yr,zn).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta}),ue(this,Mt,Qb({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:s.abort.bind(s),onFail:(S,E)=>{Le(this,Yr,zn).call(this,{type:"failed",failureCount:S,error:E})},onPause:()=>{Le(this,Yr,zn).call(this,{type:"pause"})},onContinue:()=>{Le(this,Yr,zn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const S=await I(this,Mt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(v=I(this,Tr).config).onSuccess)==null||p.call(v,S,this),(f=(w=I(this,Tr).config).onSettled)==null||f.call(w,S,this.state.error,this),S}catch(S){if(S instanceof Kb){if(S.silent)return I(this,Mt).promise;if(S.revert){if(this.setState({...I(this,Go),fetchStatus:"idle"}),this.state.data===void 0)throw S;return this.state.data}}throw Le(this,Yr,zn).call(this,{type:"error",error:S}),(g=(m=I(this,Tr).config).onError)==null||g.call(m,S,this),(b=(y=I(this,Tr).config).onSettled)==null||b.call(y,this.state.data,S,this),S}finally{this.scheduleGc()}}},Qo=new WeakMap,Go=new WeakMap,Tr=new WeakMap,Ta=new WeakMap,Mt=new WeakMap,Al=new WeakMap,Aa=new WeakMap,Yr=new WeakSet,zn=function(e){const r=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...Zb(s.data,this.options),fetchMeta:e.meta??null};case"success":const n={...s,data:e.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,Go,e.manual?n:void 0),n;case"error":const a=e.error;return{...s,error:a,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=r(this.state),Tt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),I(this,Tr).notify({query:this,type:"updated",action:e})})},dx);function Zb(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wb(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function ZN(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,s=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var gn,fx,YN=(fx=class extends bi{constructor(e={}){super();Se(this,gn);this.config=e,ue(this,gn,new Map)}build(e,r,s){const n=r.queryKey,a=r.queryHash??pv(n,r);let o=this.get(a);return o||(o=new GN({client:e,queryKey:n,queryHash:a,options:e.defaultQueryOptions(r),state:s,defaultOptions:e.getQueryDefaults(n)}),this.add(o)),o}add(e){I(this,gn).has(e.queryHash)||(I(this,gn).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=I(this,gn).get(e.queryHash);r&&(e.destroy(),r===e&&I(this,gn).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Tt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return I(this,gn).get(e)}getAll(){return[...I(this,gn).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(s=>Ly(r,s))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(s=>Ly(e,s)):r}notify(e){Tt.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Tt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Tt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},gn=new WeakMap,fx),yn,Jt,Oa,xn,bs,hx,JN=(hx=class extends Gb{constructor(e){super();Se(this,xn);Se(this,yn);Se(this,Jt);Se(this,Oa);this.mutationId=e.mutationId,ue(this,Jt,e.mutationCache),ue(this,yn,[]),this.state=e.state||Yb(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){I(this,yn).includes(e)||(I(this,yn).push(e),this.clearGcTimeout(),I(this,Jt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){ue(this,yn,I(this,yn).filter(r=>r!==e)),this.scheduleGc(),I(this,Jt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){I(this,yn).length||(this.state.status==="pending"?this.scheduleGc():I(this,Jt).remove(this))}continue(){var e;return((e=I(this,Oa))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,o,l,c,u,d,h,v,p,w,f,m,g,y,b,S,E,P,R,T;const r=()=>{Le(this,xn,bs).call(this,{type:"continue"})};ue(this,Oa,Qb({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(N,O)=>{Le(this,xn,bs).call(this,{type:"failed",failureCount:N,error:O})},onPause:()=>{Le(this,xn,bs).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>I(this,Jt).canRun(this)}));const s=this.state.status==="pending",n=!I(this,Oa).canStart();try{if(s)r();else{Le(this,xn,bs).call(this,{type:"pending",variables:e,isPaused:n}),await((o=(a=I(this,Jt).config).onMutate)==null?void 0:o.call(a,e,this));const O=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,e));O!==this.state.context&&Le(this,xn,bs).call(this,{type:"pending",context:O,variables:e,isPaused:n})}const N=await I(this,Oa).start();return await((d=(u=I(this,Jt).config).onSuccess)==null?void 0:d.call(u,N,e,this.state.context,this)),await((v=(h=this.options).onSuccess)==null?void 0:v.call(h,N,e,this.state.context)),await((w=(p=I(this,Jt).config).onSettled)==null?void 0:w.call(p,N,null,this.state.variables,this.state.context,this)),await((m=(f=this.options).onSettled)==null?void 0:m.call(f,N,null,e,this.state.context)),Le(this,xn,bs).call(this,{type:"success",data:N}),N}catch(N){try{throw await((y=(g=I(this,Jt).config).onError)==null?void 0:y.call(g,N,e,this.state.context,this)),await((S=(b=this.options).onError)==null?void 0:S.call(b,N,e,this.state.context)),await((P=(E=I(this,Jt).config).onSettled)==null?void 0:P.call(E,void 0,N,this.state.variables,this.state.context,this)),await((T=(R=this.options).onSettled)==null?void 0:T.call(R,void 0,N,e,this.state.context)),N}finally{Le(this,xn,bs).call(this,{type:"error",error:N})}}finally{I(this,Jt).runNext(this)}}},yn=new WeakMap,Jt=new WeakMap,Oa=new WeakMap,xn=new WeakSet,bs=function(e){const r=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Tt.batch(()=>{I(this,yn).forEach(s=>{s.onMutationUpdate(e)}),I(this,Jt).notify({mutation:this,type:"updated",action:e})})},hx);function Yb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Wn,Jr,Ol,px,XN=(px=class extends bi{constructor(e={}){super();Se(this,Wn);Se(this,Jr);Se(this,Ol);this.config=e,ue(this,Wn,new Set),ue(this,Jr,new Map),ue(this,Ol,0)}build(e,r,s){const n=new JN({mutationCache:this,mutationId:++nc(this,Ol)._,options:e.defaultMutationOptions(r),state:s});return this.add(n),n}add(e){I(this,Wn).add(e);const r=Sc(e);if(typeof r=="string"){const s=I(this,Jr).get(r);s?s.push(e):I(this,Jr).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(I(this,Wn).delete(e)){const r=Sc(e);if(typeof r=="string"){const s=I(this,Jr).get(r);if(s)if(s.length>1){const n=s.indexOf(e);n!==-1&&s.splice(n,1)}else s[0]===e&&I(this,Jr).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=Sc(e);if(typeof r=="string"){const s=I(this,Jr).get(r),n=s==null?void 0:s.find(a=>a.state.status==="pending");return!n||n===e}else return!0}runNext(e){var s;const r=Sc(e);if(typeof r=="string"){const n=(s=I(this,Jr).get(r))==null?void 0:s.find(a=>a!==e&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Tt.batch(()=>{I(this,Wn).forEach(e=>{this.notify({type:"removed",mutation:e})}),I(this,Wn).clear(),I(this,Jr).clear()})}getAll(){return Array.from(I(this,Wn))}find(e){const r={exact:!0,...e};return this.getAll().find(s=>Uy(r,s))}findAll(e={}){return this.getAll().filter(r=>Uy(e,r))}notify(e){Tt.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return Tt.batch(()=>Promise.all(e.map(r=>r.continue().catch(tr))))}},Wn=new WeakMap,Jr=new WeakMap,Ol=new WeakMap,px);function Sc(t){var e;return(e=t.options.scope)==null?void 0:e.id}function Hy(t){return{onFetch:(e,r)=>{var d,h,v,p,w;const s=e.options,n=(v=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:v.direction,a=((p=e.state.data)==null?void 0:p.pages)||[],o=((w=e.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let f=!1;const m=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},g=qb(e.options,e.fetchOptions),y=async(b,S,E)=>{if(f)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const R=(()=>{const j={client:e.client,queryKey:e.queryKey,pageParam:S,direction:E?"backward":"forward",meta:e.options.meta};return m(j),j})(),T=await g(R),{maxPages:N}=e.options,O=E?HN:VN;return{pages:O(b.pages,T,N),pageParams:O(b.pageParams,S,N)}};if(n&&a.length){const b=n==="backward",S=b?ej:qy,E={pages:a,pageParams:o},P=S(s,E);l=await y(E,P,b)}else{const b=t??a.length;do{const S=c===0?o[0]??s.initialPageParam:qy(s,l);if(c>0&&S==null)break;l=await y(l,S),c++}while(c<b)}return l};e.options.persister?e.fetchFn=()=>{var f,m;return(m=(f=e.options).persister)==null?void 0:m.call(f,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function qy(t,{pages:e,pageParams:r}){const s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,r[s],r):void 0}function ej(t,{pages:e,pageParams:r}){var s;return e.length>0?(s=t.getPreviousPageParam)==null?void 0:s.call(t,e[0],e,r[0],r):void 0}var yt,Os,Is,Zo,Yo,Ds,Jo,Xo,mx,tj=(mx=class{constructor(t={}){Se(this,yt);Se(this,Os);Se(this,Is);Se(this,Zo);Se(this,Yo);Se(this,Ds);Se(this,Jo);Se(this,Xo);ue(this,yt,t.queryCache||new YN),ue(this,Os,t.mutationCache||new XN),ue(this,Is,t.defaultOptions||{}),ue(this,Zo,new Map),ue(this,Yo,new Map),ue(this,Ds,0)}mount(){nc(this,Ds)._++,I(this,Ds)===1&&(ue(this,Jo,vv.subscribe(async t=>{t&&(await this.resumePausedMutations(),I(this,yt).onFocus())})),ue(this,Xo,Tu.subscribe(async t=>{t&&(await this.resumePausedMutations(),I(this,yt).onOnline())})))}unmount(){var t,e;nc(this,Ds)._--,I(this,Ds)===0&&((t=I(this,Jo))==null||t.call(this),ue(this,Jo,void 0),(e=I(this,Xo))==null||e.call(this),ue(this,Xo,void 0))}isFetching(t){return I(this,yt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return I(this,Os).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=I(this,yt).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=I(this,yt).build(this,e),s=r.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Xs(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return I(this,yt).findAll(t).map(({queryKey:e,state:r})=>{const s=r.data;return[e,s]})}setQueryData(t,e,r){const s=this.defaultQueryOptions({queryKey:t}),n=I(this,yt).get(s.queryHash),a=n==null?void 0:n.state.data,o=UN(e,a);if(o!==void 0)return I(this,yt).build(this,s).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return Tt.batch(()=>I(this,yt).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=I(this,yt).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=I(this,yt);Tt.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=I(this,yt);return Tt.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},s=Tt.batch(()=>I(this,yt).findAll(t).map(n=>n.cancel(r)));return Promise.all(s).then(tr).catch(tr)}invalidateQueries(t,e={}){return Tt.batch(()=>(I(this,yt).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},s=Tt.batch(()=>I(this,yt).findAll(t).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,r);return r.throwOnError||(a=a.catch(tr)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(tr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=I(this,yt).build(this,e);return r.isStaleByTime(Xs(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(tr).catch(tr)}fetchInfiniteQuery(t){return t.behavior=Hy(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(tr).catch(tr)}ensureInfiniteQueryData(t){return t.behavior=Hy(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Tu.isOnline()?I(this,Os).resumePausedMutations():Promise.resolve()}getQueryCache(){return I(this,yt)}getMutationCache(){return I(this,Os)}getDefaultOptions(){return I(this,Is)}setDefaultOptions(t){ue(this,Is,t)}setQueryDefaults(t,e){I(this,Zo).set(Wa(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...I(this,Zo).values()],r={};return e.forEach(s=>{kl(t,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(t,e){I(this,Yo).set(Wa(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...I(this,Yo).values()],r={};return e.forEach(s=>{kl(t,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...I(this,Is).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=pv(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===mv&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...I(this,Is).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){I(this,yt).clear(),I(this,Os).clear()}},yt=new WeakMap,Os=new WeakMap,Is=new WeakMap,Zo=new WeakMap,Yo=new WeakMap,Ds=new WeakMap,Jo=new WeakMap,Xo=new WeakMap,mx),lr,We,Il,Xt,Ia,ei,Kn,Ms,Dl,ti,ri,Da,Ma,$s,ni,Je,Bi,ep,tp,rp,np,sp,ap,op,Jb,vx,rj=(vx=class extends bi{constructor(e,r){super();Se(this,Je);Se(this,lr);Se(this,We);Se(this,Il);Se(this,Xt);Se(this,Ia);Se(this,ei);Se(this,Kn);Se(this,Ms);Se(this,Dl);Se(this,ti);Se(this,ri);Se(this,Da);Se(this,Ma);Se(this,$s);Se(this,ni,new Set);this.options=r,ue(this,lr,e),ue(this,Ms,null),ue(this,Kn,Xh()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(I(this,We).addObserver(this),By(I(this,We),this.options)?Le(this,Je,Bi).call(this):this.updateResult(),Le(this,Je,np).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ip(I(this,We),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ip(I(this,We),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Le(this,Je,sp).call(this),Le(this,Je,ap).call(this),I(this,We).removeObserver(this)}setOptions(e){const r=this.options,s=I(this,We);if(this.options=I(this,lr).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ar(this.options.enabled,I(this,We))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Le(this,Je,op).call(this),I(this,We).setOptions(this.options),r._defaulted&&!Ru(this.options,r)&&I(this,lr).getQueryCache().notify({type:"observerOptionsUpdated",query:I(this,We),observer:this});const n=this.hasListeners();n&&Wy(I(this,We),s,this.options,r)&&Le(this,Je,Bi).call(this),this.updateResult(),n&&(I(this,We)!==s||Ar(this.options.enabled,I(this,We))!==Ar(r.enabled,I(this,We))||Xs(this.options.staleTime,I(this,We))!==Xs(r.staleTime,I(this,We)))&&Le(this,Je,ep).call(this);const a=Le(this,Je,tp).call(this);n&&(I(this,We)!==s||Ar(this.options.enabled,I(this,We))!==Ar(r.enabled,I(this,We))||a!==I(this,$s))&&Le(this,Je,rp).call(this,a)}getOptimisticResult(e){const r=I(this,lr).getQueryCache().build(I(this,lr),e),s=this.createResult(r,e);return sj(this,s)&&(ue(this,Xt,s),ue(this,ei,this.options),ue(this,Ia,I(this,We).state)),s}getCurrentResult(){return I(this,Xt)}trackResult(e,r){return new Proxy(e,{get:(s,n)=>(this.trackProp(n),r==null||r(n),n==="promise"&&!this.options.experimental_prefetchInRender&&I(this,Kn).status==="pending"&&I(this,Kn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(s,n))})}trackProp(e){I(this,ni).add(e)}getCurrentQuery(){return I(this,We)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=I(this,lr).defaultQueryOptions(e),s=I(this,lr).getQueryCache().build(I(this,lr),r);return s.fetch().then(()=>this.createResult(s,r))}fetch(e){return Le(this,Je,Bi).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),I(this,Xt)))}createResult(e,r){var N;const s=I(this,We),n=this.options,a=I(this,Xt),o=I(this,Ia),l=I(this,ei),u=e!==s?e.state:I(this,Il),{state:d}=e;let h={...d},v=!1,p;if(r._optimisticResults){const O=this.hasListeners(),j=!O&&By(e,r),_=O&&Wy(e,s,r,n);(j||_)&&(h={...h,...Zb(d.data,e.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:f,status:m}=h;p=h.data;let g=!1;if(r.placeholderData!==void 0&&p===void 0&&m==="pending"){let O;a!=null&&a.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(O=a.data,g=!0):O=typeof r.placeholderData=="function"?r.placeholderData((N=I(this,ri))==null?void 0:N.state.data,I(this,ri)):r.placeholderData,O!==void 0&&(m="success",p=Jh(a==null?void 0:a.data,O,r),v=!0)}if(r.select&&p!==void 0&&!g)if(a&&p===(o==null?void 0:o.data)&&r.select===I(this,Dl))p=I(this,ti);else try{ue(this,Dl,r.select),p=r.select(p),p=Jh(a==null?void 0:a.data,p,r),ue(this,ti,p),ue(this,Ms,null)}catch(O){ue(this,Ms,O)}I(this,Ms)&&(w=I(this,Ms),p=I(this,ti),f=Date.now(),m="error");const y=h.fetchStatus==="fetching",b=m==="pending",S=m==="error",E=b&&y,P=p!==void 0,T={status:m,fetchStatus:h.fetchStatus,isPending:b,isSuccess:m==="success",isError:S,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:f,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:S&&!P,isPaused:h.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:S&&P,isStale:gv(e,r),refetch:this.refetch,promise:I(this,Kn),isEnabled:Ar(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=A=>{T.status==="error"?A.reject(T.error):T.data!==void 0&&A.resolve(T.data)},j=()=>{const A=ue(this,Kn,T.promise=Xh());O(A)},_=I(this,Kn);switch(_.status){case"pending":e.queryHash===s.queryHash&&O(_);break;case"fulfilled":(T.status==="error"||T.data!==_.value)&&j();break;case"rejected":(T.status!=="error"||T.error!==_.reason)&&j();break}}return T}updateResult(){const e=I(this,Xt),r=this.createResult(I(this,We),this.options);if(ue(this,Ia,I(this,We).state),ue(this,ei,this.options),I(this,Ia).data!==void 0&&ue(this,ri,I(this,We)),Ru(r,e))return;ue(this,Xt,r);const s=()=>{if(!e)return!0;const{notifyOnChangeProps:n}=this.options,a=typeof n=="function"?n():n;if(a==="all"||!a&&!I(this,ni).size)return!0;const o=new Set(a??I(this,ni));return this.options.throwOnError&&o.add("error"),Object.keys(I(this,Xt)).some(l=>{const c=l;return I(this,Xt)[c]!==e[c]&&o.has(c)})};Le(this,Je,Jb).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Le(this,Je,np).call(this)}},lr=new WeakMap,We=new WeakMap,Il=new WeakMap,Xt=new WeakMap,Ia=new WeakMap,ei=new WeakMap,Kn=new WeakMap,Ms=new WeakMap,Dl=new WeakMap,ti=new WeakMap,ri=new WeakMap,Da=new WeakMap,Ma=new WeakMap,$s=new WeakMap,ni=new WeakMap,Je=new WeakSet,Bi=function(e){Le(this,Je,op).call(this);let r=I(this,We).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(tr)),r},ep=function(){Le(this,Je,sp).call(this);const e=Xs(this.options.staleTime,I(this,We));if(Ba||I(this,Xt).isStale||!Zh(e))return;const s=Vb(I(this,Xt).dataUpdatedAt,e)+1;ue(this,Da,setTimeout(()=>{I(this,Xt).isStale||this.updateResult()},s))},tp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(I(this,We)):this.options.refetchInterval)??!1},rp=function(e){Le(this,Je,ap).call(this),ue(this,$s,e),!(Ba||Ar(this.options.enabled,I(this,We))===!1||!Zh(I(this,$s))||I(this,$s)===0)&&ue(this,Ma,setInterval(()=>{(this.options.refetchIntervalInBackground||vv.isFocused())&&Le(this,Je,Bi).call(this)},I(this,$s)))},np=function(){Le(this,Je,ep).call(this),Le(this,Je,rp).call(this,Le(this,Je,tp).call(this))},sp=function(){I(this,Da)&&(clearTimeout(I(this,Da)),ue(this,Da,void 0))},ap=function(){I(this,Ma)&&(clearInterval(I(this,Ma)),ue(this,Ma,void 0))},op=function(){const e=I(this,lr).getQueryCache().build(I(this,lr),this.options);if(e===I(this,We))return;const r=I(this,We);ue(this,We,e),ue(this,Il,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},Jb=function(e){Tt.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(I(this,Xt))}),I(this,lr).getQueryCache().notify({query:I(this,We),type:"observerResultsUpdated"})})},vx);function nj(t,e){return Ar(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function By(t,e){return nj(t,e)||t.state.data!==void 0&&ip(t,e,e.refetchOnMount)}function ip(t,e,r){if(Ar(e.enabled,t)!==!1&&Xs(e.staleTime,t)!=="static"){const s=typeof r=="function"?r(t):r;return s==="always"||s!==!1&&gv(t,e)}return!1}function Wy(t,e,r,s){return(t!==e||Ar(s.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&gv(t,r)}function gv(t,e){return Ar(e.enabled,t)!==!1&&t.isStaleByTime(Xs(e.staleTime,t))}function sj(t,e){return!Ru(t.getCurrentResult(),e)}var Fs,Ls,cr,Qn,rs,Qc,lp,gx,aj=(gx=class extends bi{constructor(r,s){super();Se(this,rs);Se(this,Fs);Se(this,Ls);Se(this,cr);Se(this,Qn);ue(this,Fs,r),this.setOptions(s),this.bindMethods(),Le(this,rs,Qc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var n;const s=this.options;this.options=I(this,Fs).defaultMutationOptions(r),Ru(this.options,s)||I(this,Fs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:I(this,cr),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Wa(s.mutationKey)!==Wa(this.options.mutationKey)?this.reset():((n=I(this,cr))==null?void 0:n.state.status)==="pending"&&I(this,cr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=I(this,cr))==null||r.removeObserver(this)}onMutationUpdate(r){Le(this,rs,Qc).call(this),Le(this,rs,lp).call(this,r)}getCurrentResult(){return I(this,Ls)}reset(){var r;(r=I(this,cr))==null||r.removeObserver(this),ue(this,cr,void 0),Le(this,rs,Qc).call(this),Le(this,rs,lp).call(this)}mutate(r,s){var n;return ue(this,Qn,s),(n=I(this,cr))==null||n.removeObserver(this),ue(this,cr,I(this,Fs).getMutationCache().build(I(this,Fs),this.options)),I(this,cr).addObserver(this),I(this,cr).execute(r)}},Fs=new WeakMap,Ls=new WeakMap,cr=new WeakMap,Qn=new WeakMap,rs=new WeakSet,Qc=function(){var s;const r=((s=I(this,cr))==null?void 0:s.state)??Yb();ue(this,Ls,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},lp=function(r){Tt.batch(()=>{var s,n,a,o,l,c,u,d;if(I(this,Qn)&&this.hasListeners()){const h=I(this,Ls).variables,v=I(this,Ls).context;(r==null?void 0:r.type)==="success"?((n=(s=I(this,Qn)).onSuccess)==null||n.call(s,r.data,h,v),(o=(a=I(this,Qn)).onSettled)==null||o.call(a,r.data,null,h,v)):(r==null?void 0:r.type)==="error"&&((c=(l=I(this,Qn)).onError)==null||c.call(l,r.error,h,v),(d=(u=I(this,Qn)).onSettled)==null||d.call(u,void 0,r.error,h,v))}this.listeners.forEach(h=>{h(I(this,Ls))})})},gx),Xb=x.createContext(void 0),yr=t=>{const e=x.useContext(Xb);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},oj=({client:t,children:e})=>(x.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),i.jsx(Xb.Provider,{value:t,children:e})),e1=x.createContext(!1),ij=()=>x.useContext(e1);e1.Provider;function lj(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var cj=x.createContext(lj()),uj=()=>x.useContext(cj),dj=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},fj=t=>{x.useEffect(()=>{t.clearReset()},[t])},hj=({result:t,errorResetBoundary:e,throwOnError:r,query:s,suspense:n})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(n&&t.data===void 0||Bb(r,[t.error,s])),pj=t=>{if(t.suspense){const e=s=>s==="static"?s:Math.max(s??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...s)=>e(r(...s)):e(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},mj=(t,e)=>t.isLoading&&t.isFetching&&!e,vj=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Ky=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function gj(t,e,r){var h,v,p,w,f;const s=ij(),n=uj(),a=yr(),o=a.defaultQueryOptions(t);(v=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||v.call(h,o),o._optimisticResults=s?"isRestoring":"optimistic",pj(o),dj(o,n),fj(n);const l=!a.getQueryCache().get(o.queryHash),[c]=x.useState(()=>new e(a,o)),u=c.getOptimisticResult(o),d=!s&&t.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(m=>{const g=d?c.subscribe(Tt.batchCalls(m)):tr;return c.updateResult(),g},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setOptions(o)},[o,c]),vj(o,u))throw Ky(o,c,n);if(hj({result:u,errorResetBoundary:n,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((w=(p=a.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||w.call(p,o,u),o.experimental_prefetchInRender&&!Ba&&mj(u,s)){const m=l?Ky(o,c,n):(f=a.getQueryCache().get(o.queryHash))==null?void 0:f.promise;m==null||m.catch(tr).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function hr(t,e){return gj(t,rj)}function At(t,e){const r=yr(),[s]=x.useState(()=>new aj(r,t));x.useEffect(()=>{s.setOptions(t)},[s,t]);const n=x.useSyncExternalStore(x.useCallback(o=>s.subscribe(Tt.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=x.useCallback((o,l)=>{s.mutate(o,l).catch(tr)},[s]);if(n.error&&Bb(s.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:a,mutateAsync:n.mutate}}const yj="x-agent-deck-client",xj="dashboard",t1={[yj]:xj};async function r1(t){if(t.ok)return;let e=t.statusText;try{const r=await t.text();try{const s=JSON.parse(r);e=s.error||s.message||e}catch{r.trim()&&(e=`${t.status}: ${r}`)}}catch(r){console.warn("Response body parsing failed:",r)}throw new Error(e)}async function Oe(t,e,r){const s=await fetch(e,{method:t,headers:{...t1,...r?{"Content-Type":"application/json"}:{}},body:r?JSON.stringify(r):void 0});return await r1(s),s}const wj=({on401:t})=>async({queryKey:e})=>{const r=e.join("/"),s=await fetch(r,{headers:t1});return await r1(s),await s.json()},bj=new tj({defaultOptions:{queries:{queryFn:wj({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!0,staleTime:0,gcTime:10*60*1e3,retry:!1},mutations:{retry:!1}}}),Sj=1,_j=1e6;let Tf=0;function Ej(){return Tf=(Tf+1)%Number.MAX_SAFE_INTEGER,Tf.toString()}const Af=new Map,Qy=t=>{if(Af.has(t))return;const e=setTimeout(()=>{Af.delete(t),ol({type:"REMOVE_TOAST",toastId:t})},_j);Af.set(t,e)},Cj=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,Sj)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?Qy(r):t.toasts.forEach(s=>{Qy(s.id)}),{...t,toasts:t.toasts.map(s=>s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},Gc=[];let Zc={toasts:[]};function ol(t){Zc=Cj(Zc,t),Gc.forEach(e=>{e(Zc)})}function Pj({...t}){const e=Ej(),r=n=>ol({type:"UPDATE_TOAST",toast:{...n,id:e}}),s=()=>ol({type:"DISMISS_TOAST",toastId:e});return ol({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:n=>{n||s()}}}),{id:e,dismiss:s,update:r}}function or(){const[t,e]=x.useState(Zc);return x.useEffect(()=>(Gc.push(e),()=>{const r=Gc.indexOf(e);r>-1&&Gc.splice(r,1)}),[t]),{...t,toast:Pj,dismiss:r=>ol({type:"DISMISS_TOAST",toastId:r})}}function _e(t,e,{checkForDefaultPrevented:r=!0}={}){return function(n){if(t==null||t(n),r===!1||!n.defaultPrevented)return e==null?void 0:e(n)}}function Gy(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function n1(...t){return e=>{let r=!1;const s=t.map(n=>{const a=Gy(n,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let n=0;n<s.length;n++){const a=s[n];typeof a=="function"?a():Gy(t[n],null)}}}}function et(...t){return x.useCallback(n1(...t),t)}function kj(t,e){const r=x.createContext(e),s=a=>{const{children:o,...l}=a,c=x.useMemo(()=>l,Object.values(l));return i.jsx(r.Provider,{value:c,children:o})};s.displayName=t+"Provider";function n(a){const o=x.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[s,n]}function fs(t,e=[]){let r=[];function s(a,o){const l=x.createContext(o),c=r.length;r=[...r,o];const u=h=>{var g;const{scope:v,children:p,...w}=h,f=((g=v==null?void 0:v[t])==null?void 0:g[c])||l,m=x.useMemo(()=>w,Object.values(w));return i.jsx(f.Provider,{value:m,children:p})};u.displayName=a+"Provider";function d(h,v){var f;const p=((f=v==null?void 0:v[t])==null?void 0:f[c])||l,w=x.useContext(p);if(w)return w;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[u,d]}const n=()=>{const a=r.map(o=>x.createContext(o));return function(l){const c=(l==null?void 0:l[t])||a;return x.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return n.scopeName=t,[s,Nj(n,...e)]}function Nj(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const s=t.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(a){const o=s.reduce((l,{useScope:c,scopeName:u})=>{const h=c(a)[`__scope${u}`];return{...l,...h}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function fi(t){const e=Rj(t),r=x.forwardRef((s,n)=>{const{children:a,...o}=s,l=x.Children.toArray(a),c=l.find(Aj);if(c){const u=c.props.children,d=l.map(h=>h===c?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:h);return i.jsx(e,{...o,ref:n,children:x.isValidElement(u)?x.cloneElement(u,void 0,d):null})}return i.jsx(e,{...o,ref:n,children:a})});return r.displayName=`${t}.Slot`,r}var jj=fi("Slot");function Rj(t){const e=x.forwardRef((r,s)=>{const{children:n,...a}=r;if(x.isValidElement(n)){const o=Ij(n),l=Oj(a,n.props);return n.type!==x.Fragment&&(l.ref=s?n1(s,o):o),x.cloneElement(n,l)}return x.Children.count(n)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var s1=Symbol("radix.slottable");function Tj(t){const e=({children:r})=>i.jsx(i.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=s1,e}function Aj(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===s1}function Oj(t,e){const r={...e};for(const s in e){const n=t[s],a=e[s];/^on[A-Z]/.test(s)?n&&a?r[s]=(...l)=>{const c=a(...l);return n(...l),c}:n&&(r[s]=n):s==="style"?r[s]={...n,...a}:s==="className"&&(r[s]=[n,a].filter(Boolean).join(" "))}return{...t,...r}}function Ij(t){var s,n;let e=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function yv(t){const e=t+"CollectionProvider",[r,s]=fs(e),[n,a]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=f=>{const{scope:m,children:g}=f,y=vn.useRef(null),b=vn.useRef(new Map).current;return i.jsx(n,{scope:m,itemMap:b,collectionRef:y,children:g})};o.displayName=e;const l=t+"CollectionSlot",c=fi(l),u=vn.forwardRef((f,m)=>{const{scope:g,children:y}=f,b=a(l,g),S=et(m,b.collectionRef);return i.jsx(c,{ref:S,children:y})});u.displayName=l;const d=t+"CollectionItemSlot",h="data-radix-collection-item",v=fi(d),p=vn.forwardRef((f,m)=>{const{scope:g,children:y,...b}=f,S=vn.useRef(null),E=et(m,S),P=a(d,g);return vn.useEffect(()=>(P.itemMap.set(S,{ref:S,...b}),()=>void P.itemMap.delete(S))),i.jsx(v,{[h]:"",ref:E,children:y})});p.displayName=d;function w(f){const m=a(t+"CollectionConsumer",f);return vn.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${h}]`));return Array.from(m.itemMap.values()).sort((P,R)=>b.indexOf(P.ref.current)-b.indexOf(R.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:o,Slot:u,ItemSlot:p},w,s]}var Dj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=Dj.reduce((t,e)=>{const r=fi(`Primitive.${e}`),s=x.forwardRef((n,a)=>{const{asChild:o,...l}=n,c=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:a})});return s.displayName=`Primitive.${e}`,{...t,[e]:s}},{});function a1(t,e){t&&so.flushSync(()=>t.dispatchEvent(e))}function Ur(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...r)=>{var s;return(s=e.current)==null?void 0:s.call(e,...r)},[])}function Mj(t,e=globalThis==null?void 0:globalThis.document){const r=Ur(t);x.useEffect(()=>{const s=n=>{n.key==="Escape"&&r(n)};return e.addEventListener("keydown",s,{capture:!0}),()=>e.removeEventListener("keydown",s,{capture:!0})},[r,e])}var $j="DismissableLayer",cp="dismissableLayer.update",Fj="dismissableLayer.pointerDownOutside",Lj="dismissableLayer.focusOutside",Zy,o1=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vl=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:n,onFocusOutside:a,onInteractOutside:o,onDismiss:l,...c}=t,u=x.useContext(o1),[d,h]=x.useState(null),v=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=x.useState({}),w=et(e,R=>h(R)),f=Array.from(u.layers),[m]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=f.indexOf(m),y=d?f.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,S=y>=g,E=zj(R=>{const T=R.target,N=[...u.branches].some(O=>O.contains(T));!S||N||(n==null||n(R),o==null||o(R),R.defaultPrevented||l==null||l())},v),P=Vj(R=>{const T=R.target;[...u.branches].some(O=>O.contains(T))||(a==null||a(R),o==null||o(R),R.defaultPrevented||l==null||l())},v);return Mj(R=>{y===u.layers.size-1&&(s==null||s(R),!R.defaultPrevented&&l&&(R.preventDefault(),l()))},v),x.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Zy=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Yy(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=Zy)}},[d,v,r,u]),x.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Yy())},[d,u]),x.useEffect(()=>{const R=()=>p({});return document.addEventListener(cp,R),()=>document.removeEventListener(cp,R)},[]),i.jsx(Ae.div,{...c,ref:w,style:{pointerEvents:b?S?"auto":"none":void 0,...t.style},onFocusCapture:_e(t.onFocusCapture,P.onFocusCapture),onBlurCapture:_e(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:_e(t.onPointerDownCapture,E.onPointerDownCapture)})});Vl.displayName=$j;var Uj="DismissableLayerBranch",i1=x.forwardRef((t,e)=>{const r=x.useContext(o1),s=x.useRef(null),n=et(e,s);return x.useEffect(()=>{const a=s.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),i.jsx(Ae.div,{...t,ref:n})});i1.displayName=Uj;function zj(t,e=globalThis==null?void 0:globalThis.document){const r=Ur(t),s=x.useRef(!1),n=x.useRef(()=>{});return x.useEffect(()=>{const a=l=>{if(l.target&&!s.current){let c=function(){l1(Fj,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",n.current),n.current=c,e.addEventListener("click",n.current,{once:!0})):c()}else e.removeEventListener("click",n.current);s.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",a),e.removeEventListener("click",n.current)}},[e,r]),{onPointerDownCapture:()=>s.current=!0}}function Vj(t,e=globalThis==null?void 0:globalThis.document){const r=Ur(t),s=x.useRef(!1);return x.useEffect(()=>{const n=a=>{a.target&&!s.current&&l1(Lj,r,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",n),()=>e.removeEventListener("focusin",n)},[e,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Yy(){const t=new CustomEvent(cp);document.dispatchEvent(t)}function l1(t,e,r,{discrete:s}){const n=r.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&n.addEventListener(t,e,{once:!0}),s?a1(n,a):n.dispatchEvent(a)}var Hj=Vl,qj=i1,Bt=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},Bj="Portal",Cd=x.forwardRef((t,e)=>{var l;const{container:r,...s}=t,[n,a]=x.useState(!1);Bt(()=>a(!0),[]);const o=r||n&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?lN.createPortal(i.jsx(Ae.div,{...s,ref:e}),o):null});Cd.displayName=Bj;function Wj(t,e){return x.useReducer((r,s)=>e[r][s]??r,t)}var da=t=>{const{present:e,children:r}=t,s=Kj(e),n=typeof r=="function"?r({present:s.isPresent}):x.Children.only(r),a=et(s.ref,Qj(n));return typeof r=="function"||s.isPresent?x.cloneElement(n,{ref:a}):null};da.displayName="Presence";function Kj(t){const[e,r]=x.useState(),s=x.useRef(null),n=x.useRef(t),a=x.useRef("none"),o=t?"mounted":"unmounted",[l,c]=Wj(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=_c(s.current);a.current=l==="mounted"?u:"none"},[l]),Bt(()=>{const u=s.current,d=n.current;if(d!==t){const v=a.current,p=_c(u);t?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&v!==p?"ANIMATION_OUT":"UNMOUNT"),n.current=t}},[t,c]),Bt(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,h=p=>{const f=_c(s.current).includes(CSS.escape(p.animationName));if(p.target===e&&f&&(c("ANIMATION_END"),!n.current)){const m=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=m)})}},v=p=>{p.target===e&&(a.current=_c(s.current))};return e.addEventListener("animationstart",v),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",v),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(u=>{s.current=u?getComputedStyle(u):null,r(u)},[])}}function _c(t){return(t==null?void 0:t.animationName)||"none"}function Qj(t){var s,n;let e=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(n=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Gj=bm[" useInsertionEffect ".trim().toString()]||Bt;function Ka({prop:t,defaultProp:e,onChange:r=()=>{},caller:s}){const[n,a,o]=Zj({defaultProp:e,onChange:r}),l=t!==void 0,c=l?t:n;{const d=x.useRef(t!==void 0);x.useEffect(()=>{const h=d.current;h!==l&&console.warn(`${s} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,s])}const u=x.useCallback(d=>{var h;if(l){const v=Yj(d)?d(t):d;v!==t&&((h=o.current)==null||h.call(o,v))}else a(d)},[l,t,a,o]);return[c,u]}function Zj({defaultProp:t,onChange:e}){const[r,s]=x.useState(t),n=x.useRef(r),a=x.useRef(e);return Gj(()=>{a.current=e},[e]),x.useEffect(()=>{var o;n.current!==r&&((o=a.current)==null||o.call(a,r),n.current=r)},[r,n]),[r,s,a]}function Yj(t){return typeof t=="function"}var c1=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Jj="VisuallyHidden",Pd=x.forwardRef((t,e)=>i.jsx(Ae.span,{...t,ref:e,style:{...c1,...t.style}}));Pd.displayName=Jj;var Xj=Pd,xv="ToastProvider",[wv,e2,t2]=yv("Toast"),[u1,zF]=fs("Toast",[t2]),[r2,kd]=u1(xv),d1=t=>{const{__scopeToast:e,label:r="Notification",duration:s=5e3,swipeDirection:n="right",swipeThreshold:a=50,children:o}=t,[l,c]=x.useState(null),[u,d]=x.useState(0),h=x.useRef(!1),v=x.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${xv}\`. Expected non-empty \`string\`.`),i.jsx(wv.Provider,{scope:e,children:i.jsx(r2,{scope:e,label:r,duration:s,swipeDirection:n,swipeThreshold:a,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:x.useCallback(()=>d(p=>p+1),[]),onToastRemove:x.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:v,children:o})})};d1.displayName=xv;var f1="ToastViewport",n2=["F8"],up="toast.viewportPause",dp="toast.viewportResume",h1=x.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:s=n2,label:n="Notifications ({hotkey})",...a}=t,o=kd(f1,r),l=e2(r),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),h=x.useRef(null),v=et(e,h,o.onViewportChange),p=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=o.toastCount>0;x.useEffect(()=>{const m=g=>{var b;s.length!==0&&s.every(S=>g[S]||g.code===S)&&((b=h.current)==null||b.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[s]),x.useEffect(()=>{const m=c.current,g=h.current;if(w&&m&&g){const y=()=>{if(!o.isClosePausedRef.current){const P=new CustomEvent(up);g.dispatchEvent(P),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const P=new CustomEvent(dp);g.dispatchEvent(P),o.isClosePausedRef.current=!1}},S=P=>{!m.contains(P.relatedTarget)&&b()},E=()=>{m.contains(document.activeElement)||b()};return m.addEventListener("focusin",y),m.addEventListener("focusout",S),m.addEventListener("pointermove",y),m.addEventListener("pointerleave",E),window.addEventListener("blur",y),window.addEventListener("focus",b),()=>{m.removeEventListener("focusin",y),m.removeEventListener("focusout",S),m.removeEventListener("pointermove",y),m.removeEventListener("pointerleave",E),window.removeEventListener("blur",y),window.removeEventListener("focus",b)}}},[w,o.isClosePausedRef]);const f=x.useCallback(({tabbingDirection:m})=>{const y=l().map(b=>{const S=b.ref.current,E=[S,...v2(S)];return m==="forwards"?E:E.reverse()});return(m==="forwards"?y.reverse():y).flat()},[l]);return x.useEffect(()=>{const m=h.current;if(m){const g=y=>{var E,P,R;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const T=document.activeElement,N=y.shiftKey;if(y.target===m&&N){(E=u.current)==null||E.focus();return}const _=f({tabbingDirection:N?"backwards":"forwards"}),A=_.findIndex(C=>C===T);Of(_.slice(A+1))?y.preventDefault():N?(P=u.current)==null||P.focus():(R=d.current)==null||R.focus()}};return m.addEventListener("keydown",g),()=>m.removeEventListener("keydown",g)}},[l,f]),i.jsxs(qj,{ref:c,role:"region","aria-label":n.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&i.jsx(fp,{ref:u,onFocusFromOutsideViewport:()=>{const m=f({tabbingDirection:"forwards"});Of(m)}}),i.jsx(wv.Slot,{scope:r,children:i.jsx(Ae.ol,{tabIndex:-1,...a,ref:v})}),w&&i.jsx(fp,{ref:d,onFocusFromOutsideViewport:()=>{const m=f({tabbingDirection:"backwards"});Of(m)}})]})});h1.displayName=f1;var p1="ToastFocusProxy",fp=x.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:s,...n}=t,a=kd(p1,r);return i.jsx(Pd,{tabIndex:0,...n,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&s()}})});fp.displayName=p1;var Hl="Toast",s2="toast.swipeStart",a2="toast.swipeMove",o2="toast.swipeCancel",i2="toast.swipeEnd",m1=x.forwardRef((t,e)=>{const{forceMount:r,open:s,defaultOpen:n,onOpenChange:a,...o}=t,[l,c]=Ka({prop:s,defaultProp:n??!0,onChange:a,caller:Hl});return i.jsx(da,{present:r||l,children:i.jsx(u2,{open:l,...o,ref:e,onClose:()=>c(!1),onPause:Ur(t.onPause),onResume:Ur(t.onResume),onSwipeStart:_e(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:_e(t.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:_e(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:_e(t.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});m1.displayName=Hl;var[l2,c2]=u1(Hl,{onClose(){}}),u2=x.forwardRef((t,e)=>{const{__scopeToast:r,type:s="foreground",duration:n,open:a,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:v,onSwipeEnd:p,...w}=t,f=kd(Hl,r),[m,g]=x.useState(null),y=et(e,C=>g(C)),b=x.useRef(null),S=x.useRef(null),E=n||f.duration,P=x.useRef(0),R=x.useRef(E),T=x.useRef(0),{onToastAdd:N,onToastRemove:O}=f,j=Ur(()=>{var z;(m==null?void 0:m.contains(document.activeElement))&&((z=f.viewport)==null||z.focus()),o()}),_=x.useCallback(C=>{!C||C===1/0||(window.clearTimeout(T.current),P.current=new Date().getTime(),T.current=window.setTimeout(j,C))},[j]);x.useEffect(()=>{const C=f.viewport;if(C){const z=()=>{_(R.current),u==null||u()},U=()=>{const K=new Date().getTime()-P.current;R.current=R.current-K,window.clearTimeout(T.current),c==null||c()};return C.addEventListener(up,U),C.addEventListener(dp,z),()=>{C.removeEventListener(up,U),C.removeEventListener(dp,z)}}},[f.viewport,E,c,u,_]),x.useEffect(()=>{a&&!f.isClosePausedRef.current&&_(E)},[a,E,f.isClosePausedRef,_]),x.useEffect(()=>(N(),()=>O()),[N,O]);const A=x.useMemo(()=>m?S1(m):null,[m]);return f.viewport?i.jsxs(i.Fragment,{children:[A&&i.jsx(d2,{__scopeToast:r,role:"status","aria-live":s==="foreground"?"assertive":"polite",children:A}),i.jsx(l2,{scope:r,onClose:j,children:so.createPortal(i.jsx(wv.ItemSlot,{scope:r,children:i.jsx(Hj,{asChild:!0,onEscapeKeyDown:_e(l,()=>{f.isFocusedToastEscapeKeyDownRef.current||j(),f.isFocusedToastEscapeKeyDownRef.current=!1}),children:i.jsx(Ae.li,{tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":f.swipeDirection,...w,ref:y,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:_e(t.onKeyDown,C=>{C.key==="Escape"&&(l==null||l(C.nativeEvent),C.nativeEvent.defaultPrevented||(f.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:_e(t.onPointerDown,C=>{C.button===0&&(b.current={x:C.clientX,y:C.clientY})}),onPointerMove:_e(t.onPointerMove,C=>{if(!b.current)return;const z=C.clientX-b.current.x,U=C.clientY-b.current.y,K=!!S.current,$=["left","right"].includes(f.swipeDirection),F=["left","up"].includes(f.swipeDirection)?Math.min:Math.max,V=$?F(0,z):0,ae=$?0:F(0,U),se=C.pointerType==="touch"?10:2,W={x:V,y:ae},L={originalEvent:C,delta:W};K?(S.current=W,Ec(a2,h,L,{discrete:!1})):Jy(W,f.swipeDirection,se)?(S.current=W,Ec(s2,d,L,{discrete:!1}),C.target.setPointerCapture(C.pointerId)):(Math.abs(z)>se||Math.abs(U)>se)&&(b.current=null)}),onPointerUp:_e(t.onPointerUp,C=>{const z=S.current,U=C.target;if(U.hasPointerCapture(C.pointerId)&&U.releasePointerCapture(C.pointerId),S.current=null,b.current=null,z){const K=C.currentTarget,$={originalEvent:C,delta:z};Jy(z,f.swipeDirection,f.swipeThreshold)?Ec(i2,p,$,{discrete:!0}):Ec(o2,v,$,{discrete:!0}),K.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),f.viewport)})]}):null}),d2=t=>{const{__scopeToast:e,children:r,...s}=t,n=kd(Hl,e),[a,o]=x.useState(!1),[l,c]=x.useState(!1);return p2(()=>o(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:i.jsx(Cd,{asChild:!0,children:i.jsx(Pd,{...s,children:a&&i.jsxs(i.Fragment,{children:[n.label," ",r]})})})},f2="ToastTitle",v1=x.forwardRef((t,e)=>{const{__scopeToast:r,...s}=t;return i.jsx(Ae.div,{...s,ref:e})});v1.displayName=f2;var h2="ToastDescription",g1=x.forwardRef((t,e)=>{const{__scopeToast:r,...s}=t;return i.jsx(Ae.div,{...s,ref:e})});g1.displayName=h2;var y1="ToastAction",x1=x.forwardRef((t,e)=>{const{altText:r,...s}=t;return r.trim()?i.jsx(b1,{altText:r,asChild:!0,children:i.jsx(bv,{...s,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${y1}\`. Expected non-empty \`string\`.`),null)});x1.displayName=y1;var w1="ToastClose",bv=x.forwardRef((t,e)=>{const{__scopeToast:r,...s}=t,n=c2(w1,r);return i.jsx(b1,{asChild:!0,children:i.jsx(Ae.button,{type:"button",...s,ref:e,onClick:_e(t.onClick,n.onClose)})})});bv.displayName=w1;var b1=x.forwardRef((t,e)=>{const{__scopeToast:r,altText:s,...n}=t;return i.jsx(Ae.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":s||void 0,...n,ref:e})});function S1(t){const e=[];return Array.from(t.childNodes).forEach(s=>{if(s.nodeType===s.TEXT_NODE&&s.textContent&&e.push(s.textContent),m2(s)){const n=s.ariaHidden||s.hidden||s.style.display==="none",a=s.dataset.radixToastAnnounceExclude==="";if(!n)if(a){const o=s.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...S1(s))}}),e}function Ec(t,e,r,{discrete:s}){const n=r.originalEvent.currentTarget,a=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&n.addEventListener(t,e,{once:!0}),s?a1(n,a):n.dispatchEvent(a)}var Jy=(t,e,r=0)=>{const s=Math.abs(t.x),n=Math.abs(t.y),a=s>n;return e==="left"||e==="right"?a&&s>r:!a&&n>r};function p2(t=()=>{}){const e=Ur(t);Bt(()=>{let r=0,s=0;return r=window.requestAnimationFrame(()=>s=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(s)}},[e])}function m2(t){return t.nodeType===t.ELEMENT_NODE}function v2(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const n=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||n?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Of(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var g2=d1,_1=h1,E1=m1,C1=v1,P1=g1,k1=x1,N1=bv;function j1(t){var e,r,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;e<n;e++)t[e]&&(r=j1(t[e]))&&(s&&(s+=" "),s+=r)}else for(r in t)t[r]&&(s&&(s+=" "),s+=r);return s}function R1(){for(var t,e,r=0,s="",n=arguments.length;r<n;r++)(t=arguments[r])&&(e=j1(t))&&(s&&(s+=" "),s+=e);return s}const Xy=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,e0=R1,Nd=(t,e)=>r=>{var s;if((e==null?void 0:e.variants)==null)return e0(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:n,defaultVariants:a}=e,o=Object.keys(n).map(u=>{const d=r==null?void 0:r[u],h=a==null?void 0:a[u];if(d===null)return null;const v=Xy(d)||Xy(h);return n[u][v]}),l=r&&Object.entries(r).reduce((u,d)=>{let[h,v]=d;return v===void 0||(u[h]=v),u},{}),c=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((u,d)=>{let{class:h,className:v,...p}=d;return Object.entries(p).every(w=>{let[f,m]=w;return Array.isArray(m)?m.includes({...a,...l}[f]):{...a,...l}[f]===m})?[...u,h,v]:u},[]);return e0(t,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
|
|
49
|
-
* @license lucide-react v0.453.0 - ISC
|
|
50
|
-
*
|
|
51
|
-
* This source code is licensed under the ISC license.
|
|
52
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
-
*/const y2=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),T1=(...t)=>t.filter((e,r,s)=>!!e&&s.indexOf(e)===r).join(" ");/**
|
|
54
|
-
* @license lucide-react v0.453.0 - ISC
|
|
55
|
-
*
|
|
56
|
-
* This source code is licensed under the ISC license.
|
|
57
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
58
|
-
*/var x2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
59
|
-
* @license lucide-react v0.453.0 - ISC
|
|
60
|
-
*
|
|
61
|
-
* This source code is licensed under the ISC license.
|
|
62
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
-
*/const w2=x.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:n="",children:a,iconNode:o,...l},c)=>x.createElement("svg",{ref:c,...x2,width:e,height:e,stroke:t,strokeWidth:s?Number(r)*24/Number(e):r,className:T1("lucide",n),...l},[...o.map(([u,d])=>x.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
|
|
64
|
-
* @license lucide-react v0.453.0 - ISC
|
|
65
|
-
*
|
|
66
|
-
* This source code is licensed under the ISC license.
|
|
67
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
68
|
-
*/const Ye=(t,e)=>{const r=x.forwardRef(({className:s,...n},a)=>x.createElement(w2,{ref:a,iconNode:e,className:T1(`lucide-${y2(t)}`,s),...n}));return r.displayName=`${t}`,r};/**
|
|
69
|
-
* @license lucide-react v0.453.0 - ISC
|
|
70
|
-
*
|
|
71
|
-
* This source code is licensed under the ISC license.
|
|
72
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
-
*/const b2=Ye("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
74
|
-
* @license lucide-react v0.453.0 - ISC
|
|
75
|
-
*
|
|
76
|
-
* This source code is licensed under the ISC license.
|
|
77
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/const A1=Ye("Bolt",[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
|
|
79
|
-
* @license lucide-react v0.453.0 - ISC
|
|
80
|
-
*
|
|
81
|
-
* This source code is licensed under the ISC license.
|
|
82
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
-
*/const Sv=Ye("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
84
|
-
* @license lucide-react v0.453.0 - ISC
|
|
85
|
-
*
|
|
86
|
-
* This source code is licensed under the ISC license.
|
|
87
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/const S2=Ye("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
89
|
-
* @license lucide-react v0.453.0 - ISC
|
|
90
|
-
*
|
|
91
|
-
* This source code is licensed under the ISC license.
|
|
92
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
-
*/const If=Ye("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
|
|
94
|
-
* @license lucide-react v0.453.0 - ISC
|
|
95
|
-
*
|
|
96
|
-
* This source code is licensed under the ISC license.
|
|
97
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/const O1=Ye("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
99
|
-
* @license lucide-react v0.453.0 - ISC
|
|
100
|
-
*
|
|
101
|
-
* This source code is licensed under the ISC license.
|
|
102
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
-
*/const _v=Ye("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
104
|
-
* @license lucide-react v0.453.0 - ISC
|
|
105
|
-
*
|
|
106
|
-
* This source code is licensed under the ISC license.
|
|
107
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/const _2=Ye("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
109
|
-
* @license lucide-react v0.453.0 - ISC
|
|
110
|
-
*
|
|
111
|
-
* This source code is licensed under the ISC license.
|
|
112
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
-
*/const E2=Ye("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
114
|
-
* @license lucide-react v0.453.0 - ISC
|
|
115
|
-
*
|
|
116
|
-
* This source code is licensed under the ISC license.
|
|
117
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/const C2=Ye("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
119
|
-
* @license lucide-react v0.453.0 - ISC
|
|
120
|
-
*
|
|
121
|
-
* This source code is licensed under the ISC license.
|
|
122
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
-
*/const I1=Ye("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
|
|
124
|
-
* @license lucide-react v0.453.0 - ISC
|
|
125
|
-
*
|
|
126
|
-
* This source code is licensed under the ISC license.
|
|
127
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/const hp=Ye("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
129
|
-
* @license lucide-react v0.453.0 - ISC
|
|
130
|
-
*
|
|
131
|
-
* This source code is licensed under the ISC license.
|
|
132
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/const t0=Ye("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
134
|
-
* @license lucide-react v0.453.0 - ISC
|
|
135
|
-
*
|
|
136
|
-
* This source code is licensed under the ISC license.
|
|
137
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/const P2=Ye("ClipboardPaste",[["path",{d:"M15 2H9a1 1 0 0 0-1 1v2c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V3c0-.6-.4-1-1-1Z",key:"1pp7kr"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2M16 4h2a2 2 0 0 1 2 2v2M11 14h10",key:"2ik1ml"}],["path",{d:"m17 10 4 4-4 4",key:"vp2hj1"}]]);/**
|
|
139
|
-
* @license lucide-react v0.453.0 - ISC
|
|
140
|
-
*
|
|
141
|
-
* This source code is licensed under the ISC license.
|
|
142
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/const D1=Ye("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
144
|
-
* @license lucide-react v0.453.0 - ISC
|
|
145
|
-
*
|
|
146
|
-
* This source code is licensed under the ISC license.
|
|
147
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
-
*/const r0=Ye("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
149
|
-
* @license lucide-react v0.453.0 - ISC
|
|
150
|
-
*
|
|
151
|
-
* This source code is licensed under the ISC license.
|
|
152
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
-
*/const Jn=Ye("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
154
|
-
* @license lucide-react v0.453.0 - ISC
|
|
155
|
-
*
|
|
156
|
-
* This source code is licensed under the ISC license.
|
|
157
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
-
*/const k2=Ye("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
159
|
-
* @license lucide-react v0.453.0 - ISC
|
|
160
|
-
*
|
|
161
|
-
* This source code is licensed under the ISC license.
|
|
162
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
-
*/const pp=Ye("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
|
|
164
|
-
* @license lucide-react v0.453.0 - ISC
|
|
165
|
-
*
|
|
166
|
-
* This source code is licensed under the ISC license.
|
|
167
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
-
*/const Cc=Ye("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
169
|
-
* @license lucide-react v0.453.0 - ISC
|
|
170
|
-
*
|
|
171
|
-
* This source code is licensed under the ISC license.
|
|
172
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
-
*/const mp=Ye("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
|
174
|
-
* @license lucide-react v0.453.0 - ISC
|
|
175
|
-
*
|
|
176
|
-
* This source code is licensed under the ISC license.
|
|
177
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
-
*/const N2=Ye("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
179
|
-
* @license lucide-react v0.453.0 - ISC
|
|
180
|
-
*
|
|
181
|
-
* This source code is licensed under the ISC license.
|
|
182
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
-
*/const n0=Ye("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
184
|
-
* @license lucide-react v0.453.0 - ISC
|
|
185
|
-
*
|
|
186
|
-
* This source code is licensed under the ISC license.
|
|
187
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
-
*/const j2=Ye("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
189
|
-
* @license lucide-react v0.453.0 - ISC
|
|
190
|
-
*
|
|
191
|
-
* This source code is licensed under the ISC license.
|
|
192
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
-
*/const Vs=Ye("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
194
|
-
* @license lucide-react v0.453.0 - ISC
|
|
195
|
-
*
|
|
196
|
-
* This source code is licensed under the ISC license.
|
|
197
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
-
*/const M1=Ye("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
199
|
-
* @license lucide-react v0.453.0 - ISC
|
|
200
|
-
*
|
|
201
|
-
* This source code is licensed under the ISC license.
|
|
202
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
-
*/const Au=Ye("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
204
|
-
* @license lucide-react v0.453.0 - ISC
|
|
205
|
-
*
|
|
206
|
-
* This source code is licensed under the ISC license.
|
|
207
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
-
*/const R2=Ye("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
209
|
-
* @license lucide-react v0.453.0 - ISC
|
|
210
|
-
*
|
|
211
|
-
* This source code is licensed under the ISC license.
|
|
212
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
-
*/const jd=Ye("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
214
|
-
* @license lucide-react v0.453.0 - ISC
|
|
215
|
-
*
|
|
216
|
-
* This source code is licensed under the ISC license.
|
|
217
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
-
*/const tn=Ye("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
219
|
-
* @license lucide-react v0.453.0 - ISC
|
|
220
|
-
*
|
|
221
|
-
* This source code is licensed under the ISC license.
|
|
222
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
-
*/const T2=Ye("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
|
|
224
|
-
* @license lucide-react v0.453.0 - ISC
|
|
225
|
-
*
|
|
226
|
-
* This source code is licensed under the ISC license.
|
|
227
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
-
*/const Ou=Ye("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
229
|
-
* @license lucide-react v0.453.0 - ISC
|
|
230
|
-
*
|
|
231
|
-
* This source code is licensed under the ISC license.
|
|
232
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
-
*/const Iu=Ye("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ev="-",A2=t=>{const e=I2(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:o=>{const l=o.split(Ev);return l[0]===""&&l.length!==1&&l.shift(),$1(l,e)||O2(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&s[o]?[...c,...s[o]]:c}}},$1=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],s=e.nextPart.get(r),n=s?$1(t.slice(1),s):void 0;if(n)return n;if(e.validators.length===0)return;const a=t.join(Ev);return(o=e.validators.find(({validator:l})=>l(a)))==null?void 0:o.classGroupId},s0=/^\[(.+)\]$/,O2=t=>{if(s0.test(t)){const e=s0.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},I2=t=>{const{theme:e,prefix:r}=t,s={nextPart:new Map,validators:[]};return M2(Object.entries(t.classGroups),r).forEach(([a,o])=>{vp(o,s,a,e)}),s},vp=(t,e,r,s)=>{t.forEach(n=>{if(typeof n=="string"){const a=n===""?e:a0(e,n);a.classGroupId=r;return}if(typeof n=="function"){if(D2(n)){vp(n(s),e,r,s);return}e.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([a,o])=>{vp(o,a0(e,a),r,s)})})},a0=(t,e)=>{let r=t;return e.split(Ev).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},D2=t=>t.isThemeGetter,M2=(t,e)=>e?t.map(([r,s])=>{const n=s.map(a=>typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,l])=>[e+o,l])):a);return[r,n]}):t,$2=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,s=new Map;const n=(a,o)=>{r.set(a,o),e++,e>t&&(e=0,s=r,r=new Map)};return{get(a){let o=r.get(a);if(o!==void 0)return o;if((o=s.get(a))!==void 0)return n(a,o),o},set(a,o){r.has(a)?r.set(a,o):n(a,o)}}},F1="!",F2=t=>{const{separator:e,experimentalParseClassName:r}=t,s=e.length===1,n=e[0],a=e.length,o=l=>{const c=[];let u=0,d=0,h;for(let m=0;m<l.length;m++){let g=l[m];if(u===0){if(g===n&&(s||l.slice(m,m+a)===e)){c.push(l.slice(d,m)),d=m+a;continue}if(g==="/"){h=m;continue}}g==="["?u++:g==="]"&&u--}const v=c.length===0?l:l.substring(d),p=v.startsWith(F1),w=p?v.substring(1):v,f=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:f}};return r?l=>r({className:l,parseClassName:o}):o},L2=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(s=>{s[0]==="["?(e.push(...r.sort(),s),r=[]):r.push(s)}),e.push(...r.sort()),e},U2=t=>({cache:$2(t.cacheSize),parseClassName:F2(t),...A2(t)}),z2=/\s+/,V2=(t,e)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:n}=e,a=[],o=t.trim().split(z2);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:h,baseClassName:v,maybePostfixModifierPosition:p}=r(u);let w=!!p,f=s(w?v.substring(0,p):v);if(!f){if(!w){l=u+(l.length>0?" "+l:l);continue}if(f=s(v),!f){l=u+(l.length>0?" "+l:l);continue}w=!1}const m=L2(d).join(":"),g=h?m+F1:m,y=g+f;if(a.includes(y))continue;a.push(y);const b=n(f,w);for(let S=0;S<b.length;++S){const E=b[S];a.push(g+E)}l=u+(l.length>0?" "+l:l)}return l};function H2(){let t=0,e,r,s="";for(;t<arguments.length;)(e=arguments[t++])&&(r=L1(e))&&(s&&(s+=" "),s+=r);return s}const L1=t=>{if(typeof t=="string")return t;let e,r="";for(let s=0;s<t.length;s++)t[s]&&(e=L1(t[s]))&&(r&&(r+=" "),r+=e);return r};function q2(t,...e){let r,s,n,a=o;function o(c){const u=e.reduce((d,h)=>h(d),t());return r=U2(u),s=r.cache.get,n=r.cache.set,a=l,l(c)}function l(c){const u=s(c);if(u)return u;const d=V2(c,r);return n(c,d),d}return function(){return a(H2.apply(null,arguments))}}const it=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},U1=/^\[(?:([a-z-]+):)?(.+)\]$/i,B2=/^\d+\/\d+$/,W2=new Set(["px","full","screen"]),K2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Q2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,G2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Z2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Y2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Un=t=>Uo(t)||W2.has(t)||B2.test(t),xs=t=>Si(t,"length",aR),Uo=t=>!!t&&!Number.isNaN(Number(t)),Df=t=>Si(t,"number",Uo),Fi=t=>!!t&&Number.isInteger(Number(t)),J2=t=>t.endsWith("%")&&Uo(t.slice(0,-1)),$e=t=>U1.test(t),ws=t=>K2.test(t),X2=new Set(["length","size","percentage"]),eR=t=>Si(t,X2,z1),tR=t=>Si(t,"position",z1),rR=new Set(["image","url"]),nR=t=>Si(t,rR,iR),sR=t=>Si(t,"",oR),Li=()=>!0,Si=(t,e,r)=>{const s=U1.exec(t);return s?s[1]?typeof e=="string"?s[1]===e:e.has(s[1]):r(s[2]):!1},aR=t=>Q2.test(t)&&!G2.test(t),z1=()=>!1,oR=t=>Z2.test(t),iR=t=>Y2.test(t),lR=()=>{const t=it("colors"),e=it("spacing"),r=it("blur"),s=it("brightness"),n=it("borderColor"),a=it("borderRadius"),o=it("borderSpacing"),l=it("borderWidth"),c=it("contrast"),u=it("grayscale"),d=it("hueRotate"),h=it("invert"),v=it("gap"),p=it("gradientColorStops"),w=it("gradientColorStopPositions"),f=it("inset"),m=it("margin"),g=it("opacity"),y=it("padding"),b=it("saturate"),S=it("scale"),E=it("sepia"),P=it("skew"),R=it("space"),T=it("translate"),N=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",$e,e],_=()=>[$e,e],A=()=>["",Un,xs],C=()=>["auto",Uo,$e],z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",$e],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ae=()=>[Uo,$e];return{cacheSize:500,separator:":",theme:{colors:[Li],spacing:[Un,xs],blur:["none","",ws,$e],brightness:ae(),borderColor:[t],borderRadius:["none","","full",ws,$e],borderSpacing:_(),borderWidth:A(),contrast:ae(),grayscale:F(),hueRotate:ae(),invert:F(),gap:_(),gradientColorStops:[t],gradientColorStopPositions:[J2,xs],inset:j(),margin:j(),opacity:ae(),padding:_(),saturate:ae(),scale:ae(),sepia:F(),skew:ae(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[ws]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...z(),$e]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[f]}],"inset-x":[{"inset-x":[f]}],"inset-y":[{"inset-y":[f]}],start:[{start:[f]}],end:[{end:[f]}],top:[{top:[f]}],right:[{right:[f]}],bottom:[{bottom:[f]}],left:[{left:[f]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Fi,$e]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",Fi,$e]}],"grid-cols":[{"grid-cols":[Li]}],"col-start-end":[{col:["auto",{span:["full",Fi,$e]},$e]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[Li]}],"row-start-end":[{row:["auto",{span:[Fi,$e]},$e]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[m]}],mx:[{mx:[m]}],my:[{my:[m]}],ms:[{ms:[m]}],me:[{me:[m]}],mt:[{mt:[m]}],mr:[{mr:[m]}],mb:[{mb:[m]}],ml:[{ml:[m]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,e]}],"min-w":[{"min-w":[$e,e,"min","max","fit"]}],"max-w":[{"max-w":[$e,e,"none","full","min","max","fit","prose",{screen:[ws]},ws]}],h:[{h:[$e,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,e,"auto","min","max","fit"]}],"font-size":[{text:["base",ws,xs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Df]}],"font-family":[{font:[Li]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$e]}],"line-clamp":[{"line-clamp":["none",Uo,Df]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Un,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Un,xs]}],"underline-offset":[{"underline-offset":["auto",Un,$e]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...z(),tR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",eR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nR]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:U()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Un,$e]}],"outline-w":[{outline:[Un,xs]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Un,xs]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",ws,sR]}],"shadow-color":[{shadow:[Li]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",ws,$e]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[b]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:ae()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Fi,$e]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Un,xs,Df]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},cR=q2(lR);function Te(...t){return cR(R1(t))}const uR=g2,V1=x.forwardRef(({className:t,...e},r)=>i.jsx(_1,{ref:r,className:Te("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));V1.displayName=_1.displayName;const dR=Nd("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),H1=x.forwardRef(({className:t,variant:e,...r},s)=>i.jsx(E1,{ref:s,className:Te(dR({variant:e}),t),...r}));H1.displayName=E1.displayName;const fR=x.forwardRef(({className:t,...e},r)=>i.jsx(k1,{ref:r,className:Te("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));fR.displayName=k1.displayName;const q1=x.forwardRef(({className:t,...e},r)=>i.jsx(N1,{ref:r,className:Te("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:i.jsx(Iu,{className:"h-4 w-4"})}));q1.displayName=N1.displayName;const B1=x.forwardRef(({className:t,...e},r)=>i.jsx(C1,{ref:r,className:Te("text-sm font-semibold",t),...e}));B1.displayName=C1.displayName;const W1=x.forwardRef(({className:t,...e},r)=>i.jsx(P1,{ref:r,className:Te("text-sm opacity-90",t),...e}));W1.displayName=P1.displayName;function hR(){const{toasts:t}=or();return i.jsxs(uR,{children:[t.map(function({id:e,title:r,description:s,action:n,...a}){return i.jsxs(H1,{...a,children:[i.jsxs("div",{className:"grid gap-1",children:[r&&i.jsx(B1,{children:r}),s&&i.jsx(W1,{children:s})]}),n,i.jsx(q1,{})]},e)}),i.jsx(V1,{})]})}var pR=bm[" useId ".trim().toString()]||(()=>{}),mR=0;function ea(t){const[e,r]=x.useState(pR());return Bt(()=>{r(s=>s??String(mR++))},[t]),e?`radix-${e}`:""}const vR=["top","right","bottom","left"],aa=Math.min,Sr=Math.max,Du=Math.round,Pc=Math.floor,jn=t=>({x:t,y:t}),gR={left:"right",right:"left",bottom:"top",top:"bottom"},yR={start:"end",end:"start"};function gp(t,e,r){return Sr(t,aa(e,r))}function is(t,e){return typeof t=="function"?t(e):t}function ls(t){return t.split("-")[0]}function _i(t){return t.split("-")[1]}function Cv(t){return t==="x"?"y":"x"}function Pv(t){return t==="y"?"height":"width"}const xR=new Set(["top","bottom"]);function Cn(t){return xR.has(ls(t))?"y":"x"}function kv(t){return Cv(Cn(t))}function wR(t,e,r){r===void 0&&(r=!1);const s=_i(t),n=kv(t),a=Pv(n);let o=n==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=Mu(o)),[o,Mu(o)]}function bR(t){const e=Mu(t);return[yp(t),e,yp(e)]}function yp(t){return t.replace(/start|end/g,e=>yR[e])}const o0=["left","right"],i0=["right","left"],SR=["top","bottom"],_R=["bottom","top"];function ER(t,e,r){switch(t){case"top":case"bottom":return r?e?i0:o0:e?o0:i0;case"left":case"right":return e?SR:_R;default:return[]}}function CR(t,e,r,s){const n=_i(t);let a=ER(ls(t),r==="start",s);return n&&(a=a.map(o=>o+"-"+n),e&&(a=a.concat(a.map(yp)))),a}function Mu(t){return t.replace(/left|right|bottom|top/g,e=>gR[e])}function PR(t){return{top:0,right:0,bottom:0,left:0,...t}}function K1(t){return typeof t!="number"?PR(t):{top:t,right:t,bottom:t,left:t}}function $u(t){const{x:e,y:r,width:s,height:n}=t;return{width:s,height:n,top:r,left:e,right:e+s,bottom:r+n,x:e,y:r}}function l0(t,e,r){let{reference:s,floating:n}=t;const a=Cn(e),o=kv(e),l=Pv(o),c=ls(e),u=a==="y",d=s.x+s.width/2-n.width/2,h=s.y+s.height/2-n.height/2,v=s[l]/2-n[l]/2;let p;switch(c){case"top":p={x:d,y:s.y-n.height};break;case"bottom":p={x:d,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-n.width,y:h};break;default:p={x:s.x,y:s.y}}switch(_i(e)){case"start":p[o]-=v*(r&&u?-1:1);break;case"end":p[o]+=v*(r&&u?-1:1);break}return p}const kR=async(t,e,r)=>{const{placement:s="bottom",strategy:n="absolute",middleware:a=[],platform:o}=r,l=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:n}),{x:d,y:h}=l0(u,s,c),v=s,p={},w=0;for(let f=0;f<l.length;f++){const{name:m,fn:g}=l[f],{x:y,y:b,data:S,reset:E}=await g({x:d,y:h,initialPlacement:s,placement:v,strategy:n,middlewareData:p,rects:u,platform:o,elements:{reference:t,floating:e}});d=y??d,h=b??h,p={...p,[m]:{...p[m],...S}},E&&w<=50&&(w++,typeof E=="object"&&(E.placement&&(v=E.placement),E.rects&&(u=E.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:n}):E.rects),{x:d,y:h}=l0(u,v,c)),f=-1)}return{x:d,y:h,placement:v,strategy:n,middlewareData:p}};async function Nl(t,e){var r;e===void 0&&(e={});const{x:s,y:n,platform:a,rects:o,elements:l,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:v=!1,padding:p=0}=is(e,t),w=K1(p),m=l[v?h==="floating"?"reference":"floating":h],g=$u(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(m)))==null||r?m:m.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),y=h==="floating"?{x:s,y:n,width:o.floating.width,height:o.floating.height}:o.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),S=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},E=$u(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:b,strategy:c}):y);return{top:(g.top-E.top+w.top)/S.y,bottom:(E.bottom-g.bottom+w.bottom)/S.y,left:(g.left-E.left+w.left)/S.x,right:(E.right-g.right+w.right)/S.x}}const NR=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:s,placement:n,rects:a,platform:o,elements:l,middlewareData:c}=e,{element:u,padding:d=0}=is(t,e)||{};if(u==null)return{};const h=K1(d),v={x:r,y:s},p=kv(n),w=Pv(p),f=await o.getDimensions(u),m=p==="y",g=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",S=a.reference[w]+a.reference[p]-v[p]-a.floating[w],E=v[p]-a.reference[p],P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let R=P?P[b]:0;(!R||!await(o.isElement==null?void 0:o.isElement(P)))&&(R=l.floating[b]||a.floating[w]);const T=S/2-E/2,N=R/2-f[w]/2-1,O=aa(h[g],N),j=aa(h[y],N),_=O,A=R-f[w]-j,C=R/2-f[w]/2+T,z=gp(_,C,A),U=!c.arrow&&_i(n)!=null&&C!==z&&a.reference[w]/2-(C<_?O:j)-f[w]/2<0,K=U?C<_?C-_:C-A:0;return{[p]:v[p]+K,data:{[p]:z,centerOffset:C-z-K,...U&&{alignmentOffset:K}},reset:U}}}),jR=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,s;const{placement:n,middlewareData:a,rects:o,initialPlacement:l,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:f=!0,...m}=is(t,e);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const g=ls(n),y=Cn(l),b=ls(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),E=v||(b||!f?[Mu(l)]:bR(l)),P=w!=="none";!v&&P&&E.push(...CR(l,f,w,S));const R=[l,...E],T=await Nl(e,m),N=[];let O=((s=a.flip)==null?void 0:s.overflows)||[];if(d&&N.push(T[g]),h){const C=wR(n,o,S);N.push(T[C[0]],T[C[1]])}if(O=[...O,{placement:n,overflows:N}],!N.every(C=>C<=0)){var j,_;const C=(((j=a.flip)==null?void 0:j.index)||0)+1,z=R[C];if(z&&(!(h==="alignment"?y!==Cn(z):!1)||O.every($=>Cn($.placement)===y?$.overflows[0]>0:!0)))return{data:{index:C,overflows:O},reset:{placement:z}};let U=(_=O.filter(K=>K.overflows[0]<=0).sort((K,$)=>K.overflows[1]-$.overflows[1])[0])==null?void 0:_.placement;if(!U)switch(p){case"bestFit":{var A;const K=(A=O.filter($=>{if(P){const F=Cn($.placement);return F===y||F==="y"}return!0}).map($=>[$.placement,$.overflows.filter(F=>F>0).reduce((F,V)=>F+V,0)]).sort(($,F)=>$[1]-F[1])[0])==null?void 0:A[0];K&&(U=K);break}case"initialPlacement":U=l;break}if(n!==U)return{reset:{placement:U}}}return{}}}};function c0(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function u0(t){return vR.some(e=>t[e]>=0)}const RR=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:s="referenceHidden",...n}=is(t,e);switch(s){case"referenceHidden":{const a=await Nl(e,{...n,elementContext:"reference"}),o=c0(a,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:u0(o)}}}case"escaped":{const a=await Nl(e,{...n,altBoundary:!0}),o=c0(a,r.floating);return{data:{escapedOffsets:o,escaped:u0(o)}}}default:return{}}}}},Q1=new Set(["left","top"]);async function TR(t,e){const{placement:r,platform:s,elements:n}=t,a=await(s.isRTL==null?void 0:s.isRTL(n.floating)),o=ls(r),l=_i(r),c=Cn(r)==="y",u=Q1.has(o)?-1:1,d=a&&c?-1:1,h=is(e,t);let{mainAxis:v,crossAxis:p,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof w=="number"&&(p=l==="end"?w*-1:w),c?{x:p*d,y:v*u}:{x:v*u,y:p*d}}const AR=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,s;const{x:n,y:a,placement:o,middlewareData:l}=e,c=await TR(e,t);return o===((r=l.offset)==null?void 0:r.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:n+c.x,y:a+c.y,data:{...c,placement:o}}}}},OR=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:s,placement:n}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:l={fn:m=>{let{x:g,y}=m;return{x:g,y}}},...c}=is(t,e),u={x:r,y:s},d=await Nl(e,c),h=Cn(ls(n)),v=Cv(h);let p=u[v],w=u[h];if(a){const m=v==="y"?"top":"left",g=v==="y"?"bottom":"right",y=p+d[m],b=p-d[g];p=gp(y,p,b)}if(o){const m=h==="y"?"top":"left",g=h==="y"?"bottom":"right",y=w+d[m],b=w-d[g];w=gp(y,w,b)}const f=l.fn({...e,[v]:p,[h]:w});return{...f,data:{x:f.x-r,y:f.y-s,enabled:{[v]:a,[h]:o}}}}}},IR=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:s,placement:n,rects:a,middlewareData:o}=e,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=is(t,e),d={x:r,y:s},h=Cn(n),v=Cv(h);let p=d[v],w=d[h];const f=is(l,e),m=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const b=v==="y"?"height":"width",S=a.reference[v]-a.floating[b]+m.mainAxis,E=a.reference[v]+a.reference[b]-m.mainAxis;p<S?p=S:p>E&&(p=E)}if(u){var g,y;const b=v==="y"?"width":"height",S=Q1.has(ls(n)),E=a.reference[h]-a.floating[b]+(S&&((g=o.offset)==null?void 0:g[h])||0)+(S?0:m.crossAxis),P=a.reference[h]+a.reference[b]+(S?0:((y=o.offset)==null?void 0:y[h])||0)-(S?m.crossAxis:0);w<E?w=E:w>P&&(w=P)}return{[v]:p,[h]:w}}}},DR=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,s;const{placement:n,rects:a,platform:o,elements:l}=e,{apply:c=()=>{},...u}=is(t,e),d=await Nl(e,u),h=ls(n),v=_i(n),p=Cn(n)==="y",{width:w,height:f}=a.floating;let m,g;h==="top"||h==="bottom"?(m=h,g=v===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=h,m=v==="end"?"top":"bottom");const y=f-d.top-d.bottom,b=w-d.left-d.right,S=aa(f-d[m],y),E=aa(w-d[g],b),P=!e.middlewareData.shift;let R=S,T=E;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(T=b),(s=e.middlewareData.shift)!=null&&s.enabled.y&&(R=y),P&&!v){const O=Sr(d.left,0),j=Sr(d.right,0),_=Sr(d.top,0),A=Sr(d.bottom,0);p?T=w-2*(O!==0||j!==0?O+j:Sr(d.left,d.right)):R=f-2*(_!==0||A!==0?_+A:Sr(d.top,d.bottom))}await c({...e,availableWidth:T,availableHeight:R});const N=await o.getDimensions(l.floating);return w!==N.width||f!==N.height?{reset:{rects:!0}}:{}}}};function Rd(){return typeof window<"u"}function Ei(t){return G1(t)?(t.nodeName||"").toLowerCase():"#document"}function Cr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function On(t){var e;return(e=(G1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function G1(t){return Rd()?t instanceof Node||t instanceof Cr(t).Node:!1}function an(t){return Rd()?t instanceof Element||t instanceof Cr(t).Element:!1}function Tn(t){return Rd()?t instanceof HTMLElement||t instanceof Cr(t).HTMLElement:!1}function d0(t){return!Rd()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Cr(t).ShadowRoot}const MR=new Set(["inline","contents"]);function ql(t){const{overflow:e,overflowX:r,overflowY:s,display:n}=on(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+r)&&!MR.has(n)}const $R=new Set(["table","td","th"]);function FR(t){return $R.has(Ei(t))}const LR=[":popover-open",":modal"];function Td(t){return LR.some(e=>{try{return t.matches(e)}catch{return!1}})}const UR=["transform","translate","scale","rotate","perspective"],zR=["transform","translate","scale","rotate","perspective","filter"],VR=["paint","layout","strict","content"];function Nv(t){const e=jv(),r=an(t)?on(t):t;return UR.some(s=>r[s]?r[s]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||zR.some(s=>(r.willChange||"").includes(s))||VR.some(s=>(r.contain||"").includes(s))}function HR(t){let e=oa(t);for(;Tn(e)&&!hi(e);){if(Nv(e))return e;if(Td(e))return null;e=oa(e)}return null}function jv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const qR=new Set(["html","body","#document"]);function hi(t){return qR.has(Ei(t))}function on(t){return Cr(t).getComputedStyle(t)}function Ad(t){return an(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function oa(t){if(Ei(t)==="html")return t;const e=t.assignedSlot||t.parentNode||d0(t)&&t.host||On(t);return d0(e)?e.host:e}function Z1(t){const e=oa(t);return hi(e)?t.ownerDocument?t.ownerDocument.body:t.body:Tn(e)&&ql(e)?e:Z1(e)}function jl(t,e,r){var s;e===void 0&&(e=[]),r===void 0&&(r=!0);const n=Z1(t),a=n===((s=t.ownerDocument)==null?void 0:s.body),o=Cr(n);if(a){const l=xp(o);return e.concat(o,o.visualViewport||[],ql(n)?n:[],l&&r?jl(l):[])}return e.concat(n,jl(n,[],r))}function xp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Y1(t){const e=on(t);let r=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const n=Tn(t),a=n?t.offsetWidth:r,o=n?t.offsetHeight:s,l=Du(r)!==a||Du(s)!==o;return l&&(r=a,s=o),{width:r,height:s,$:l}}function Rv(t){return an(t)?t:t.contextElement}function zo(t){const e=Rv(t);if(!Tn(e))return jn(1);const r=e.getBoundingClientRect(),{width:s,height:n,$:a}=Y1(e);let o=(a?Du(r.width):r.width)/s,l=(a?Du(r.height):r.height)/n;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const BR=jn(0);function J1(t){const e=Cr(t);return!jv()||!e.visualViewport?BR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function WR(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Cr(t)?!1:e}function Qa(t,e,r,s){e===void 0&&(e=!1),r===void 0&&(r=!1);const n=t.getBoundingClientRect(),a=Rv(t);let o=jn(1);e&&(s?an(s)&&(o=zo(s)):o=zo(t));const l=WR(a,r,s)?J1(a):jn(0);let c=(n.left+l.x)/o.x,u=(n.top+l.y)/o.y,d=n.width/o.x,h=n.height/o.y;if(a){const v=Cr(a),p=s&&an(s)?Cr(s):s;let w=v,f=xp(w);for(;f&&s&&p!==w;){const m=zo(f),g=f.getBoundingClientRect(),y=on(f),b=g.left+(f.clientLeft+parseFloat(y.paddingLeft))*m.x,S=g.top+(f.clientTop+parseFloat(y.paddingTop))*m.y;c*=m.x,u*=m.y,d*=m.x,h*=m.y,c+=b,u+=S,w=Cr(f),f=xp(w)}}return $u({width:d,height:h,x:c,y:u})}function Od(t,e){const r=Ad(t).scrollLeft;return e?e.left+r:Qa(On(t)).left+r}function X1(t,e){const r=t.getBoundingClientRect(),s=r.left+e.scrollLeft-Od(t,r),n=r.top+e.scrollTop;return{x:s,y:n}}function KR(t){let{elements:e,rect:r,offsetParent:s,strategy:n}=t;const a=n==="fixed",o=On(s),l=e?Td(e.floating):!1;if(s===o||l&&a)return r;let c={scrollLeft:0,scrollTop:0},u=jn(1);const d=jn(0),h=Tn(s);if((h||!h&&!a)&&((Ei(s)!=="body"||ql(o))&&(c=Ad(s)),Tn(s))){const p=Qa(s);u=zo(s),d.x=p.x+s.clientLeft,d.y=p.y+s.clientTop}const v=o&&!h&&!a?X1(o,c):jn(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+v.x,y:r.y*u.y-c.scrollTop*u.y+d.y+v.y}}function QR(t){return Array.from(t.getClientRects())}function GR(t){const e=On(t),r=Ad(t),s=t.ownerDocument.body,n=Sr(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),a=Sr(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let o=-r.scrollLeft+Od(t);const l=-r.scrollTop;return on(s).direction==="rtl"&&(o+=Sr(e.clientWidth,s.clientWidth)-n),{width:n,height:a,x:o,y:l}}const f0=25;function ZR(t,e){const r=Cr(t),s=On(t),n=r.visualViewport;let a=s.clientWidth,o=s.clientHeight,l=0,c=0;if(n){a=n.width,o=n.height;const d=jv();(!d||d&&e==="fixed")&&(l=n.offsetLeft,c=n.offsetTop)}const u=Od(s);if(u<=0){const d=s.ownerDocument,h=d.body,v=getComputedStyle(h),p=d.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(s.clientWidth-h.clientWidth-p);w<=f0&&(a-=w)}else u<=f0&&(a+=u);return{width:a,height:o,x:l,y:c}}const YR=new Set(["absolute","fixed"]);function JR(t,e){const r=Qa(t,!0,e==="fixed"),s=r.top+t.clientTop,n=r.left+t.clientLeft,a=Tn(t)?zo(t):jn(1),o=t.clientWidth*a.x,l=t.clientHeight*a.y,c=n*a.x,u=s*a.y;return{width:o,height:l,x:c,y:u}}function h0(t,e,r){let s;if(e==="viewport")s=ZR(t,r);else if(e==="document")s=GR(On(t));else if(an(e))s=JR(e,r);else{const n=J1(t);s={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return $u(s)}function eS(t,e){const r=oa(t);return r===e||!an(r)||hi(r)?!1:on(r).position==="fixed"||eS(r,e)}function XR(t,e){const r=e.get(t);if(r)return r;let s=jl(t,[],!1).filter(l=>an(l)&&Ei(l)!=="body"),n=null;const a=on(t).position==="fixed";let o=a?oa(t):t;for(;an(o)&&!hi(o);){const l=on(o),c=Nv(o);!c&&l.position==="fixed"&&(n=null),(a?!c&&!n:!c&&l.position==="static"&&!!n&&YR.has(n.position)||ql(o)&&!c&&eS(t,o))?s=s.filter(d=>d!==o):n=l,o=oa(o)}return e.set(t,s),s}function eT(t){let{element:e,boundary:r,rootBoundary:s,strategy:n}=t;const o=[...r==="clippingAncestors"?Td(e)?[]:XR(e,this._c):[].concat(r),s],l=o[0],c=o.reduce((u,d)=>{const h=h0(e,d,n);return u.top=Sr(h.top,u.top),u.right=aa(h.right,u.right),u.bottom=aa(h.bottom,u.bottom),u.left=Sr(h.left,u.left),u},h0(e,l,n));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function tT(t){const{width:e,height:r}=Y1(t);return{width:e,height:r}}function rT(t,e,r){const s=Tn(e),n=On(e),a=r==="fixed",o=Qa(t,!0,a,e);let l={scrollLeft:0,scrollTop:0};const c=jn(0);function u(){c.x=Od(n)}if(s||!s&&!a)if((Ei(e)!=="body"||ql(n))&&(l=Ad(e)),s){const p=Qa(e,!0,a,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else n&&u();a&&!s&&n&&u();const d=n&&!s&&!a?X1(n,l):jn(0),h=o.left+l.scrollLeft-c.x-d.x,v=o.top+l.scrollTop-c.y-d.y;return{x:h,y:v,width:o.width,height:o.height}}function Mf(t){return on(t).position==="static"}function p0(t,e){if(!Tn(t)||on(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return On(t)===r&&(r=r.ownerDocument.body),r}function tS(t,e){const r=Cr(t);if(Td(t))return r;if(!Tn(t)){let n=oa(t);for(;n&&!hi(n);){if(an(n)&&!Mf(n))return n;n=oa(n)}return r}let s=p0(t,e);for(;s&&FR(s)&&Mf(s);)s=p0(s,e);return s&&hi(s)&&Mf(s)&&!Nv(s)?r:s||HR(t)||r}const nT=async function(t){const e=this.getOffsetParent||tS,r=this.getDimensions,s=await r(t.floating);return{reference:rT(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function sT(t){return on(t).direction==="rtl"}const aT={convertOffsetParentRelativeRectToViewportRelativeRect:KR,getDocumentElement:On,getClippingRect:eT,getOffsetParent:tS,getElementRects:nT,getClientRects:QR,getDimensions:tT,getScale:zo,isElement:an,isRTL:sT};function rS(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function oT(t,e){let r=null,s;const n=On(t);function a(){var l;clearTimeout(s),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=t.getBoundingClientRect(),{left:d,top:h,width:v,height:p}=u;if(l||e(),!v||!p)return;const w=Pc(h),f=Pc(n.clientWidth-(d+v)),m=Pc(n.clientHeight-(h+p)),g=Pc(d),b={rootMargin:-w+"px "+-f+"px "+-m+"px "+-g+"px",threshold:Sr(0,aa(1,c))||1};let S=!0;function E(P){const R=P[0].intersectionRatio;if(R!==c){if(!S)return o();R?o(!1,R):s=setTimeout(()=>{o(!1,1e-7)},1e3)}R===1&&!rS(u,t.getBoundingClientRect())&&o(),S=!1}try{r=new IntersectionObserver(E,{...b,root:n.ownerDocument})}catch{r=new IntersectionObserver(E,b)}r.observe(t)}return o(!0),a}function iT(t,e,r,s){s===void 0&&(s={});const{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,u=Rv(t),d=n||a?[...u?jl(u):[],...jl(e)]:[];d.forEach(g=>{n&&g.addEventListener("scroll",r,{passive:!0}),a&&g.addEventListener("resize",r)});const h=u&&l?oT(u,r):null;let v=-1,p=null;o&&(p=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(e)})),r()}),u&&!c&&p.observe(u),p.observe(e));let w,f=c?Qa(t):null;c&&m();function m(){const g=Qa(t);f&&!rS(f,g)&&r(),f=g,w=requestAnimationFrame(m)}return r(),()=>{var g;d.forEach(y=>{n&&y.removeEventListener("scroll",r),a&&y.removeEventListener("resize",r)}),h==null||h(),(g=p)==null||g.disconnect(),p=null,c&&cancelAnimationFrame(w)}}const lT=AR,cT=OR,uT=jR,dT=DR,fT=RR,m0=NR,hT=IR,pT=(t,e,r)=>{const s=new Map,n={platform:aT,...r},a={...n.platform,_c:s};return kR(t,e,{...n,platform:a})};var mT=typeof document<"u",vT=function(){},Yc=mT?x.useLayoutEffect:vT;function Fu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,s,n;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(s=r;s--!==0;)if(!Fu(t[s],e[s]))return!1;return!0}if(n=Object.keys(t),r=n.length,r!==Object.keys(e).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(e,n[s]))return!1;for(s=r;s--!==0;){const a=n[s];if(!(a==="_owner"&&t.$$typeof)&&!Fu(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function nS(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function v0(t,e){const r=nS(t);return Math.round(e*r)/r}function $f(t){const e=x.useRef(t);return Yc(()=>{e.current=t}),e}function gT(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:s=[],platform:n,elements:{reference:a,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,h]=x.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[v,p]=x.useState(s);Fu(v,s)||p(s);const[w,f]=x.useState(null),[m,g]=x.useState(null),y=x.useCallback($=>{$!==P.current&&(P.current=$,f($))},[]),b=x.useCallback($=>{$!==R.current&&(R.current=$,g($))},[]),S=a||w,E=o||m,P=x.useRef(null),R=x.useRef(null),T=x.useRef(d),N=c!=null,O=$f(c),j=$f(n),_=$f(u),A=x.useCallback(()=>{if(!P.current||!R.current)return;const $={placement:e,strategy:r,middleware:v};j.current&&($.platform=j.current),pT(P.current,R.current,$).then(F=>{const V={...F,isPositioned:_.current!==!1};C.current&&!Fu(T.current,V)&&(T.current=V,so.flushSync(()=>{h(V)}))})},[v,e,r,j,_]);Yc(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h($=>({...$,isPositioned:!1})))},[u]);const C=x.useRef(!1);Yc(()=>(C.current=!0,()=>{C.current=!1}),[]),Yc(()=>{if(S&&(P.current=S),E&&(R.current=E),S&&E){if(O.current)return O.current(S,E,A);A()}},[S,E,A,O,N]);const z=x.useMemo(()=>({reference:P,floating:R,setReference:y,setFloating:b}),[y,b]),U=x.useMemo(()=>({reference:S,floating:E}),[S,E]),K=x.useMemo(()=>{const $={position:r,left:0,top:0};if(!U.floating)return $;const F=v0(U.floating,d.x),V=v0(U.floating,d.y);return l?{...$,transform:"translate("+F+"px, "+V+"px)",...nS(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:F,top:V}},[r,l,U.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:A,refs:z,elements:U,floatingStyles:K}),[d,A,z,U,K])}const yT=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:s,padding:n}=typeof t=="function"?t(r):t;return s&&e(s)?s.current!=null?m0({element:s.current,padding:n}).fn(r):{}:s?m0({element:s,padding:n}).fn(r):{}}}},xT=(t,e)=>({...lT(t),options:[t,e]}),wT=(t,e)=>({...cT(t),options:[t,e]}),bT=(t,e)=>({...hT(t),options:[t,e]}),ST=(t,e)=>({...uT(t),options:[t,e]}),_T=(t,e)=>({...dT(t),options:[t,e]}),ET=(t,e)=>({...fT(t),options:[t,e]}),CT=(t,e)=>({...yT(t),options:[t,e]});var PT="Arrow",sS=x.forwardRef((t,e)=>{const{children:r,width:s=10,height:n=5,...a}=t;return i.jsx(Ae.svg,{...a,ref:e,width:s,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});sS.displayName=PT;var kT=sS;function aS(t){const[e,r]=x.useState(void 0);return Bt(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const s=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;const a=n[0];let o,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=t.offsetWidth,l=t.offsetHeight;r({width:o,height:l})});return s.observe(t,{box:"border-box"}),()=>s.unobserve(t)}else r(void 0)},[t]),e}var Tv="Popper",[oS,Id]=fs(Tv),[NT,iS]=oS(Tv),lS=t=>{const{__scopePopper:e,children:r}=t,[s,n]=x.useState(null);return i.jsx(NT,{scope:e,anchor:s,onAnchorChange:n,children:r})};lS.displayName=Tv;var cS="PopperAnchor",uS=x.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:s,...n}=t,a=iS(cS,r),o=x.useRef(null),l=et(e,o),c=x.useRef(null);return x.useEffect(()=>{const u=c.current;c.current=(s==null?void 0:s.current)||o.current,u!==c.current&&a.onAnchorChange(c.current)}),s?null:i.jsx(Ae.div,{...n,ref:l})});uS.displayName=cS;var Av="PopperContent",[jT,RT]=oS(Av),dS=x.forwardRef((t,e)=>{var Z,ce,Ee,ve,te,we;const{__scopePopper:r,side:s="bottom",sideOffset:n=0,align:a="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:p="optimized",onPlaced:w,...f}=t,m=iS(Av,r),[g,y]=x.useState(null),b=et(e,ke=>y(ke)),[S,E]=x.useState(null),P=aS(S),R=(P==null?void 0:P.width)??0,T=(P==null?void 0:P.height)??0,N=s+(a!=="center"?"-"+a:""),O=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(u)?u:[u],_=j.length>0,A={padding:O,boundary:j.filter(AT),altBoundary:_},{refs:C,floatingStyles:z,placement:U,isPositioned:K,middlewareData:$}=gT({strategy:"fixed",placement:N,whileElementsMounted:(...ke)=>iT(...ke,{animationFrame:p==="always"}),elements:{reference:m.anchor},middleware:[xT({mainAxis:n+T,alignmentAxis:o}),c&&wT({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?bT():void 0,...A}),c&&ST({...A}),_T({...A,apply:({elements:ke,rects:De,availableWidth:ee,availableHeight:fe})=>{const{width:X,height:ze}=De.reference,re=ke.floating.style;re.setProperty("--radix-popper-available-width",`${ee}px`),re.setProperty("--radix-popper-available-height",`${fe}px`),re.setProperty("--radix-popper-anchor-width",`${X}px`),re.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),S&&CT({element:S,padding:l}),OT({arrowWidth:R,arrowHeight:T}),v&&ET({strategy:"referenceHidden",...A})]}),[F,V]=pS(U),ae=Ur(w);Bt(()=>{K&&(ae==null||ae())},[K,ae]);const se=(Z=$.arrow)==null?void 0:Z.x,W=(ce=$.arrow)==null?void 0:ce.y,L=((Ee=$.arrow)==null?void 0:Ee.centerOffset)!==0,[Q,oe]=x.useState();return Bt(()=>{g&&oe(window.getComputedStyle(g).zIndex)},[g]),i.jsx("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:K?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(ve=$.transformOrigin)==null?void 0:ve.x,(te=$.transformOrigin)==null?void 0:te.y].join(" "),...((we=$.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:i.jsx(jT,{scope:r,placedSide:F,onArrowChange:E,arrowX:se,arrowY:W,shouldHideArrow:L,children:i.jsx(Ae.div,{"data-side":F,"data-align":V,...f,ref:b,style:{...f.style,animation:K?void 0:"none"}})})})});dS.displayName=Av;var fS="PopperArrow",TT={top:"bottom",right:"left",bottom:"top",left:"right"},hS=x.forwardRef(function(e,r){const{__scopePopper:s,...n}=e,a=RT(fS,s),o=TT[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(kT,{...n,ref:r,style:{...n.style,display:"block"}})})});hS.displayName=fS;function AT(t){return t!==null}var OT=t=>({name:"transformOrigin",options:t,fn(e){var m,g,y;const{placement:r,rects:s,middlewareData:n}=e,o=((m=n.arrow)==null?void 0:m.centerOffset)!==0,l=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[u,d]=pS(r),h={start:"0%",center:"50%",end:"100%"}[d],v=(((g=n.arrow)==null?void 0:g.x)??0)+l/2,p=(((y=n.arrow)==null?void 0:y.y)??0)+c/2;let w="",f="";return u==="bottom"?(w=o?h:`${v}px`,f=`${-c}px`):u==="top"?(w=o?h:`${v}px`,f=`${s.floating.height+c}px`):u==="right"?(w=`${-c}px`,f=o?h:`${p}px`):u==="left"&&(w=`${s.floating.width+c}px`,f=o?h:`${p}px`),{data:{x:w,y:f}}}});function pS(t){const[e,r="center"]=t.split("-");return[e,r]}var IT=lS,mS=uS,vS=dS,gS=hS,[Dd,VF]=fs("Tooltip",[Id]),Ov=Id(),yS="TooltipProvider",DT=700,g0="tooltip.open",[MT,xS]=Dd(yS),wS=t=>{const{__scopeTooltip:e,delayDuration:r=DT,skipDelayDuration:s=300,disableHoverableContent:n=!1,children:a}=t,o=x.useRef(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),i.jsx(MT,{scope:e,isOpenDelayedRef:o,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,s)},[s]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(u=>{l.current=u},[]),disableHoverableContent:n,children:a})};wS.displayName=yS;var bS="Tooltip",[HF,Md]=Dd(bS),wp="TooltipTrigger",$T=x.forwardRef((t,e)=>{const{__scopeTooltip:r,...s}=t,n=Md(wp,r),a=xS(wp,r),o=Ov(r),l=x.useRef(null),c=et(e,l,n.onTriggerChange),u=x.useRef(!1),d=x.useRef(!1),h=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),i.jsx(mS,{asChild:!0,...o,children:i.jsx(Ae.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...s,ref:c,onPointerMove:_e(t.onPointerMove,v=>{v.pointerType!=="touch"&&!d.current&&!a.isPointerInTransitRef.current&&(n.onTriggerEnter(),d.current=!0)}),onPointerLeave:_e(t.onPointerLeave,()=>{n.onTriggerLeave(),d.current=!1}),onPointerDown:_e(t.onPointerDown,()=>{n.open&&n.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:_e(t.onFocus,()=>{u.current||n.onOpen()}),onBlur:_e(t.onBlur,n.onClose),onClick:_e(t.onClick,n.onClose)})})});$T.displayName=wp;var FT="TooltipPortal",[qF,LT]=Dd(FT,{forceMount:void 0}),pi="TooltipContent",SS=x.forwardRef((t,e)=>{const r=LT(pi,t.__scopeTooltip),{forceMount:s=r.forceMount,side:n="top",...a}=t,o=Md(pi,t.__scopeTooltip);return i.jsx(da,{present:s||o.open,children:o.disableHoverableContent?i.jsx(_S,{side:n,...a,ref:e}):i.jsx(UT,{side:n,...a,ref:e})})}),UT=x.forwardRef((t,e)=>{const r=Md(pi,t.__scopeTooltip),s=xS(pi,t.__scopeTooltip),n=x.useRef(null),a=et(e,n),[o,l]=x.useState(null),{trigger:c,onClose:u}=r,d=n.current,{onPointerInTransitChange:h}=s,v=x.useCallback(()=>{l(null),h(!1)},[h]),p=x.useCallback((w,f)=>{const m=w.currentTarget,g={x:w.clientX,y:w.clientY},y=BT(g,m.getBoundingClientRect()),b=WT(g,y),S=KT(f.getBoundingClientRect()),E=GT([...b,...S]);l(E),h(!0)},[h]);return x.useEffect(()=>()=>v(),[v]),x.useEffect(()=>{if(c&&d){const w=m=>p(m,d),f=m=>p(m,c);return c.addEventListener("pointerleave",w),d.addEventListener("pointerleave",f),()=>{c.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",f)}}},[c,d,p,v]),x.useEffect(()=>{if(o){const w=f=>{const m=f.target,g={x:f.clientX,y:f.clientY},y=(c==null?void 0:c.contains(m))||(d==null?void 0:d.contains(m)),b=!QT(g,o);y?v():b&&(v(),u())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[c,d,o,u,v]),i.jsx(_S,{...t,ref:a})}),[zT,VT]=Dd(bS,{isInside:!1}),HT=Tj("TooltipContent"),_S=x.forwardRef((t,e)=>{const{__scopeTooltip:r,children:s,"aria-label":n,onEscapeKeyDown:a,onPointerDownOutside:o,...l}=t,c=Md(pi,r),u=Ov(r),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(g0,d),()=>document.removeEventListener(g0,d)),[d]),x.useEffect(()=>{if(c.trigger){const h=v=>{const p=v.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),i.jsx(Vl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:i.jsxs(vS,{"data-state":c.stateAttribute,...u,...l,ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(HT,{children:s}),i.jsx(zT,{scope:r,isInside:!0,children:i.jsx(Xj,{id:c.contentId,role:"tooltip",children:n||s})})]})})});SS.displayName=pi;var ES="TooltipArrow",qT=x.forwardRef((t,e)=>{const{__scopeTooltip:r,...s}=t,n=Ov(r);return VT(ES,r).isInside?null:i.jsx(gS,{...n,...s,ref:e})});qT.displayName=ES;function BT(t,e){const r=Math.abs(e.top-t.y),s=Math.abs(e.bottom-t.y),n=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(r,s,n,a)){case a:return"left";case n:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function WT(t,e,r=5){const s=[];switch(e){case"top":s.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":s.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":s.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":s.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return s}function KT(t){const{top:e,right:r,bottom:s,left:n}=t;return[{x:n,y:e},{x:r,y:e},{x:r,y:s},{x:n,y:s}]}function QT(t,e){const{x:r,y:s}=t;let n=!1;for(let a=0,o=e.length-1;a<e.length;o=a++){const l=e[a],c=e[o],u=l.x,d=l.y,h=c.x,v=c.y;d>s!=v>s&&r<(h-u)*(s-d)/(v-d)+u&&(n=!n)}return n}function GT(t){const e=t.slice();return e.sort((r,s)=>r.x<s.x?-1:r.x>s.x?1:r.y<s.y?-1:r.y>s.y?1:0),ZT(e)}function ZT(t){if(t.length<=1)return t.slice();const e=[];for(let s=0;s<t.length;s++){const n=t[s];for(;e.length>=2;){const a=e[e.length-1],o=e[e.length-2];if((a.x-o.x)*(n.y-o.y)>=(a.y-o.y)*(n.x-o.x))e.pop();else break}e.push(n)}e.pop();const r=[];for(let s=t.length-1;s>=0;s--){const n=t[s];for(;r.length>=2;){const a=r[r.length-1],o=r[r.length-2];if((a.x-o.x)*(n.y-o.y)>=(a.y-o.y)*(n.x-o.x))r.pop();else break}r.push(n)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var YT=wS,CS=SS;const JT=YT,XT=x.forwardRef(({className:t,sideOffset:e=4,...r},s)=>i.jsx(CS,{ref:s,sideOffset:e,className:Te("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",t),...r}));XT.displayName=CS.displayName;const eA={total:0,byKind:{oauth_required:0,oauth_expired:0,service_unhealthy:0,credential_missing_secret:0,playbook_missing_deps:0},serviceWarnings:new Map,credentialWarnings:new Map,playbookWarnings:new Map};function tA(t){return t?{total:t.total,byKind:t.byKind,serviceWarnings:new Map(Object.entries(t.services)),credentialWarnings:new Map(Object.entries(t.credentials)),playbookWarnings:new Map(Object.entries(t.playbooks))}:eA}const wr="#92E4DD",ur="#F9386D",Zr="#FFFFFF",bn="bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900";function mn(t){return t.type==="mcp"||t.type==="local-mcp"?wr:t.cardColor??wr}function Sn(t){return{borderColor:t,color:t,boxShadow:`0 0 20px ${t}20`}}const rA=Nd("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),me=x.forwardRef(({className:t,variant:e,size:r,asChild:s=!1,...n},a)=>{const o=s?jj:"button";return i.jsx(o,{className:Te(rA({variant:e,size:r,className:t})),ref:a,...n})});me.displayName="Button";function Vo({warnings:t}){if(!(t!=null&&t.length))return null;const e=t.find(s=>s.severity==="error")??t[0],r=e.severity==="error";return i.jsxs("div",{className:`absolute left-1/2 -translate-x-1/2 top-8 z-20 flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[7px] font-semibold uppercase tracking-wide shadow-lg ${r?"bg-red-500/90 text-white border border-red-300/60":"bg-amber-500/90 text-black border border-amber-200/60"}`,title:t.map(s=>s.message).join(" · "),"data-testid":"card-warning-badge",children:[i.jsx(tn,{className:"h-2.5 w-2.5 shrink-0"}),i.jsx("span",{className:"max-w-[72px] truncate",children:e.message})]})}const y0="data:image/svg+xml,%3csvg%20id='eSEM9z84vJh1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20300%20300'%20shape-rendering='geometricPrecision'%20text-rendering='geometricPrecision'%20project-id='c9405aa1bbb44eb388e44d7178ee1932'%20export-id='327eb6bfd5a543cb88b86ffe07ce0c92'%20cached='false'%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='translate(71.928217%20125.25355)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='matrix(2.570356%200%200%202.449277%2067.884163%2017.275854)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='translate(163.184592%20125.25355)'%20stroke-width='0'/%3e%3crect%20width='63.894524'%20height='34.989858'%20rx='0'%20ry='0'%20transform='matrix(3.42849%200%200%200.403818%2040.469132%20102.975708)'%20stroke-width='0'/%3e%3cpolygon%20points='0,-42.01893%2030.924539,20.531677%2024.698107,33.994028%20-24.698107,33.994028%20-33.20748,20.12246%200,-42.01893'%20transform='matrix(-.687913%200.002106-.00101-.33%20149.995947%20212.592699)'%20stroke-width='0'/%3e%3cpolygon%20points='0,-42.01893%2036.327051,-24.945112%2016.852287,34.058016%20-19.029679,34.002758%20-36.534138,-25.057317%200,-42.01893'%20transform='matrix(-.466366%200.001428-.002837-.926983%20149.84238%20249.643929)'%20stroke-width='0'/%3e%3c/svg%3e";function nA(t){return t.iconUrl?t.iconUrl:null}function PS({service:t}){const e=mn(t),r=nA(t),[s,n]=x.useState(!1);return r&&!s?i.jsx("img",{src:r,alt:"",className:"w-7 h-7 object-contain rounded-sm",draggable:!1,onError:()=>n(!0)}):i.jsx("div",{style:{width:28,height:28,backgroundColor:e,WebkitMask:`url(${y0}) no-repeat center / contain`,mask:`url(${y0}) no-repeat center / contain`},"aria-hidden":!0})}function Iv(t){return t?"ring-2 ring-inset ring-yellow-400/90 shadow-[0_0_10px_rgba(250,204,21,0.2)]":""}function Dv(){return i.jsx("span",{className:"absolute top-1.5 left-1/2 z-20 -translate-x-1/2 rounded bg-yellow-500 px-1 py-px text-[7px] font-bold uppercase tracking-wide text-black shadow",children:"In deck"})}function sA({service:t,onDragStart:e,onDragEnd:r,isInActiveDeck:s,onCardClick:n,isInCollection:a=!1,onMouseEnter:o,onMouseLeave:l,activeDeck:c,warnings:u}){const d=yr(),{toast:h}=or(),v=mn(t),p=At({mutationFn:async()=>{if(!c)throw new Error("No active deck found");return Oe("POST",`/api/decks/${c.id}/services`,{serviceId:t.id,position:0})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),h({title:"Service added to deck",description:`${t.name} has been added to your active deck.`})},onError:g=>{h({title:"Failed to add service",description:g.message,variant:"destructive"})}}),w=At({mutationFn:async()=>Oe("DELETE",`/api/services/${t.id}`,{}),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/services"]}),d.invalidateQueries({queryKey:["/api/collection/warnings"]}),d.invalidateQueries({queryKey:["/api/decks"]}),h({title:"Service deleted",description:`${t.name} has been deleted successfully.`})},onError:g=>{h({title:"Failed to delete service",description:g.message,variant:"destructive"})}}),f=g=>{g.stopPropagation(),p.mutate()},m=g=>{g.stopPropagation(),window.confirm(`Are you sure you want to delete ${t.name}? This action cannot be undone.`)&&w.mutate()};return i.jsx("div",{className:"relative group cursor-pointer",draggable:!s,onDragStart:g=>e(g,t),onDragEnd:r,onClick:()=>n==null?void 0:n(t),"data-testid":`card-${t.id}`,onMouseEnter:o,onMouseLeave:l,children:i.jsxs("div",{className:`
|
|
234
|
-
w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
|
|
235
|
-
transform transition-all duration-300 shadow-lg hover:shadow-2xl
|
|
236
|
-
bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
|
|
237
|
-
relative overflow-hidden
|
|
238
|
-
${Iv(s)}
|
|
239
|
-
${a?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
|
|
240
|
-
`,style:{borderColor:v,boxShadow:`0 0 20px ${v}20`},children:[i.jsx(Vo,{warnings:u}),s&&i.jsx(Dv,{}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:v},children:t.type==="mcp"?"RM":t.type==="local-mcp"?"LM":"A"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:v},children:t.type==="mcp"?"RM":t.type==="local-mcp"?"LM":"A"})}),i.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:i.jsx(me,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:m,title:`Delete ${t.name}`,children:i.jsx(jd,{className:"w-3 h-3"})})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:v},children:i.jsx(PS,{service:t})}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2","data-testid":`text-service-name-${t.id}`,style:{color:v},children:t.name}),i.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:v,borderColor:v},children:t.type==="mcp"?"Remote MCP":t.type==="local-mcp"?"Local MCP":"A2A"})]}),i.jsx("div",{className:"absolute bottom-6 inset-x-1",children:i.jsx(me,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:v,borderColor:v},onClick:f,disabled:s||p.isPending,"data-testid":`button-add-to-deck-${t.id}`,children:s?"IN DECK":"ADD"})}),i.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-br from-transparent via-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-all duration-500 pointer-events-none"})]})})}const aA=x.memo(sA);function oA(t){return t.iconUrl?t.iconUrl:null}function kS({credential:t,color:e}){const r=oA(t);return r?i.jsx("img",{src:r,alt:"",className:"h-7 w-7 object-contain rounded-sm",draggable:!1}):i.jsx(pp,{className:"h-7 w-7",strokeWidth:2.25,style:{color:e}})}function iA({credential:t,isInActiveDeck:e,activeDeck:r,isInCollection:s=!0,onDragStart:n,onDragEnd:a,onMouseEnter:o,onMouseLeave:l,onCardClick:c,warnings:u}){const d=yr(),{toast:h}=or(),v=ur,p=At({mutationFn:async()=>{if(!r)throw new Error("No active deck found");return Oe("POST",`/api/decks/${r.id}/credentials`,{credentialId:t.id})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),d.invalidateQueries({queryKey:["/api/decks"]}),h({title:"Added to deck",description:`${t.label} is in your active deck.`})},onError:f=>{h({title:"Failed to add to deck",description:f.message,variant:"destructive"})}}),w=At({mutationFn:async()=>Oe("DELETE",`/api/credentials/${t.id}`),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/credentials/vault"]}),d.invalidateQueries({queryKey:["/api/decks"]}),d.invalidateQueries({queryKey:["/api/decks"]}),h({title:"API key removed",description:`${t.label} was deleted from your vault.`})},onError:f=>{h({title:"Failed to remove API key",description:f.message,variant:"destructive"})}});return i.jsx("div",{className:"relative group cursor-pointer",draggable:!e&&!!n,onDragStart:n?f=>n(f,t):void 0,onDragEnd:a,onClick:()=>c==null?void 0:c(t),"data-testid":`card-${t.id}`,onMouseEnter:o,onMouseLeave:l,children:i.jsxs("div",{className:`
|
|
241
|
-
w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
|
|
242
|
-
transform transition-all duration-300 shadow-lg hover:shadow-2xl
|
|
243
|
-
bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
|
|
244
|
-
relative overflow-hidden
|
|
245
|
-
${Iv(e)}
|
|
246
|
-
${s?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
|
|
247
|
-
`,style:{borderColor:v,boxShadow:`0 0 20px ${v}20`},children:[i.jsx(Vo,{warnings:u}),e&&i.jsx(Dv,{}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:v},children:"AK"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:v},children:"AK"})}),i.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:i.jsx(me,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:f=>{f.stopPropagation(),window.confirm(`Remove ${t.label} from your vault?`)&&w.mutate()},title:`Remove ${t.label}`,children:i.jsx(jd,{className:"w-3 h-3"})})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:v},children:i.jsx(kS,{credential:t,color:v})}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2","data-testid":`text-credential-name-${t.id}`,style:{color:v},children:t.label}),i.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:v,borderColor:v},children:t.hasSecret?"API Key":"Missing key"})]}),i.jsx("div",{className:"absolute bottom-6 inset-x-1",children:i.jsx(me,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:v,borderColor:v},onClick:f=>{f.stopPropagation(),p.mutate()},disabled:e||p.isPending||!r,"data-testid":`button-add-to-deck-${t.id}`,children:e?"IN DECK":"ADD"})}),i.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-br from-transparent via-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-all duration-500 pointer-events-none"})]})})}const lA=x.memo(iA);function cA({playbook:t,isInActiveDeck:e,activeDeck:r,isInCollection:s=!0,onDragStart:n,onDragEnd:a,onMouseEnter:o,onMouseLeave:l,onCardClick:c,warnings:u}){const d=yr(),{toast:h}=or(),v=Zr,p=t.dependsOnCredentialIds.length+t.dependsOnServiceIds.length,w=At({mutationFn:async()=>{if(!r)throw new Error("No deck selected");return Oe("POST",`/api/decks/${r.id}/playbooks`,{playbookId:t.id})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),h({title:"Playbook added to deck",description:`${t.title} is on this deck.`})},onError:m=>{h({title:"Failed to add playbook",description:m.message,variant:"destructive"})}}),f=At({mutationFn:async()=>Oe("DELETE",`/api/playbooks/${t.id}`),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/playbooks/vault"]}),d.invalidateQueries({queryKey:["/api/decks"]}),h({title:"Playbook deleted",description:`${t.title} was removed from your collection.`})},onError:m=>{h({title:"Failed to delete playbook",description:m.message,variant:"destructive"})}});return i.jsx("div",{className:"relative group cursor-pointer",draggable:!e&&!!n,onDragStart:n?m=>n(m,t):void 0,onDragEnd:a,onClick:()=>c==null?void 0:c(t),"data-testid":`card-${t.id}`,onMouseEnter:o,onMouseLeave:l,children:i.jsxs("div",{className:`
|
|
248
|
-
w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
|
|
249
|
-
transform transition-all duration-300 shadow-lg hover:shadow-2xl
|
|
250
|
-
bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
|
|
251
|
-
relative overflow-hidden
|
|
252
|
-
${Iv(e)}
|
|
253
|
-
${s?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
|
|
254
|
-
`,style:{borderColor:v,boxShadow:`0 0 20px ${v}20`},children:[i.jsx(Vo,{warnings:u}),e&&i.jsx(Dv,{}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:v},children:"PB"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:v},children:"PB"})}),i.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:i.jsx(me,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:m=>{m.stopPropagation(),window.confirm(`Delete playbook "${t.title}"?`)&&f.mutate()},title:`Delete ${t.title}`,children:i.jsx(jd,{className:"w-3 h-3"})})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:v},children:i.jsx(Sv,{className:"h-7 w-7",strokeWidth:2.25})}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:v},children:t.title}),i.jsxs("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:v,borderColor:v},children:["Playbook",p>0?` · ${p} deps`:""]})]}),i.jsx("div",{className:"absolute bottom-6 inset-x-1",children:i.jsx(me,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:v,borderColor:v},onClick:m=>{m.stopPropagation(),w.mutate()},disabled:e||w.isPending||!r,children:e?"IN DECK":"ADD"})}),i.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-br from-transparent via-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-all duration-500 pointer-events-none"})]})})}const uA=x.memo(cA),bp=128,dA=192,$d=48,fA=10,x0=12,kc=64,Nc=4,w0=14,NS=12,jS=1.08;function hA(t=NS,e=jS){const r=t*Math.PI/180,s=bp*Math.sin(r)+dA*Math.cos(r);return Math.ceil(s*e)+8}const b0=hA();function RS(t,e=$d){return t===0?0:bp+Math.max(0,t-1)*(bp-e)}const pA=RS(fA,$d);function mA(t,e,r,s=NS){const n=e+r/2,a=r/2;if(a<=0)return 0;const o=(t-n)/a;return Math.max(-s,Math.min(s,o*s))}function vA(t){return{flexShrink:0,marginLeft:t===0?0:`-${$d}px`}}function gA(t,e,r){return r===t?999999:e-t}function yA({cardCount:t,children:e}){const r=x.useRef(null),s=x.useRef([]),n=x.useRef(0),a=x.useRef(void 0),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(!1),[v,p]=x.useState(!1),[w,f]=x.useState(!1),m=x.useRef(!1),g=x.useRef(!1),[y,b]=x.useState(null),S=x.useRef(null);S.current=y;const E=x.useCallback(()=>{const N=r.current;if(!N)return;const O=N.getBoundingClientRect(),j=S.current;s.current.forEach((_,A)=>{if(!_)return;const C=_.getBoundingClientRect(),z=C.left+C.width/2,U=j===A?0:mA(z,O.left,O.width),K=j===A?jS:1;_.style.transform=`rotate(${U}deg) scale(${K})`,_.style.transformOrigin="center center",_.style.zIndex=String(gA(A,t,j))})},[t]),P=x.useCallback(()=>{const N=r.current;if(!N)return;const j=RS(t,$d)>N.clientWidth+2;l(j),u(j&&N.scrollLeft>4),h(j&&N.scrollLeft+N.clientWidth<N.scrollWidth-4),E()},[t,E]);x.useLayoutEffect(()=>{const N=r.current;if(!N)return;P();const O=new ResizeObserver(P);return O.observe(N),N.addEventListener("scroll",P,{passive:!0}),()=>{O.disconnect(),N.removeEventListener("scroll",P)}},[t,P]),x.useEffect(()=>{const N=()=>{const O=r.current,j=n.current;if(O&&j!==0){O.scrollLeft+=j,E();const C=O.scrollLeft>4,z=O.scrollLeft+O.clientWidth<O.scrollWidth-4;u(C),h(z)}const _=j<0,A=j>0;_!==m.current&&(m.current=_,p(_)),A!==g.current&&(g.current=A,f(A)),a.current=requestAnimationFrame(N)};return a.current=requestAnimationFrame(N),()=>{a.current!==void 0&&cancelAnimationFrame(a.current)}},[E]);const R=N=>{const O=r.current;if(!O||!o){n.current=0;return}const j=O.getBoundingClientRect(),_=N.clientX-j.left;if(_<kc&&c){const A=1-_/kc;n.current=-(Nc+A*(w0-Nc))}else if(_>j.width-kc&&d){const A=1-(j.width-_)/kc;n.current=Nc+A*(w0-Nc)}else n.current=0;E()},T=()=>{n.current=0,m.current=!1,g.current=!1,p(!1),f(!1)};return x.useLayoutEffect(()=>{E()},[t,y,E]),t===0?i.jsx(i.Fragment,{children:e}):i.jsxs("div",{className:"relative flex h-full w-full min-w-0 max-w-full items-center justify-center overflow-x-hidden overflow-y-visible","data-testid":"deck-fan",onMouseMove:R,onMouseLeave:T,children:[o&&i.jsx("div",{className:`pointer-events-none absolute left-2 top-1/2 z-30 -translate-y-1/2 rounded-full bg-black/60 p-1 text-yellow-300 shadow-lg transition-all duration-150 ${c?"opacity-90":"opacity-25"} ${v?"scale-125":"scale-100"}`,"aria-hidden":!0,"data-testid":"deck-scroll-left",children:i.jsx(_2,{className:"h-6 w-6",strokeWidth:2.5})}),o&&i.jsx("div",{className:`pointer-events-none absolute right-2 top-1/2 z-30 -translate-y-1/2 rounded-full bg-black/60 p-1 text-yellow-300 shadow-lg transition-all duration-150 ${d?"opacity-90":"opacity-25"} ${w?"scale-125":"scale-100"}`,"aria-hidden":!0,"data-testid":"deck-scroll-right",children:i.jsx(E2,{className:"h-6 w-6",strokeWidth:2.5})}),o&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-20 w-24 bg-gradient-to-r from-gray-950/95 via-gray-950/50 to-transparent","aria-hidden":!0}),i.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 z-20 w-24 bg-gradient-to-l from-gray-950/95 via-gray-950/50 to-transparent","aria-hidden":!0})]}),i.jsx("div",{ref:r,className:"max-w-full overflow-x-auto overflow-y-visible [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{width:pA,maxWidth:"100%"},children:i.jsx("div",{className:"flex items-center justify-start isolate group/fan",style:{minHeight:b0,paddingLeft:x0,paddingRight:x0},children:x.Children.map(e,(N,O)=>i.jsx("div",{ref:j=>{s.current[O]=j},className:"relative flex items-center justify-center transition-[transform,box-shadow] duration-500 will-change-transform",style:{...vA(O),minHeight:b0},onMouseEnter:()=>b(O),onMouseLeave:()=>b(null),children:N},N&&typeof N=="object"&&"key"in N?N.key:O))})})]})}function xA({deck:t,services:e,credentials:r=[],playbooks:s=[],collectionWarnings:n,onDrop:a,onDragStart:o,onCredentialDragStart:l,onPlaybookDragStart:c,onDragEnd:u,onCardClick:d,onPlaybookClick:h,onCredentialClick:v}){const p=m=>{m.preventDefault(),a(m)},w=m=>{m.preventDefault()},f=e.length+r.length+s.length;return i.jsxs("div",{className:"flex h-full min-w-0 flex-col overflow-hidden",children:[i.jsx("div",{className:"mb-4 shrink-0 flex items-center justify-between",children:i.jsxs("h3",{className:"text-lg font-bold flex items-center",children:[i.jsx("i",{className:"fas fa-layer-group mr-2 text-blue-400"}),"Deck",i.jsx("span",{className:"ml-2 text-sm font-normal text-gray-400",children:t.name}),i.jsxs("span",{className:"ml-2 text-sm font-normal text-gray-400",children:["(",f," cards)"]})]})}),i.jsx("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-x-hidden overflow-y-visible rounded-xl border-2 border-dashed px-4 py-2 min-w-0",onDrop:p,onDragOver:w,style:{minHeight:"200px",background:"linear-gradient(135deg, rgba(196, 182, 67, 0.1), rgba(212, 199, 96, 0.1))",borderColor:"rgba(196, 182, 67, 0.3)"},"data-testid":"deck-drop-zone",children:i.jsx("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-x-hidden overflow-y-visible min-w-0",children:f===0?i.jsx("div",{className:"text-center",children:i.jsx("div",{className:"w-32 h-48 border-2 border-dashed border-gray-500 rounded-lg flex items-center justify-center opacity-50 hover:opacity-75 transition-all mb-4",children:i.jsx(Vs,{className:"w-8 h-8 text-gray-500"})})}):i.jsxs(yA,{cardCount:f,children:[r.map((m,g)=>i.jsxs("div",{className:"w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3 transition-shadow duration-500 shadow-lg hover:shadow-2xl bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900 relative overflow-hidden cursor-pointer",style:{borderColor:ur,boxShadow:`0 0 20px ${ur}20`},draggable:!0,onDragStart:y=>l(y,m,!0),onDragEnd:u,onClick:()=>v==null?void 0:v(m),"data-testid":`deck-card-${m.id}`,children:[i.jsx(Vo,{warnings:n==null?void 0:n.credentialWarnings.get(m.id)}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:ur},children:"AK"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:ur},children:"AK"})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:ur},children:i.jsx(kS,{credential:m,color:ur})}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:ur},children:m.label}),i.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:ur,borderColor:ur},children:m.hasSecret?"API Key":"Missing key"})]})]},m.id)),s.map((m,g)=>i.jsxs("div",{className:"w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3 transition-shadow duration-500 shadow-lg hover:shadow-2xl bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900 relative overflow-hidden cursor-pointer",style:{borderColor:Zr,boxShadow:`0 0 20px ${Zr}20`},draggable:!0,onDragStart:y=>c(y,m,!0),onDragEnd:u,onClick:()=>h==null?void 0:h(m),"data-testid":`deck-card-${m.id}`,children:[i.jsx(Vo,{warnings:n==null?void 0:n.playbookWarnings.get(m.id)}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:Zr},children:"PB"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:Zr},children:"PB"})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:Zr},children:i.jsx(Sv,{className:"h-7 w-7",strokeWidth:2.25})}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:Zr},children:m.title}),i.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:Zr,borderColor:Zr},children:"Playbook"})]})]},m.id)),e.map(m=>i.jsxs("div",{className:"w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3 transition-shadow duration-500 shadow-lg hover:shadow-2xl bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900 relative overflow-hidden cursor-pointer",style:{borderColor:mn(m),boxShadow:`0 0 20px ${mn(m)}20`},draggable:!0,onDragStart:g=>o(g,m,!0),onDragEnd:u,onClick:()=>d==null?void 0:d(m),"data-testid":`deck-card-${m.id}`,children:[i.jsx(Vo,{warnings:n==null?void 0:n.serviceWarnings.get(m.id)}),i.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:i.jsx("div",{className:"leading-none",style:{color:mn(m)},children:m.type==="mcp"?"RM":m.type==="local-mcp"?"LM":"A"})}),i.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:i.jsx("div",{className:"leading-none",style:{color:mn(m)},children:m.type==="mcp"?"RM":m.type==="local-mcp"?"LM":"A"})}),i.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"mb-2",style:{color:mn(m)},children:i.jsx(PS,{service:m})}),i.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:mn(m)},children:m.name}),i.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:mn(m),borderColor:mn(m)},children:m.type==="mcp"?"Remote MCP":m.type==="local-mcp"?"Local MCP":"A2A"})]})]},m.id))]})})})]})}var Ff="focusScope.autoFocusOnMount",Lf="focusScope.autoFocusOnUnmount",S0={bubbles:!1,cancelable:!0},wA="FocusScope",Mv=x.forwardRef((t,e)=>{const{loop:r=!1,trapped:s=!1,onMountAutoFocus:n,onUnmountAutoFocus:a,...o}=t,[l,c]=x.useState(null),u=Ur(n),d=Ur(a),h=x.useRef(null),v=et(e,f=>c(f)),p=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(s){let f=function(b){if(p.paused||!l)return;const S=b.target;l.contains(S)?h.current=S:Ss(h.current,{select:!0})},m=function(b){if(p.paused||!l)return;const S=b.relatedTarget;S!==null&&(l.contains(S)||Ss(h.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const E of b)E.removedNodes.length>0&&Ss(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",m);const y=new MutationObserver(g);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",m),y.disconnect()}}},[s,l,p.paused]),x.useEffect(()=>{if(l){E0.add(p);const f=document.activeElement;if(!l.contains(f)){const g=new CustomEvent(Ff,S0);l.addEventListener(Ff,u),l.dispatchEvent(g),g.defaultPrevented||(bA(PA(TS(l)),{select:!0}),document.activeElement===f&&Ss(l))}return()=>{l.removeEventListener(Ff,u),setTimeout(()=>{const g=new CustomEvent(Lf,S0);l.addEventListener(Lf,d),l.dispatchEvent(g),g.defaultPrevented||Ss(f??document.body,{select:!0}),l.removeEventListener(Lf,d),E0.remove(p)},0)}}},[l,u,d,p]);const w=x.useCallback(f=>{if(!r&&!s||p.paused)return;const m=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,g=document.activeElement;if(m&&g){const y=f.currentTarget,[b,S]=SA(y);b&&S?!f.shiftKey&&g===S?(f.preventDefault(),r&&Ss(b,{select:!0})):f.shiftKey&&g===b&&(f.preventDefault(),r&&Ss(S,{select:!0})):g===y&&f.preventDefault()}},[r,s,p.paused]);return i.jsx(Ae.div,{tabIndex:-1,...o,ref:v,onKeyDown:w})});Mv.displayName=wA;function bA(t,{select:e=!1}={}){const r=document.activeElement;for(const s of t)if(Ss(s,{select:e}),document.activeElement!==r)return}function SA(t){const e=TS(t),r=_0(e,t),s=_0(e.reverse(),t);return[r,s]}function TS(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const n=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||n?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function _0(t,e){for(const r of t)if(!_A(r,{upTo:e}))return r}function _A(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function EA(t){return t instanceof HTMLInputElement&&"select"in t}function Ss(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&EA(t)&&e&&t.select()}}var E0=CA();function CA(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=C0(t,e),t.unshift(e)},remove(e){var r;t=C0(t,e),(r=t[0])==null||r.resume()}}}function C0(t,e){const r=[...t],s=r.indexOf(e);return s!==-1&&r.splice(s,1),r}function PA(t){return t.filter(e=>e.tagName!=="A")}var Uf=0;function AS(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??P0()),document.body.insertAdjacentElement("beforeend",t[1]??P0()),Uf++,()=>{Uf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Uf--}},[])}function P0(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var _n=function(){return _n=Object.assign||function(e){for(var r,s=1,n=arguments.length;s<n;s++){r=arguments[s];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_n.apply(this,arguments)};function OS(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(r[s[n]]=t[s[n]]);return r}function kA(t,e,r){if(r||arguments.length===2)for(var s=0,n=e.length,a;s<n;s++)(a||!(s in e))&&(a||(a=Array.prototype.slice.call(e,0,s)),a[s]=e[s]);return t.concat(a||Array.prototype.slice.call(e))}var Jc="right-scroll-bar-position",Xc="width-before-scroll-bar",NA="with-scroll-bars-hidden",jA="--removed-body-scroll-bar-size";function zf(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function RA(t,e){var r=x.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(s){var n=r.value;n!==s&&(r.value=s,r.callback(s,n))}}}})[0];return r.callback=e,r.facade}var TA=typeof window<"u"?x.useLayoutEffect:x.useEffect,k0=new WeakMap;function AA(t,e){var r=RA(null,function(s){return t.forEach(function(n){return zf(n,s)})});return TA(function(){var s=k0.get(r);if(s){var n=new Set(s),a=new Set(t),o=r.current;n.forEach(function(l){a.has(l)||zf(l,null)}),a.forEach(function(l){n.has(l)||zf(l,o)})}k0.set(r,t)},[t]),r}function OA(t){return t}function IA(t,e){e===void 0&&(e=OA);var r=[],s=!1,n={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(a){var o=e(a,s);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(a){for(s=!0;r.length;){var o=r;r=[],o.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){s=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(a),o=r}var c=function(){var d=o;o=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),r}}}};return n}function DA(t){t===void 0&&(t={});var e=IA(null);return e.options=_n({async:!0,ssr:!1},t),e}var IS=function(t){var e=t.sideCar,r=OS(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=e.read();if(!s)throw new Error("Sidecar medium not found");return x.createElement(s,_n({},r))};IS.isSideCarExport=!0;function MA(t,e){return t.useMedium(e),IS}var DS=DA(),Vf=function(){},Fd=x.forwardRef(function(t,e){var r=x.useRef(null),s=x.useState({onScrollCapture:Vf,onWheelCapture:Vf,onTouchMoveCapture:Vf}),n=s[0],a=s[1],o=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,h=t.shards,v=t.sideCar,p=t.noRelative,w=t.noIsolation,f=t.inert,m=t.allowPinchZoom,g=t.as,y=g===void 0?"div":g,b=t.gapMode,S=OS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=v,P=AA([r,e]),R=_n(_n({},S),n);return x.createElement(x.Fragment,null,d&&x.createElement(E,{sideCar:DS,removeScrollBar:u,shards:h,noRelative:p,noIsolation:w,inert:f,setCallbacks:a,allowPinchZoom:!!m,lockRef:r,gapMode:b}),o?x.cloneElement(x.Children.only(l),_n(_n({},R),{ref:P})):x.createElement(y,_n({},R,{className:c,ref:P}),l))});Fd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fd.classNames={fullWidth:Xc,zeroRight:Jc};var $A=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function FA(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=$A();return e&&t.setAttribute("nonce",e),t}function LA(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function UA(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var zA=function(){var t=0,e=null;return{add:function(r){t==0&&(e=FA())&&(LA(e,r),UA(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},VA=function(){var t=zA();return function(e,r){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},MS=function(){var t=VA(),e=function(r){var s=r.styles,n=r.dynamic;return t(s,n),null};return e},HA={left:0,top:0,right:0,gap:0},Hf=function(t){return parseInt(t||"",10)||0},qA=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],s=e[t==="padding"?"paddingTop":"marginTop"],n=e[t==="padding"?"paddingRight":"marginRight"];return[Hf(r),Hf(s),Hf(n)]},BA=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return HA;var e=qA(t),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,s-r+e[2]-e[0])}},WA=MS(),Ho="data-scroll-locked",KA=function(t,e,r,s){var n=t.left,a=t.top,o=t.right,l=t.gap;return r===void 0&&(r="margin"),`
|
|
255
|
-
.`.concat(NA,` {
|
|
256
|
-
overflow: hidden `).concat(s,`;
|
|
257
|
-
padding-right: `).concat(l,"px ").concat(s,`;
|
|
258
|
-
}
|
|
259
|
-
body[`).concat(Ho,`] {
|
|
260
|
-
overflow: hidden `).concat(s,`;
|
|
261
|
-
overscroll-behavior: contain;
|
|
262
|
-
`).concat([e&&"position: relative ".concat(s,";"),r==="margin"&&`
|
|
263
|
-
padding-left: `.concat(n,`px;
|
|
264
|
-
padding-top: `).concat(a,`px;
|
|
265
|
-
padding-right: `).concat(o,`px;
|
|
266
|
-
margin-left:0;
|
|
267
|
-
margin-top:0;
|
|
268
|
-
margin-right: `).concat(l,"px ").concat(s,`;
|
|
269
|
-
`),r==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";")].filter(Boolean).join(""),`
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.`).concat(Jc,` {
|
|
273
|
-
right: `).concat(l,"px ").concat(s,`;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.`).concat(Xc,` {
|
|
277
|
-
margin-right: `).concat(l,"px ").concat(s,`;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.`).concat(Jc," .").concat(Jc,` {
|
|
281
|
-
right: 0 `).concat(s,`;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.`).concat(Xc," .").concat(Xc,` {
|
|
285
|
-
margin-right: 0 `).concat(s,`;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
body[`).concat(Ho,`] {
|
|
289
|
-
`).concat(jA,": ").concat(l,`px;
|
|
290
|
-
}
|
|
291
|
-
`)},N0=function(){var t=parseInt(document.body.getAttribute(Ho)||"0",10);return isFinite(t)?t:0},QA=function(){x.useEffect(function(){return document.body.setAttribute(Ho,(N0()+1).toString()),function(){var t=N0()-1;t<=0?document.body.removeAttribute(Ho):document.body.setAttribute(Ho,t.toString())}},[])},GA=function(t){var e=t.noRelative,r=t.noImportant,s=t.gapMode,n=s===void 0?"margin":s;QA();var a=x.useMemo(function(){return BA(n)},[n]);return x.createElement(WA,{styles:KA(a,!e,n,r?"":"!important")})},Sp=!1;if(typeof window<"u")try{var jc=Object.defineProperty({},"passive",{get:function(){return Sp=!0,!0}});window.addEventListener("test",jc,jc),window.removeEventListener("test",jc,jc)}catch{Sp=!1}var co=Sp?{passive:!1}:!1,ZA=function(t){return t.tagName==="TEXTAREA"},$S=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!ZA(t)&&r[e]==="visible")},YA=function(t){return $S(t,"overflowY")},JA=function(t){return $S(t,"overflowX")},j0=function(t,e){var r=e.ownerDocument,s=e;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var n=FS(t,s);if(n){var a=LS(t,s),o=a[1],l=a[2];if(o>l)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},XA=function(t){var e=t.scrollTop,r=t.scrollHeight,s=t.clientHeight;return[e,r,s]},eO=function(t){var e=t.scrollLeft,r=t.scrollWidth,s=t.clientWidth;return[e,r,s]},FS=function(t,e){return t==="v"?YA(e):JA(e)},LS=function(t,e){return t==="v"?XA(e):eO(e)},tO=function(t,e){return t==="h"&&e==="rtl"?-1:1},rO=function(t,e,r,s,n){var a=tO(t,window.getComputedStyle(e).direction),o=a*s,l=r.target,c=e.contains(l),u=!1,d=o>0,h=0,v=0;do{if(!l)break;var p=LS(t,l),w=p[0],f=p[1],m=p[2],g=f-m-a*w;(w||g)&&FS(t,l)&&(h+=g,v+=w);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!c&&l!==document.body||c&&(e.contains(l)||e===l));return(d&&Math.abs(h)<1||!d&&Math.abs(v)<1)&&(u=!0),u},Rc=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},R0=function(t){return[t.deltaX,t.deltaY]},T0=function(t){return t&&"current"in t?t.current:t},nO=function(t,e){return t[0]===e[0]&&t[1]===e[1]},sO=function(t){return`
|
|
292
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
293
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
294
|
-
`)},aO=0,uo=[];function oO(t){var e=x.useRef([]),r=x.useRef([0,0]),s=x.useRef(),n=x.useState(aO++)[0],a=x.useState(MS)[0],o=x.useRef(t);x.useEffect(function(){o.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(n));var f=kA([t.lockRef.current],(t.shards||[]).map(T0),!0).filter(Boolean);return f.forEach(function(m){return m.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),f.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(n))})}}},[t.inert,t.lockRef.current,t.shards]);var l=x.useCallback(function(f,m){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!o.current.allowPinchZoom;var g=Rc(f),y=r.current,b="deltaX"in f?f.deltaX:y[0]-g[0],S="deltaY"in f?f.deltaY:y[1]-g[1],E,P=f.target,R=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in f&&R==="h"&&P.type==="range")return!1;var T=j0(R,P);if(!T)return!0;if(T?E=R:(E=R==="v"?"h":"v",T=j0(R,P)),!T)return!1;if(!s.current&&"changedTouches"in f&&(b||S)&&(s.current=E),!E)return!0;var N=s.current||E;return rO(N,m,f,N==="h"?b:S)},[]),c=x.useCallback(function(f){var m=f;if(!(!uo.length||uo[uo.length-1]!==a)){var g="deltaY"in m?R0(m):Rc(m),y=e.current.filter(function(E){return E.name===m.type&&(E.target===m.target||m.target===E.shadowParent)&&nO(E.delta,g)})[0];if(y&&y.should){m.cancelable&&m.preventDefault();return}if(!y){var b=(o.current.shards||[]).map(T0).filter(Boolean).filter(function(E){return E.contains(m.target)}),S=b.length>0?l(m,b[0]):!o.current.noIsolation;S&&m.cancelable&&m.preventDefault()}}},[]),u=x.useCallback(function(f,m,g,y){var b={name:f,delta:m,target:g,should:y,shadowParent:iO(g)};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(S){return S!==b})},1)},[]),d=x.useCallback(function(f){r.current=Rc(f),s.current=void 0},[]),h=x.useCallback(function(f){u(f.type,R0(f),f.target,l(f,t.lockRef.current))},[]),v=x.useCallback(function(f){u(f.type,Rc(f),f.target,l(f,t.lockRef.current))},[]);x.useEffect(function(){return uo.push(a),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:v}),document.addEventListener("wheel",c,co),document.addEventListener("touchmove",c,co),document.addEventListener("touchstart",d,co),function(){uo=uo.filter(function(f){return f!==a}),document.removeEventListener("wheel",c,co),document.removeEventListener("touchmove",c,co),document.removeEventListener("touchstart",d,co)}},[]);var p=t.removeScrollBar,w=t.inert;return x.createElement(x.Fragment,null,w?x.createElement(a,{styles:sO(n)}):null,p?x.createElement(GA,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function iO(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const lO=MA(DS,oO);var $v=x.forwardRef(function(t,e){return x.createElement(Fd,_n({},t,{ref:e,sideCar:lO}))});$v.classNames=Fd.classNames;var cO=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},fo=new WeakMap,Tc=new WeakMap,Ac={},qf=0,US=function(t){return t&&(t.host||US(t.parentNode))},uO=function(t,e){return e.map(function(r){if(t.contains(r))return r;var s=US(r);return s&&t.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},dO=function(t,e,r,s){var n=uO(e,Array.isArray(t)?t:[t]);Ac[r]||(Ac[r]=new WeakMap);var a=Ac[r],o=[],l=new Set,c=new Set(n),u=function(h){!h||l.has(h)||(l.add(h),u(h.parentNode))};n.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(v){if(l.has(v))d(v);else try{var p=v.getAttribute(s),w=p!==null&&p!=="false",f=(fo.get(v)||0)+1,m=(a.get(v)||0)+1;fo.set(v,f),a.set(v,m),o.push(v),f===1&&w&&Tc.set(v,!0),m===1&&v.setAttribute(r,"true"),w||v.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",v,g)}})};return d(e),l.clear(),qf++,function(){o.forEach(function(h){var v=fo.get(h)-1,p=a.get(h)-1;fo.set(h,v),a.set(h,p),v||(Tc.has(h)||h.removeAttribute(s),Tc.delete(h)),p||h.removeAttribute(r)}),qf--,qf||(fo=new WeakMap,fo=new WeakMap,Tc=new WeakMap,Ac={})}},zS=function(t,e,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(t)?t:[t]),n=cO(t);return n?(s.push.apply(s,Array.from(n.querySelectorAll("[aria-live], script"))),dO(s,n,r,"aria-hidden")):function(){return null}},Ld="Dialog",[VS,BF]=fs(Ld),[fO,ln]=VS(Ld),HS=t=>{const{__scopeDialog:e,children:r,open:s,defaultOpen:n,onOpenChange:a,modal:o=!0}=t,l=x.useRef(null),c=x.useRef(null),[u,d]=Ka({prop:s,defaultProp:n??!1,onChange:a,caller:Ld});return i.jsx(fO,{scope:e,triggerRef:l,contentRef:c,contentId:ea(),titleId:ea(),descriptionId:ea(),open:u,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(h=>!h),[d]),modal:o,children:r})};HS.displayName=Ld;var qS="DialogTrigger",hO=x.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,n=ln(qS,r),a=et(e,n.triggerRef);return i.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":Uv(n.open),...s,ref:a,onClick:_e(t.onClick,n.onOpenToggle)})});hO.displayName=qS;var Fv="DialogPortal",[pO,BS]=VS(Fv,{forceMount:void 0}),WS=t=>{const{__scopeDialog:e,forceMount:r,children:s,container:n}=t,a=ln(Fv,e);return i.jsx(pO,{scope:e,forceMount:r,children:x.Children.map(s,o=>i.jsx(da,{present:r||a.open,children:i.jsx(Cd,{asChild:!0,container:n,children:o})}))})};WS.displayName=Fv;var Lu="DialogOverlay",KS=x.forwardRef((t,e)=>{const r=BS(Lu,t.__scopeDialog),{forceMount:s=r.forceMount,...n}=t,a=ln(Lu,t.__scopeDialog);return a.modal?i.jsx(da,{present:s||a.open,children:i.jsx(vO,{...n,ref:e})}):null});KS.displayName=Lu;var mO=fi("DialogOverlay.RemoveScroll"),vO=x.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,n=ln(Lu,r);return i.jsx($v,{as:mO,allowPinchZoom:!0,shards:[n.contentRef],children:i.jsx(Ae.div,{"data-state":Uv(n.open),...s,ref:e,style:{pointerEvents:"auto",...s.style}})})}),Ga="DialogContent",QS=x.forwardRef((t,e)=>{const r=BS(Ga,t.__scopeDialog),{forceMount:s=r.forceMount,...n}=t,a=ln(Ga,t.__scopeDialog);return i.jsx(da,{present:s||a.open,children:a.modal?i.jsx(gO,{...n,ref:e}):i.jsx(yO,{...n,ref:e})})});QS.displayName=Ga;var gO=x.forwardRef((t,e)=>{const r=ln(Ga,t.__scopeDialog),s=x.useRef(null),n=et(e,r.contentRef,s);return x.useEffect(()=>{const a=s.current;if(a)return zS(a)},[]),i.jsx(GS,{...t,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(t.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:_e(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&a.preventDefault()}),onFocusOutside:_e(t.onFocusOutside,a=>a.preventDefault())})}),yO=x.forwardRef((t,e)=>{const r=ln(Ga,t.__scopeDialog),s=x.useRef(!1),n=x.useRef(!1);return i.jsx(GS,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,l;(o=t.onCloseAutoFocus)==null||o.call(t,a),a.defaultPrevented||(s.current||(l=r.triggerRef.current)==null||l.focus(),a.preventDefault()),s.current=!1,n.current=!1},onInteractOutside:a=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,a),a.defaultPrevented||(s.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const o=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),GS=x.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:n,onCloseAutoFocus:a,...o}=t,l=ln(Ga,r),c=x.useRef(null),u=et(e,c);return AS(),i.jsxs(i.Fragment,{children:[i.jsx(Mv,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:n,onUnmountAutoFocus:a,children:i.jsx(Vl,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Uv(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(xO,{titleId:l.titleId}),i.jsx(bO,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Lv="DialogTitle",ZS=x.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,n=ln(Lv,r);return i.jsx(Ae.h2,{id:n.titleId,...s,ref:e})});ZS.displayName=Lv;var YS="DialogDescription",JS=x.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,n=ln(YS,r);return i.jsx(Ae.p,{id:n.descriptionId,...s,ref:e})});JS.displayName=YS;var XS="DialogClose",e_=x.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,n=ln(XS,r);return i.jsx(Ae.button,{type:"button",...s,ref:e,onClick:_e(t.onClick,()=>n.onOpenChange(!1))})});e_.displayName=XS;function Uv(t){return t?"open":"closed"}var t_="DialogTitleWarning",[WF,r_]=kj(t_,{contentName:Ga,titleName:Lv,docsSlug:"dialog"}),xO=({titleId:t})=>{const e=r_(t_),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
295
|
-
|
|
296
|
-
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
297
|
-
|
|
298
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return x.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},wO="DialogDescriptionWarning",bO=({contentRef:t,descriptionId:e})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r_(wO).contentName}}.`;return x.useEffect(()=>{var a;const n=(a=t.current)==null?void 0:a.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(s))},[s,t,e]),null},SO=HS,_O=WS,n_=KS,s_=QS,a_=ZS,o_=JS,EO=e_;const ao=SO,CO=_O,i_=x.forwardRef(({className:t,...e},r)=>i.jsx(n_,{ref:r,className:Te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));i_.displayName=n_.displayName;const fa=x.forwardRef(({className:t,children:e,...r},s)=>i.jsxs(CO,{children:[i.jsx(i_,{}),i.jsxs(s_,{ref:s,className:Te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[e,i.jsxs(EO,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[i.jsx(Iu,{className:"h-4 w-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fa.displayName=s_.displayName;const ha=({className:t,...e})=>i.jsx("div",{className:Te("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});ha.displayName="DialogHeader";const pa=x.forwardRef(({className:t,...e},r)=>i.jsx(a_,{ref:r,className:Te("text-lg font-semibold leading-none tracking-tight",t),...e}));pa.displayName=a_.displayName;const Ci=x.forwardRef(({className:t,...e},r)=>i.jsx(o_,{ref:r,className:Te("text-sm text-muted-foreground",t),...e}));Ci.displayName=o_.displayName;const tt=x.forwardRef(({className:t,type:e,...r},s)=>i.jsx("input",{type:e,className:Te("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:s,...r}));tt.displayName="Input";const Gn=x.forwardRef(({className:t,...e},r)=>i.jsx("textarea",{className:Te("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...e}));Gn.displayName="Textarea";var PO="Label",l_=x.forwardRef((t,e)=>i.jsx(Ae.label,{...t,ref:e,onMouseDown:r=>{var n;r.target.closest("button, input, select, textarea")||((n=t.onMouseDown)==null||n.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));l_.displayName=PO;var c_=l_;const kO=Nd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ke=x.forwardRef(({className:t,...e},r)=>i.jsx(c_,{ref:r,className:Te(kO(),t),...e}));Ke.displayName=c_.displayName;var NO=x.createContext(void 0);function zv(t){const e=x.useContext(NO);return t||e||"ltr"}var Bf="rovingFocusGroup.onEntryFocus",jO={bubbles:!1,cancelable:!0},Bl="RovingFocusGroup",[_p,u_,RO]=yv(Bl),[TO,d_]=fs(Bl,[RO]),[AO,OO]=TO(Bl),f_=x.forwardRef((t,e)=>i.jsx(_p.Provider,{scope:t.__scopeRovingFocusGroup,children:i.jsx(_p.Slot,{scope:t.__scopeRovingFocusGroup,children:i.jsx(IO,{...t,ref:e})})}));f_.displayName=Bl;var IO=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:s,loop:n=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=t,v=x.useRef(null),p=et(e,v),w=zv(a),[f,m]=Ka({prop:o,defaultProp:l??null,onChange:c,caller:Bl}),[g,y]=x.useState(!1),b=Ur(u),S=u_(r),E=x.useRef(!1),[P,R]=x.useState(0);return x.useEffect(()=>{const T=v.current;if(T)return T.addEventListener(Bf,b),()=>T.removeEventListener(Bf,b)},[b]),i.jsx(AO,{scope:r,orientation:s,dir:w,loop:n,currentTabStopId:f,onItemFocus:x.useCallback(T=>m(T),[m]),onItemShiftTab:x.useCallback(()=>y(!0),[]),onFocusableItemAdd:x.useCallback(()=>R(T=>T+1),[]),onFocusableItemRemove:x.useCallback(()=>R(T=>T-1),[]),children:i.jsx(Ae.div,{tabIndex:g||P===0?-1:0,"data-orientation":s,...h,ref:p,style:{outline:"none",...t.style},onMouseDown:_e(t.onMouseDown,()=>{E.current=!0}),onFocus:_e(t.onFocus,T=>{const N=!E.current;if(T.target===T.currentTarget&&N&&!g){const O=new CustomEvent(Bf,jO);if(T.currentTarget.dispatchEvent(O),!O.defaultPrevented){const j=S().filter(U=>U.focusable),_=j.find(U=>U.active),A=j.find(U=>U.id===f),z=[_,A,...j].filter(Boolean).map(U=>U.ref.current);m_(z,d)}}E.current=!1}),onBlur:_e(t.onBlur,()=>y(!1))})})}),h_="RovingFocusGroupItem",p_=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:s=!0,active:n=!1,tabStopId:a,children:o,...l}=t,c=ea(),u=a||c,d=OO(h_,r),h=d.currentTabStopId===u,v=u_(r),{onFocusableItemAdd:p,onFocusableItemRemove:w,currentTabStopId:f}=d;return x.useEffect(()=>{if(s)return p(),()=>w()},[s,p,w]),i.jsx(_p.ItemSlot,{scope:r,id:u,focusable:s,active:n,children:i.jsx(Ae.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:e,onMouseDown:_e(t.onMouseDown,m=>{s?d.onItemFocus(u):m.preventDefault()}),onFocus:_e(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:_e(t.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){d.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const g=$O(m,d.orientation,d.dir);if(g!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let b=v().filter(S=>S.focusable).map(S=>S.ref.current);if(g==="last")b.reverse();else if(g==="prev"||g==="next"){g==="prev"&&b.reverse();const S=b.indexOf(m.currentTarget);b=d.loop?FO(b,S+1):b.slice(S+1)}setTimeout(()=>m_(b))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:f!=null}):o})})});p_.displayName=h_;var DO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MO(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function $O(t,e,r){const s=MO(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return DO[s]}function m_(t,e=!1){const r=document.activeElement;for(const s of t)if(s===r||(s.focus({preventScroll:e}),document.activeElement!==r))return}function FO(t,e){return t.map((r,s)=>t[(e+s)%t.length])}var LO=f_,UO=p_,Ud="Tabs",[zO,KF]=fs(Ud,[d_]),v_=d_(),[VO,Vv]=zO(Ud),g_=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:s,onValueChange:n,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=t,d=zv(l),[h,v]=Ka({prop:s,onChange:n,defaultProp:a??"",caller:Ud});return i.jsx(VO,{scope:r,baseId:ea(),value:h,onValueChange:v,orientation:o,dir:d,activationMode:c,children:i.jsx(Ae.div,{dir:d,"data-orientation":o,...u,ref:e})})});g_.displayName=Ud;var y_="TabsList",x_=x.forwardRef((t,e)=>{const{__scopeTabs:r,loop:s=!0,...n}=t,a=Vv(y_,r),o=v_(r);return i.jsx(LO,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:s,children:i.jsx(Ae.div,{role:"tablist","aria-orientation":a.orientation,...n,ref:e})})});x_.displayName=y_;var w_="TabsTrigger",b_=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:s,disabled:n=!1,...a}=t,o=Vv(w_,r),l=v_(r),c=E_(o.baseId,s),u=C_(o.baseId,s),d=s===o.value;return i.jsx(UO,{asChild:!0,...l,focusable:!n,active:d,children:i.jsx(Ae.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":n?"":void 0,disabled:n,id:c,...a,ref:e,onMouseDown:_e(t.onMouseDown,h=>{!n&&h.button===0&&h.ctrlKey===!1?o.onValueChange(s):h.preventDefault()}),onKeyDown:_e(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(s)}),onFocus:_e(t.onFocus,()=>{const h=o.activationMode!=="manual";!d&&!n&&h&&o.onValueChange(s)})})})});b_.displayName=w_;var S_="TabsContent",__=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:s,forceMount:n,children:a,...o}=t,l=Vv(S_,r),c=E_(l.baseId,s),u=C_(l.baseId,s),d=s===l.value,h=x.useRef(d);return x.useEffect(()=>{const v=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(v)},[]),i.jsx(da,{present:n||d,children:({present:v})=>i.jsx(Ae.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!v,id:u,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0},children:v&&a})})});__.displayName=S_;function E_(t,e){return`${t}-trigger-${e}`}function C_(t,e){return`${t}-content-${e}`}var HO=g_,P_=x_,k_=b_,N_=__;const qO=HO,j_=x.forwardRef(({className:t,...e},r)=>i.jsx(P_,{ref:r,className:Te("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));j_.displayName=P_.displayName;const Ep=x.forwardRef(({className:t,...e},r)=>i.jsx(k_,{ref:r,className:Te("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...e}));Ep.displayName=k_.displayName;const Cp=x.forwardRef(({className:t,...e},r)=>i.jsx(N_,{ref:r,className:Te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Cp.displayName=N_.displayName;function il(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function R_(t){return il(t)&&typeof t.command=="string"}function Wf(t){return!il(t)||Object.keys(t).length===0?!1:Object.values(t).every(R_)}function BO(t){let e=t.trim();return e.startsWith("```")?e.replace(/^```(?:json)?\s*\n?/i,"").replace(/\n?```\s*$/,"").trim():e}function WO(t){if(!il(t))throw new Error("Configuration must be a JSON object");if(il(t.config)&&Wf(t.config.mcpServers))return{mcpServers:t.config.mcpServers};if(Wf(t.mcpServers))return{mcpServers:t.mcpServers};if(il(t)&&typeof t.command=="string"){const e=typeof t.name=="string"&&t.name.trim()?t.name.trim():"local-server",{name:r,...s}=t;if(!R_(s))throw new Error("Missing or invalid command");return{mcpServers:{[e]:s}}}if(Wf(t))return{mcpServers:t};throw new Error(`Invalid configuration: expected a top-level "mcpServers" object. Example:
|
|
299
|
-
{
|
|
300
|
-
"mcpServers": {
|
|
301
|
-
"google-drive": {
|
|
302
|
-
"command": "npx",
|
|
303
|
-
"args": ["-y", "@piotr-agier/google-drive-mcp"]
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}`)}function KO(t){let e;try{e=JSON.parse(BO(t))}catch(r){throw new Error(`Failed to parse JSON: ${r instanceof Error?r.message:"Unknown error"}`)}return WO(e)}function QO({type:t,open:e,onOpenChange:r}){const[s,n]=x.useState("remote"),[a,o]=x.useState("json"),[l,c]=x.useState(`{
|
|
307
|
-
"mcpServers": {
|
|
308
|
-
"memory": {
|
|
309
|
-
"command": "npx",
|
|
310
|
-
"args": ["-y", "@modelcontextprotocol/server-memory"],
|
|
311
|
-
"env": {
|
|
312
|
-
"MEMORY_FILE_PATH": "/path/to/custom/memory.json"
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}`),[u,d]=x.useState(null),[h,v]=x.useState(null),[p,w]=x.useState(null),[f,m]=x.useState({name:"",type:"mcp",url:"http://localhost:8000/mcp",description:"",headers_enabled:!1,headers:{},cardColor:wr}),[g,y]=x.useState(`{
|
|
317
|
-
|
|
318
|
-
}`),[b,S]=x.useState(null),[E,P]=x.useState({name:"",type:"local-mcp",command:"",args:[""],env:{},description:"",cardColor:wr}),[R,T]=x.useState({name:"",type:"a2a",manifest_url:"http://localhost:8001/.well-known/a2a/manifest.json",description:"",cardColor:wr}),N=yr(),{toast:O}=or(),j=()=>{try{v(null);const L=KO(l),Q=Object.entries(L.mcpServers);if(Q.length===0)throw new Error("No MCP servers found in configuration");if(Q.length>1)throw new Error("Multiple servers not supported. Please configure one server at a time.");const[oe,Z]=Q[0],{command:ce,args:Ee,env:ve,description:te}=Z;if(!ce||typeof ce!="string")throw new Error("Missing or invalid command");if(!Ee||!Array.isArray(Ee))throw new Error("Missing or invalid args array");const we={name:oe,command:ce,args:Ee.map(String),env:ve&&typeof ve=="object"?ve:void 0,description:te&&typeof te=="string"?te:void 0};d(we),o("review"),P({name:we.name,type:"local-mcp",command:we.command,args:we.args,env:we.env||{},description:we.description||"",cardColor:wr}),_(oe)}catch(L){v(L instanceof Error?L.message:"Failed to parse JSON"),d(null)}},_=async L=>{try{const Z=((await Oe("GET","/api/services")).data||[]).find(ce=>ce.name===L);w(Z?L:null)}catch(Q){console.error("Failed to check name conflict:",Q)}},A=async L=>{await _(L)},C=At({mutationFn:async L=>{if(t==="mcp"&&s==="local"){const Q={mcpServers:{[L.name]:{command:L.command,args:L.args.filter(oe=>oe.trim()!==""),...Object.keys(L.env).length>0&&{env:L.env}}}};return console.log("Importing local MCP server:",Q),Oe("POST","/api/local-mcp/import",{config:JSON.stringify(Q)})}else{const Q={name:L.name,type:t,url:t==="mcp"?L.url:L.manifest_url,description:L.description,cardColor:L.cardColor,...L.headers_enabled&&{headers:L.headers}};return console.log("Sending service data:",Q),Oe("POST","/api/services",Q)}},onSuccess:()=>{N.invalidateQueries({queryKey:["/api/services"]}),N.invalidateQueries({queryKey:["/api/collection/warnings"]}),O({title:"Service registered successfully!",description:`${(t==="mcp"?s==="remote"?f:E:R).name} has been added to your collection.`}),U()},onError:L=>{var Q;console.error("Registration failed:",L),console.error("Error details:",{message:L==null?void 0:L.message,name:L==null?void 0:L.name,stack:L==null?void 0:L.stack,toString:L==null?void 0:L.toString(),constructor:(Q=L==null?void 0:L.constructor)==null?void 0:Q.name}),O({title:"Registration failed",description:(L==null?void 0:L.message)||"Failed to register service. Please try again.",variant:"destructive"})}}),z=async()=>{if(t==="mcp"&&s==="local"){if(a==="json")j();else if(a==="review"){if(await A(E.name),p){O({title:"Name Conflict",description:`A service with the name "${E.name}" already exists. Please choose a different name.`,variant:"destructive"});return}C.mutate(E)}}else{const L=t==="mcp"?s==="remote"?f:E:R;if(await A(L.name),p){O({title:"Name Conflict",description:`A service with the name "${L.name}" already exists. Please choose a different name.`,variant:"destructive"});return}if(t==="mcp"&&s==="remote"&&f.headers_enabled){const Q=F();if(Q===null)return;C.mutate({...f,headers:Q});return}C.mutate(L)}},U=()=>{o("json"),c(`{
|
|
319
|
-
"mcpServers": {
|
|
320
|
-
"memory": {
|
|
321
|
-
"command": "npx",
|
|
322
|
-
"args": ["-y", "@modelcontextprotocol/server-memory"],
|
|
323
|
-
"env": {
|
|
324
|
-
"MEMORY_FILE_PATH": "/path/to/custom/memory.json"
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}`),d(null),v(null),w(null),m({name:"",type:"mcp",url:"http://localhost:8000/mcp",description:"",headers_enabled:!1,headers:{},cardColor:wr}),y(`{
|
|
329
|
-
|
|
330
|
-
}`),S(null),P({name:"",type:"local-mcp",command:"",args:[""],env:{},description:"",cardColor:wr}),T({name:"",type:"a2a",manifest_url:"http://localhost:8001/.well-known/a2a/manifest.json",description:"",cardColor:wr}),r(!1)},K=(L,Q)=>{m(oe=>({...oe,[L]:Q}))},$=L=>{K("headers_enabled",L),L&&g.trim()===`{
|
|
331
|
-
|
|
332
|
-
}`&&y(`{
|
|
333
|
-
"Authorization": "Bearer "
|
|
334
|
-
}`),L||S(null)},F=()=>{const L=g.trim();if(!L||L==="{}")return{};try{const Q=JSON.parse(L);if(typeof Q!="object"||Q===null||Array.isArray(Q))return S('Headers must be a JSON object (e.g. {"Authorization": "Bearer token"})'),null;for(const[oe,Z]of Object.entries(Q))if(typeof Z!="string")return S(`Header "${oe}" must be a string value`),null;return S(null),Q}catch{return S("Invalid JSON — fix syntax before registering"),null}},V=(L,Q)=>{P(oe=>({...oe,[L]:Q}))},ae=(L,Q)=>{T(oe=>({...oe,[L]:Q}))},se=()=>{if(t==="mcp"&&s==="local"){if(a==="json")return"Parse Configuration";if(a==="review")return p?"Register Anyway":"Register Service"}return"Register Service"},W=()=>{var L,Q;if(t==="mcp"&&s==="local"){if(a==="json")return!l.trim();if(a==="review")return!E.name.trim()||!E.command.trim()}else{const oe=t==="mcp"?s==="remote"?f:E:R;return!oe.name.trim()||t==="mcp"&&s==="remote"&&!((L=oe.url)!=null&&L.trim())||t==="a2a"&&!((Q=oe.manifest_url)!=null&&Q.trim())}return!1};return i.jsx(ao,{open:e,onOpenChange:r,children:i.jsxs(fa,{className:"sm:max-w-2xl max-h-[90vh] overflow-y-auto bg-black/40 backdrop-blur-md border border-white/10 text-white shadow-2xl",children:[i.jsxs(ha,{children:[i.jsxs(pa,{className:"text-2xl font-bold flex items-center",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:[t==="mcp"?i.jsx(Au,{className:"w-6 h-6 mr-3",style:{color:"#92E4DD"}}):i.jsx(S2,{className:"w-6 h-6 mr-3",style:{color:"#92E4DD"}}),"Register ",t==="mcp"?"MCP Server":"A2A Agent"]}),i.jsx(Ci,{className:"mt-2",style:{color:"#92E4DD",opacity:.8},children:t==="mcp"?"Add a new Model Context Protocol (MCP) server to your service deck. Configure the server URL and provide details for registration.":"Register a new A2A agent with your service deck. Provide the agent manifest and configuration details."})]}),t==="mcp"?i.jsxs(qO,{value:s,onValueChange:L=>n(L),className:"w-full",children:[i.jsxs(j_,{className:"grid w-full grid-cols-2 bg-white/10 border border-white/20",children:[i.jsxs(Ep,{value:"remote",className:"data-[state=active]:bg-white/20 data-[state=active]:text-white text-gray-400",children:[i.jsx(Au,{className:"w-4 h-4 mr-2"}),"Remote MCP"]}),i.jsxs(Ep,{value:"local",className:"data-[state=active]:bg-white/20 data-[state=active]:text-white text-gray-400",children:[i.jsx(R2,{className:"w-4 h-4 mr-2"}),"Local MCP"]})]}),i.jsxs(Cp,{value:"remote",className:"space-y-4 mt-4",children:[i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Server Name"}),i.jsx(tt,{id:"name",placeholder:"e.g., Database Tools",value:f.name,onChange:L=>{K("name",L.target.value),L.target.value.trim()?A(L.target.value):w(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-service-name"}),p&&i.jsxs("div",{className:"flex items-center gap-2 mt-1 text-red-400 text-sm",children:[i.jsx(tn,{className:"w-4 h-4"}),i.jsx("span",{children:"A service with this name already exists"})]})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"url",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"MCP URL"}),i.jsx(tt,{id:"url",type:"url",placeholder:"http://localhost:8080/mcp or https://mcp.notion.com/mcp",value:f.url,onChange:L=>K("url",L.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-mcp-url"}),i.jsxs("div",{className:"mt-1 text-xs text-gray-400",children:[i.jsx("p",{children:"Supported formats:"}),i.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[i.jsxs("li",{children:["HTTP MCP: ",i.jsx("code",{children:"http://localhost:8080/mcp"})]}),i.jsxs("li",{children:["SSE MCP: ",i.jsx("code",{children:"https://be.omnimcp.ai/api/v1/mcp/.../sse"})]}),i.jsxs("li",{children:["Notion MCP: ",i.jsx("code",{children:"https://mcp.notion.com/mcp"})]})]})]})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),i.jsx(Gn,{id:"description",placeholder:"Brief description of capabilities...",value:f.description,onChange:L=>K("description",L.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-description"})]})]}),i.jsxs(Cp,{value:"local",className:"space-y-4 mt-4",children:[a==="json"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"local-json",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Local MCP Configuration (JSON)"}),i.jsx(Gn,{id:"local-json",placeholder:`{
|
|
335
|
-
"mcpServers": {
|
|
336
|
-
"memory": {
|
|
337
|
-
"command": "npx",
|
|
338
|
-
"args": ["-y", "@modelcontextprotocol/server-memory"]
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}`,value:l,onChange:L=>c(L.target.value),rows:12,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none font-mono text-xs","data-testid":"textarea-local-json"}),i.jsxs("div",{className:"mt-2 text-xs text-gray-400",children:[i.jsx("p",{children:"Enter your local MCP server configuration in JSON format."}),i.jsx("p",{children:"Example:"}),i.jsx("pre",{className:"bg-white/10 p-2 rounded-md text-xs text-gray-300",children:`{
|
|
342
|
-
"mcpServers": {
|
|
343
|
-
"memory": {
|
|
344
|
-
"command": "npx",
|
|
345
|
-
"args": ["-y", "@modelcontextprotocol/server-memory"],
|
|
346
|
-
"env": {
|
|
347
|
-
"MEMORY_FILE_PATH": "/path/to/custom/memory.json"
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}`})]})]}),i.jsxs(me,{type:"button",className:"flex-1 border",style:{background:"linear-gradient(135deg, #C4B643, #D4C760)",borderColor:"#C4B643",color:"#0A0A07"},onClick:j,disabled:!l.trim()||l.trim().length<10,"data-testid":"button-parse-json",children:[i.jsx(hp,{className:"w-4 h-4 mr-2",style:{color:"#0A0A07"}}),"Parse Configuration"]})]}),a==="review"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"local-name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Server Name"}),i.jsx(tt,{id:"local-name",placeholder:"e.g., Memory Server",value:E.name,onChange:L=>{V("name",L.target.value),L.target.value.trim()?A(L.target.value):w(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-local-service-name"}),p&&i.jsxs("div",{className:"mt-2 text-xs text-red-400 flex items-center",children:[i.jsx(tn,{className:"w-4 h-4 mr-1"}),'A service with the name "',p,'" already exists.']})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"command",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Command"}),i.jsx(tt,{id:"command",placeholder:"e.g., npx, python, node",value:E.command,onChange:L=>V("command",L.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-command"}),i.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"The command to execute (e.g., npx, python, node)"})]}),i.jsxs("div",{children:[i.jsx(Ke,{className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Arguments"}),E.args.map((L,Q)=>i.jsxs("div",{className:"flex gap-2 mb-2",children:[i.jsx(tt,{placeholder:`Argument ${Q+1}`,value:L,onChange:oe=>{const Z=[...E.args];Z[Q]=oe.target.value,V("args",Z)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-arg-${Q}`}),Q===E.args.length-1&&i.jsx(me,{type:"button",size:"sm",onClick:()=>V("args",[...E.args,""]),className:"bg-white/20 hover:bg-white/30 text-white",children:i.jsx(Vs,{className:"w-4 h-4"})}),E.args.length>1&&i.jsx(me,{type:"button",size:"sm",variant:"destructive",onClick:()=>{const oe=E.args.filter((Z,ce)=>ce!==Q);V("args",oe)},className:"bg-red-500/80 hover:bg-red-500 text-white",children:i.jsx(Iu,{className:"w-4 h-4"})})]},Q)),i.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"Command arguments (e.g., -y, @modelcontextprotocol/server-memory)"})]}),i.jsxs("div",{children:[i.jsx(Ke,{className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Environment Variables"}),Object.entries(E.env).length===0?i.jsx("div",{className:"text-gray-400 text-sm italic",children:"No environment variables configured"}):i.jsx("div",{className:"space-y-2",children:Object.entries(E.env).map(([L,Q],oe)=>i.jsxs("div",{className:"flex gap-2",children:[i.jsx(tt,{placeholder:"Variable name",value:L,onChange:Z=>{const ce={...E.env};delete ce[L],ce[Z.target.value]=Q,V("env",ce)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-env-key-${oe}`}),i.jsx(tt,{placeholder:"Value",value:Q,onChange:Z=>{const ce={...E.env};ce[L]=Z.target.value,V("env",ce)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-env-value-${oe}`}),i.jsx(me,{type:"button",size:"sm",variant:"destructive",onClick:()=>{const Z={...E.env};delete Z[L],V("env",Z)},className:"bg-red-500/80 hover:bg-red-500 text-white",children:i.jsx(Iu,{className:"w-4 h-4"})})]},oe))}),i.jsxs(me,{type:"button",size:"sm",onClick:()=>{const L={...E.env};L[""]="",V("env",L)},className:"mt-2 bg-white/20 hover:bg-white/30 text-white",children:[i.jsx(Vs,{className:"w-4 h-4 mr-2"}),"Add Environment Variable"]}),i.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"Environment variables for the MCP server process"})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"local-description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),i.jsx(Gn,{id:"local-description",placeholder:"Brief description of capabilities...",value:E.description,onChange:L=>V("description",L.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-local-description"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx(me,{type:"button",variant:"outline",className:"flex-1 border-white/20 text-white hover:bg-white/10",onClick:()=>o("json"),"data-testid":"button-back-to-json",children:"← Back to JSON"}),i.jsxs(me,{type:"button",variant:"ghost",className:`flex-1 border-2 hover:opacity-90 ${bn}`,style:Sn(wr),onClick:z,disabled:W(),"data-testid":"button-register",children:[i.jsx(Vs,{className:"w-4 h-4 mr-2"}),C.isPending?"Registering...":se()]})]})]}),a==="complete"&&i.jsxs("div",{className:"text-center py-8",children:[i.jsx(hp,{className:"w-16 h-16 text-green-500 mx-auto mb-4"}),i.jsx("h3",{className:"text-xl font-bold mb-2",style:{color:"#92E4DD"},children:"Local MCP Registered!"}),i.jsx("p",{className:"text-gray-400 mb-4",children:"Your local MCP server has been successfully registered."}),i.jsx(me,{type:"button",className:"flex-1 border",style:{background:"linear-gradient(135deg, #C4B643, #D4C760)",borderColor:"#C4B643",color:"#0A0A07"},onClick:U,"data-testid":"button-close",children:"Close"})]})]})]}):i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Agent Name"}),i.jsx(tt,{id:"name",placeholder:"e.g., Code Assistant",value:R.name,onChange:L=>{ae("name",L.target.value),L.target.value.trim()?A(L.target.value):w(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-service-name"}),p&&i.jsxs("div",{className:"flex items-center gap-2 mt-1 text-red-400 text-sm",children:[i.jsx(tn,{className:"w-4 h-4"}),i.jsx("span",{children:"A service with this name already exists"})]})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"manifest_url",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Manifest URL"}),i.jsx(tt,{id:"manifest_url",type:"url",placeholder:"http://localhost:8001/.well-known/a2a/manifest.json",value:R.manifest_url,onChange:L=>ae("manifest_url",L.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-manifest-url"})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),i.jsx(Gn,{id:"description",placeholder:"Brief description of capabilities...",value:R.description,onChange:L=>ae("description",L.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-description"})]})]}),t==="mcp"&&s==="remote"&&i.jsxs("div",{className:"space-y-4 border border-white/10 rounded-lg p-4",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{type:"checkbox",id:"headers_enabled",checked:f.headers_enabled,onChange:L=>$(L.target.checked),className:"rounded border-white/20 bg-white/10"}),i.jsx(Ke,{htmlFor:"headers_enabled",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"🔐 Authentication Required"})]}),i.jsx("div",{className:"text-xs text-gray-400",children:i.jsx("p",{children:"Enable this if your MCP server requires authentication (API keys, tokens, etc.)."})}),f.headers_enabled&&i.jsxs("div",{className:"space-y-3 pl-6",children:[i.jsxs("div",{className:"text-xs text-gray-400 mb-2",children:[i.jsx("p",{children:"Configure HTTP headers for authentication. Common examples:"}),i.jsxs("ul",{className:"list-disc list-inside ml-2 mt-1 space-y-1",children:[i.jsxs("li",{children:[i.jsx("code",{children:"Authorization: Bearer YOUR_TOKEN"})," - For API tokens"]}),i.jsxs("li",{children:[i.jsx("code",{children:"X-API-Key: YOUR_API_KEY"})," - For API keys"]}),i.jsxs("li",{children:[i.jsx("code",{children:"X-Custom-Header: value"})," - For custom headers"]})]})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"headers",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"HTTP Headers (JSON)"}),i.jsx(Gn,{id:"headers",placeholder:`{
|
|
352
|
-
"Authorization": "Bearer YOUR_TOKEN_HERE",
|
|
353
|
-
"X-API-Key": "YOUR_API_KEY_HERE"
|
|
354
|
-
}`,value:g,onChange:L=>{y(L.target.value),b&&S(null)},onBlur:()=>{g.trim()&&F()},rows:6,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none font-mono text-xs","data-testid":"textarea-headers"}),b&&i.jsxs("p",{className:"text-red-400 text-xs mt-1 flex items-center gap-1",children:[i.jsx(tn,{className:"w-3 h-3 shrink-0"}),b]}),i.jsx("div",{className:"text-xs text-gray-400 mt-1",children:i.jsx("p",{children:"Enter headers as JSON. Keys are header names, values are header values."})})]})]})]}),h&&i.jsxs("div",{className:"text-red-400 text-sm mt-2",children:[i.jsx(tn,{className:"w-4 h-4 mr-1"}),h]}),p&&i.jsxs("div",{className:"text-red-400 text-sm mt-2",children:[i.jsx(tn,{className:"w-4 h-4 mr-1"}),'A service with the name "',p,'" already exists. You can register it anyway, but it might overwrite the existing one.']}),i.jsxs("div",{className:"flex space-x-3 pt-4",children:[i.jsx(me,{type:"button",variant:"secondary",className:"flex-1 border text-white",style:{background:"#ad095e",borderColor:"#ad095e"},onClick:U,"data-testid":"button-cancel",children:"Cancel"}),!(t==="mcp"&&s==="local")&&i.jsxs(me,{type:"button",variant:"ghost",className:`flex-1 border-2 hover:opacity-90 ${bn}`,style:Sn(wr),disabled:C.isPending||W(),"data-testid":"button-register",onClick:z,children:[i.jsx(Vs,{className:"w-4 h-4 mr-2"}),C.isPending?"Registering...":"Register Service"]})]})]})})}function GO({decks:t,editingDeckId:e,onSelectDeck:r,isLoading:s}){const[n,a]=x.useState(!1),[o,l]=x.useState({name:"",description:""}),c=yr(),{toast:u}=or(),d=At({mutationFn:async m=>Oe("POST","/api/decks",{name:m.name,description:m.description,isActive:!1}),onSuccess:async m=>{var y;const g=await m.json();c.invalidateQueries({queryKey:["/api/decks"]}),(y=g.data)!=null&&y.id&&r(g.data.id),u({title:"Deck created",description:`${o.name} has been created successfully.`}),a(!1),l({name:"",description:""})},onError:m=>{u({title:"Failed to create deck",description:m.message,variant:"destructive"})}}),h=At({mutationFn:async m=>Oe("DELETE",`/api/decks/${m}`,{}),onSuccess:()=>{c.invalidateQueries({queryKey:["/api/decks"]}),u({title:"Deck deleted",description:"Your deck has been deleted successfully."})},onError:m=>{m.message.includes("Cannot delete the last deck")?u({title:"Cannot delete deck",description:"You cannot delete the last deck. Please create another deck first.",variant:"destructive"}):u({title:"Failed to delete deck",description:m.message,variant:"destructive"})}}),v=async(m,g)=>{m.stopPropagation();try{const b=await(await Oe("GET",`/api/scope/manifest-template?deckId=${encodeURIComponent(g.id)}&name=${encodeURIComponent(g.name)}`)).json();await navigator.clipboard.writeText(b.data.content),u({title:"Copied deck.yaml snippet",description:"Paste into .agent-deck/deck.yaml in repos that use this deck."})}catch(y){u({title:"Failed to copy manifest",description:y instanceof Error?y.message:"Unknown error",variant:"destructive"})}},p=(m,g)=>{m.stopPropagation(),window.confirm("Are you sure you want to delete this deck? This action cannot be undone.")&&h.mutate(g)},w=m=>{m.preventDefault(),d.mutate(o)},f=m=>{var g,y,b;return(((g=m.services)==null?void 0:g.length)??0)+(((y=m.credentials)==null?void 0:y.length)??0)+(((b=m.playbooks)==null?void 0:b.length)??0)};return s?i.jsx("div",{className:"bg-black/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 shadow-2xl",children:i.jsxs("div",{className:"animate-pulse space-y-4",children:[i.jsx("div",{className:"h-6 bg-white/10 rounded"}),i.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((m,g)=>i.jsx("div",{className:"h-16 bg-white/5 rounded-lg"},g))})]})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"h-full flex flex-col","data-testid":"deck-management-panel",children:[i.jsxs("h2",{className:"text-lg font-bold mb-3 flex items-center",children:[i.jsx(mp,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),i.jsx("span",{style:{color:"#92E4DD"},children:"My Decks"})]}),i.jsx("div",{className:"mb-3",children:i.jsxs(me,{onClick:()=>a(!0),className:"w-full border text-sm py-2",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},"data-testid":"create-deck-button",children:[i.jsx(Vs,{className:"w-3 h-3 mr-2"}),"Add Deck"]})}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"space-y-2",children:t.map(m=>{const g=m.id===e,y=f(m);return i.jsxs("div",{className:`p-2 rounded-lg border cursor-pointer transition-all relative group ${g?"bg-gradient-to-r from-yellow-500/20 to-yellow-600/20 border-2 border-yellow-500/40 hover:border-yellow-400/60":"bg-white/5 border border-white/10 hover:border-white/20"}`,onClick:()=>r(m.id),"data-testid":`deck-item-${m.id}`,children:[i.jsxs("div",{className:"absolute top-1 right-1 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:[i.jsx(me,{size:"sm",variant:"secondary",className:"h-5 w-5 p-0",onClick:b=>v(b,m),title:"Copy .agent-deck/deck.yaml snippet",children:i.jsx(D1,{className:"w-2 h-2"})}),i.jsx(me,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:b=>p(b,m.id),title:"Delete deck",children:i.jsx(jd,{className:"w-2 h-2"})})]}),i.jsxs("div",{children:[i.jsx("h3",{className:`font-semibold text-sm pr-12 ${g?"text-yellow-300":"text-white"}`,children:m.name}),i.jsx("p",{className:"text-xs text-gray-400",children:y>0?`${y} cards`:"Empty"})]})]},m.id)})})})]}),i.jsx(ao,{open:n,onOpenChange:a,children:i.jsxs(fa,{className:"sm:max-w-md bg-gradient-to-br from-cosmic-900 to-cosmic-800 border border-white/20 text-white",children:[i.jsx(ha,{children:i.jsxs(pa,{className:"text-xl font-bold flex items-center",children:[i.jsx(Vs,{className:"w-5 h-5 mr-2 text-purple-400"}),"Create New Deck"]})}),i.jsxs("form",{onSubmit:w,className:"space-y-4","data-testid":"form-create-deck",children:[i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"deckName",className:"text-sm font-semibold",children:"Deck Name"}),i.jsx(tt,{id:"deckName",placeholder:"e.g., Hiring stack",value:o.name,onChange:m=>l(g=>({...g,name:m.target.value})),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-deck-name"})]}),i.jsxs("div",{children:[i.jsx(Ke,{htmlFor:"deckDescription",className:"text-sm font-semibold",children:"Description"}),i.jsx(Gn,{id:"deckDescription",placeholder:"Brief description of this deck...",value:o.description,onChange:m=>l(g=>({...g,description:m.target.value})),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-deck-description"})]}),i.jsxs("div",{className:"flex space-x-3 pt-4",children:[i.jsx(me,{type:"button",variant:"secondary",className:"flex-1",onClick:()=>a(!1),"data-testid":"button-cancel-create",children:"Cancel"}),i.jsx(me,{type:"submit",className:"flex-1 bg-gradient-to-r from-purple-600 to-blue-600 hover:from-purple-700 hover:to-blue-700",disabled:d.isPending,"data-testid":"button-submit-create",children:d.isPending?"Creating...":"Create Deck"})]})]})]})})]})}function ZO({open:t,onOpenChange:e}){const[r,s]=x.useState(""),[n,a]=x.useState(""),o=yr(),{toast:l}=or(),c=At({mutationFn:async()=>Oe("POST","/api/credentials",{label:r.trim(),value:n}),onSuccess:()=>{o.invalidateQueries({queryKey:["/api/credentials/vault"]}),o.invalidateQueries({queryKey:["/api/decks"]}),l({title:"API key saved",description:`${r.trim()} is stored securely. Your agent can use it from the active deck.`}),e(!1),s(""),a("")},onError:d=>{l({title:"Could not save API key",description:d.message,variant:"destructive"})}}),u=r.trim().length>0&&n.trim().length>0;return i.jsx(ao,{open:t,onOpenChange:e,children:i.jsxs(fa,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[i.jsxs(ha,{children:[i.jsx(pa,{className:"text-[#E8F6F4]",children:"Register API key"}),i.jsx(Ci,{className:"text-[#A8C4C0]",children:"Name the service and paste the key. Agent Deck handles the rest — stored in your vault, never shown again."})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"credential-name",className:"text-[#CFEAE6]",children:"Service name"}),i.jsx(tt,{id:"credential-name",placeholder:"OpenAI, Linear, Slack…",value:r,onChange:d=>s(d.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"credential-value",className:"text-[#CFEAE6]",children:"API key"}),i.jsx(tt,{id:"credential-value",type:"password",placeholder:"Paste key from the service dashboard",value:n,onChange:d=>a(d.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),i.jsx(me,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${bn}`,style:Sn(ur),onClick:()=>c.mutate(),disabled:!u||c.isPending,children:"Save to vault"})]})]})})}function YO({open:t,onOpenChange:e}){const[r,s]=x.useState(""),[n,a]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(""),[d,h]=x.useState(""),[v,p]=x.useState([]),[w,f]=x.useState([]),m=yr(),{toast:g}=or(),{data:y}=hr({queryKey:["/api/credentials/vault"],enabled:t}),{data:b}=hr({queryKey:["/api/services"],enabled:t}),S=(y==null?void 0:y.data)??[],E=(b==null?void 0:b.data)??[],P=At({mutationFn:async()=>Oe("POST","/api/playbooks",{title:r.trim(),body:n,triggers:o.split(",").map(N=>N.trim()).filter(Boolean),dependsOnCredentialIds:v,dependsOnServiceIds:w,exec:c.trim()||void 0,skill:d.trim()||void 0,autoDetectDependencies:!0}),onSuccess:()=>{m.invalidateQueries({queryKey:["/api/playbooks/vault"]}),g({title:"Playbook saved",description:`${r.trim()} is in your collection.`}),e(!1),s(""),a(""),l(""),u(""),h(""),p([]),f([])},onError:N=>{g({title:"Could not save playbook",description:N.message,variant:"destructive"})}}),R=(N,O,j)=>{j(N.includes(O)?N.filter(_=>_!==O):[...N,O])},T=r.trim().length>0&&n.trim().length>0;return i.jsx(ao,{open:t,onOpenChange:e,children:i.jsxs(fa,{className:"sm:max-w-2xl max-h-[90vh] overflow-y-auto border-border bg-[#161612] text-[#E8F6F4]",children:[i.jsxs(ha,{children:[i.jsx(pa,{children:"Register Playbook"}),i.jsxs(Ci,{className:"text-[#A8C4C0]",children:["Prefer"," ",i.jsx("span",{className:"font-mono text-xs",children:"register_playbook"})," /"," ",i.jsx("span",{className:"font-mono text-xs",children:"update_playbook"})," from your AI agent. This form also auto-detects API key and MCP dependencies from the content on save."]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"playbook-title",children:"Title"}),i.jsx(tt,{id:"playbook-title",placeholder:"Hiring inbox, Ashby API guide…",value:r,onChange:N=>s(N.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"playbook-triggers",children:"Triggers (comma-separated)"}),i.jsx(tt,{id:"playbook-triggers",placeholder:"check inbox, review applicants",value:o,onChange:N=>l(N.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"playbook-body",children:"Instructions (markdown)"}),i.jsx(Gn,{id:"playbook-body",rows:8,placeholder:`# Steps
|
|
355
|
-
1. …
|
|
356
|
-
2. …`,value:n,onChange:N=>a(N.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-sm"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{children:"Extra API key deps (optional)"}),i.jsx("p",{className:"text-xs text-gray-500",children:"Merged with auto-detected refs from content."}),i.jsx("div",{className:"max-h-28 overflow-y-auto rounded border border-white/10 p-2 space-y-1",children:S.length===0?i.jsx("p",{className:"text-xs text-gray-500",children:"No API keys registered yet."}):S.map(N=>i.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:v.includes(N.id),onChange:()=>R(v,N.id,p)}),N.label]},N.id))})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{children:"Extra MCP deps (optional)"}),i.jsx("p",{className:"text-xs text-gray-500",children:"Merged with auto-detected refs from content."}),i.jsx("div",{className:"max-h-28 overflow-y-auto rounded border border-white/10 p-2 space-y-1",children:E.length===0?i.jsx("p",{className:"text-xs text-gray-500",children:"No MCP services registered yet."}):E.map(N=>i.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:w.includes(N.id),onChange:()=>R(w,N.id,f)}),N.name]},N.id))})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"playbook-exec",children:"Suggested exec (optional)"}),i.jsx(tt,{id:"playbook-exec",placeholder:"agent-deck exec --connections … -- uv run …",value:c,onChange:N=>u(N.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-xs"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"playbook-skill",children:"Skill path hint (optional)"}),i.jsx(tt,{id:"playbook-skill",placeholder:".cursor/skills/…/SKILL.md",value:d,onChange:N=>h(N.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-xs"})]}),i.jsx(me,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${bn}`,style:Sn(Zr),onClick:()=>P.mutate(),disabled:!T||P.isPending,children:"Save to collection"})]})]})})}function JO({playbookId:t,open:e,onOpenChange:r}){const{data:s,isLoading:n}=hr({queryKey:t?[`/api/playbooks/${t}`]:["playbook-detail-disabled"],enabled:e&&!!t}),a=s==null?void 0:s.data,o=((a==null?void 0:a.dependencies.missingCredentialIds.length)??0)+((a==null?void 0:a.dependencies.missingServiceIds.length)??0);return i.jsx(ao,{open:e,onOpenChange:r,children:i.jsxs(fa,{className:"sm:max-w-2xl max-h-[90vh] overflow-y-auto border-border bg-[#161612] text-[#E8F6F4]",children:[i.jsxs(ha,{children:[i.jsx(pa,{children:(a==null?void 0:a.title)??"Playbook"}),i.jsx(Ci,{className:"text-[#A8C4C0]",children:(a==null?void 0:a.id)??t})]}),n||!a?i.jsx("p",{className:"text-sm text-gray-400",children:"Loading…"}):i.jsxs("div",{className:"space-y-4 text-sm",children:[i.jsxs("p",{className:"rounded-md border border-white/10 bg-white/5 px-3 py-2 text-[#A8C4C0]",children:["Ask your AI agent to refine this playbook with"," ",i.jsx("span",{className:"font-mono text-xs",children:"update_playbook"})," — dependencies are re-detected from the content automatically."]}),a.triggers.length>0&&i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Triggers"}),i.jsx("p",{className:"text-gray-300",children:a.triggers.join(", ")})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Dependencies"}),a.dependencies.credentials.length===0&&a.dependencies.services.length===0&&o===0?i.jsx("p",{className:"text-gray-400",children:"None declared."}):i.jsxs("ul",{className:"space-y-1 text-gray-300",children:[a.dependencies.credentials.map(l=>i.jsxs("li",{children:["API key: ",l.label]},l.id)),a.dependencies.services.map(l=>i.jsxs("li",{children:["MCP: ",l.label]},l.id)),a.dependencies.missingCredentialIds.map(l=>i.jsxs("li",{className:"text-amber-300 flex items-center gap-1",children:[i.jsx(tn,{className:"w-3 h-3"})," Missing API key: ",l]},l)),a.dependencies.missingServiceIds.map(l=>i.jsxs("li",{className:"text-amber-300 flex items-center gap-1",children:[i.jsx(tn,{className:"w-3 h-3"})," Missing MCP: ",l]},l))]})]}),a.exec&&i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Suggested exec"}),i.jsx("pre",{className:"rounded bg-black/40 p-2 text-xs overflow-x-auto",children:a.exec})]}),a.skill&&i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Skill hint"}),i.jsx("p",{className:"font-mono text-xs text-gray-300",children:a.skill})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Instructions"}),i.jsx("div",{className:"rounded bg-black/30 p-3 whitespace-pre-wrap text-gray-200",children:a.body})]})]})]})})}function XO({credentialId:t,open:e,onOpenChange:r}){const s=yr(),{toast:n}=or(),[a,o]=x.useState(""),[l,c]=x.useState(""),[u,d]=x.useState(""),{data:h,isLoading:v}=hr({queryKey:t?[`/api/credentials/${t}`]:["credential-detail-disabled"],enabled:e&&!!t}),p=h==null?void 0:h.data;x.useEffect(()=>{p&&(o(p.label),c(p.docsUrl??""),d(""))},[p==null?void 0:p.id,p==null?void 0:p.label,p==null?void 0:p.docsUrl]);const w=At({mutationFn:async()=>{if(!t)throw new Error("No credential selected");const m=a.trim();if(!m)throw new Error("Name is required");const g=l.trim();if(g)try{new URL(g)}catch{throw new Error("Documentation link must be a valid URL")}await Oe("PUT",`/api/credentials/${t}`,{label:m,docsUrl:g}),u.trim()&&await Oe("POST",`/api/credentials/${t}/rotate`,{value:u.trim()})},onSuccess:()=>{s.invalidateQueries({queryKey:["/api/credentials/vault"]}),t&&s.invalidateQueries({queryKey:[`/api/credentials/${t}`]}),s.invalidateQueries({queryKey:["/api/collection/warnings"]}),s.invalidateQueries({queryKey:["/api/decks"]}),n({title:u.trim()?"API key updated":"API key saved",description:u.trim()?"Name, docs link, and key value were updated.":"Name and docs link were updated."}),d(""),r(!1)},onError:m=>{n({title:"Could not save API key",description:m.message,variant:"destructive"})}}),f=a.trim().length>0&&(a.trim()!==(p==null?void 0:p.label)||l.trim()!==((p==null?void 0:p.docsUrl)??"")||u.trim().length>0);return i.jsx(ao,{open:e,onOpenChange:r,children:i.jsxs(fa,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[i.jsxs(ha,{children:[i.jsx(pa,{className:"text-[#E8F6F4]",children:(p==null?void 0:p.label)??"API key"}),i.jsx(Ci,{className:"font-mono text-xs text-[#A8C4C0]",children:(p==null?void 0:p.id)??t})]}),v||!p?i.jsx("p",{className:"text-sm text-gray-400",children:"Loading…"}):i.jsxs("div",{className:"space-y-4",children:[!p.hasSecret&&i.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm text-amber-200",children:[i.jsx(tn,{className:"mt-0.5 h-4 w-4 shrink-0"}),i.jsx("p",{children:"No key is stored in your vault for this credential. Paste a key below to save it — the value is never shown after saving."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"credential-detail-name",className:"text-[#CFEAE6]",children:"Name"}),i.jsx(tt,{id:"credential-detail-name",value:a,onChange:m=>o(m.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"credential-detail-key",className:"text-[#CFEAE6]",children:p.hasSecret?"Rotate API key":"API key"}),i.jsx(tt,{id:"credential-detail-key",type:"password",placeholder:p.hasSecret?"Leave blank to keep current key":"Paste key from the service dashboard",value:u,onChange:m=>d(m.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"}),p.hasSecret&&i.jsx("p",{className:"text-xs text-[#6B8581]",children:"Stored securely in Keychain. Enter a new value only when rotating."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"credential-detail-docs",className:"text-[#CFEAE6]",children:"Documentation link"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(tt,{id:"credential-detail-docs",type:"url",placeholder:"https://…",value:l,onChange:m=>c(m.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"}),l.trim()&&i.jsx(me,{type:"button",variant:"outline",size:"icon",className:"shrink-0 border-white/15 bg-[#0F0F0C] text-[#A8C4C0] hover:bg-white/5",onClick:()=>window.open(l.trim(),"_blank","noopener,noreferrer"),title:"Open documentation",children:i.jsx(Jn,{className:"h-4 w-4"})})]})]}),i.jsx(me,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${bn}`,style:Sn(ur),onClick:()=>w.mutate(),disabled:!f||w.isPending,children:w.isPending?"Saving…":"Save changes"})]})]})})}const eI=Nd("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function hn({className:t,variant:e,...r}){return i.jsx("div",{className:Te(eI({variant:e}),t),...r})}function T_(t){const e=x.useRef({value:t,previous:t});return x.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var zd="Checkbox",[tI,QF]=fs(zd),[rI,Hv]=tI(zd);function nI(t){const{__scopeCheckbox:e,checked:r,children:s,defaultChecked:n,disabled:a,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:h}=t,[v,p]=Ka({prop:r,defaultProp:n??!1,onChange:c,caller:zd}),[w,f]=x.useState(null),[m,g]=x.useState(null),y=x.useRef(!1),b=w?!!o||!!w.closest("form"):!0,S={checked:v,disabled:a,setChecked:p,control:w,setControl:f,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:ta(n)?!1:n,isFormControl:b,bubbleInput:m,setBubbleInput:g};return i.jsx(rI,{scope:e,...S,children:sI(h)?h(S):s})}var A_="CheckboxTrigger",O_=x.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:r,...s},n)=>{const{control:a,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:v,isFormControl:p,bubbleInput:w}=Hv(A_,t),f=et(n,d),m=x.useRef(c);return x.useEffect(()=>{const g=a==null?void 0:a.form;if(g){const y=()=>h(m.current);return g.addEventListener("reset",y),()=>g.removeEventListener("reset",y)}},[a,h]),i.jsx(Ae.button,{type:"button",role:"checkbox","aria-checked":ta(c)?"mixed":c,"aria-required":u,"data-state":F_(c),"data-disabled":l?"":void 0,disabled:l,value:o,...s,ref:f,onKeyDown:_e(e,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:_e(r,g=>{h(y=>ta(y)?!0:!y),w&&p&&(v.current=g.isPropagationStopped(),v.current||g.stopPropagation())})})});O_.displayName=A_;var qv=x.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:s,checked:n,defaultChecked:a,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...h}=t;return i.jsx(nI,{__scopeCheckbox:r,checked:n,defaultChecked:a,disabled:l,required:o,onCheckedChange:u,name:s,form:d,value:c,internal_do_not_use_render:({isFormControl:v})=>i.jsxs(i.Fragment,{children:[i.jsx(O_,{...h,ref:e,__scopeCheckbox:r}),v&&i.jsx($_,{__scopeCheckbox:r})]})})});qv.displayName=zd;var I_="CheckboxIndicator",D_=x.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:s,...n}=t,a=Hv(I_,r);return i.jsx(da,{present:s||ta(a.checked)||a.checked===!0,children:i.jsx(Ae.span,{"data-state":F_(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:e,style:{pointerEvents:"none",...t.style}})})});D_.displayName=I_;var M_="CheckboxBubbleInput",$_=x.forwardRef(({__scopeCheckbox:t,...e},r)=>{const{control:s,hasConsumerStoppedPropagationRef:n,checked:a,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:h,bubbleInput:v,setBubbleInput:p}=Hv(M_,t),w=et(r,p),f=T_(a),m=aS(s);x.useEffect(()=>{const y=v;if(!y)return;const b=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(b,"checked").set,P=!n.current;if(f!==a&&E){const R=new Event("click",{bubbles:P});y.indeterminate=ta(a),E.call(y,ta(a)?!1:a),y.dispatchEvent(R)}},[v,f,a,n]);const g=x.useRef(ta(a)?!1:a);return i.jsx(Ae.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??g.current,required:l,disabled:c,name:u,value:d,form:h,...e,tabIndex:-1,ref:w,style:{...e.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});$_.displayName=M_;function sI(t){return typeof t=="function"}function ta(t){return t==="indeterminate"}function F_(t){return ta(t)?"indeterminate":t?"checked":"unchecked"}const L_=x.forwardRef(({className:t,...e},r)=>i.jsx(qv,{ref:r,className:Te("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:i.jsx(D_,{className:Te("flex items-center justify-center text-current"),children:i.jsx(O1,{className:"h-4 w-4"})})}));L_.displayName=qv.displayName;const U_=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{className:"relative w-full overflow-auto",children:i.jsx("table",{ref:r,className:Te("w-full caption-bottom text-sm",t),...e})}));U_.displayName="Table";const z_=x.forwardRef(({className:t,...e},r)=>i.jsx("thead",{ref:r,className:Te("[&_tr]:border-b",t),...e}));z_.displayName="TableHeader";const V_=x.forwardRef(({className:t,...e},r)=>i.jsx("tbody",{ref:r,className:Te("[&_tr:last-child]:border-0",t),...e}));V_.displayName="TableBody";const aI=x.forwardRef(({className:t,...e},r)=>i.jsx("tfoot",{ref:r,className:Te("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));aI.displayName="TableFooter";const Wi=x.forwardRef(({className:t,...e},r)=>i.jsx("tr",{ref:r,className:Te("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));Wi.displayName="TableRow";const eu=x.forwardRef(({className:t,...e},r)=>i.jsx("th",{ref:r,className:Te("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));eu.displayName="TableHead";const ho=x.forwardRef(({className:t,...e},r)=>i.jsx("td",{ref:r,className:Te("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));ho.displayName="TableCell";const oI=x.forwardRef(({className:t,...e},r)=>i.jsx("caption",{ref:r,className:Te("mt-4 text-sm text-muted-foreground",t),...e}));oI.displayName="TableCaption";function Kf(t){return new Set(t.filter(e=>e.enabled===!1).map(e=>e.name))}function iI({serviceId:t,tools:e,isLoading:r}){const[s,n]=x.useState(""),[a,o]=x.useState(null),[l,c]=x.useState(()=>Kf(e)),u=yr(),{toast:d}=or(),h=x.useMemo(()=>e.filter(y=>y.enabled===!1).map(y=>y.name).sort().join("\0"),[e]);x.useEffect(()=>{c(Kf(e))},[t,h,e.length]);const v=At({mutationFn:async y=>{await Oe("PUT",`/api/services/${t}/tool-settings`,{disabledTools:y})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/services",t,"tools"]}),u.invalidateQueries({queryKey:["/api/services"]})},onError:y=>{d({title:"Could not save tool settings",description:y.message,variant:"destructive"}),c(Kf(e))}}),p=y=>{c(y),v.mutate([...y])},w=(y,b)=>{const S=new Set(l);b?S.delete(y):S.add(y),p(S)},f=y=>{if(y){p(new Set);return}p(new Set(e.map(b=>b.name)))},m=x.useMemo(()=>{const y=s.trim().toLowerCase();return y?e.filter(b=>b.name.toLowerCase().includes(y)||b.description.toLowerCase().includes(y)):e},[e,s]),g=e.length-l.size;return r?i.jsx("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:i.jsx("p",{className:"text-sm text-gray-400",children:"Loading tools…"})}):e.length===0?null:i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[i.jsxs("h3",{className:"text-lg font-semibold flex items-center",children:[i.jsx(Ou,{className:"w-5 h-5 mr-2"}),"Tools",i.jsxs("span",{className:"ml-2 text-sm font-normal text-gray-400",children:[g," of ",e.length," enabled"]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx(me,{type:"button",size:"sm",variant:"ghost",className:"h-8 text-xs text-[#A8C4C0] hover:text-white hover:bg-white/10",onClick:()=>f(!0),disabled:l.size===0||v.isPending,children:"Enable all"}),i.jsx(me,{type:"button",size:"sm",variant:"ghost",className:"h-8 text-xs text-[#A8C4C0] hover:text-white hover:bg-white/10",onClick:()=>f(!1),disabled:g===0||v.isPending,children:"Disable all"})]})]}),i.jsx("p",{className:"mb-3 text-xs text-[#A8C4C0]",children:"Choose which tools your agent can use from this MCP. Disabled tools are hidden from the agent but stay registered on the server."}),i.jsxs("div",{className:"relative mb-3",children:[i.jsx(M1,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500"}),i.jsx(tt,{value:s,onChange:y=>n(y.target.value),placeholder:"Search tools…",className:"border-white/15 bg-[#0F0F0C] pl-9 text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),i.jsx("div",{className:"rounded-md border border-white/10 overflow-hidden",children:i.jsxs(U_,{children:[i.jsx(z_,{children:i.jsxs(Wi,{className:"border-white/10 hover:bg-transparent",children:[i.jsx(eu,{className:"w-[72px] text-center text-[#A8C4C0]",children:"Enabled"}),i.jsx(eu,{className:"w-[220px] text-[#A8C4C0]",children:"Tool"}),i.jsx(eu,{className:"text-[#A8C4C0]",children:"Description"})]})}),i.jsx(V_,{children:m.length===0?i.jsx(Wi,{className:"border-white/10 hover:bg-transparent",children:i.jsx(ho,{colSpan:3,className:"py-8 text-center text-sm text-gray-400",children:"No tools match your search."})}):m.map(y=>{const b=!l.has(y.name),S=a===y.name,E=y.inputSchema&&Object.keys(y.inputSchema).length>0;return i.jsxs(x.Fragment,{children:[i.jsxs(Wi,{className:`border-white/10 ${b?"hover:bg-white/5":"opacity-60 hover:bg-white/5"}`,children:[i.jsx(ho,{className:"text-center",children:i.jsx("div",{className:"flex justify-center",children:i.jsx(L_,{checked:b,onCheckedChange:P=>w(y.name,P===!0),disabled:v.isPending,"aria-label":`${b?"Disable":"Enable"} ${y.name}`,className:"h-[18px] w-[18px] border-white/40 bg-[#0F0F0C] data-[state=checked]:border-[#92E4DD] data-[state=checked]:bg-[#92E4DD] data-[state=checked]:text-[#0F0F0C]"})})}),i.jsx(ho,{children:E?i.jsxs("button",{type:"button",onClick:()=>o(S?null:y.name),className:"flex w-full items-center gap-1 text-left font-mono text-sm text-[#92E4DD] hover:text-white",children:[i.jsx(_v,{className:`h-4 w-4 shrink-0 transition-transform ${S?"rotate-180":""}`}),y.name]}):i.jsx("span",{className:"font-mono text-sm text-[#92E4DD]",children:y.name})}),i.jsx(ho,{className:"text-sm text-gray-300",children:y.description||"—"})]}),E&&S&&i.jsx(Wi,{className:"border-white/10 bg-black/30 hover:bg-black/30",children:i.jsx(ho,{colSpan:3,className:"py-3",children:i.jsx("pre",{className:"max-h-48 overflow-auto rounded border border-white/10 bg-[#0F0F0C] p-3 text-xs text-gray-300",children:JSON.stringify(y.inputSchema,null,2)})})})]},y.name)})})]})})]})}function Qf({items:t,className:e}){return t.length===0?null:i.jsx("ol",{className:`list-decimal list-inside space-y-1 text-xs ${e??""}`,children:t.map((r,s)=>i.jsx("li",{children:r},`${s}-${r.slice(0,24)}`))})}function A0({serviceId:t,onConnected:e}){const{toast:r}=or(),[s,n]=x.useState(""),[a,o]=x.useState(""),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[h,v]=x.useState(!1),{data:p,isLoading:w}=hr({queryKey:["/api/oauth",t,"setup"],queryFn:async()=>{const E=await Oe("GET",`/api/oauth/${t}/setup`),P=await E.json();if(!E.ok||!P.success)throw new Error(P.error||"Failed to load OAuth setup");return P.data},enabled:!!t}),f=p==null?void 0:p.guide,m=!!(p!=null&&p.hasSavedCredentials),g=()=>{if(!u||(f==null?void 0:f.setupMode)!=="manual")return;const E={};return s.trim()&&(E.clientId=s.trim()),a.trim()&&(E.clientSecret=a.trim()),E},y=async(E,P)=>{try{await navigator.clipboard.writeText(P),r({title:"Copied",description:`${E} copied to clipboard.`})}catch{r({title:"Copy failed",description:"Select and copy manually.",variant:"destructive"})}};x.useEffect(()=>{(f==null?void 0:f.setupMode)==="manual"?d(!0):d(!1),v(!m)},[f==null?void 0:f.setupMode,m]),x.useEffect(()=>{p!=null&&p.savedOAuthClientId&&!s&&n(p.savedOAuthClientId)},[p==null?void 0:p.savedOAuthClientId,s]);const b=async E=>{var P,R,T;c(!0);try{const N=await Oe("POST",`/api/oauth/${t}/connect`,E??{}),O=await N.json();if(!N.ok||!O.success){((P=O.data)!=null&&P.needsCredentials||((R=O.data)==null?void 0:R.setupMode)==="manual")&&d(!0),r({title:"OAuth setup",description:O.error||"Could not start OAuth flow.",variant:"destructive"});return}(T=O.data)!=null&&T.authorizationUrl&&(window.open(O.data.authorizationUrl,"_blank"),r({title:"Continue in browser",description:"Complete sign-in in the new tab, then return here."}),e==null||e())}catch(N){r({title:"OAuth setup failed",description:N instanceof Error?N.message:"Unknown error",variant:"destructive"})}finally{c(!1)}};if(w)return i.jsx("p",{className:"text-sm text-orange-200",children:"Loading setup guide…"});if(!f)return null;if(f.setupMode==="unavailable")return i.jsxs("div",{className:"space-y-3 text-sm text-orange-100",children:[i.jsx("p",{children:f.unavailableReason}),f.docsUrl&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(f.docsUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"Provider docs"]})]});const S=f.setupMode==="dynamic"||f.setupMode==="managed"||f.setupMode==="manual";return i.jsxs("div",{className:"space-y-4 text-sm text-orange-100",children:[i.jsxs("div",{children:[i.jsx("p",{className:"font-medium text-orange-200",children:f.title}),f.summary&&i.jsx("p",{className:"mt-1 text-xs text-orange-100/90",children:f.summary}),S&&i.jsxs("p",{className:"mt-2 text-xs text-orange-100/80",children:["Redirect URI:"," ",i.jsx("code",{className:"text-orange-50",children:f.redirectUri})]}),f.easierAlternative&&i.jsx("p",{className:"mt-2 text-xs text-orange-100/70 border-l-2 border-orange-500/30 pl-2",children:f.easierAlternative})]}),m&&f.setupMode==="manual"&&i.jsxs("div",{className:"rounded-lg border border-green-500/30 bg-green-500/10 p-3 text-xs text-green-100",children:[i.jsx("p",{className:"font-medium text-green-200",children:"OAuth credentials saved"}),i.jsx("p",{className:"mt-1 text-green-100/90",children:"Client ID is prefilled and your secret is remembered. Click Reconnect — no need to paste the secret again unless Slack rejects the flow."})]}),f.prerequisites&&f.prerequisites.length>0&&!m&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"Before you start"}),i.jsx("ul",{className:"list-disc list-inside space-y-1 text-xs text-orange-100/90",children:f.prerequisites.map(E=>i.jsx("li",{children:E},E))})]}),(f.manifestJson||f.createAppUrl||S)&&i.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.manifestJson&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>void y("App manifest",f.manifestJson),children:[i.jsx(P2,{className:"w-4 h-4 mr-1"}),"Copy manifest"]}),S&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>void y("Redirect URI",f.redirectUri),children:[i.jsx(D1,{className:"w-4 h-4 mr-1"}),"Copy redirect URI"]}),f.createAppUrl&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(f.createAppUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),f.createAppLabel??"Open app creator"]})]}),f.steps.length>0&&i.jsx("div",{children:m&&f.setupMode==="manual"?i.jsxs("details",{className:"rounded-lg border border-orange-500/20 bg-orange-500/5 p-3",children:[i.jsx("summary",{className:"cursor-pointer text-xs font-medium text-orange-200",children:"First-time Slack app setup"}),i.jsx("div",{className:"mt-2",children:i.jsx(Qf,{items:f.steps})})]}):i.jsxs(i.Fragment,{children:[f.setupMode==="informational"?i.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"What to do"}):null,i.jsx(Qf,{items:f.steps})]})}),f.tokenAlternative&&i.jsxs("p",{className:"text-xs text-orange-100/80 border-l-2 border-orange-500/30 pl-2",children:[i.jsx("span",{className:"font-medium text-orange-200",children:"Alternative: "}),f.tokenAlternative]}),u&&f.setupMode==="manual"&&i.jsxs("div",{className:"space-y-3 rounded-lg border border-orange-500/20 bg-orange-500/5 p-3",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ke,{htmlFor:`oauth-client-id-${t}`,className:"text-orange-200",children:"Client ID"}),i.jsx(tt,{id:`oauth-client-id-${t}`,value:s,onChange:E=>n(E.target.value),placeholder:"OAuth Client ID",className:"bg-black/20 border-orange-500/30"})]}),h?i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ke,{htmlFor:`oauth-client-secret-${t}`,className:"text-orange-200",children:"Client Secret"}),i.jsx(tt,{id:`oauth-client-secret-${t}`,type:"password",value:a,onChange:E=>o(E.target.value),placeholder:"OAuth Client Secret",className:"bg-black/20 border-orange-500/30"})]}):i.jsx("p",{className:"text-xs text-orange-200/80",children:"Client secret is saved locally for this service."}),m&&i.jsx(me,{type:"button",size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>v(E=>!E),children:h?"Hide client secret field":"Update client secret"}),(p==null?void 0:p.hasStoredClientSecret)&&h&&i.jsx("p",{className:"text-xs text-orange-200/80",children:"Leave blank to keep the saved secret. Enter a new value only if Slack rejected the last connect attempt."})]}),f.afterConnect&&f.afterConnect.length>0&&i.jsxs("div",{children:[i.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"After connect"}),i.jsx(Qf,{items:f.afterConnect,className:"text-orange-100/80"})]}),S&&i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(me,{size:"sm",className:"bg-orange-600 hover:bg-orange-700",disabled:l||u&&f.setupMode==="manual"&&!m&&(!s.trim()||!a.trim()),onClick:()=>b(g()),children:l?"Connecting…":m&&f.setupMode==="manual"?"Reconnect":f.setupMode==="dynamic"||f.setupMode==="managed"?"Connect":"Connect with credentials"}),f.docsUrl&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(f.docsUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"Docs"]})]}),f.setupMode==="informational"&&f.docsUrl&&i.jsxs(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(f.docsUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"Docs"]})]})}function lI(t){if(!t||t.type!=="local-mcp")return!1;const e=[t.localCommand,...t.localArgs??[],t.url,t.name].filter(Boolean).join(" ").toLowerCase();return e.includes("google-drive")||e.includes("google_drive")}function cI({service:t,isOpen:e,onClose:r}){var Ne,rt,pt,qr,zt,hs,oo,Yt,Br,ps,jr,Dn,ms,ya,vs,ne,Et,Mn,$n,Yl,Jl,Xl;const[s,n]=x.useState(null),[a,o]=x.useState(!1),[l,c]=x.useState(""),[u,d]=x.useState(!1),[h,v]=x.useState(!1),[p,w]=x.useState(!1),[f,m]=x.useState(""),[g,y]=x.useState(""),[b,S]=x.useState(!1),[E,P]=x.useState(!1),[R,T]=x.useState(null),N=yr(),{toast:O}=or(),j=t&&(R==null?void 0:R.id)===t.id?R:t,_=j,A=!!(_&&_.id&&_.url),{data:C,isLoading:z,error:U,refetch:K}=hr({queryKey:["/api/mcp/discover",_==null?void 0:_.url],queryFn:async()=>{if(!_||_.type!=="mcp")return null;console.log(`🔍 Attempting MCP discovery for: ${_.url}`);try{const je=await(await Oe("POST","/api/mcp/discover",{url:_.url})).json();return console.log(`✅ MCP discovery successful for ${_.url}:`,je),je}catch(de){throw console.log(`❌ MCP discovery failed for ${_.url}:`,de),de}},enabled:A&&_.type==="mcp"&&e,staleTime:0,gcTime:2*60*1e3}),$=((rt=(Ne=C==null?void 0:C.data)==null?void 0:Ne.oauth)==null?void 0:rt.required)===!0,{data:F,refetch:V}=hr({queryKey:["/api/oauth",_==null?void 0:_.id,"status"],queryFn:async()=>{const de=await Oe("GET",`/api/oauth/${_.id}/status`),je=await de.json();if(!de.ok||!je.success)throw new Error(je.error||"Failed to load OAuth status");return je.data},enabled:A&&_.type==="mcp"&&e&&$,refetchInterval:de=>{const je=de.state.data;return je!=null&&je.authenticated?!1:2e3}}),se=$?F!=null&&F.authenticated?{status:"authenticated",message:null}:F!=null&&F.hasToken&&(F!=null&&F.isExpired)?{status:"expired",message:"OAuth Token Expired - Please re-authenticate"}:{status:"required",message:"OAuth 2.0 Authentication Required"}:{status:"not_required",message:null};console.log("MCP Discovery Query Debug:",{apiService:_==null?void 0:_.id,apiServiceType:_==null?void 0:_.type,apiServiceUrl:_==null?void 0:_.url,isOpen:e,hasValidService:A,enabled:A&&_.type==="mcp"&&e,mcpDiscoveryLoading:z,mcpDiscoveryData:C?JSON.stringify(C,null,2):null,mcpDiscoveryDataKeys:C?Object.keys(C):null,oauthRequired:(qr=(pt=C==null?void 0:C.data)==null?void 0:pt.oauth)==null?void 0:qr.required,oauthData:(zt=C==null?void 0:C.data)!=null&&zt.oauth?JSON.stringify(C.data.oauth,null,2):null,toolsQueryEnabled:A&&_.type==="mcp"&&e&&!((oo=(hs=C==null?void 0:C.data)==null?void 0:hs.oauth)!=null&&oo.required)});const{data:W,isLoading:L,error:Q,refetch:oe}=hr({queryKey:["/api/services",_==null?void 0:_.id,"tools"],queryFn:async()=>{if(!_||_.type!=="mcp"&&_.type!=="local-mcp")return{data:[]};console.log(`🔍 Attempting to discover tools for MCP service: ${_.id} at ${_.url}`);try{const je=await(await Oe("GET",`/api/services/${_.id}/tools`)).json();return console.log(`✅ MCP tools discovery successful for ${_.id}:`,je),je}catch(de){throw console.log(`❌ MCP tools discovery failed for ${_.id}:`,de),de}},enabled:A&&(_.type==="mcp"||_.type==="local-mcp")&&e&&(_.type==="local-mcp"||se.status==="authenticated"||se.status==="not_required"),staleTime:0,gcTime:2*60*1e3});x.useEffect(()=>{if(!e||!(_!=null&&_.id)||_.type!=="mcp"&&_.type!=="local-mcp"||!(_.type==="local-mcp"||se.status==="authenticated"||se.status==="not_required")||L||Q)return;let je=!1;return(async()=>{try{const Nt=await(await Oe("GET",`/api/services/${_.id}`)).json();!je&&(Nt!=null&&Nt.success)&&Nt.data&&T(Nt.data),N.invalidateQueries({queryKey:["/api/services"]})}catch{}})(),()=>{je=!0}},[e,_==null?void 0:_.id,_==null?void 0:_.type,L,Q,se.status,N]),x.useEffect(()=>{if(!e||!(_!=null&&_.id)||_.type!=="a2a")return;let de=!1;return(async()=>{try{await Oe("GET",`/api/services/${_.id}/health`);const Dt=await(await Oe("GET",`/api/services/${_.id}`)).json();!de&&(Dt!=null&&Dt.success)&&Dt.data&&T(Dt.data),N.invalidateQueries({queryKey:["/api/services"]})}catch{}})(),()=>{de=!0}},[e,_==null?void 0:_.id,_==null?void 0:_.type,N]),console.log("MCP Tools Query Debug:",{hasValidService:A,apiServiceType:_==null?void 0:_.type,isOpen:e,oauthRequired:(Br=(Yt=C==null?void 0:C.data)==null?void 0:Yt.oauth)==null?void 0:Br.required,oauthStatus:se.status,toolsQueryEnabled:A&&(_.type==="mcp"||_.type==="local-mcp")&&e&&(_.type==="local-mcp"||se.status==="authenticated"||se.status==="not_required"),mcpToolsLoading:L});const{data:Z,isLoading:ce,error:Ee}=hr({queryKey:["/api/proxy/a2a",_==null?void 0:_.id,"manifest"],queryFn:async()=>{if(!_||_.type!=="a2a")return null;const je=await(await Oe("GET",`/api/proxy/a2a/${_.id}/manifest`)).text();return JSON.parse(je)},enabled:A&&_.type==="a2a"&&e,staleTime:0,gcTime:2*60*1e3}),ve=(W==null?void 0:W.data)||[],te=Z,we=L||ce;console.log("ServiceDetailsModal Debug:",{service:t==null?void 0:t.id,serviceType:t==null?void 0:t.type,isOpen:e,mcpDiscoveryLoading:z,mcpDiscoveryData:C,mcpDiscoveryError:U?String(U):null,mcpToolsLoading:L,a2aManifestLoading:ce,mcpToolsError:Q?String(Q):null,a2aManifestError:Ee?String(Ee):null,mcpToolsCount:ve.length,mcpToolsData:W,hasA2aManifest:!!te,isLoading:we,oauthRequired:(jr=(ps=C==null?void 0:C.data)==null?void 0:ps.oauth)==null?void 0:jr.required,oauthStatus:se.status,oauthMessage:se.message,oauthAuthenticated:F==null?void 0:F.authenticated,expiresAt:F==null?void 0:F.expiresAt}),x.useEffect(()=>{if(!e){T(null);return}t&&(T(t),c(t.cardColor||"#92E4DD"),m(t.name||""),y(t.description||""))},[t,e]);const ke=x.useRef(!1);x.useEffect(()=>{if(!e||!(_!=null&&_.id)){ke.current=!1;return}if(!(F!=null&&F.authenticated)){ke.current=!1;return}if(ke.current)return;ke.current=!0,(async()=>{O({title:"OAuth completed",description:"Authentication successful! Refreshing service status..."}),N.invalidateQueries({queryKey:["/api/services",_.id]}),N.invalidateQueries({queryKey:["/api/mcp/discover",_.url]}),N.invalidateQueries({queryKey:["/api/collection-warnings"]});try{const je=await Oe("GET",`/api/services/${_.id}`);if(je.ok){const at=await je.json();T(at.data??at)}}catch{}await K(),N.invalidateQueries({queryKey:["/api/services",_.id,"tools"]}),await oe()})()},[F==null?void 0:F.authenticated,e,_==null?void 0:_.id]),x.useEffect(()=>{const de=je=>{const at=je.target;a&&!at.closest(".color-picker-container")&&o(!1)};return document.addEventListener("mousedown",de),()=>{document.removeEventListener("mousedown",de)}},[a]);const De=()=>(t==null?void 0:t.type)==="mcp"?i.jsx(r0,{className:"w-6 h-6"}):i.jsx(If,{className:"w-6 h-6"}),ee=()=>(t==null?void 0:t.type)==="mcp"?"text-blue-400":"text-purple-400",fe=()=>(t==null?void 0:t.type)==="mcp"?"bg-blue-500/20":"bg-purple-500/20",X=de=>new Date(de).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),ze=async de=>{if(t){d(!0),c(de);try{if((await Oe("PUT",`/api/services/${t.id}`,{cardColor:de})).ok)N.invalidateQueries({queryKey:["/api/services"]}),N.invalidateQueries({queryKey:["/api/collection/warnings"]}),N.invalidateQueries({queryKey:["/api/decks"]}),N.invalidateQueries({queryKey:["/api/decks"]}),O({title:"Color updated",description:"Card color has been updated successfully."}),o(!1);else throw new Error("Failed to update color")}catch{c(t.cardColor||"#92E4DD"),O({title:"Update failed",description:"Failed to update card color. Please try again.",variant:"destructive"})}finally{d(!1)}}},re=async()=>{if(!(!t||!f.trim())){S(!0);try{if((await Oe("PUT",`/api/services/${t.id}`,{name:f.trim()})).ok){if(R){const je={...R,name:f.trim()};T(je)}N.invalidateQueries({queryKey:["/api/services"]}),N.invalidateQueries({queryKey:["/api/collection/warnings"]}),N.invalidateQueries({queryKey:["/api/decks"]}),N.invalidateQueries({queryKey:["/api/decks"]}),O({title:"Name updated",description:"Service name has been updated successfully."}),v(!1)}else throw new Error("Failed to update name")}catch{O({title:"Update failed",description:"Failed to update service name. Please try again.",variant:"destructive"})}finally{S(!1)}}},Me=async()=>{if(t){P(!0);try{if((await Oe("PUT",`/api/services/${t.id}`,{description:g.trim()})).ok){if(R){const je={...R,description:g.trim()};T(je)}N.invalidateQueries({queryKey:["/api/services"]}),N.invalidateQueries({queryKey:["/api/collection/warnings"]}),N.invalidateQueries({queryKey:["/api/decks"]}),N.invalidateQueries({queryKey:["/api/decks"]}),O({title:"Description updated",description:"Service description has been updated successfully."}),w(!1)}else throw new Error("Failed to update description")}catch{O({title:"Update failed",description:"Failed to update service description. Please try again.",variant:"destructive"})}finally{P(!1)}}},Ue=[{value:"#92E4DD",label:"Default"},{value:"#F9386D",label:"Red"},{value:"#E0E0E0",label:"Gray"},{value:"#FF6B00",label:"Orange"}];return i.jsx(ao,{open:e,onOpenChange:r,children:i.jsxs(fa,{className:"sm:max-w-6xl bg-gradient-to-br from-cosmic-900 to-cosmic-800 border border-white/20 text-white max-h-[90vh] overflow-y-auto",children:[i.jsx(ha,{children:i.jsxs(pa,{className:"text-2xl font-bold flex items-center",children:[De(),i.jsx("div",{className:"ml-3 flex items-center",children:h?i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"text",value:f,onChange:de=>m(de.target.value),onKeyDown:de=>{de.key==="Enter"?re():de.key==="Escape"&&(v(!1),m((j==null?void 0:j.name)||""))},className:"bg-black/30 border border-white/20 rounded px-2 py-1 text-white text-2xl font-bold focus:outline-none focus:border-white/40",autoFocus:!0}),i.jsx(me,{size:"sm",onClick:re,disabled:b,className:"h-6 px-2 text-xs",children:b?"Saving...":"Save"}),i.jsx(me,{size:"sm",variant:"outline",onClick:()=>{v(!1),m((j==null?void 0:j.name)||"")},className:"h-6 px-2 text-xs",children:"Cancel"})]}):i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"cursor-pointer hover:bg-white/10 px-2 py-1 rounded transition-colors",onClick:()=>v(!0),title:"Click to edit name",children:j==null?void 0:j.name}),i.jsx(me,{size:"sm",variant:"ghost",onClick:()=>v(!0),className:"h-6 w-6 p-0 opacity-0 hover:opacity-100 transition-opacity",title:"Edit name",children:i.jsx(Ou,{className:"w-3 h-3"})})]})}),i.jsx(hn,{className:`ml-3 ${fe()} ${ee()}`,children:(Dn=t==null?void 0:t.type)==null?void 0:Dn.toUpperCase()})]})}),t&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("h3",{className:"text-lg font-semibold flex items-center",children:[i.jsx(b2,{className:"w-5 h-5 mr-2"}),"Service Overview"]}),i.jsxs("div",{className:"relative color-picker-container",children:[i.jsx(me,{size:"sm",variant:"outline",className:"h-8 w-8 p-0 border-white/20 hover:bg-white/10",onClick:()=>o(!a),title:"Change card color",children:i.jsx("div",{className:"w-4 h-4 rounded-full border border-white/20",style:{backgroundColor:l||t.cardColor||"#92E4DD"}})}),a&&i.jsxs("div",{className:"absolute top-full right-0 mt-2 bg-black/90 border border-white/20 rounded-lg p-3 z-50 min-w-32",children:[i.jsx("div",{className:"text-xs text-gray-300 mb-2",children:"Choose Color:"}),i.jsx("div",{className:"grid grid-cols-1 gap-1",children:Ue.map(de=>i.jsxs("button",{className:`flex items-center gap-2 px-2 py-1 rounded text-xs hover:bg-white/10 transition-colors ${(l||t.cardColor)===de.value?"bg-white/20":""}`,onClick:()=>ze(de.value),disabled:u,children:[i.jsx("div",{className:"w-3 h-3 rounded-full border border-white/20",style:{backgroundColor:de.value}}),i.jsx("span",{className:"text-white",children:de.label}),u&&t.cardColor===de.value&&i.jsx("div",{className:"ml-auto w-3 h-3 border border-white/20 border-t-transparent rounded-full animate-spin"})]},de.value))})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("p",{className:"text-gray-300 text-sm",children:"Description"}),!p&&i.jsx(me,{size:"sm",variant:"ghost",onClick:()=>w(!0),className:"h-6 w-6 p-0 opacity-0 hover:opacity-100 transition-opacity",title:"Edit description",children:i.jsx(Ou,{className:"w-3 h-3"})})]}),p?i.jsxs("div",{className:"space-y-2",children:[i.jsx("textarea",{value:g,onChange:de=>y(de.target.value),className:"w-full bg-black/30 border border-white/20 rounded px-2 py-1 text-white focus:outline-none focus:border-white/40 resize-none",rows:3,placeholder:"Enter description...",autoFocus:!0}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(me,{size:"sm",onClick:Me,disabled:E,className:"h-6 px-2 text-xs",children:E?"Saving...":"Save"}),i.jsx(me,{size:"sm",variant:"outline",onClick:()=>{w(!1),y((j==null?void 0:j.description)||"")},className:"h-6 px-2 text-xs",children:"Cancel"})]})]}):i.jsx("p",{className:"text-white cursor-pointer hover:bg-white/10 px-2 py-1 rounded transition-colors",onClick:()=>w(!0),title:"Click to edit description",children:(j==null?void 0:j.description)||"No description"})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Endpoint"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(hn,{variant:"outline",className:"border-blue-500/30 text-blue-300",children:_.type.toUpperCase()}),t.headers&&typeof t.headers=="object"&&Object.keys(t.headers).length>0&&i.jsx(hn,{variant:"outline",className:"border-green-500/30 text-green-300",children:"Custom Headers"})]}),i.jsx(me,{size:"sm",variant:"ghost",onClick:()=>window.open(_.url,"_blank"),className:"p-1 h-auto",children:i.jsx(Jn,{className:"w-4 h-4"})})]}),i.jsx("div",{className:"text-xs text-gray-400 break-all bg-black/20 p-2 rounded border border-white/10",children:_.url||"No URL available"}),t.headers&&typeof t.headers=="object"&&Object.keys(t.headers).length>0&&i.jsxs("div",{className:"text-xs text-gray-400 bg-black/20 p-2 rounded border border-white/10",children:[i.jsx("p",{className:"font-semibold mb-1",children:"Custom Headers:"}),i.jsx("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(t.headers,null,2)})]})]})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Health Status"}),i.jsx(hn,{className:_.health==="healthy"?"bg-green-500/20 text-green-300":_.health==="unhealthy"?"bg-red-500/20 text-red-300":"bg-amber-500/20 text-amber-200",children:_.health==="healthy"?"Healthy":_.health==="unhealthy"?"Unreachable":se.status==="required"||se.status==="expired"?"Auth required":"Unknown"})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Registered"}),i.jsx("p",{className:"text-white text-sm",children:X(_.registeredAt)})]})]})]}),we&&i.jsxs("div",{className:"text-center py-8",children:[i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4"}),i.jsx("p",{className:"text-gray-400",children:"Fetching service details..."})]}),s&&i.jsx("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:i.jsx("p",{className:"text-red-300",children:s})}),(t.type==="mcp"||t.type==="local-mcp")&&i.jsxs(i.Fragment,{children:[t.type==="local-mcp"&&i.jsxs("div",{className:"bg-cyan-500/15 border border-cyan-500/30 rounded-lg p-4 mb-4",children:[i.jsx("h3",{className:"text-cyan-200 font-semibold mb-2",children:"Local MCP — auth happens outside Agent Deck"}),i.jsx("div",{className:"text-cyan-100/90 text-sm space-y-2",children:lI(_)?i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["This card runs ",i.jsx("code",{className:"text-xs",children:"@piotr-agier/google-drive-mcp"})," on your machine. Agent Deck does ",i.jsx("strong",{children:"not"}),' handle Google OAuth for it. If Google shows "app not verified", that is ',i.jsx("strong",{children:"your Google Cloud project"}),", not Agent Deck."]}),i.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-1",children:[i.jsxs("li",{children:["Create a GCP OAuth client type ",i.jsx("strong",{children:"Desktop app"})," (not Web)."]}),i.jsxs("li",{children:["Add yourself as a ",i.jsx("strong",{children:"Test user"})," on the consent screen."]}),i.jsxs("li",{children:["Run in terminal first:"," ",i.jsx("code",{className:"text-xs block mt-1 bg-black/30 p-2 rounded whitespace-pre-wrap",children:`export GOOGLE_DRIVE_OAUTH_CREDENTIALS="/path/to/gcp-oauth.keys.json"
|
|
357
|
-
export GOOGLE_DRIVE_MCP_AUTH_PORT=3100
|
|
358
|
-
npx @piotr-agier/google-drive-mcp auth`})]}),i.jsxs("li",{children:["Set ",i.jsx("code",{className:"text-xs",children:"GOOGLE_DRIVE_MCP_TOKEN_PATH"})," in the card env to the same token file (",i.jsx("code",{className:"text-xs",children:"~/.config/google-drive-mcp/tokens.json"}),")."]})]}),i.jsxs("p",{className:"text-xs text-cyan-200/80",children:["Full steps: ",i.jsx("code",{className:"text-xs",children:"docs/GOOGLE_DRIVE_WORKAROUND.md"})," in the repo."]})]}):i.jsx("p",{children:"Local servers manage their own credentials (API keys, OAuth, etc.) in the spawned process. Complete any login in the terminal or config for that package before expecting tools here."})})]}),i.jsx(iI,{serviceId:_.id,tools:ve,isLoading:L})]}),t.type==="a2a"&&te&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[i.jsx(T2,{className:"w-5 h-5 mr-2"}),"Agent Overview"]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Agent Name"}),i.jsx("p",{className:"text-white font-semibold",children:te.name})]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Version"}),i.jsx("p",{className:"text-white",children:te.version})]}),i.jsxs("div",{className:"md:col-span-2",children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Description"}),i.jsx("p",{className:"text-white",children:te.description})]}),te.provider&&i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Provider"}),i.jsx("p",{className:"text-white",children:te.provider.organization})]}),te.documentationUrl&&i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Documentation"}),i.jsxs(me,{size:"sm",variant:"ghost",onClick:()=>window.open(te.documentationUrl,"_blank"),className:"p-1 h-auto text-purple-300",children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"View Docs"]})]})]})]}),te.capabilities&&i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[i.jsx(A1,{className:"w-5 h-5 mr-2"}),"Capabilities"]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[te.capabilities.streaming&&i.jsx(hn,{className:"bg-green-500/20 text-green-300",children:"Streaming"}),te.capabilities.pushNotifications&&i.jsx(hn,{className:"bg-blue-500/20 text-blue-300",children:"Push Notifications"}),te.capabilities.stateTransitionHistory&&i.jsx(hn,{className:"bg-purple-500/20 text-purple-300",children:"State History"})]})]}),te.skills&&te.skills.length>0&&i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[i.jsx(If,{className:"w-5 h-5 mr-2"}),"Skills (",te.skills.length,")"]}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4",children:te.skills.map((de,je)=>i.jsxs("div",{className:"relative group cursor-pointer transform hover:scale-105 transition-all duration-300",style:{aspectRatio:"2/3",background:"linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(196, 181, 253, 0.1))",border:"2px solid rgba(147, 51, 234, 0.3)",borderRadius:"12px",boxShadow:"0 4px 20px rgba(147, 51, 234, 0.2)",minWidth:"120px",maxWidth:"160px"},children:[i.jsx("div",{className:"absolute top-2 left-2 text-xs font-bold",children:i.jsx("div",{className:"text-purple-300 leading-none",children:"S"})}),i.jsx("div",{className:"absolute bottom-2 right-2 text-xs font-bold rotate-180",children:i.jsx("div",{className:"text-purple-300 leading-none",children:"S"})}),i.jsxs("div",{className:"absolute inset-x-3 top-8 bottom-8 flex flex-col items-center justify-center text-center",children:[i.jsx("div",{className:"text-purple-300 mb-2",children:i.jsx(If,{className:"w-6 h-6"})}),i.jsx("h4",{className:"font-bold text-sm mb-2 line-clamp-2 text-white",children:de.name}),i.jsx("p",{className:"text-gray-300 text-xs line-clamp-4 mb-2",children:de.description}),de.tags&&de.tags.length>0&&i.jsx("div",{className:"flex flex-wrap gap-1 justify-center",children:de.tags.slice(0,2).map((at,Dt)=>i.jsx("span",{className:"text-purple-300 text-xs bg-purple-500/20 px-1 py-0.5 rounded",children:at},Dt))})]}),i.jsx("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-br from-transparent via-purple-500/5 to-transparent opacity-0 group-hover:opacity-100 transition-all duration-500 pointer-events-none"})]},je))})]}),(te.defaultInputModes||te.defaultOutputModes)&&i.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[i.jsxs("h3",{className:"text-lg font-semibold mb-3 flex items-center",children:[i.jsx(r0,{className:"w-5 h-5 mr-2"}),"Data Modes"]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[te.defaultInputModes&&i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-2",children:"Input Modes"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:te.defaultInputModes.map((de,je)=>i.jsx(hn,{className:"bg-blue-500/20 text-blue-300 text-xs",children:de},je))})]}),te.defaultOutputModes&&i.jsxs("div",{children:[i.jsx("p",{className:"text-gray-300 text-sm mb-2",children:"Output Modes"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:te.defaultOutputModes.map((de,je)=>i.jsx(hn,{className:"bg-green-500/20 text-green-300 text-xs",children:de},je))})]})]})]})]}),(t==null?void 0:t.type)==="mcp"&&se.status==="not_required"&&(_==null?void 0:_.id)&&i.jsxs("div",{className:"bg-blue-500/20 border border-blue-500/30 rounded-lg p-4 mb-4",children:[i.jsx("h3",{className:"text-blue-300 font-semibold mb-2",children:"How to connect"}),i.jsx(A0,{serviceId:_.id})]}),(t==null?void 0:t.type)==="mcp"&&se.status!=="authenticated"&&se.status!=="not_required"&&i.jsxs("div",{className:`${se.status==="expired"?"bg-red-500/20 border-red-500/30":"bg-orange-500/20 border-orange-500/30"} rounded-lg p-4 mb-4`,children:[i.jsx("h3",{className:`${se.status==="expired"?"text-red-300":"text-orange-300"} font-semibold mb-2`,children:se.status==="expired"?"⏰ Token Expired":"🔐 Authentication Required"}),i.jsxs("div",{className:`${se.status==="expired"?"text-red-200":"text-orange-200"} text-sm space-y-2`,children:[i.jsx("p",{children:i.jsx("strong",{children:se.message})}),i.jsx("p",{children:se.status==="expired"?"Your OAuth token has expired. Please re-authenticate to continue using this service.":"This MCP server requires OAuth authentication to access its tools. Please authenticate to continue."}),(_==null?void 0:_.id)&&i.jsx(A0,{serviceId:_.id,onConnected:()=>void V()}),((ya=(ms=C==null?void 0:C.data)==null?void 0:ms.oauth)==null?void 0:ya.resourceName)&&i.jsx("div",{className:"mt-3 p-2 bg-orange-500/10 rounded border border-orange-500/20 text-xs text-orange-100",children:i.jsxs("p",{children:[i.jsx("strong",{children:"Resource:"})," ",C.data.oauth.resourceName]})})]})]}),(t==null?void 0:t.type)==="mcp"&&i.jsxs("div",{className:"bg-gray-800/50 border border-gray-600/30 rounded-lg p-4 mb-4",children:[i.jsx("h3",{className:"text-gray-300 font-semibold mb-2",children:"Connection Logs"}),i.jsxs("div",{className:"text-gray-200 text-sm space-y-2",children:[i.jsxs("div",{className:"bg-black/30 p-2 rounded text-xs",children:[i.jsx("p",{children:i.jsx("strong",{children:"🔍 Attempting to discover tools for MCP service:"})}),i.jsxs("p",{children:["Service ID: ",t==null?void 0:t.id]}),i.jsxs("p",{children:["Service URL: ",_==null?void 0:_.url]}),i.jsxs("p",{children:["Status: ",L?"🔄 Loading...":Q?"❌ Failed":"✅ Complete"]})]}),L&&i.jsxs("div",{className:"bg-yellow-500/20 p-2 rounded text-xs",children:[i.jsxs("p",{children:["🔄 Making HTTP request to: ",i.jsxs("code",{children:["GET /api/services/",t==null?void 0:t.id,"/tools"]})]}),i.jsxs("p",{children:["Target MCP server: ",i.jsx("code",{children:_==null?void 0:_.url})]})]}),Q&&i.jsxs("div",{className:"bg-red-500/20 p-2 rounded text-xs",children:[i.jsx("p",{children:"❌ Request failed:"}),i.jsx("pre",{className:"whitespace-pre-wrap overflow-x-auto",children:Q instanceof Error?Q.message:String(Q)}),i.jsxs("div",{className:"mt-2 p-2 bg-black/30 rounded",children:[i.jsx("p",{children:i.jsx("strong",{children:"🔍 What we tried:"})}),i.jsxs("p",{children:["• Service ID: ",t==null?void 0:t.id]}),i.jsxs("p",{children:["• Target URL: ",_==null?void 0:_.url]}),i.jsxs("p",{children:["• Request: GET /api/services/",t==null?void 0:t.id,"/tools"]}),(_==null?void 0:_.headers)&&i.jsxs("div",{children:[i.jsx("p",{children:i.jsx("strong",{children:"📋 Headers sent:"})}),i.jsx("pre",{className:"text-xs overflow-x-auto",children:JSON.stringify(_.headers,null,2)})]}),i.jsxs("div",{className:"mt-2",children:[i.jsx("p",{children:i.jsx("strong",{children:"💡 What this means:"})}),i.jsxs("p",{children:["• The MCP server at ",_==null?void 0:_.url," returned an error"]}),i.jsx("p",{children:"• This could be due to authentication issues, server being down, or invalid configuration"}),i.jsx("p",{children:"• Check the error message above for specific details from the MCP server"})]})]})]}),!L&&!Q&&ve.length>0&&i.jsx("div",{className:"bg-green-500/20 p-2 rounded text-xs",children:i.jsxs("p",{children:["✅ Successfully discovered ",ve.length," tools from MCP server"]})}),!L&&!Q&&ve.length===0&&i.jsxs("div",{className:"bg-yellow-500/20 p-2 rounded text-xs",children:[i.jsx("p",{children:"⚠️ Connected to MCP server but no tools were found"}),i.jsx("p",{children:"This could mean the server has no tools or requires specific authentication"})]})]})]}),Q&&(t.type==="mcp"||t.type==="local-mcp")&&i.jsxs("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:[i.jsx("h3",{className:"text-red-300 font-semibold mb-2",children:"MCP Tool Discovery Failed"}),i.jsxs("div",{className:"text-red-200 text-sm space-y-2",children:[i.jsx("p",{children:i.jsx("strong",{children:"Raw Error:"})}),i.jsx("pre",{className:"bg-black/30 p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap",children:Q instanceof Error?Q.message:String(Q)}),i.jsxs("p",{children:[i.jsx("strong",{children:"Service URL:"})," ",_==null?void 0:_.url]}),i.jsxs("p",{children:[i.jsx("strong",{children:"Service ID:"})," ",_==null?void 0:_.id]}),(_==null?void 0:_.headers)&&i.jsxs("div",{children:[i.jsx("p",{children:i.jsx("strong",{children:"Custom Headers:"})}),i.jsx("pre",{className:"bg-black/30 p-2 rounded text-xs overflow-x-auto",children:JSON.stringify(_.headers,null,2)})]})]})]}),Ee&&t.type==="a2a"&&i.jsxs("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:[i.jsx("h3",{className:"text-red-300 font-semibold mb-2",children:"A2A Manifest Discovery Failed"}),i.jsxs("div",{className:"text-red-200 text-sm space-y-2",children:[i.jsx("p",{children:i.jsx("strong",{children:"Raw Error:"})}),i.jsx("pre",{className:"bg-black/30 p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap",children:Ee instanceof Error?Ee.message:String(Ee)}),i.jsxs("p",{children:[i.jsx("strong",{children:"Service URL:"})," ",_==null?void 0:_.url]}),i.jsxs("p",{children:[i.jsx("strong",{children:"Service ID:"})," ",_==null?void 0:_.id]})]})]}),!we&&!Q&&!Ee&&(t.type==="mcp"||t.type==="local-mcp")&&ve.length===0&&(t.type==="local-mcp"||!((ne=(vs=C==null?void 0:C.data)==null?void 0:vs.oauth)!=null&&ne.required))&&i.jsxs("div",{className:"bg-yellow-500/20 border border-yellow-500/30 rounded-lg p-4",children:[i.jsx("h3",{className:"text-yellow-300 font-semibold mb-2",children:"No Tools Available"}),i.jsxs("p",{className:"text-yellow-200 text-sm",children:["Successfully connected to MCP server at ",_==null?void 0:_.url,", but no tools were discovered."]}),i.jsxs("div",{className:"text-yellow-200 text-xs mt-2",children:[i.jsx("p",{children:i.jsx("strong",{children:"This could mean:"})}),i.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[i.jsx("li",{children:"The MCP server has no tools registered"}),i.jsx("li",{children:"Tools require specific authentication"}),i.jsx("li",{children:"Tools are only available after certain operations"})]})]})]}),(t.type==="mcp"||t.type==="local-mcp")&&i.jsxs("div",{className:"bg-blue-500/20 border border-blue-500/30 rounded-lg p-4",children:[i.jsx("h3",{className:"text-blue-300 font-semibold mb-2",children:"🔍 MCP Server Analysis"}),i.jsxs("div",{className:"text-blue-200 text-sm space-y-2",children:[i.jsxs("p",{children:[i.jsx("strong",{children:"Server URL:"})," ",_==null?void 0:_.url]}),z&&i.jsx("div",{className:"mt-3 p-3 bg-black/30 rounded",children:i.jsx("p",{children:"🔍 Analyzing MCP server configuration..."})}),C&&i.jsxs("div",{className:"mt-3 p-3 bg-black/30 rounded",children:[i.jsx("p",{children:i.jsx("strong",{children:"🔍 What we discovered:"})}),C.error&&C.analysis&&i.jsxs("div",{className:"text-yellow-200",children:[C.analysis.auth_type==="oauth2"&&i.jsxs("div",{children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"OAuth 2.0 Authentication Required"})]}),i.jsx("p",{children:"• This MCP server requires OAuth 2.0 Bearer token authentication"}),i.jsx("p",{children:"• You'll need to provide OAuth credentials (client ID, client secret, authorization URL, token URL)"}),i.jsx("p",{children:"• Check the service provider's documentation for OAuth setup instructions"})]}),C.analysis.protocol==="sse"&&i.jsxs("div",{children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"SSE Protocol Required"})]}),i.jsx("p",{children:"• This MCP server uses Server-Sent Events (SSE) protocol"}),i.jsx("p",{children:"• We'll need to connect using event streaming instead of HTTP"})]}),C.analysis.issue==="not_found"&&i.jsxs("div",{children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"Server Not Found"})]}),i.jsx("p",{children:"• The MCP server URL might be incorrect"}),i.jsx("p",{children:"• Check if the server is running and the URL is correct"})]}),C.analysis.issue==="server_error"&&i.jsxs("div",{children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"Server Error"})]}),i.jsx("p",{children:"• The MCP server is experiencing internal errors"}),i.jsx("p",{children:"• Try again later or contact the service provider"})]}),C.analysis.message&&i.jsxs("p",{children:["• ",i.jsx("strong",{children:"Analysis:"})," ",C.analysis.message]})]}),((Mn=(Et=C==null?void 0:C.data)==null?void 0:Et.oauth)==null?void 0:Mn.required)&&i.jsxs("div",{className:"text-yellow-200",children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"OAuth 2.0 Authentication Required"})]}),C.data.oauth.authorizationUrl&&i.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[i.jsx(me,{size:"sm",variant:"default",className:"h-7",onClick:async()=>{var de,je;if(_!=null&&_.id)try{O({title:"Setting up OAuth...",description:"Automatically registering OAuth application and starting authorization flow..."});const at=await Oe("POST",`/api/oauth/${_.id}/auto-setup`,{});if(!at.ok){const Nt=await at.json();(de=Nt.data)!=null&&de.registrationUrl?(window.open(Nt.data.registrationUrl,"_blank"),O({title:"OAuth Registration Required",description:`${Nt.error} I've opened the registration page for you. Please create an OAuth app and then come back to add your credentials.`,duration:15e3})):O({title:"OAuth Setup Failed",description:Nt.error||"Failed to setup OAuth automatically. Please configure manually.",variant:"destructive"});return}const Dt=await at.json();Dt.success&&((je=Dt.data)!=null&&je.authorizationUrl)?(window.open(Dt.data.authorizationUrl,"_blank"),O({title:"OAuth Setup Successful",description:"OAuth application registered automatically! Please complete the authorization in the new window.",duration:1e4}),V()):O({title:"OAuth Setup Failed",description:"Failed to get authorization URL. Please try again.",variant:"destructive"})}catch(at){O({title:"OAuth Setup Failed",description:at instanceof Error?at.message:"Unknown error occurred",variant:"destructive"})}},children:"🔧 Auto-Setup OAuth"}),i.jsxs(me,{size:"sm",variant:"ghost",className:"p-1 h-auto text-blue-300",onClick:()=>window.open(C.data.oauth.authorizationUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"Open Raw Authorization URL"]})]}),!C.data.oauth.authorizationUrl&&C.data.oauth.protectedResourceConfigUrl&&i.jsx("div",{className:"mt-2",children:i.jsxs(me,{size:"sm",variant:"ghost",className:"p-1 h-auto text-blue-300",onClick:()=>window.open(C.data.oauth.protectedResourceConfigUrl,"_blank"),children:[i.jsx(Jn,{className:"w-4 h-4 mr-1"}),"View OAuth Configuration"]})}),C.data.oauth.authorizationServerMetadataUrl&&i.jsxs("div",{className:"mt-2 text-xs text-gray-300",children:[i.jsx("span",{className:"mr-1",children:"Auth Server Metadata:"}),i.jsx("button",{className:"underline text-blue-300",onClick:()=>window.open(C.data.oauth.authorizationServerMetadataUrl,"_blank"),children:C.data.oauth.authorizationServerMetadataUrl})]})]}),(C==null?void 0:C.success)&&!((Yl=($n=C==null?void 0:C.data)==null?void 0:$n.oauth)!=null&&Yl.required)&&i.jsxs("div",{className:"text-green-200",children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"✅ Server Analysis Complete"})]}),i.jsx("p",{children:"• MCP server is accessible and responding"}),i.jsx("p",{children:"• No authentication issues detected"}),i.jsx("p",{children:"• Protocol compatibility confirmed"})]}),((Xl=(Jl=C==null?void 0:C.data)==null?void 0:Jl.oauth)==null?void 0:Xl.required)&&i.jsxs("div",{className:"text-orange-200",children:[i.jsxs("p",{children:["• ",i.jsx("strong",{children:"🔐 OAuth 2.0 Authentication Required"})]}),i.jsx("p",{children:"• This MCP server requires OAuth authentication"}),C.data.oauth.resourceName&&i.jsxs("p",{children:["• Service: ",C.data.oauth.resourceName]}),C.data.oauth.authorizationUrl&&i.jsxs("p",{children:["• Authorization URL: ",C.data.oauth.authorizationUrl]}),C.data.oauth.tokenUrl&&i.jsxs("p",{children:["• Token URL: ",C.data.oauth.tokenUrl]}),i.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[i.jsx(me,{size:"sm",variant:"default",className:"bg-orange-600 hover:bg-orange-700",onClick:async()=>{var de,je;if(_!=null&&_.id)try{O({title:"Setting up OAuth...",description:"Automatically registering OAuth application and starting authorization flow..."});const at=await Oe("POST",`/api/oauth/${_.id}/auto-setup`,{});if(!at.ok){const Nt=await at.json();(de=Nt.data)!=null&&de.registrationUrl?(window.open(Nt.data.registrationUrl,"_blank"),O({title:"OAuth Registration Required",description:`${Nt.error} I've opened the registration page for you. Please create an OAuth app and then come back to add your credentials.`,duration:15e3})):O({title:"OAuth Setup Failed",description:Nt.error||"Failed to setup OAuth automatically. Please configure manually.",variant:"destructive"});return}const Dt=await at.json();Dt.success&&((je=Dt.data)!=null&&je.authorizationUrl)?(window.open(Dt.data.authorizationUrl,"_blank"),O({title:"OAuth Setup Successful",description:"OAuth application registered automatically! Please complete the authorization in the new window.",duration:1e4}),V()):O({title:"OAuth Setup Failed",description:"Failed to get authorization URL. Please try again.",variant:"destructive"})}catch(at){O({title:"OAuth Setup Failed",description:at instanceof Error?at.message:"Unknown error occurred",variant:"destructive"})}},children:"🔧 Auto-Setup OAuth"}),i.jsx(me,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-300 hover:bg-orange-500/10",onClick:()=>{const de=`OAuth Setup Instructions:
|
|
359
|
-
|
|
360
|
-
1. Go to the service provider's OAuth/Developer settings
|
|
361
|
-
2. Create a new OAuth application
|
|
362
|
-
3. Set Redirect URL: http://localhost:8000/api/oauth/${_==null?void 0:_.id}/callback
|
|
363
|
-
4. Copy the Client ID and Client Secret
|
|
364
|
-
5. Edit this service and add the credentials
|
|
365
|
-
|
|
366
|
-
${C.data.oauth.authorizationUrl?`Authorization URL: ${C.data.oauth.authorizationUrl}`:""}
|
|
367
|
-
${C.data.oauth.tokenUrl?`Token URL: ${C.data.oauth.tokenUrl}`:""}
|
|
368
|
-
${C.data.oauth.issuer?`Issuer: ${C.data.oauth.issuer}`:""}`;O({title:"OAuth Setup Instructions",description:de,duration:1e4})},children:"📋 Setup Instructions"})]})]}),i.jsxs("div",{className:"mt-2 text-xs",children:[i.jsx("p",{children:i.jsx("strong",{children:"💡 Next Steps:"})}),i.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[i.jsx("li",{children:"For OAuth servers: Provide OAuth credentials in service settings"}),i.jsx("li",{children:"For SSE servers: We'll automatically use the correct protocol"}),i.jsx("li",{children:"For connection issues: Verify the server URL and status"})]})]})]}),U&&i.jsxs("div",{className:"mt-3 p-3 bg-red-500/20 rounded",children:[i.jsx("p",{children:i.jsx("strong",{children:"❌ Discovery Failed"})}),i.jsx("p",{children:"Could not analyze MCP server configuration"}),i.jsx("pre",{className:"text-xs overflow-x-auto",children:U instanceof Error?U.message:String(U)})]})]})]}),!we&&!Q&&!Ee&&t.type==="a2a"&&!te&&i.jsxs("div",{className:"bg-yellow-500/20 border border-yellow-500/30 rounded-lg p-4",children:[i.jsx("h3",{className:"text-yellow-300 font-semibold mb-2",children:"Agent Details Not Available"}),i.jsxs("p",{className:"text-yellow-200 text-sm",children:["Successfully connected to A2A agent at ",_==null?void 0:_.url,", but no manifest was found."]}),i.jsxs("div",{className:"text-yellow-200 text-xs mt-2",children:[i.jsx("p",{children:i.jsx("strong",{children:"This could mean:"})}),i.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[i.jsx("li",{children:"The agent doesn't provide a manifest"}),i.jsx("li",{children:"Manifest endpoint is not implemented"}),i.jsx("li",{children:"Agent requires specific authentication"})]})]})]})]})]})})}function uI(){const[t,e]=x.useState("connecting"),[r,s]=x.useState(null),n=x.useRef(null),a=x.useRef(null),o=yr();return x.useEffect(()=>{const c=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws/events`,u=()=>{try{const d=new WebSocket(c);n.current=d,d.onopen=()=>{console.log("WebSocket connected"),e("connected")},d.onmessage=h=>{try{const v=JSON.parse(h.data);s(v),v.type==="deck_update"?(console.log("Received deck update:",v),o.invalidateQueries({queryKey:["/api/decks"]}),o.invalidateQueries({queryKey:["/api/decks"]})):v.type==="service_update"?(console.log("Received service update:",v),o.invalidateQueries({queryKey:["/api/services"]})):v.type==="connection_status"&&e(v.status==="connected"?"connected":"disconnected")}catch(v){console.error("Failed to parse WebSocket message:",v)}},d.onclose=()=>{console.log("WebSocket disconnected"),e("disconnected"),a.current=setTimeout(()=>{console.log("Attempting to reconnect WebSocket..."),e("connecting"),u()},3e3)},d.onerror=h=>{console.error("WebSocket error:",h),e("disconnected")}}catch(d){console.error("Failed to connect WebSocket:",d),e("disconnected")}};return u(),()=>{a.current&&clearTimeout(a.current),n.current&&n.current.readyState===WebSocket.OPEN&&n.current.close()}},[o]),{connectionStatus:t,lastMessage:r}}async function O0(t,e){const r=t==="credential"?`credentialId=${encodeURIComponent(e)}`:`serviceId=${encodeURIComponent(e)}`;return(await(await Oe("GET",`/api/playbooks/dependents/check?${r}`)).json()).data??[]}function dI(t){const[e,r]=x.useState(null),[s,n]=x.useState(null),[a,o]=x.useState(null),[l,c]=x.useState(!1),u=yr(),{toast:d}=or(),h=()=>{if(!t)throw new Error("Select a deck to edit first");return t},v=At({mutationFn:async j=>{var K,$,F;const _=h(),z=(K=(await(await Oe("GET","/api/decks")).json()).data)==null?void 0:K.find(V=>V.id===_);if(!z)throw new Error("Selected deck not found");if(($=z.services)!=null&&$.some(V=>V.id===j))throw new Error("Service is already in the deck");const U=((F=z.services)==null?void 0:F.length)??0;return Oe("POST",`/api/decks/${_}/services`,{serviceId:j,position:U})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Service added to deck",description:`${(e==null?void 0:e.name)||"Service"} has been added to the deck.`})},onError:j=>{d({title:"Failed to add service",description:j.message,variant:"destructive"})}}),p=At({mutationFn:async j=>{var U,K;const _=h(),z=(U=(await(await Oe("GET","/api/decks")).json()).data)==null?void 0:U.find($=>$.id===_);if((K=z==null?void 0:z.credentials)!=null&&K.some($=>$.id===j))throw new Error("API key is already in the deck");return Oe("POST",`/api/decks/${_}/credentials`,{credentialId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"API key added to deck",description:`${(s==null?void 0:s.label)||"API key"} is scoped to this deck.`})},onError:j=>{d({title:"Failed to add API key",description:j.message,variant:"destructive"})}}),w=At({mutationFn:async j=>{var U,K;const _=h(),z=(U=(await(await Oe("GET","/api/decks")).json()).data)==null?void 0:U.find($=>$.id===_);if((K=z==null?void 0:z.playbooks)!=null&&K.some($=>$.id===j))throw new Error("Playbook is already in the deck");return Oe("POST",`/api/decks/${_}/playbooks`,{playbookId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Playbook added to deck",description:`${(a==null?void 0:a.title)||"Playbook"} is on this deck.`})},onError:j=>{d({title:"Failed to add playbook",description:j.message,variant:"destructive"})}}),f=At({mutationFn:async j=>{const _=await O0("service",j);if(_.length>0){const C=_.map(U=>U.title).join(", ");if(!window.confirm(`Warning: ${_.length} playbook(s) depend on this MCP (${C}). Remove from deck anyway?`))throw new Error("Cancelled")}const A=h();return Oe("DELETE",`/api/decks/${A}/services`,{serviceId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Service removed from deck",description:`${(e==null?void 0:e.name)||"Service"} has been removed from the deck.`})},onError:j=>{j.message!=="Cancelled"&&d({title:"Failed to remove service",description:j.message,variant:"destructive"})}}),m=At({mutationFn:async j=>{const _=await O0("credential",j);if(_.length>0){const C=_.map(U=>U.title).join(", ");if(!window.confirm(`Warning: ${_.length} playbook(s) depend on this API key (${C}). Remove from deck anyway?`))throw new Error("Cancelled")}const A=h();return Oe("DELETE",`/api/decks/${A}/credentials`,{credentialId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"API key removed from deck",description:`${(s==null?void 0:s.label)||"API key"} is no longer on this deck.`})},onError:j=>{j.message!=="Cancelled"&&d({title:"Failed to remove API key",description:j.message,variant:"destructive"})}}),g=At({mutationFn:async j=>{const _=h();return Oe("DELETE",`/api/decks/${_}/playbooks`,{playbookId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Playbook removed from deck",description:`${(a==null?void 0:a.title)||"Playbook"} is no longer on this deck.`})},onError:j=>{d({title:"Failed to remove playbook",description:j.message,variant:"destructive"})}}),y=(j,_)=>{j.currentTarget instanceof HTMLElement&&(j.currentTarget.style.opacity=_)},b=(j,_)=>{j.dataTransfer.setData("text/plain",_.id),j.dataTransfer.setData("application/json",JSON.stringify(_)),j.dataTransfer.effectAllowed=_.fromDeck?"move":"copy"},S=(j,_,A=!1)=>{r(_),n(null),o(null),c(A),b(j,{kind:"service",id:_.id,fromDeck:A}),y(j,"0.5")},E=(j,_,A=!1)=>{n(_),r(null),o(null),c(A),b(j,{kind:"credential",id:_.id,fromDeck:A}),y(j,"0.5")},P=(j,_,A=!1)=>{o(_),r(null),n(null),c(A),b(j,{kind:"playbook",id:_.id,fromDeck:A}),y(j,"0.5")},R=j=>{r(null),n(null),o(null),y(j,"1")},T=j=>{if(j.kind==="service"){j.fromDeck?f.mutate(j.id):v.mutate(j.id);return}if(j.kind==="credential"){j.fromDeck?m.mutate(j.id):p.mutate(j.id);return}j.fromDeck?g.mutate(j.id):w.mutate(j.id)};return{draggedService:e,draggedCredential:s,draggedPlaybook:a,isDraggingFromDeck:l,handleDragStart:S,handleCredentialDragStart:E,handlePlaybookDragStart:P,handleDragEnd:R,handleDrop:j=>{j.preventDefault();const _=j.dataTransfer.getData("application/json");if(_){try{T(JSON.parse(_))}catch{const A=j.dataTransfer.getData("text/plain");A&&e&&v.mutate(A)}r(null),n(null),o(null),c(!1)}},handleGlobalDrop:j=>{j.preventDefault();const _=j.dataTransfer.getData("application/json");if(_){try{const A=JSON.parse(_);A.fromDeck&&T(A)}catch{}r(null),n(null),o(null),c(!1)}},isDropping:v.isPending||p.isPending||w.isPending||f.isPending||m.isPending||g.isPending}}const Gf="agent-deck-editing-deck-id";function fI(t){const[e,r]=x.useState(()=>typeof window>"u"?null:localStorage.getItem(Gf));x.useEffect(()=>{if(t.length===0)return;if(!(e&&t.some(o=>o.id===e))){const o=t[0].id;r(o),localStorage.setItem(Gf,o)}},[t,e]);const s=a=>{r(a),localStorage.setItem(Gf,a)};return{editingDeck:t.find(a=>a.id===e)??null,editingDeckId:e,setEditingDeckId:s}}function I0(t,[e,r]){return Math.min(r,Math.max(e,t))}var hI=[" ","Enter","ArrowUp","ArrowDown"],pI=[" ","Enter"],Za="Select",[Vd,Hd,mI]=yv(Za),[Pi,GF]=fs(Za,[mI,Id]),qd=Id(),[vI,ma]=Pi(Za),[gI,yI]=Pi(Za),H_=t=>{const{__scopeSelect:e,children:r,open:s,defaultOpen:n,onOpenChange:a,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:v,required:p,form:w}=t,f=qd(e),[m,g]=x.useState(null),[y,b]=x.useState(null),[S,E]=x.useState(!1),P=zv(u),[R,T]=Ka({prop:s,defaultProp:n??!1,onChange:a,caller:Za}),[N,O]=Ka({prop:o,defaultProp:l,onChange:c,caller:Za}),j=x.useRef(null),_=m?w||!!m.closest("form"):!0,[A,C]=x.useState(new Set),z=Array.from(A).map(U=>U.props.value).join(";");return i.jsx(IT,{...f,children:i.jsxs(vI,{required:p,scope:e,trigger:m,onTriggerChange:g,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:ea(),value:N,onValueChange:O,open:R,onOpenChange:T,dir:P,triggerPointerDownPosRef:j,disabled:v,children:[i.jsx(Vd.Provider,{scope:e,children:i.jsx(gI,{scope:t.__scopeSelect,onNativeOptionAdd:x.useCallback(U=>{C(K=>new Set(K).add(U))},[]),onNativeOptionRemove:x.useCallback(U=>{C(K=>{const $=new Set(K);return $.delete(U),$})},[]),children:r})}),_?i.jsxs(hE,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:h,value:N,onChange:U=>O(U.target.value),disabled:v,form:w,children:[N===void 0?i.jsx("option",{value:""}):null,Array.from(A)]},z):null]})})};H_.displayName=Za;var q_="SelectTrigger",B_=x.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:s=!1,...n}=t,a=qd(r),o=ma(q_,r),l=o.disabled||s,c=et(e,o.onTriggerChange),u=Hd(r),d=x.useRef("touch"),[h,v,p]=mE(f=>{const m=u().filter(b=>!b.disabled),g=m.find(b=>b.value===o.value),y=vE(m,f,g);y!==void 0&&o.onValueChange(y.value)}),w=f=>{l||(o.onOpenChange(!0),p()),f&&(o.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return i.jsx(mS,{asChild:!0,...a,children:i.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":pE(o.value)?"":void 0,...n,ref:c,onClick:_e(n.onClick,f=>{f.currentTarget.focus(),d.current!=="mouse"&&w(f)}),onPointerDown:_e(n.onPointerDown,f=>{d.current=f.pointerType;const m=f.target;m.hasPointerCapture(f.pointerId)&&m.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(w(f),f.preventDefault())}),onKeyDown:_e(n.onKeyDown,f=>{const m=h.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&v(f.key),!(m&&f.key===" ")&&hI.includes(f.key)&&(w(),f.preventDefault())})})})});B_.displayName=q_;var W_="SelectValue",K_=x.forwardRef((t,e)=>{const{__scopeSelect:r,className:s,style:n,children:a,placeholder:o="",...l}=t,c=ma(W_,r),{onValueNodeHasChildrenChange:u}=c,d=a!==void 0,h=et(e,c.onValueNodeChange);return Bt(()=>{u(d)},[u,d]),i.jsx(Ae.span,{...l,ref:h,style:{pointerEvents:"none"},children:pE(c.value)?i.jsx(i.Fragment,{children:o}):a})});K_.displayName=W_;var xI="SelectIcon",Q_=x.forwardRef((t,e)=>{const{__scopeSelect:r,children:s,...n}=t;return i.jsx(Ae.span,{"aria-hidden":!0,...n,ref:e,children:s||"▼"})});Q_.displayName=xI;var wI="SelectPortal",G_=t=>i.jsx(Cd,{asChild:!0,...t});G_.displayName=wI;var Ya="SelectContent",Z_=x.forwardRef((t,e)=>{const r=ma(Ya,t.__scopeSelect),[s,n]=x.useState();if(Bt(()=>{n(new DocumentFragment)},[]),!r.open){const a=s;return a?so.createPortal(i.jsx(Y_,{scope:t.__scopeSelect,children:i.jsx(Vd.Slot,{scope:t.__scopeSelect,children:i.jsx("div",{children:t.children})})}),a):null}return i.jsx(J_,{...t,ref:e})});Z_.displayName=Ya;var Kr=10,[Y_,va]=Pi(Ya),bI="SelectContentImpl",SI=fi("SelectContent.RemoveScroll"),J_=x.forwardRef((t,e)=>{const{__scopeSelect:r,position:s="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:v,collisionPadding:p,sticky:w,hideWhenDetached:f,avoidCollisions:m,...g}=t,y=ma(Ya,r),[b,S]=x.useState(null),[E,P]=x.useState(null),R=et(e,Z=>S(Z)),[T,N]=x.useState(null),[O,j]=x.useState(null),_=Hd(r),[A,C]=x.useState(!1),z=x.useRef(!1);x.useEffect(()=>{if(b)return zS(b)},[b]),AS();const U=x.useCallback(Z=>{const[ce,...Ee]=_().map(we=>we.ref.current),[ve]=Ee.slice(-1),te=document.activeElement;for(const we of Z)if(we===te||(we==null||we.scrollIntoView({block:"nearest"}),we===ce&&E&&(E.scrollTop=0),we===ve&&E&&(E.scrollTop=E.scrollHeight),we==null||we.focus(),document.activeElement!==te))return},[_,E]),K=x.useCallback(()=>U([T,b]),[U,T,b]);x.useEffect(()=>{A&&K()},[A,K]);const{onOpenChange:$,triggerPointerDownPosRef:F}=y;x.useEffect(()=>{if(b){let Z={x:0,y:0};const ce=ve=>{var te,we;Z={x:Math.abs(Math.round(ve.pageX)-(((te=F.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(ve.pageY)-(((we=F.current)==null?void 0:we.y)??0))}},Ee=ve=>{Z.x<=10&&Z.y<=10?ve.preventDefault():b.contains(ve.target)||$(!1),document.removeEventListener("pointermove",ce),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",Ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",Ee,{capture:!0})}}},[b,$,F]),x.useEffect(()=>{const Z=()=>$(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[$]);const[V,ae]=mE(Z=>{const ce=_().filter(te=>!te.disabled),Ee=ce.find(te=>te.ref.current===document.activeElement),ve=vE(ce,Z,Ee);ve&&setTimeout(()=>ve.ref.current.focus())}),se=x.useCallback((Z,ce,Ee)=>{const ve=!z.current&&!Ee;(y.value!==void 0&&y.value===ce||ve)&&(N(Z),ve&&(z.current=!0))},[y.value]),W=x.useCallback(()=>b==null?void 0:b.focus(),[b]),L=x.useCallback((Z,ce,Ee)=>{const ve=!z.current&&!Ee;(y.value!==void 0&&y.value===ce||ve)&&j(Z)},[y.value]),Q=s==="popper"?Pp:X_,oe=Q===Pp?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:v,collisionPadding:p,sticky:w,hideWhenDetached:f,avoidCollisions:m}:{};return i.jsx(Y_,{scope:r,content:b,viewport:E,onViewportChange:P,itemRefCallback:se,selectedItem:T,onItemLeave:W,itemTextRefCallback:L,focusSelectedItem:K,selectedItemText:O,position:s,isPositioned:A,searchRef:V,children:i.jsx($v,{as:SI,allowPinchZoom:!0,children:i.jsx(Mv,{asChild:!0,trapped:y.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:_e(n,Z=>{var ce;(ce=y.trigger)==null||ce.focus({preventScroll:!0}),Z.preventDefault()}),children:i.jsx(Vl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:i.jsx(Q,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:Z=>Z.preventDefault(),...g,...oe,onPlaced:()=>C(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:_e(g.onKeyDown,Z=>{const ce=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!ce&&Z.key.length===1&&ae(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let ve=_().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const te=Z.target,we=ve.indexOf(te);ve=ve.slice(we+1)}setTimeout(()=>U(ve)),Z.preventDefault()}})})})})})})});J_.displayName=bI;var _I="SelectItemAlignedPosition",X_=x.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:s,...n}=t,a=ma(Ya,r),o=va(Ya,r),[l,c]=x.useState(null),[u,d]=x.useState(null),h=et(e,R=>d(R)),v=Hd(r),p=x.useRef(!1),w=x.useRef(!0),{viewport:f,selectedItem:m,selectedItemText:g,focusSelectedItem:y}=o,b=x.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&f&&m&&g){const R=a.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),N=a.valueNode.getBoundingClientRect(),O=g.getBoundingClientRect();if(a.dir!=="rtl"){const te=O.left-T.left,we=N.left-te,ke=R.left-we,De=R.width+ke,ee=Math.max(De,T.width),fe=window.innerWidth-Kr,X=I0(we,[Kr,Math.max(Kr,fe-ee)]);l.style.minWidth=De+"px",l.style.left=X+"px"}else{const te=T.right-O.right,we=window.innerWidth-N.right-te,ke=window.innerWidth-R.right-we,De=R.width+ke,ee=Math.max(De,T.width),fe=window.innerWidth-Kr,X=I0(we,[Kr,Math.max(Kr,fe-ee)]);l.style.minWidth=De+"px",l.style.right=X+"px"}const j=v(),_=window.innerHeight-Kr*2,A=f.scrollHeight,C=window.getComputedStyle(u),z=parseInt(C.borderTopWidth,10),U=parseInt(C.paddingTop,10),K=parseInt(C.borderBottomWidth,10),$=parseInt(C.paddingBottom,10),F=z+U+A+$+K,V=Math.min(m.offsetHeight*5,F),ae=window.getComputedStyle(f),se=parseInt(ae.paddingTop,10),W=parseInt(ae.paddingBottom,10),L=R.top+R.height/2-Kr,Q=_-L,oe=m.offsetHeight/2,Z=m.offsetTop+oe,ce=z+U+Z,Ee=F-ce;if(ce<=L){const te=j.length>0&&m===j[j.length-1].ref.current;l.style.bottom="0px";const we=u.clientHeight-f.offsetTop-f.offsetHeight,ke=Math.max(Q,oe+(te?W:0)+we+K),De=ce+ke;l.style.height=De+"px"}else{const te=j.length>0&&m===j[0].ref.current;l.style.top="0px";const ke=Math.max(L,z+f.offsetTop+(te?se:0)+oe)+Ee;l.style.height=ke+"px",f.scrollTop=ce-L+f.offsetTop}l.style.margin=`${Kr}px 0`,l.style.minHeight=V+"px",l.style.maxHeight=_+"px",s==null||s(),requestAnimationFrame(()=>p.current=!0)}},[v,a.trigger,a.valueNode,l,u,f,m,g,a.dir,s]);Bt(()=>b(),[b]);const[S,E]=x.useState();Bt(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const P=x.useCallback(R=>{R&&w.current===!0&&(b(),y==null||y(),w.current=!1)},[b,y]);return i.jsx(CI,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:P,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:i.jsx(Ae.div,{...n,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});X_.displayName=_I;var EI="SelectPopperPosition",Pp=x.forwardRef((t,e)=>{const{__scopeSelect:r,align:s="start",collisionPadding:n=Kr,...a}=t,o=qd(r);return i.jsx(vS,{...o,...a,ref:e,align:s,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Pp.displayName=EI;var[CI,Bv]=Pi(Ya,{}),kp="SelectViewport",eE=x.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:s,...n}=t,a=va(kp,r),o=Bv(kp,r),l=et(e,a.onViewportChange),c=x.useRef(0);return i.jsxs(i.Fragment,{children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),i.jsx(Vd.Slot,{scope:r,children:i.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:_e(n.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:v}=o;if(v!=null&&v.current&&h){const p=Math.abs(c.current-d.scrollTop);if(p>0){const w=window.innerHeight-Kr*2,f=parseFloat(h.style.minHeight),m=parseFloat(h.style.height),g=Math.max(f,m);if(g<w){const y=g+p,b=Math.min(w,y),S=y-b;h.style.height=b+"px",h.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});eE.displayName=kp;var tE="SelectGroup",[PI,kI]=Pi(tE),NI=x.forwardRef((t,e)=>{const{__scopeSelect:r,...s}=t,n=ea();return i.jsx(PI,{scope:r,id:n,children:i.jsx(Ae.div,{role:"group","aria-labelledby":n,...s,ref:e})})});NI.displayName=tE;var rE="SelectLabel",nE=x.forwardRef((t,e)=>{const{__scopeSelect:r,...s}=t,n=kI(rE,r);return i.jsx(Ae.div,{id:n.id,...s,ref:e})});nE.displayName=rE;var Uu="SelectItem",[jI,sE]=Pi(Uu),aE=x.forwardRef((t,e)=>{const{__scopeSelect:r,value:s,disabled:n=!1,textValue:a,...o}=t,l=ma(Uu,r),c=va(Uu,r),u=l.value===s,[d,h]=x.useState(a??""),[v,p]=x.useState(!1),w=et(e,y=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,y,s,n)}),f=ea(),m=x.useRef("touch"),g=()=>{n||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return i.jsx(jI,{scope:r,value:s,disabled:n,textId:f,isSelected:u,onItemTextChange:x.useCallback(y=>{h(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:i.jsx(Vd.ItemSlot,{scope:r,value:s,disabled:n,textValue:d,children:i.jsx(Ae.div,{role:"option","aria-labelledby":f,"data-highlighted":v?"":void 0,"aria-selected":u&&v,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...o,ref:w,onFocus:_e(o.onFocus,()=>p(!0)),onBlur:_e(o.onBlur,()=>p(!1)),onClick:_e(o.onClick,()=>{m.current!=="mouse"&&g()}),onPointerUp:_e(o.onPointerUp,()=>{m.current==="mouse"&&g()}),onPointerDown:_e(o.onPointerDown,y=>{m.current=y.pointerType}),onPointerMove:_e(o.onPointerMove,y=>{var b;m.current=y.pointerType,n?(b=c.onItemLeave)==null||b.call(c):m.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(o.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:_e(o.onKeyDown,y=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&y.key===" "||(pI.includes(y.key)&&g(),y.key===" "&&y.preventDefault())})})})})});aE.displayName=Uu;var Ki="SelectItemText",oE=x.forwardRef((t,e)=>{const{__scopeSelect:r,className:s,style:n,...a}=t,o=ma(Ki,r),l=va(Ki,r),c=sE(Ki,r),u=yI(Ki,r),[d,h]=x.useState(null),v=et(e,g=>h(g),c.onItemTextChange,g=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,g,c.value,c.disabled)}),p=d==null?void 0:d.textContent,w=x.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:f,onNativeOptionRemove:m}=u;return Bt(()=>(f(w),()=>m(w)),[f,m,w]),i.jsxs(i.Fragment,{children:[i.jsx(Ae.span,{id:c.textId,...a,ref:v}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?so.createPortal(a.children,o.valueNode):null]})});oE.displayName=Ki;var iE="SelectItemIndicator",lE=x.forwardRef((t,e)=>{const{__scopeSelect:r,...s}=t;return sE(iE,r).isSelected?i.jsx(Ae.span,{"aria-hidden":!0,...s,ref:e}):null});lE.displayName=iE;var Np="SelectScrollUpButton",cE=x.forwardRef((t,e)=>{const r=va(Np,t.__scopeSelect),s=Bv(Np,t.__scopeSelect),[n,a]=x.useState(!1),o=et(e,s.onScrollButtonChange);return Bt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;a(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),n?i.jsx(dE,{...t,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});cE.displayName=Np;var jp="SelectScrollDownButton",uE=x.forwardRef((t,e)=>{const r=va(jp,t.__scopeSelect),s=Bv(jp,t.__scopeSelect),[n,a]=x.useState(!1),o=et(e,s.onScrollButtonChange);return Bt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;a(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),n?i.jsx(dE,{...t,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});uE.displayName=jp;var dE=x.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:s,...n}=t,a=va("SelectScrollButton",r),o=x.useRef(null),l=Hd(r),c=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),Bt(()=>{var d;const u=l().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),i.jsx(Ae.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:_e(n.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(s,50))}),onPointerMove:_e(n.onPointerMove,()=>{var u;(u=a.onItemLeave)==null||u.call(a),o.current===null&&(o.current=window.setInterval(s,50))}),onPointerLeave:_e(n.onPointerLeave,()=>{c()})})}),RI="SelectSeparator",fE=x.forwardRef((t,e)=>{const{__scopeSelect:r,...s}=t;return i.jsx(Ae.div,{"aria-hidden":!0,...s,ref:e})});fE.displayName=RI;var Rp="SelectArrow",TI=x.forwardRef((t,e)=>{const{__scopeSelect:r,...s}=t,n=qd(r),a=ma(Rp,r),o=va(Rp,r);return a.open&&o.position==="popper"?i.jsx(gS,{...n,...s,ref:e}):null});TI.displayName=Rp;var AI="SelectBubbleInput",hE=x.forwardRef(({__scopeSelect:t,value:e,...r},s)=>{const n=x.useRef(null),a=et(s,n),o=T_(e);return x.useEffect(()=>{const l=n.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==e&&d){const h=new Event("change",{bubbles:!0});d.call(l,e),l.dispatchEvent(h)}},[o,e]),i.jsx(Ae.select,{...r,style:{...c1,...r.style},ref:a,defaultValue:e})});hE.displayName=AI;function pE(t){return t===""||t===void 0}function mE(t){const e=Ur(t),r=x.useRef(""),s=x.useRef(0),n=x.useCallback(o=>{const l=r.current+o;e(l),function c(u){r.current=u,window.clearTimeout(s.current),u!==""&&(s.current=window.setTimeout(()=>c(""),1e3))}(l)},[e]),a=x.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,n,a]}function vE(t,e,r){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,a=r?t.indexOf(r):-1;let o=OI(t,Math.max(a,0));n.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==r?c:void 0}function OI(t,e){return t.map((r,s)=>t[(e+s)%t.length])}var II=H_,gE=B_,DI=K_,MI=Q_,$I=G_,yE=Z_,FI=eE,xE=nE,wE=aE,LI=oE,UI=lE,bE=cE,SE=uE,_E=fE;const zI=II,VI=DI,EE=x.forwardRef(({className:t,children:e,...r},s)=>i.jsxs(gE,{ref:s,className:Te("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...r,children:[e,i.jsx(MI,{asChild:!0,children:i.jsx(_v,{className:"h-4 w-4 opacity-50"})})]}));EE.displayName=gE.displayName;const CE=x.forwardRef(({className:t,...e},r)=>i.jsx(bE,{ref:r,className:Te("flex cursor-default items-center justify-center py-1",t),...e,children:i.jsx(C2,{className:"h-4 w-4"})}));CE.displayName=bE.displayName;const PE=x.forwardRef(({className:t,...e},r)=>i.jsx(SE,{ref:r,className:Te("flex cursor-default items-center justify-center py-1",t),...e,children:i.jsx(_v,{className:"h-4 w-4"})}));PE.displayName=SE.displayName;const kE=x.forwardRef(({className:t,children:e,position:r="popper",...s},n)=>i.jsx($I,{children:i.jsxs(yE,{ref:n,className:Te("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...s,children:[i.jsx(CE,{}),i.jsx(FI,{className:Te("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),i.jsx(PE,{})]})}));kE.displayName=yE.displayName;const HI=x.forwardRef(({className:t,...e},r)=>i.jsx(xE,{ref:r,className:Te("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));HI.displayName=xE.displayName;const po=x.forwardRef(({className:t,children:e,...r},s)=>i.jsxs(wE,{ref:s,className:Te("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[i.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:i.jsx(UI,{children:i.jsx(O1,{className:"h-4 w-4"})})}),i.jsx(LI,{children:e})]}));po.displayName=wE.displayName;const qI=x.forwardRef(({className:t,...e},r)=>i.jsx(_E,{ref:r,className:Te("-mx-1 my-1 h-px bg-muted",t),...e}));qI.displayName=_E.displayName;const BI="/assets/AgentDeckLogo3-X5qCXS2A.png";function WI(){var ms,ya,vs;const[t,e]=x.useState(""),[r,s]=x.useState(""),[n,a]=x.useState(!1),[o,l]=x.useState(!1),[c,u]=x.useState(null),[d,h]=x.useState(!1),[v,p]=x.useState(!1),[w,f]=x.useState(null),[m,g]=x.useState(!1),[y,b]=x.useState(!1),[S,E]=x.useState(null),[P,R]=x.useState(!1),[T,N]=x.useState(null),{toast:O}=or(),{connectionStatus:j}=uI(),{data:_,isLoading:A,error:C}=hr({queryKey:["/api/decks"]}),z=(_==null?void 0:_.data)||[],{editingDeck:U,editingDeckId:K,setEditingDeckId:$}=fI(z),{handleDragStart:F,handleCredentialDragStart:V,handlePlaybookDragStart:ae,handleDragEnd:se,handleDrop:W,handleGlobalDrop:L,isDraggingFromDeck:Q}=dI(K),{data:oe,isLoading:Z,error:ce}=hr({queryKey:["/api/services"]}),{data:Ee,isLoading:ve}=hr({queryKey:["/api/credentials/vault"]}),{data:te,isLoading:we}=hr({queryKey:["/api/playbooks/vault"]}),{data:ke}=hr({queryKey:["/api/collection/warnings"],staleTime:6e4}),De=(oe==null?void 0:oe.data)||[],ee=(Ee==null?void 0:Ee.data)||[],fe=(te==null?void 0:te.data)||[],X=x.useMemo(()=>tA(ke==null?void 0:ke.data),[ke==null?void 0:ke.data]),ze=(ne,Et)=>n?ne==="service"?X.serviceWarnings.has(Et):ne==="credential"?X.credentialWarnings.has(Et):X.playbookWarnings.has(Et):!0,re=De.filter(ne=>{var $n;if(!ze("service",ne.id)||r==="api-key"||r==="playbook")return!1;const Et=ne.name.toLowerCase().includes(t.toLowerCase())||(($n=ne.description)==null?void 0:$n.toLowerCase().includes(t.toLowerCase())),Mn=!r||r==="all"||ne.type===r;return Et&&Mn}),Me=ee.filter(ne=>!ze("credential",ne.id)||r&&r!=="all"&&r!=="api-key"?!1:ne.label.toLowerCase().includes(t.toLowerCase())),Ue=fe.filter(ne=>!ze("playbook",ne.id)||r&&r!=="all"&&r!=="playbook"?!1:ne.title.toLowerCase().includes(t.toLowerCase())||ne.body.toLowerCase().includes(t.toLowerCase())),Ne=re.length+Me.length+Ue.length;ce&&console.error("Services error:",ce),C&&console.error("Decks error:",C);const rt=()=>{e(""),s(""),a(!1)},pt=!!(t||r||n),qr=new Set(((U==null?void 0:U.credentials)??[]).map(ne=>ne.id)),zt=new Set(((U==null?void 0:U.playbooks)??[]).map(ne=>ne.id)),hs=(U==null?void 0:U.services)||[],oo=(U==null?void 0:U.playbooks)||[],Yt=ne=>{u(ne),h(!0)},Br=ne=>{E(ne.id),R(!0)},ps=ne=>{f(ne.id),g(!0)},jr=ne=>{N(ne)};if(ce||C){const ne=(C instanceof Error?C.message:null)??(ce instanceof Error?ce.message:null)??"There was an error loading the application data.";return i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-900",children:i.jsxs("div",{className:"text-center max-w-lg px-4",children:[i.jsx("h2",{className:"text-2xl font-bold text-red-400 mb-4",children:"Error Loading Data"}),i.jsx("p",{className:"text-gray-300 mb-2",children:"There was an error loading the application data."}),i.jsx("p",{className:"text-gray-400 text-sm mb-4",children:ne}),i.jsxs("p",{className:"text-gray-500 text-xs mb-6",children:["Is the API running? Try ",i.jsx("code",{className:"text-gray-300",children:"agent-deck stop && agent-deck start"})]}),i.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Reload Page"})]})})}return Z||A||ve||we?i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-900",children:i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-yellow-400 mx-auto mb-4"}),i.jsx("p",{className:"text-gray-300",children:"Loading AgentDeck..."})]})}):i.jsxs("div",{className:"min-h-screen",onDrop:L,onDragOver:ne=>ne.preventDefault(),style:{position:"relative",...Q&&{background:"linear-gradient(to bottom right, #1a1a2e, #16213e, #0f3460)"}},children:[i.jsx("header",{className:"relative z-20 bg-black/30 backdrop-blur-md border-b border-white/10",children:i.jsx("div",{className:"container mx-auto px-4 py-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx("img",{src:BI,alt:"Agent Deck Logo",className:"h-16 w-16 object-contain"}),i.jsxs("div",{children:[i.jsx("h1",{className:"text-2xl font-bold bg-gradient-to-r from-yellow-400 to-yellow-600 bg-clip-text text-transparent",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:"AgentDeck"}),i.jsx("p",{className:"text-sm",style:{color:"#92E4DD"},children:"Build tool deck for your agent"})]})]}),i.jsxs("div",{className:"flex items-center space-x-6",children:[i.jsxs("div",{className:`flex items-center space-x-2 px-3 py-1 rounded-full border ${j==="connected"?"bg-emerald-500/20 border-emerald-500/30":"bg-red-500/20 border-red-500/30"}`,children:[i.jsx("div",{className:`w-2 h-2 rounded-full animate-pulse ${j==="connected"?"bg-emerald-400":"bg-red-400"}`}),i.jsx("button",{className:`text-sm hover:underline cursor-pointer ${j==="connected"?"text-emerald-300":"text-red-300"}`,"data-testid":"button-copy-mcp-url",onClick:()=>{navigator.clipboard.writeText("http://localhost:3001/mcp").then(()=>{O({title:"MCP URL copied!",description:"The MCP server URL has been copied to your clipboard."})})},title:"Click to copy MCP URL",children:"Get MCP URL"})]}),U&&i.jsx("div",{className:"px-4 py-2 rounded-lg border",style:{backgroundColor:"rgba(196, 182, 67, 0.2)",borderColor:"rgba(196, 182, 67, 0.4)"},children:i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("i",{className:"fas fa-star",style:{color:"#C4B643"}}),i.jsx("span",{className:"text-sm font-medium","data-testid":"editing-deck-name",style:{color:"#92E4DD"},children:U.name}),i.jsxs("span",{className:"text-xs",style:{color:"#92E4DD",opacity:.7},"data-testid":"editing-deck-count",children:[(((ms=U.services)==null?void 0:ms.length)??0)+(((ya=U.credentials)==null?void 0:ya.length)??0)+(((vs=U.playbooks)==null?void 0:vs.length)??0)," ","cards"]})]})})]})]})})}),Q&&i.jsx("div",{className:"fixed inset-0 pointer-events-none z-50 flex items-center justify-center",children:i.jsxs("div",{className:"bg-red-500/20 border-2 border-dashed border-red-500/50 rounded-lg p-8 text-center",children:[i.jsx("div",{className:"text-red-400 text-lg font-bold mb-2",children:"Drop to Remove"}),i.jsx("div",{className:"text-red-300 text-sm",children:"Release to remove card from deck"})]})}),i.jsx("main",{className:"container mx-auto px-4 py-6",children:i.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-4 gap-6 h-screen min-w-0",children:[i.jsxs("div",{className:"xl:col-span-1 space-y-6 min-w-0",children:[i.jsx("div",{className:"panel-surface p-4 h-80 overflow-hidden min-w-0",children:i.jsx(GO,{decks:z,editingDeckId:K,onSelectDeck:$,isLoading:A})}),i.jsxs("div",{className:"panel-surface p-4",children:[i.jsxs("h2",{className:"text-lg font-bold mb-3 flex items-center",children:[i.jsx(A1,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),i.jsx("span",{style:{color:"#92E4DD"},children:"Add Cards"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs(me,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${bn}`,style:Sn(wr),onClick:()=>l(!0),"data-testid":"button-register-mcp",children:[i.jsx(Au,{className:"w-3 h-3 mr-2"}),"Register MCP"]}),i.jsxs(me,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${bn}`,style:Sn(ur),onClick:()=>p(!0),"data-testid":"button-register-api-key",children:[i.jsx(pp,{className:"w-3 h-3 mr-2"}),"Register API key"]}),i.jsxs(me,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${bn}`,style:Sn(Zr),onClick:()=>b(!0),"data-testid":"button-register-playbook",children:[i.jsx(Sv,{className:"w-3 h-3 mr-2"}),"Register Playbook"]})]})]})]}),i.jsxs("div",{className:"xl:col-span-3 space-y-6 min-w-0",children:[i.jsx("div",{className:"panel-surface p-4 h-88 overflow-hidden min-w-0",children:U?i.jsx("div",{className:"h-full",children:i.jsx(xA,{deck:U,services:hs,credentials:U.credentials??[],playbooks:oo,allServices:De,collectionWarnings:X,onDrop:W,onDragStart:F,onCredentialDragStart:V,onPlaybookDragStart:ae,onDragEnd:se,onCardClick:Yt,onPlaybookClick:Br,onCredentialClick:ps})}):i.jsxs("div",{className:"text-center h-full flex flex-col justify-center",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-yellow-500/20 border border-yellow-500/30 flex items-center justify-center mx-auto mb-3",children:i.jsx(mp,{className:"w-6 h-6 text-yellow-400"})}),i.jsx("h3",{className:"text-lg font-bold mb-2",style:{color:"#92E4DD"},children:"No deck selected"}),i.jsx("p",{className:"text-gray-300 mb-4 text-sm",children:"Create a deck or select one from the sidebar to edit its cards."}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs(me,{onClick:()=>{const ne=document.querySelector('[data-testid="create-deck-button"]');ne&&ne.click()},className:"border text-sm py-2",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},children:[i.jsx(Vs,{className:"w-4 h-4 mr-2"}),"Create New Deck"]}),i.jsxs(me,{variant:"outline",className:"border-white/20 text-white hover:bg-white/10 text-sm py-2",onClick:()=>{const ne=document.querySelector('[data-testid="deck-management-panel"]');ne&&ne.scrollIntoView({behavior:"smooth"})},children:[i.jsx(mp,{className:"w-4 h-4 mr-2"}),"Manage Decks"]})]})]})}),i.jsxs("div",{className:"panel-surface p-4 h-80",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("h2",{className:"text-lg font-bold flex items-center",children:[i.jsx(N2,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),i.jsx("span",{style:{color:"#92E4DD"},children:"My Collection"}),i.jsxs("span",{className:"ml-3 text-sm font-normal text-gray-400",children:["(",Ne," cards)"]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"relative",children:[i.jsx(M1,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),i.jsx(tt,{placeholder:"Search...",value:t,onChange:ne=>e(ne.target.value),className:"w-48 pl-8 h-8 text-sm bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":"input-search"})]}),i.jsxs(zI,{value:r||"all",onValueChange:ne=>s(ne==="all"?"":ne),children:[i.jsxs(EE,{className:"w-[7.5rem] h-8 bg-white/10 border-white/20 text-white text-xs shrink-0","data-testid":"select-type",children:[i.jsx(k2,{className:"w-3 h-3 mr-1 shrink-0"}),i.jsx(VI,{placeholder:"Type"})]}),i.jsxs(kE,{children:[i.jsx(po,{value:"all",children:"All"}),i.jsx(po,{value:"mcp",children:"MCP"}),i.jsx(po,{value:"local-mcp",children:"Local MCP"}),i.jsx(po,{value:"api-key",children:"API Key"}),i.jsx(po,{value:"playbook",children:"Playbook"})]})]}),(t||r||n)&&i.jsx(me,{size:"sm",variant:"outline",className:"h-8 px-2 text-xs border-white/20 text-white hover:bg-white/10",onClick:rt,title:"Clear all filters",children:"Clear"})]})]}),X.total>0&&i.jsx("button",{type:"button",onClick:()=>a(ne=>!ne),className:`mb-4 w-full rounded-lg border px-3 py-2 text-left text-sm transition-colors ${n?"border-amber-300/60 bg-amber-500/15 text-amber-100":"border-amber-400/30 bg-amber-500/10 text-amber-100 hover:bg-amber-500/15"}`,"data-testid":"button-collection-warnings",children:i.jsxs("span",{className:"flex items-start gap-2",children:[i.jsx(tn,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-300"}),i.jsx("span",{children:n?i.jsxs(i.Fragment,{children:["Showing ",i.jsx("strong",{children:Ne})," card",Ne===1?"":"s"," needing attention.",i.jsx("span",{className:"text-amber-200/80",children:" Click to show all cards."})]}):i.jsxs(i.Fragment,{children:[i.jsx("strong",{children:X.total})," card",X.total===1?"":"s"," need attention",X.byKind.oauth_expired+X.byKind.oauth_required>0&&i.jsxs(i.Fragment,{children:[" ","(",X.byKind.oauth_expired+X.byKind.oauth_required," ","OAuth)"]}),". ",i.jsx("span",{className:"text-amber-200/80",children:"Click to filter."})]})})]})}),Z||ve||we?i.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,80px)] gap-0",children:Array.from({length:10}).map((ne,Et)=>i.jsx("div",{className:"animate-pulse",children:i.jsx("div",{className:"bg-white/10 rounded-lg w-32 h-48 aspect-[2/3]"})},Et))}):Ne===0?i.jsxs("div",{className:"text-center py-12",children:[i.jsx("div",{className:"text-gray-400 mb-4",children:i.jsx("i",{className:"fas fa-layer-group text-4xl"})}),i.jsx("h3",{className:"text-lg font-semibold text-gray-300 mb-2",children:"No cards yet"}),i.jsx("p",{className:"text-gray-400 text-sm mb-4",children:pt?n?"No cards with warnings match your current filters":"Try adjusting your search or filters":"Register an MCP server, API key, or playbook to get started"}),!pt&&i.jsxs("div",{className:"flex gap-3 justify-center",children:[i.jsxs(me,{variant:"ghost",size:"sm",className:`border-2 hover:opacity-90 ${bn}`,style:Sn(wr),onClick:()=>l(!0),"data-testid":"button-register-mcp-empty",children:[i.jsx(Au,{className:"w-3 h-3 mr-1"}),"Register MCP"]}),i.jsxs(me,{variant:"ghost",size:"sm",className:`border-2 hover:opacity-90 ${bn}`,style:Sn(ur),onClick:()=>p(!0),"data-testid":"button-register-api-key-empty",children:[i.jsx(pp,{className:"w-3 h-3 mr-1"}),"Register API key"]})]})]}):i.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,80px)] gap-0 relative isolate",style:{isolation:"isolate"},children:[Ue.map((ne,Et)=>i.jsx("div",{className:"relative group",style:{zIndex:T===ne.id?999999:Ne-Et},children:i.jsx(uA,{playbook:ne,isInActiveDeck:zt.has(ne.id),activeDeck:U??void 0,isInCollection:!0,onDragStart:ae,onDragEnd:se,onCardClick:Br,onMouseEnter:()=>jr(ne.id),onMouseLeave:()=>jr(null),warnings:X.playbookWarnings.get(ne.id)})},ne.id)),Me.map((ne,Et)=>i.jsx("div",{className:"relative group",style:{zIndex:T===ne.id?999999:Ne-Ue.length-Et},children:i.jsx(lA,{credential:ne,isInActiveDeck:qr.has(ne.id),activeDeck:U??void 0,isInCollection:!0,onDragStart:V,onDragEnd:se,onMouseEnter:()=>jr(ne.id),onMouseLeave:()=>jr(null),onCardClick:ps,warnings:X.credentialWarnings.get(ne.id)})},ne.id)),re.map((ne,Et)=>{var Mn;return i.jsx("div",{className:"relative group",style:{zIndex:T===ne.id?999999:Ne-Ue.length-Me.length-Et},children:i.jsx(aA,{service:ne,onDragStart:F,onDragEnd:se,isInActiveDeck:((Mn=U==null?void 0:U.services)==null?void 0:Mn.some($n=>$n.id===ne.id))||!1,onCardClick:Yt,isInCollection:!0,onMouseEnter:()=>jr(ne.id),onMouseLeave:()=>jr(null),activeDeck:U??void 0,warnings:X.serviceWarnings.get(ne.id)})},ne.id)})]})]})]})]})}),i.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0",children:[i.jsx("div",{className:"absolute top-20 left-20 w-96 h-96 bg-cyan-500/10 rounded-full blur-3xl animate-float"}),i.jsx("div",{className:"absolute bottom-20 right-20 w-96 h-96 bg-pink-500/10 rounded-full blur-3xl animate-float",style:{animationDelay:"-1s"}}),i.jsx("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-96 h-96 bg-purple-500/5 rounded-full blur-3xl animate-float",style:{animationDelay:"-2s"}})]}),i.jsx(QO,{type:"mcp",open:o,onOpenChange:l}),i.jsx(cI,{service:c,isOpen:d,onClose:()=>h(!1)}),i.jsx(ZO,{open:v,onOpenChange:p}),i.jsx(XO,{credentialId:w,open:m,onOpenChange:g}),i.jsx(YO,{open:y,onOpenChange:b}),i.jsx(JO,{playbookId:S,open:P,onOpenChange:R})]})}const Cs=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Cs.displayName="Card";const _a=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("flex flex-col space-y-1.5 p-6",t),...e}));_a.displayName="CardHeader";const Ea=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("text-2xl font-semibold leading-none tracking-tight",t),...e}));Ea.displayName="CardTitle";const tu=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("text-sm text-muted-foreground",t),...e}));tu.displayName="CardDescription";const Ps=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("p-6 pt-0",t),...e}));Ps.displayName="CardContent";const KI=x.forwardRef(({className:t,...e},r)=>i.jsx("div",{ref:r,className:Te("flex items-center p-6 pt-0",t),...e}));KI.displayName="CardFooter";function QI(){return i.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:i.jsx(Cs,{className:"w-full max-w-md mx-4",children:i.jsxs(Ps,{className:"pt-6",children:[i.jsxs("div",{className:"flex mb-4 gap-2",children:[i.jsx(I1,{className:"h-8 w-8 text-red-500"}),i.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),i.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}function GI(){const[t]=MN(),[e,r]=x.useState("loading"),[s,n]=x.useState("Authenticating...");return x.useEffect(()=>{(async()=>{try{const o=new URL(window.location.href),l=o.searchParams.get("success"),c=o.searchParams.get("error");l==="true"?(r("success"),n("Authentication successful! This window will close automatically."),setTimeout(()=>{window.close()},2e3)):l==="false"?(r("error"),n(`OAuth Error: ${c||"Authentication failed"}`)):(r("error"),n("Invalid OAuth callback - please try again"))}catch(o){r("error"),n(o instanceof Error?o.message:"Authentication failed")}})()},[t]),i.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:i.jsxs("div",{className:"text-center space-y-4",children:[e==="loading"&&i.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto"}),e==="success"&&i.jsx("div",{className:"text-green-500 text-4xl",children:"✓"}),e==="error"&&i.jsx("div",{className:"text-red-500 text-4xl",children:"✗"}),i.jsx("h1",{className:"text-xl font-semibold",children:s}),e==="error"&&i.jsx("button",{onClick:()=>window.close(),className:"px-4 py-2 bg-primary text-primary-foreground rounded hover:bg-primary/90",children:"Close Window"})]})})}function To(t){const e=()=>{throw new Error(`Invalid url to pass to open(): ${t}`)};let r;try{r=new URL(t)}catch{e()}return r.protocol!=="https:"&&r.protocol!=="http:"&&e(),r.hostname!==encodeURIComponent(r.hostname)&&e(),r.username&&(r.username=encodeURIComponent(r.username)),r.password&&(r.password=encodeURIComponent(r.password)),r.pathname=r.pathname.slice(0,1)+encodeURIComponent(r.pathname.slice(1)).replace(/%2f/ig,"/"),r.search=r.search.slice(0,1)+Array.from(r.searchParams.entries()).map(ZI).join("&"),r.hash=r.hash.slice(0,1)+encodeURIComponent(r.hash.slice(1)),r.href}function ZI([t,e]){return`${encodeURIComponent(t)}${e.length>0?`=${encodeURIComponent(e)}`:""}`}var D0=class{constructor(t,e={}){Ln(this,"serverUrl");Ln(this,"storageKeyPrefix");Ln(this,"serverUrlHash");Ln(this,"clientName");Ln(this,"clientUri");Ln(this,"callbackUrl");Ln(this,"preventAutoAuth");Ln(this,"onPopupWindow");this.serverUrl=t,this.storageKeyPrefix=e.storageKeyPrefix||"mcp:auth",this.serverUrlHash=this.hashString(t),this.clientName=e.clientName||"MCP Browser Client",this.clientUri=e.clientUri||(typeof window<"u"?window.location.origin:""),this.callbackUrl=To(e.callbackUrl||(typeof window<"u"?new URL("/oauth/callback",window.location.origin).toString():"/oauth/callback")),this.preventAutoAuth=e.preventAutoAuth,this.onPopupWindow=e.onPopupWindow}get redirectUrl(){return To(this.callbackUrl)}get clientMetadata(){return{redirect_uris:[this.redirectUrl],token_endpoint_auth_method:"none",grant_types:["authorization_code","refresh_token"],response_types:["code"],client_name:this.clientName,client_uri:this.clientUri}}async clientInformation(){const t=this.getKey("client_info"),e=localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch(r){console.warn(`[${this.storageKeyPrefix}] Failed to parse client information:`,r),localStorage.removeItem(t);return}}async saveClientInformation(t){const e=this.getKey("client_info");localStorage.setItem(e,JSON.stringify(t))}async tokens(){const t=this.getKey("tokens"),e=localStorage.getItem(t);if(e)try{return JSON.parse(e)}catch(r){console.warn(`[${this.storageKeyPrefix}] Failed to parse tokens:`,r),localStorage.removeItem(t);return}}async saveTokens(t){const e=this.getKey("tokens");localStorage.setItem(e,JSON.stringify(t)),localStorage.removeItem(this.getKey("code_verifier")),localStorage.removeItem(this.getKey("last_auth_url"))}async saveCodeVerifier(t){const e=this.getKey("code_verifier");localStorage.setItem(e,t)}async codeVerifier(){const t=this.getKey("code_verifier"),e=localStorage.getItem(t);if(!e)throw new Error(`[${this.storageKeyPrefix}] Code verifier not found in storage for key ${t}. Auth flow likely corrupted or timed out.`);return e}async prepareAuthorizationUrl(t){const e=crypto.randomUUID(),r=`${this.storageKeyPrefix}:state_${e}`,s={serverUrlHash:this.serverUrlHash,expiry:Date.now()+1e3*60*10,providerOptions:{serverUrl:this.serverUrl,storageKeyPrefix:this.storageKeyPrefix,clientName:this.clientName,clientUri:this.clientUri,callbackUrl:this.callbackUrl}};localStorage.setItem(r,JSON.stringify(s)),t.searchParams.set("state",e);const n=t.toString(),a=To(n);return localStorage.setItem(this.getKey("last_auth_url"),a),a}async redirectToAuthorization(t){if(this.preventAutoAuth)return;const e=await this.prepareAuthorizationUrl(t),r="width=600,height=700,resizable=yes,scrollbars=yes,status=yes";try{const s=window.open(e,`mcp_auth_${this.serverUrlHash}`,r);this.onPopupWindow&&this.onPopupWindow(e,r,s),!s||s.closed||typeof s.closed>"u"?console.warn(`[${this.storageKeyPrefix}] Popup likely blocked by browser. Manual navigation might be required using the stored URL.`):(s.focus(),console.info(`[${this.storageKeyPrefix}] Redirecting to authorization URL in popup.`))}catch(s){console.error(`[${this.storageKeyPrefix}] Error opening popup window:`,s)}}getLastAttemptedAuthUrl(){const t=localStorage.getItem(this.getKey("last_auth_url"));return t?To(t):null}clearStorage(){const t=`${this.storageKeyPrefix}_${this.serverUrlHash}_`,e=`${this.storageKeyPrefix}:state_`,r=[];let s=0;for(let a=0;a<localStorage.length;a++){const o=localStorage.key(a);if(o){if(o.startsWith(t))r.push(o);else if(o.startsWith(e))try{const l=localStorage.getItem(o);l&&JSON.parse(l).serverUrlHash===this.serverUrlHash&&r.push(o)}catch(l){console.warn(`[${this.storageKeyPrefix}] Error parsing state key ${o} during clearStorage:`,l)}}}return[...new Set(r)].forEach(a=>{localStorage.removeItem(a),s++}),s}hashString(t){let e=0;for(let r=0;r<t.length;r++){const s=t.charCodeAt(r);e=(e<<5)-e+s,e=e&e}return Math.abs(e).toString(16)}getKey(t){return`${this.storageKeyPrefix}_${this.serverUrlHash}_${t}`}},Ge;(function(t){t.assertEqual=n=>{};function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{const a={};for(const o of n)a[o]=o;return a},t.getValidEnumValues=n=>{const a=t.objectKeys(n).filter(l=>typeof n[n[l]]!="number"),o={};for(const l of a)o[l]=n[l];return t.objectValues(o)},t.objectValues=n=>t.objectKeys(n).map(function(a){return n[a]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.push(o);return a},t.find=(n,a)=>{for(const o of n)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(Ge||(Ge={}));var M0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(M0||(M0={}));const pe=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ks=t=>{switch(typeof t){case"undefined":return pe.undefined;case"string":return pe.string;case"number":return Number.isNaN(t)?pe.nan:pe.number;case"boolean":return pe.boolean;case"function":return pe.function;case"bigint":return pe.bigint;case"symbol":return pe.symbol;case"object":return Array.isArray(t)?pe.array:t===null?pe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?pe.promise:typeof Map<"u"&&t instanceof Map?pe.map:typeof Set<"u"&&t instanceof Set?pe.set:typeof Date<"u"&&t instanceof Date?pe.date:pe.object;default:return pe.unknown}},J=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class cs extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(a){return a.message},s={_errors:[]},n=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)s._errors.push(r(o));else{let l=s,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(r(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return n(this),s}static assert(e){if(!(e instanceof cs))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},s=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];r[a]=r[a]||[],r[a].push(e(n))}else s.push(e(n));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}cs.create=t=>new cs(t);const Tp=(t,e)=>{let r;switch(t.code){case J.invalid_type:t.received===pe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case J.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ge.jsonStringifyReplacer)}`;break;case J.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ge.joinValues(t.keys,", ")}`;break;case J.invalid_union:r="Invalid input";break;case J.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ge.joinValues(t.options)}`;break;case J.invalid_enum_value:r=`Invalid enum value. Expected ${Ge.joinValues(t.options)}, received '${t.received}'`;break;case J.invalid_arguments:r="Invalid function arguments";break;case J.invalid_return_type:r="Invalid function return type";break;case J.invalid_date:r="Invalid date";break;case J.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ge.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case J.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case J.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case J.custom:r="Invalid input";break;case J.invalid_intersection_types:r="Intersection results could not be merged";break;case J.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case J.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ge.assertNever(t)}return{message:r}};let YI=Tp;function JI(){return YI}const XI=t=>{const{data:e,path:r,errorMaps:s,issueData:n}=t,a=[...r,...n.path||[]],o={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let l="";const c=s.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:e,defaultError:l}).message;return{...n,path:a,message:l}};function le(t,e){const r=JI(),s=XI({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Tp?void 0:Tp].filter(n=>!!n)});t.common.issues.push(s)}class nr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const s=[];for(const n of r){if(n.status==="aborted")return Ce;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){const s=[];for(const n of r){const a=await n.key,o=await n.value;s.push({key:a,value:o})}return nr.mergeObjectSync(e,s)}static mergeObjectSync(e,r){const s={};for(const n of r){const{key:a,value:o}=n;if(a.status==="aborted"||o.status==="aborted")return Ce;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet)&&(s[a.value]=o.value)}return{status:e.value,value:s}}}const Ce=Object.freeze({status:"aborted"}),Qi=t=>({status:"dirty",value:t}),zr=t=>({status:"valid",value:t}),$0=t=>t.status==="aborted",F0=t=>t.status==="dirty",mi=t=>t.status==="valid",zu=t=>typeof Promise<"u"&&t instanceof Promise;var ye;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ye||(ye={}));class An{constructor(e,r,s,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const L0=(t,e)=>{if(mi(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new cs(t.common.issues);return this._error=r,this._error}}};function Fe(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:s,description:n}=t;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(o,l)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??s??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??r??l.defaultError}},description:n}}class Be{get description(){return this._def.description}_getType(e){return ks(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ks(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new nr,ctx:{common:e.parent.common,data:e.data,parsedType:ks(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(zu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){const s={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ks(e)},n=this._parseSync({data:e,path:s.path,parent:s});return L0(s,n)}"~validate"(e){var s,n;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ks(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:r});return mi(a)?{value:a.value}:{issues:r.common.issues}}catch(a){(n=(s=a==null?void 0:a.message)==null?void 0:s.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(a=>mi(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(e,r){const s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){const s={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ks(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(zu(n)?n:Promise.resolve(n));return L0(s,a)}refine(e,r){const s=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,a)=>{const o=e(n),l=()=>a.addIssue({code:J.custom,...s(n)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,r){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof r=="function"?r(s,n):r),!1))}_refinement(e){return new eo({schema:this,typeName:Pe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ts.create(this,this._def)}nullable(){return to.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Rn.create(this)}promise(){return Ku.create(this,this._def)}or(e){return Hu.create([this,e],this._def)}and(e){return qu.create(this,e,this._def)}transform(e){return new eo({...Fe(this._def),schema:this,typeName:Pe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Qu({...Fe(this._def),innerType:this,defaultValue:r,typeName:Pe.ZodDefault})}brand(){return new TE({typeName:Pe.ZodBranded,type:this,...Fe(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Gu({...Fe(this._def),innerType:this,catchValue:r,typeName:Pe.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Kv.create(this,e)}readonly(){return Zu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const e4=/^c[^\s-]{8,}$/i,t4=/^[0-9a-z]+$/,r4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,n4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,s4=/^[a-z0-9_-]{21}$/i,a4=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,o4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,i4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,l4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Zf;const c4=/^(?:(?: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])$/,u4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,d4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,f4=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,h4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,p4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,NE="((\\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])))",m4=new RegExp(`^${NE}$`);function jE(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function v4(t){return new RegExp(`^${jE(t)}$`)}function g4(t){let e=`${NE}T${jE(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function y4(t,e){return!!((e==="v4"||!e)&&c4.test(t)||(e==="v6"||!e)&&d4.test(t))}function x4(t,e){if(!a4.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function w4(t,e){return!!((e==="v4"||!e)&&u4.test(t)||(e==="v6"||!e)&&f4.test(t))}class Xn extends Be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==pe.string){const a=this._getOrReturnCtx(e);return le(a,{code:J.invalid_type,expected:pe.string,received:a.parsedType}),Ce}const s=new nr;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),le(n,{code:J.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),le(n,{code:J.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,l=e.data.length<a.value;(o||l)&&(n=this._getOrReturnCtx(e,n),o?le(n,{code:J.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):l&&le(n,{code:J.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")i4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"email",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")Zf||(Zf=new RegExp(l4,"u")),Zf.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"emoji",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")n4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"uuid",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")s4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"nanoid",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")e4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"cuid",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")t4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"cuid2",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")r4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"ulid",code:J.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),le(n,{validation:"url",code:J.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"regex",code:J.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?g4(a).test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?m4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?v4(a).test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{code:J.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?o4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"duration",code:J.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?y4(e.data,a.version)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"ip",code:J.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?x4(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"jwt",code:J.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?w4(e.data,a.version)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"cidr",code:J.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?h4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"base64",code:J.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?p4.test(e.data)||(n=this._getOrReturnCtx(e,n),le(n,{validation:"base64url",code:J.invalid_string,message:a.message}),s.dirty()):Ge.assertNever(a);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(n=>e.test(n),{validation:r,code:J.invalid_string,...ye.errToObj(s)})}_addCheck(e){return new Xn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ye.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ye.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ye.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ye.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ye.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ye.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ye.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ye.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ye.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ye.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ye.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ye.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ye.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...ye.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ye.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ye.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ye.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...ye.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ye.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ye.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ye.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ye.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ye.errToObj(r)})}nonempty(e){return this.min(1,ye.errToObj(e))}trim(){return new Xn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Xn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Xn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Xn.create=t=>new Xn({checks:[],typeName:Pe.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Fe(t)});function b4(t,e){const r=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=r>s?r:s,a=Number.parseInt(t.toFixed(n).replace(".","")),o=Number.parseInt(e.toFixed(n).replace(".",""));return a%o/10**n}class vi extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==pe.number){const a=this._getOrReturnCtx(e);return le(a,{code:J.invalid_type,expected:pe.number,received:a.parsedType}),Ce}let s;const n=new nr;for(const a of this._def.checks)a.kind==="int"?Ge.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{code:J.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?b4(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),le(s,{code:J.not_finite,message:a.message}),n.dirty()):Ge.assertNever(a);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ye.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ye.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ye.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ye.toString(r))}setLimit(e,r,s,n){return new vi({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:ye.toString(n)}]})}_addCheck(e){return new vi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ye.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ye.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ye.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ye.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ye.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ye.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ge.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}}vi.create=t=>new vi({checks:[],typeName:Pe.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Fe(t)});class Rl extends Be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==pe.bigint)return this._getInvalidInput(e);let s;const n=new nr;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),le(s,{code:J.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):Ge.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return le(r,{code:J.invalid_type,expected:pe.bigint,received:r.parsedType}),Ce}gte(e,r){return this.setLimit("min",e,!0,ye.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ye.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ye.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ye.toString(r))}setLimit(e,r,s,n){return new Rl({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:ye.toString(n)}]})}_addCheck(e){return new Rl({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ye.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ye.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Rl.create=t=>new Rl({checks:[],typeName:Pe.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Fe(t)});class Ap extends Be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==pe.boolean){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.boolean,received:s.parsedType}),Ce}return zr(e.data)}}Ap.create=t=>new Ap({typeName:Pe.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Fe(t)});class Vu extends Be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==pe.date){const a=this._getOrReturnCtx(e);return le(a,{code:J.invalid_type,expected:pe.date,received:a.parsedType}),Ce}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return le(a,{code:J.invalid_date}),Ce}const s=new nr;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),le(n,{code:J.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),le(n,{code:J.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):Ge.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Vu({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ye.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ye.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Vu.create=t=>new Vu({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Pe.ZodDate,...Fe(t)});class U0 extends Be{_parse(e){if(this._getType(e)!==pe.symbol){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.symbol,received:s.parsedType}),Ce}return zr(e.data)}}U0.create=t=>new U0({typeName:Pe.ZodSymbol,...Fe(t)});class Op extends Be{_parse(e){if(this._getType(e)!==pe.undefined){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.undefined,received:s.parsedType}),Ce}return zr(e.data)}}Op.create=t=>new Op({typeName:Pe.ZodUndefined,...Fe(t)});class Ip extends Be{_parse(e){if(this._getType(e)!==pe.null){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.null,received:s.parsedType}),Ce}return zr(e.data)}}Ip.create=t=>new Ip({typeName:Pe.ZodNull,...Fe(t)});class Dp extends Be{constructor(){super(...arguments),this._any=!0}_parse(e){return zr(e.data)}}Dp.create=t=>new Dp({typeName:Pe.ZodAny,...Fe(t)});class Mp extends Be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return zr(e.data)}}Mp.create=t=>new Mp({typeName:Pe.ZodUnknown,...Fe(t)});class ia extends Be{_parse(e){const r=this._getOrReturnCtx(e);return le(r,{code:J.invalid_type,expected:pe.never,received:r.parsedType}),Ce}}ia.create=t=>new ia({typeName:Pe.ZodNever,...Fe(t)});class z0 extends Be{_parse(e){if(this._getType(e)!==pe.undefined){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.void,received:s.parsedType}),Ce}return zr(e.data)}}z0.create=t=>new z0({typeName:Pe.ZodVoid,...Fe(t)});class Rn extends Be{_parse(e){const{ctx:r,status:s}=this._processInputParams(e),n=this._def;if(r.parsedType!==pe.array)return le(r,{code:J.invalid_type,expected:pe.array,received:r.parsedType}),Ce;if(n.exactLength!==null){const o=r.data.length>n.exactLength.value,l=r.data.length<n.exactLength.value;(o||l)&&(le(r,{code:o?J.too_big:J.too_small,minimum:l?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(le(r,{code:J.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(le(r,{code:J.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>n.type._parseAsync(new An(r,o,r.path,l)))).then(o=>nr.mergeArray(s,o));const a=[...r.data].map((o,l)=>n.type._parseSync(new An(r,o,r.path,l)));return nr.mergeArray(s,a)}get element(){return this._def.type}min(e,r){return new Rn({...this._def,minLength:{value:e,message:ye.toString(r)}})}max(e,r){return new Rn({...this._def,maxLength:{value:e,message:ye.toString(r)}})}length(e,r){return new Rn({...this._def,exactLength:{value:e,message:ye.toString(r)}})}nonempty(e){return this.min(1,e)}}Rn.create=(t,e)=>new Rn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Pe.ZodArray,...Fe(e)});function mo(t){if(t instanceof Pt){const e={};for(const r in t.shape){const s=t.shape[r];e[r]=ts.create(mo(s))}return new Pt({...t._def,shape:()=>e})}else return t instanceof Rn?new Rn({...t._def,type:mo(t.element)}):t instanceof ts?ts.create(mo(t.unwrap())):t instanceof to?to.create(mo(t.unwrap())):t instanceof Ja?Ja.create(t.items.map(e=>mo(e))):t}class Pt extends Be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Ge.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==pe.object){const u=this._getOrReturnCtx(e);return le(u,{code:J.invalid_type,expected:pe.object,received:u.parsedType}),Ce}const{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof ia&&this._def.unknownKeys==="strip"))for(const u in n.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=a[u],h=n.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new An(n,h,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof ia){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:n.data[d]}});else if(u==="strict")l.length>0&&(le(n,{code:J.unrecognized_keys,keys:l}),s.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const h=n.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new An(n,h,n.path,d)),alwaysSet:d in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const h=await d.key,v=await d.value;u.push({key:h,value:v,alwaysSet:d.alwaysSet})}return u}).then(u=>nr.mergeObjectSync(s,u)):nr.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return ye.errToObj,new Pt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{var a,o;const n=((o=(a=this._def).errorMap)==null?void 0:o.call(a,r,s).message)??s.defaultError;return r.code==="unrecognized_keys"?{message:ye.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new Pt({...this._def,unknownKeys:"strip"})}passthrough(){return new Pt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Pt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Pt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Pe.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Pt({...this._def,catchall:e})}pick(e){const r={};for(const s of Ge.objectKeys(e))e[s]&&this.shape[s]&&(r[s]=this.shape[s]);return new Pt({...this._def,shape:()=>r})}omit(e){const r={};for(const s of Ge.objectKeys(this.shape))e[s]||(r[s]=this.shape[s]);return new Pt({...this._def,shape:()=>r})}deepPartial(){return mo(this)}partial(e){const r={};for(const s of Ge.objectKeys(this.shape)){const n=this.shape[s];e&&!e[s]?r[s]=n:r[s]=n.optional()}return new Pt({...this._def,shape:()=>r})}required(e){const r={};for(const s of Ge.objectKeys(this.shape))if(e&&!e[s])r[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof ts;)a=a._def.innerType;r[s]=a}return new Pt({...this._def,shape:()=>r})}keyof(){return RE(Ge.objectKeys(this.shape))}}Pt.create=(t,e)=>new Pt({shape:()=>t,unknownKeys:"strip",catchall:ia.create(),typeName:Pe.ZodObject,...Fe(e)});Pt.strictCreate=(t,e)=>new Pt({shape:()=>t,unknownKeys:"strict",catchall:ia.create(),typeName:Pe.ZodObject,...Fe(e)});Pt.lazycreate=(t,e)=>new Pt({shape:t,unknownKeys:"strip",catchall:ia.create(),typeName:Pe.ZodObject,...Fe(e)});class Hu extends Be{_parse(e){const{ctx:r}=this._processInputParams(e),s=this._def.options;function n(a){for(const l of a)if(l.result.status==="valid")return l.result;for(const l of a)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const o=a.map(l=>new cs(l.ctx.common.issues));return le(r,{code:J.invalid_union,unionErrors:o}),Ce}if(r.common.async)return Promise.all(s.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(n);{let a;const o=[];for(const c of s){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!a&&(a={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const l=o.map(c=>new cs(c));return le(r,{code:J.invalid_union,unionErrors:l}),Ce}}get options(){return this._def.options}}Hu.create=(t,e)=>new Hu({options:t,typeName:Pe.ZodUnion,...Fe(e)});const Vn=t=>t instanceof Fp?Vn(t.schema):t instanceof eo?Vn(t.innerType()):t instanceof Wu?[t.value]:t instanceof Xa?t.options:t instanceof Lp?Ge.objectValues(t.enum):t instanceof Qu?Vn(t._def.innerType):t instanceof Op?[void 0]:t instanceof Ip?[null]:t instanceof ts?[void 0,...Vn(t.unwrap())]:t instanceof to?[null,...Vn(t.unwrap())]:t instanceof TE||t instanceof Zu?Vn(t.unwrap()):t instanceof Gu?Vn(t._def.innerType):[];class Wv extends Be{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==pe.object)return le(r,{code:J.invalid_type,expected:pe.object,received:r.parsedType}),Ce;const s=this.discriminator,n=r.data[s],a=this.optionsMap.get(n);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(le(r,{code:J.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,s){const n=new Map;for(const a of r){const o=Vn(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(n.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);n.set(l,a)}}return new Wv({typeName:Pe.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...Fe(s)})}}function $p(t,e){const r=ks(t),s=ks(e);if(t===e)return{valid:!0,data:t};if(r===pe.object&&s===pe.object){const n=Ge.objectKeys(e),a=Ge.objectKeys(t).filter(l=>n.indexOf(l)!==-1),o={...t,...e};for(const l of a){const c=$p(t[l],e[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(r===pe.array&&s===pe.array){if(t.length!==e.length)return{valid:!1};const n=[];for(let a=0;a<t.length;a++){const o=t[a],l=e[a],c=$p(o,l);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return r===pe.date&&s===pe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class qu extends Be{_parse(e){const{status:r,ctx:s}=this._processInputParams(e),n=(a,o)=>{if($0(a)||$0(o))return Ce;const l=$p(a.value,o.value);return l.valid?((F0(a)||F0(o))&&r.dirty(),{status:r.value,value:l.data}):(le(s,{code:J.invalid_intersection_types}),Ce)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,o])=>n(a,o)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}qu.create=(t,e,r)=>new qu({left:t,right:e,typeName:Pe.ZodIntersection,...Fe(r)});class Ja extends Be{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==pe.array)return le(s,{code:J.invalid_type,expected:pe.array,received:s.parsedType}),Ce;if(s.data.length<this._def.items.length)return le(s,{code:J.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&s.data.length>this._def.items.length&&(le(s,{code:J.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...s.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new An(s,o,s.path,l)):null}).filter(o=>!!o);return s.common.async?Promise.all(a).then(o=>nr.mergeArray(r,o)):nr.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Ja({...this._def,rest:e})}}Ja.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ja({items:t,typeName:Pe.ZodTuple,rest:null,...Fe(e)})};class Bu extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==pe.object)return le(s,{code:J.invalid_type,expected:pe.object,received:s.parsedType}),Ce;const n=[],a=this._def.keyType,o=this._def.valueType;for(const l in s.data)n.push({key:a._parse(new An(s,l,s.path,l)),value:o._parse(new An(s,s.data[l],s.path,l)),alwaysSet:l in s.data});return s.common.async?nr.mergeObjectAsync(r,n):nr.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,s){return r instanceof Be?new Bu({keyType:e,valueType:r,typeName:Pe.ZodRecord,...Fe(s)}):new Bu({keyType:Xn.create(),valueType:e,typeName:Pe.ZodRecord,...Fe(r)})}}class V0 extends Be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==pe.map)return le(s,{code:J.invalid_type,expected:pe.map,received:s.parsedType}),Ce;const n=this._def.keyType,a=this._def.valueType,o=[...s.data.entries()].map(([l,c],u)=>({key:n._parse(new An(s,l,s.path,[u,"key"])),value:a._parse(new An(s,c,s.path,[u,"value"]))}));if(s.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Ce;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Ce;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}}}}V0.create=(t,e,r)=>new V0({valueType:e,keyType:t,typeName:Pe.ZodMap,...Fe(r)});class Tl extends Be{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==pe.set)return le(s,{code:J.invalid_type,expected:pe.set,received:s.parsedType}),Ce;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(le(s,{code:J.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(le(s,{code:J.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());const a=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return Ce;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const l=[...s.data.values()].map((c,u)=>a._parse(new An(s,c,s.path,u)));return s.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(e,r){return new Tl({...this._def,minSize:{value:e,message:ye.toString(r)}})}max(e,r){return new Tl({...this._def,maxSize:{value:e,message:ye.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Tl.create=(t,e)=>new Tl({valueType:t,minSize:null,maxSize:null,typeName:Pe.ZodSet,...Fe(e)});class Fp extends Be{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Fp.create=(t,e)=>new Fp({getter:t,typeName:Pe.ZodLazy,...Fe(e)});class Wu extends Be{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return le(r,{received:r.data,code:J.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:e.data}}get value(){return this._def.value}}Wu.create=(t,e)=>new Wu({value:t,typeName:Pe.ZodLiteral,...Fe(e)});function RE(t,e){return new Xa({values:t,typeName:Pe.ZodEnum,...Fe(e)})}class Xa extends Be{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),s=this._def.values;return le(r,{expected:Ge.joinValues(s),received:r.parsedType,code:J.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),s=this._def.values;return le(r,{received:r.data,code:J.invalid_enum_value,options:s}),Ce}return zr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Xa.create(e,{...this._def,...r})}exclude(e,r=this._def){return Xa.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}}Xa.create=RE;class Lp extends Be{_parse(e){const r=Ge.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==pe.string&&s.parsedType!==pe.number){const n=Ge.objectValues(r);return le(s,{expected:Ge.joinValues(n),received:s.parsedType,code:J.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Ge.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=Ge.objectValues(r);return le(s,{received:s.data,code:J.invalid_enum_value,options:n}),Ce}return zr(e.data)}get enum(){return this._def.values}}Lp.create=(t,e)=>new Lp({values:t,typeName:Pe.ZodNativeEnum,...Fe(e)});class Ku extends Be{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==pe.promise&&r.common.async===!1)return le(r,{code:J.invalid_type,expected:pe.promise,received:r.parsedType}),Ce;const s=r.parsedType===pe.promise?r.data:Promise.resolve(r.data);return zr(s.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Ku.create=(t,e)=>new Ku({type:t,typeName:Pe.ZodPromise,...Fe(e)});class eo extends Be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:o=>{le(s,o),o.fatal?r.abort():r.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const o=n.transform(s.data,a);if(s.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return Ce;const c=await this._def.schema._parseAsync({data:l,path:s.path,parent:s});return c.status==="aborted"?Ce:c.status==="dirty"||r.value==="dirty"?Qi(c.value):c});{if(r.value==="aborted")return Ce;const l=this._def.schema._parseSync({data:o,path:s.path,parent:s});return l.status==="aborted"?Ce:l.status==="dirty"||r.value==="dirty"?Qi(l.value):l}}if(n.type==="refinement"){const o=l=>{const c=n.refinement(l,a);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(s.common.async===!1){const l=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return l.status==="aborted"?Ce:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(l=>l.status==="aborted"?Ce:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(n.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!mi(o))return Ce;const l=n.transform(o.value,a);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>mi(o)?Promise.resolve(n.transform(o.value,a)).then(l=>({status:r.value,value:l})):Ce);Ge.assertNever(n)}}eo.create=(t,e,r)=>new eo({schema:t,typeName:Pe.ZodEffects,effect:e,...Fe(r)});eo.createWithPreprocess=(t,e,r)=>new eo({schema:e,effect:{type:"preprocess",transform:t},typeName:Pe.ZodEffects,...Fe(r)});class ts extends Be{_parse(e){return this._getType(e)===pe.undefined?zr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ts.create=(t,e)=>new ts({innerType:t,typeName:Pe.ZodOptional,...Fe(e)});class to extends Be{_parse(e){return this._getType(e)===pe.null?zr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}to.create=(t,e)=>new to({innerType:t,typeName:Pe.ZodNullable,...Fe(e)});class Qu extends Be{_parse(e){const{ctx:r}=this._processInputParams(e);let s=r.data;return r.parsedType===pe.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Qu.create=(t,e)=>new Qu({innerType:t,typeName:Pe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Fe(e)});class Gu extends Be{_parse(e){const{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return zu(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new cs(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new cs(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Gu.create=(t,e)=>new Gu({innerType:t,typeName:Pe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Fe(e)});class H0 extends Be{_parse(e){if(this._getType(e)!==pe.nan){const s=this._getOrReturnCtx(e);return le(s,{code:J.invalid_type,expected:pe.nan,received:s.parsedType}),Ce}return{status:"valid",value:e.data}}}H0.create=t=>new H0({typeName:Pe.ZodNaN,...Fe(t)});class TE extends Be{_parse(e){const{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}}class Kv extends Be{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?Ce:a.status==="dirty"?(r.dirty(),Qi(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?Ce:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,r){return new Kv({in:e,out:r,typeName:Pe.ZodPipeline})}}class Zu extends Be{_parse(e){const r=this._def.innerType._parse(e),s=n=>(mi(n)&&(n.value=Object.freeze(n.value)),n);return zu(r)?r.then(n=>s(n)):s(r)}unwrap(){return this._def.innerType}}Zu.create=(t,e)=>new Zu({innerType:t,typeName:Pe.ZodReadonly,...Fe(e)});var Pe;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Pe||(Pe={}));const H=Xn.create,Ut=vi.create,It=Ap.create,S4=Dp.create,Wl=Mp.create;ia.create;const ge=Rn.create,ie=Pt.create,ir=Hu.create,_4=Wv.create;qu.create;Ja.create;const Kl=Bu.create,Ie=Wu.create,us=Xa.create;Ku.create;const G=ts.create;to.create;const E4=Ce,Bd="2025-06-18",C4=[Bd,"2025-03-26","2024-11-05","2024-10-07"],Wd="2.0",AE=ir([H(),Ut().int()]),OE=H(),P4=ie({progressToken:G(AE)}).passthrough(),Vr=ie({_meta:G(P4)}).passthrough(),xr=ie({method:H(),params:G(Vr)}),Ql=ie({_meta:G(ie({}).passthrough())}).passthrough(),In=ie({method:H(),params:G(Ql)}),Hr=ie({_meta:G(ie({}).passthrough())}).passthrough(),Kd=ir([H(),Ut().int()]),IE=ie({jsonrpc:Ie(Wd),id:Kd}).merge(xr).strict(),DE=t=>IE.safeParse(t).success,ME=ie({jsonrpc:Ie(Wd)}).merge(In).strict(),k4=t=>ME.safeParse(t).success,$E=ie({jsonrpc:Ie(Wd),id:Kd,result:Hr}).strict(),Up=t=>$E.safeParse(t).success;var En;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(En||(En={}));const FE=ie({jsonrpc:Ie(Wd),id:Kd,error:ie({code:Ut().int(),message:H(),data:G(Wl())})}).strict(),N4=t=>FE.safeParse(t).success,ru=ir([IE,ME,$E,FE]),Ao=Hr.strict(),Qv=In.extend({method:Ie("notifications/cancelled"),params:Ql.extend({requestId:Kd,reason:H().optional()})}),Gl=ie({name:H(),title:G(H())}).passthrough(),LE=Gl.extend({version:H()}),j4=ie({experimental:G(ie({}).passthrough()),sampling:G(ie({}).passthrough()),elicitation:G(ie({}).passthrough()),roots:G(ie({listChanged:G(It())}).passthrough())}).passthrough(),R4=xr.extend({method:Ie("initialize"),params:Vr.extend({protocolVersion:H(),capabilities:j4,clientInfo:LE})}),T4=ie({experimental:G(ie({}).passthrough()),logging:G(ie({}).passthrough()),completions:G(ie({}).passthrough()),prompts:G(ie({listChanged:G(It())}).passthrough()),resources:G(ie({subscribe:G(It()),listChanged:G(It())}).passthrough()),tools:G(ie({listChanged:G(It())}).passthrough())}).passthrough(),UE=Hr.extend({protocolVersion:H(),capabilities:T4,serverInfo:LE,instructions:G(H())}),zE=In.extend({method:Ie("notifications/initialized")}),A4=t=>zE.safeParse(t).success,Gv=xr.extend({method:Ie("ping")}),O4=ie({progress:Ut(),total:G(Ut()),message:G(H())}).passthrough(),Zv=In.extend({method:Ie("notifications/progress"),params:Ql.merge(O4).extend({progressToken:AE})}),Qd=xr.extend({params:Vr.extend({cursor:G(OE)}).optional()}),Gd=Hr.extend({nextCursor:G(OE)}),VE=ie({uri:H(),mimeType:G(H()),_meta:G(ie({}).passthrough())}).passthrough(),HE=VE.extend({text:H()}),Yv=H().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),qE=VE.extend({blob:Yv}),BE=Gl.extend({uri:H(),description:G(H()),mimeType:G(H()),_meta:G(ie({}).passthrough())}),I4=Gl.extend({uriTemplate:H(),description:G(H()),mimeType:G(H()),_meta:G(ie({}).passthrough())}),D4=Qd.extend({method:Ie("resources/list")}),Yu=Gd.extend({resources:ge(BE)}),M4=Qd.extend({method:Ie("resources/templates/list")}),WE=Gd.extend({resourceTemplates:ge(I4)}),$4=xr.extend({method:Ie("resources/read"),params:Vr.extend({uri:H()})}),Jv=Hr.extend({contents:ge(ir([HE,qE]))}),F4=In.extend({method:Ie("notifications/resources/list_changed")}),L4=xr.extend({method:Ie("resources/subscribe"),params:Vr.extend({uri:H()})}),U4=xr.extend({method:Ie("resources/unsubscribe"),params:Vr.extend({uri:H()})}),z4=In.extend({method:Ie("notifications/resources/updated"),params:Ql.extend({uri:H()})}),V4=ie({name:H(),description:G(H()),required:G(It())}).passthrough(),H4=Gl.extend({description:G(H()),arguments:G(ge(V4)),_meta:G(ie({}).passthrough())}),q4=Qd.extend({method:Ie("prompts/list")}),Ju=Gd.extend({prompts:ge(H4)}),B4=xr.extend({method:Ie("prompts/get"),params:Vr.extend({name:H(),arguments:G(Kl(H()))})}),Xv=ie({type:Ie("text"),text:H(),_meta:G(ie({}).passthrough())}).passthrough(),eg=ie({type:Ie("image"),data:Yv,mimeType:H(),_meta:G(ie({}).passthrough())}).passthrough(),tg=ie({type:Ie("audio"),data:Yv,mimeType:H(),_meta:G(ie({}).passthrough())}).passthrough(),W4=ie({type:Ie("resource"),resource:ir([HE,qE]),_meta:G(ie({}).passthrough())}).passthrough(),K4=BE.extend({type:Ie("resource_link")}),KE=ir([Xv,eg,tg,K4,W4]),Q4=ie({role:us(["user","assistant"]),content:KE}).passthrough(),rg=Hr.extend({description:G(H()),messages:ge(Q4)}),G4=In.extend({method:Ie("notifications/prompts/list_changed")}),Z4=ie({title:G(H()),readOnlyHint:G(It()),destructiveHint:G(It()),idempotentHint:G(It()),openWorldHint:G(It())}).passthrough(),Y4=Gl.extend({description:G(H()),inputSchema:ie({type:Ie("object"),properties:G(ie({}).passthrough()),required:G(ge(H()))}).passthrough(),outputSchema:G(ie({type:Ie("object"),properties:G(ie({}).passthrough()),required:G(ge(H()))}).passthrough()),annotations:G(Z4),_meta:G(ie({}).passthrough())}),J4=Qd.extend({method:Ie("tools/list")}),ng=Gd.extend({tools:ge(Y4)}),Zd=Hr.extend({content:ge(KE).default([]),structuredContent:ie({}).passthrough().optional(),isError:G(It())});Zd.or(Hr.extend({toolResult:Wl()}));const X4=xr.extend({method:Ie("tools/call"),params:Vr.extend({name:H(),arguments:G(Kl(Wl()))})}),eD=In.extend({method:Ie("notifications/tools/list_changed")}),QE=us(["debug","info","notice","warning","error","critical","alert","emergency"]),tD=xr.extend({method:Ie("logging/setLevel"),params:Vr.extend({level:QE})}),rD=In.extend({method:Ie("notifications/message"),params:Ql.extend({level:QE,logger:G(H()),data:Wl()})}),nD=ie({name:H().optional()}).passthrough(),sD=ie({hints:G(ge(nD)),costPriority:G(Ut().min(0).max(1)),speedPriority:G(Ut().min(0).max(1)),intelligencePriority:G(Ut().min(0).max(1))}).passthrough(),aD=ie({role:us(["user","assistant"]),content:ir([Xv,eg,tg])}).passthrough(),oD=xr.extend({method:Ie("sampling/createMessage"),params:Vr.extend({messages:ge(aD),systemPrompt:G(H()),includeContext:G(us(["none","thisServer","allServers"])),temperature:G(Ut()),maxTokens:Ut().int(),stopSequences:G(ge(H())),metadata:G(ie({}).passthrough()),modelPreferences:G(sD)})}),iD=Hr.extend({model:H(),stopReason:G(us(["endTurn","stopSequence","maxTokens"]).or(H())),role:us(["user","assistant"]),content:_4("type",[Xv,eg,tg])}),lD=ie({type:Ie("boolean"),title:G(H()),description:G(H()),default:G(It())}).passthrough(),cD=ie({type:Ie("string"),title:G(H()),description:G(H()),minLength:G(Ut()),maxLength:G(Ut()),format:G(us(["email","uri","date","date-time"]))}).passthrough(),uD=ie({type:us(["number","integer"]),title:G(H()),description:G(H()),minimum:G(Ut()),maximum:G(Ut())}).passthrough(),dD=ie({type:Ie("string"),title:G(H()),description:G(H()),enum:ge(H()),enumNames:G(ge(H()))}).passthrough(),fD=ir([lD,cD,uD,dD]),hD=xr.extend({method:Ie("elicitation/create"),params:Vr.extend({message:H(),requestedSchema:ie({type:Ie("object"),properties:Kl(H(),fD),required:G(ge(H()))}).passthrough()})}),pD=Hr.extend({action:us(["accept","decline","cancel"]),content:G(Kl(H(),Wl()))}),mD=ie({type:Ie("ref/resource"),uri:H()}).passthrough(),vD=ie({type:Ie("ref/prompt"),name:H()}).passthrough(),gD=xr.extend({method:Ie("completion/complete"),params:Vr.extend({ref:ir([vD,mD]),argument:ie({name:H(),value:H()}).passthrough(),context:G(ie({arguments:G(Kl(H(),H()))}))})}),GE=Hr.extend({completion:ie({values:ge(H()).max(100),total:G(Ut().int()),hasMore:G(It())}).passthrough()}),yD=ie({uri:H().startsWith("file://"),name:G(H()),_meta:G(ie({}).passthrough())}).passthrough(),xD=xr.extend({method:Ie("roots/list")}),wD=Hr.extend({roots:ge(yD)}),bD=In.extend({method:Ie("notifications/roots/list_changed")});ir([Gv,R4,gD,tD,B4,q4,D4,M4,$4,L4,U4,X4,J4]);ir([Qv,Zv,zE,bD]);ir([Ao,iD,pD,wD]);ir([Gv,oD,hD,xD]);ir([Qv,Zv,rD,z4,F4,eD,G4]);ir([Ao,UE,GE,rg,Ju,Yu,WE,Jv,Zd,ng]);class Hs extends Error{constructor(e,r,s){super(`MCP error ${e}: ${r}`),this.code=e,this.data=s,this.name="McpError"}}class q0 extends Error{constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function Yf(t){}function ZE(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=Yf,onError:r=Yf,onRetry:s=Yf,onComment:n}=t;let a="",o=!0,l,c="",u="";function d(f){const m=o?f.replace(/^\xEF\xBB\xBF/,""):f,[g,y]=SD(`${a}${m}`);for(const b of g)h(b);a=y,o=!1}function h(f){if(f===""){p();return}if(f.startsWith(":")){n&&n(f.slice(f.startsWith(": ")?2:1));return}const m=f.indexOf(":");if(m!==-1){const g=f.slice(0,m),y=f[m+1]===" "?2:1,b=f.slice(m+y);v(g,b,f);return}v(f,"",f)}function v(f,m,g){switch(f){case"event":u=m;break;case"data":c=`${c}${m}
|
|
369
|
-
`;break;case"id":l=m.includes("\0")?void 0:m;break;case"retry":/^\d+$/.test(m)?s(parseInt(m,10)):r(new q0(`Invalid \`retry\` value: "${m}"`,{type:"invalid-retry",value:m,line:g}));break;default:r(new q0(`Unknown field "${f.length>20?`${f.slice(0,20)}…`:f}"`,{type:"unknown-field",field:f,value:m,line:g}));break}}function p(){c.length>0&&e({id:l,event:u||void 0,data:c.endsWith(`
|
|
370
|
-
`)?c.slice(0,-1):c}),l=void 0,c="",u=""}function w(f={}){a&&f.consume&&h(a),o=!0,l=void 0,c="",u="",a=""}return{feed:d,reset:w}}function SD(t){const e=[];let r="",s=0;for(;s<t.length;){const n=t.indexOf("\r",s),a=t.indexOf(`
|
|
371
|
-
`,s);let o=-1;if(n!==-1&&a!==-1?o=Math.min(n,a):n!==-1?n===t.length-1?o=-1:o=n:a!==-1&&(o=a),o===-1){r=t.slice(s);break}else{const l=t.slice(s,o);e.push(l),s=o+1,t[s-1]==="\r"&&t[s]===`
|
|
372
|
-
`&&s++}}return[e,r]}class B0 extends Event{constructor(e,r){var s,n;super(e),this.code=(s=r==null?void 0:r.code)!=null?s:void 0,this.message=(n=r==null?void 0:r.message)!=null?n:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,s){return s(W0(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(W0(this),r)}}function _D(t){const e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}function zp(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(zp).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${zp(t.cause)}`:t.message:`${t}`}function W0(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}var YE=t=>{throw TypeError(t)},sg=(t,e,r)=>e.has(t)||YE("Cannot "+r),Ve=(t,e,r)=>(sg(t,e,"read from private field"),r?r.call(t):e.get(t)),jt=(t,e,r)=>e.has(t)?YE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ft=(t,e,r,s)=>(sg(t,e,"write to private field"),e.set(t,r),r),Hn=(t,e,r)=>(sg(t,e,"access private method"),r),dr,Ca,vo,nu,Xu,ll,Oo,cl,Rs,go,qo,yo,Gi,Qr,Vp,Hp,qp,K0,Bp,Wp,Zi,Kp,Qp;class su extends EventTarget{constructor(e,r){var s,n;super(),jt(this,Qr),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,jt(this,dr),jt(this,Ca),jt(this,vo),jt(this,nu),jt(this,Xu),jt(this,ll),jt(this,Oo),jt(this,cl,null),jt(this,Rs),jt(this,go),jt(this,qo,null),jt(this,yo,null),jt(this,Gi,null),jt(this,Hp,async a=>{var o;Ve(this,go).reset();const{body:l,redirected:c,status:u,headers:d}=a;if(u===204){Hn(this,Qr,Zi).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(c?ft(this,vo,new URL(a.url)):ft(this,vo,void 0),u!==200){Hn(this,Qr,Zi).call(this,`Non-200 status code (${u})`,u);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){Hn(this,Qr,Zi).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(Ve(this,dr)===this.CLOSED)return;ft(this,dr,this.OPEN);const h=new Event("open");if((o=Ve(this,Gi))==null||o.call(this,h),this.dispatchEvent(h),typeof l!="object"||!l||!("getReader"in l)){Hn(this,Qr,Zi).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const v=new TextDecoder,p=l.getReader();let w=!0;do{const{done:f,value:m}=await p.read();m&&Ve(this,go).feed(v.decode(m,{stream:!f})),f&&(w=!1,Ve(this,go).reset(),Hn(this,Qr,Kp).call(this))}while(w)}),jt(this,qp,a=>{ft(this,Rs,void 0),!(a.name==="AbortError"||a.type==="aborted")&&Hn(this,Qr,Kp).call(this,zp(a))}),jt(this,Bp,a=>{typeof a.id=="string"&&ft(this,cl,a.id);const o=new MessageEvent(a.event||"message",{data:a.data,origin:Ve(this,vo)?Ve(this,vo).origin:Ve(this,Ca).origin,lastEventId:a.id||""});Ve(this,yo)&&(!a.event||a.event==="message")&&Ve(this,yo).call(this,o),this.dispatchEvent(o)}),jt(this,Wp,a=>{ft(this,ll,a)}),jt(this,Qp,()=>{ft(this,Oo,void 0),Ve(this,dr)===this.CONNECTING&&Hn(this,Qr,Vp).call(this)});try{if(e instanceof URL)ft(this,Ca,e);else if(typeof e=="string")ft(this,Ca,new URL(e,ED()));else throw new Error("Invalid URL")}catch{throw _D("An invalid or illegal string was specified")}ft(this,go,ZE({onEvent:Ve(this,Bp),onRetry:Ve(this,Wp)})),ft(this,dr,this.CONNECTING),ft(this,ll,3e3),ft(this,Xu,(s=r==null?void 0:r.fetch)!=null?s:globalThis.fetch),ft(this,nu,(n=r==null?void 0:r.withCredentials)!=null?n:!1),Hn(this,Qr,Vp).call(this)}get readyState(){return Ve(this,dr)}get url(){return Ve(this,Ca).href}get withCredentials(){return Ve(this,nu)}get onerror(){return Ve(this,qo)}set onerror(e){ft(this,qo,e)}get onmessage(){return Ve(this,yo)}set onmessage(e){ft(this,yo,e)}get onopen(){return Ve(this,Gi)}set onopen(e){ft(this,Gi,e)}addEventListener(e,r,s){const n=r;super.addEventListener(e,n,s)}removeEventListener(e,r,s){const n=r;super.removeEventListener(e,n,s)}close(){Ve(this,Oo)&&clearTimeout(Ve(this,Oo)),Ve(this,dr)!==this.CLOSED&&(Ve(this,Rs)&&Ve(this,Rs).abort(),ft(this,dr,this.CLOSED),ft(this,Rs,void 0))}}dr=new WeakMap,Ca=new WeakMap,vo=new WeakMap,nu=new WeakMap,Xu=new WeakMap,ll=new WeakMap,Oo=new WeakMap,cl=new WeakMap,Rs=new WeakMap,go=new WeakMap,qo=new WeakMap,yo=new WeakMap,Gi=new WeakMap,Qr=new WeakSet,Vp=function(){ft(this,dr,this.CONNECTING),ft(this,Rs,new AbortController),Ve(this,Xu)(Ve(this,Ca),Hn(this,Qr,K0).call(this)).then(Ve(this,Hp)).catch(Ve(this,qp))},Hp=new WeakMap,qp=new WeakMap,K0=function(){var t;const e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ve(this,cl)?{"Last-Event-ID":Ve(this,cl)}:void 0},cache:"no-store",signal:(t=Ve(this,Rs))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},Bp=new WeakMap,Wp=new WeakMap,Zi=function(t,e){var r;Ve(this,dr)!==this.CLOSED&&ft(this,dr,this.CLOSED);const s=new B0("error",{code:e,message:t});(r=Ve(this,qo))==null||r.call(this,s),this.dispatchEvent(s)},Kp=function(t,e){var r;if(Ve(this,dr)===this.CLOSED)return;ft(this,dr,this.CONNECTING);const s=new B0("error",{code:e,message:t});(r=Ve(this,qo))==null||r.call(this,s),this.dispatchEvent(s),ft(this,Oo,setTimeout(Ve(this,Qp),Ve(this,ll)))},Qp=new WeakMap,su.CONNECTING=0,su.OPEN=1,su.CLOSED=2;function ED(){const t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}let ag;ag=globalThis.crypto;async function CD(t){return(await ag).getRandomValues(new Uint8Array(t))}async function PD(t){const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";let r="";const s=await CD(t);for(let n=0;n<t;n++){const a=s[n]%e.length;r+=e[a]}return r}async function kD(t){return await PD(t)}async function ND(t){const e=await(await ag).subtle.digest("SHA-256",new TextEncoder().encode(t));return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function jD(t){if(t||(t=43),t<43||t>128)throw`Expected a length between 43 and 128. Received ${t}.`;const e=await kD(t),r=await ND(e);return{code_verifier:e,code_challenge:r}}const Ft=H().url().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:J.custom,message:"URL must be parseable",fatal:!0}),E4}).refine(t=>{const e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),RD=ie({resource:H().url(),authorization_servers:ge(Ft).optional(),jwks_uri:H().url().optional(),scopes_supported:ge(H()).optional(),bearer_methods_supported:ge(H()).optional(),resource_signing_alg_values_supported:ge(H()).optional(),resource_name:H().optional(),resource_documentation:H().optional(),resource_policy_uri:H().url().optional(),resource_tos_uri:H().url().optional(),tls_client_certificate_bound_access_tokens:It().optional(),authorization_details_types_supported:ge(H()).optional(),dpop_signing_alg_values_supported:ge(H()).optional(),dpop_bound_access_tokens_required:It().optional()}).passthrough(),JE=ie({issuer:H(),authorization_endpoint:Ft,token_endpoint:Ft,registration_endpoint:Ft.optional(),scopes_supported:ge(H()).optional(),response_types_supported:ge(H()),response_modes_supported:ge(H()).optional(),grant_types_supported:ge(H()).optional(),token_endpoint_auth_methods_supported:ge(H()).optional(),token_endpoint_auth_signing_alg_values_supported:ge(H()).optional(),service_documentation:Ft.optional(),revocation_endpoint:Ft.optional(),revocation_endpoint_auth_methods_supported:ge(H()).optional(),revocation_endpoint_auth_signing_alg_values_supported:ge(H()).optional(),introspection_endpoint:H().optional(),introspection_endpoint_auth_methods_supported:ge(H()).optional(),introspection_endpoint_auth_signing_alg_values_supported:ge(H()).optional(),code_challenge_methods_supported:ge(H()).optional()}).passthrough(),TD=ie({issuer:H(),authorization_endpoint:Ft,token_endpoint:Ft,userinfo_endpoint:Ft.optional(),jwks_uri:Ft,registration_endpoint:Ft.optional(),scopes_supported:ge(H()).optional(),response_types_supported:ge(H()),response_modes_supported:ge(H()).optional(),grant_types_supported:ge(H()).optional(),acr_values_supported:ge(H()).optional(),subject_types_supported:ge(H()),id_token_signing_alg_values_supported:ge(H()),id_token_encryption_alg_values_supported:ge(H()).optional(),id_token_encryption_enc_values_supported:ge(H()).optional(),userinfo_signing_alg_values_supported:ge(H()).optional(),userinfo_encryption_alg_values_supported:ge(H()).optional(),userinfo_encryption_enc_values_supported:ge(H()).optional(),request_object_signing_alg_values_supported:ge(H()).optional(),request_object_encryption_alg_values_supported:ge(H()).optional(),request_object_encryption_enc_values_supported:ge(H()).optional(),token_endpoint_auth_methods_supported:ge(H()).optional(),token_endpoint_auth_signing_alg_values_supported:ge(H()).optional(),display_values_supported:ge(H()).optional(),claim_types_supported:ge(H()).optional(),claims_supported:ge(H()).optional(),service_documentation:H().optional(),claims_locales_supported:ge(H()).optional(),ui_locales_supported:ge(H()).optional(),claims_parameter_supported:It().optional(),request_parameter_supported:It().optional(),request_uri_parameter_supported:It().optional(),require_request_uri_registration:It().optional(),op_policy_uri:Ft.optional(),op_tos_uri:Ft.optional()}).passthrough(),AD=TD.merge(JE.pick({code_challenge_methods_supported:!0})),XE=ie({access_token:H(),id_token:H().optional(),token_type:H(),expires_in:Ut().optional(),scope:H().optional(),refresh_token:H().optional()}).strip(),OD=ie({error:H(),error_description:H().optional(),error_uri:H().optional()}),ID=ie({redirect_uris:ge(Ft),token_endpoint_auth_method:H().optional(),grant_types:ge(H()).optional(),response_types:ge(H()).optional(),client_name:H().optional(),client_uri:Ft.optional(),logo_uri:Ft.optional(),scope:H().optional(),contacts:ge(H()).optional(),tos_uri:Ft.optional(),policy_uri:H().optional(),jwks_uri:Ft.optional(),jwks:S4().optional(),software_id:H().optional(),software_version:H().optional(),software_statement:H().optional()}).strip(),DD=ie({client_id:H(),client_secret:H().optional(),client_id_issued_at:Ut().optional(),client_secret_expires_at:Ut().optional()}).strip(),MD=ID.merge(DD);ie({error:H(),error_description:H().optional()}).strip();ie({token:H(),token_type_hint:H().optional()}).strip();function $D(t){const e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}function FD({requestedResource:t,configuredResource:e}){const r=typeof t=="string"?new URL(t):new URL(t.href),s=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==s.origin||r.pathname.length<s.pathname.length)return!1;const n=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",a=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return n.startsWith(a)}class Wt extends Error{constructor(e,r){super(e),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){const e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}}class Gp extends Wt{}Gp.errorCode="invalid_request";class ed extends Wt{}ed.errorCode="invalid_client";class td extends Wt{}td.errorCode="invalid_grant";class rd extends Wt{}rd.errorCode="unauthorized_client";class Zp extends Wt{}Zp.errorCode="unsupported_grant_type";class Yp extends Wt{}Yp.errorCode="invalid_scope";class Jp extends Wt{}Jp.errorCode="access_denied";class gi extends Wt{}gi.errorCode="server_error";class Xp extends Wt{}Xp.errorCode="temporarily_unavailable";class em extends Wt{}em.errorCode="unsupported_response_type";class tm extends Wt{}tm.errorCode="unsupported_token_type";class rm extends Wt{}rm.errorCode="invalid_token";class nm extends Wt{}nm.errorCode="method_not_allowed";class sm extends Wt{}sm.errorCode="too_many_requests";class am extends Wt{}am.errorCode="invalid_client_metadata";class om extends Wt{}om.errorCode="insufficient_scope";const LD={[Gp.errorCode]:Gp,[ed.errorCode]:ed,[td.errorCode]:td,[rd.errorCode]:rd,[Zp.errorCode]:Zp,[Yp.errorCode]:Yp,[Jp.errorCode]:Jp,[gi.errorCode]:gi,[Xp.errorCode]:Xp,[em.errorCode]:em,[tm.errorCode]:tm,[rm.errorCode]:rm,[nm.errorCode]:nm,[sm.errorCode]:sm,[am.errorCode]:am,[om.errorCode]:om};class Dr extends Error{constructor(e){super(e??"Unauthorized")}}function eC(t,e){const r=t.client_secret!==void 0;return e.length===0?r?"client_secret_post":"none":r&&e.includes("client_secret_basic")?"client_secret_basic":r&&e.includes("client_secret_post")?"client_secret_post":e.includes("none")?"none":r?"client_secret_post":"none"}function tC(t,e,r,s){const{client_id:n,client_secret:a}=e;switch(t){case"client_secret_basic":UD(n,a,r);return;case"client_secret_post":zD(n,a,s);return;case"none":VD(n,s);return;default:throw new Error(`Unsupported client authentication method: ${t}`)}}function UD(t,e,r){if(!e)throw new Error("client_secret_basic authentication requires a client_secret");const s=btoa(`${t}:${e}`);r.set("Authorization",`Basic ${s}`)}function zD(t,e,r){r.set("client_id",t),e&&r.set("client_secret",e)}function VD(t,e){e.set("client_id",t)}async function og(t){const e=t instanceof Response?t.status:void 0,r=t instanceof Response?await t.text():t;try{const s=OD.parse(JSON.parse(r)),{error:n,error_description:a,error_uri:o}=s,l=LD[n]||gi;return new l(a||"",o)}catch(s){const n=`${e?`HTTP ${e}: `:""}Invalid OAuth error response: ${s}. Raw body: ${r}`;return new gi(n)}}async function Pn(t,e){var r,s;try{return await Jf(t,e)}catch(n){if(n instanceof ed||n instanceof rd)return await((r=t.invalidateCredentials)===null||r===void 0?void 0:r.call(t,"all")),await Jf(t,e);if(n instanceof td)return await((s=t.invalidateCredentials)===null||s===void 0?void 0:s.call(t,"tokens")),await Jf(t,e);throw n}}async function Jf(t,{serverUrl:e,authorizationCode:r,scope:s,resourceMetadataUrl:n,fetchFn:a}){let o,l;try{o=await qD(e,{resourceMetadataUrl:n},a),o.authorization_servers&&o.authorization_servers.length>0&&(l=o.authorization_servers[0])}catch{}l||(l=e);const c=await HD(e,t,o),u=await GD(l,{fetchFn:a});let d=await Promise.resolve(t.clientInformation());if(!d){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!t.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const f=await XD(l,{metadata:u,clientMetadata:t.clientMetadata,fetchFn:a});await t.saveClientInformation(f),d=f}if(r!==void 0){const f=await t.codeVerifier(),m=await YD(l,{metadata:u,clientInformation:d,authorizationCode:r,codeVerifier:f,redirectUri:t.redirectUrl,resource:c,addClientAuthentication:t.addClientAuthentication,fetchFn:a});return await t.saveTokens(m),"AUTHORIZED"}const h=await t.tokens();if(h!=null&&h.refresh_token)try{const f=await JD(l,{metadata:u,clientInformation:d,refreshToken:h.refresh_token,resource:c,addClientAuthentication:t.addClientAuthentication,fetchFn:a});return await t.saveTokens(f),"AUTHORIZED"}catch(f){if(!(!(f instanceof Wt)||f instanceof gi))throw f}const v=t.state?await t.state():void 0,{authorizationUrl:p,codeVerifier:w}=await ZD(l,{metadata:u,clientInformation:d,state:v,redirectUrl:t.redirectUrl,scope:s||t.clientMetadata.scope,resource:c});return await t.saveCodeVerifier(w),await t.redirectToAuthorization(p),"REDIRECT"}async function HD(t,e,r){const s=$D(t);if(e.validateResourceURL)return await e.validateResourceURL(s,r==null?void 0:r.resource);if(r){if(!FD({requestedResource:s,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${s} (or origin)`);return new URL(r.resource)}}function im(t){const e=t.headers.get("WWW-Authenticate");if(!e)return;const[r,s]=e.split(" ");if(r.toLowerCase()!=="bearer"||!s)return;const a=/resource_metadata="([^"]*)"/.exec(e);if(a)try{return new URL(a[1])}catch{return}}async function qD(t,e,r=fetch){const s=await KD(t,"oauth-protected-resource",r,{protocolVersion:e==null?void 0:e.protocolVersion,metadataUrl:e==null?void 0:e.resourceMetadataUrl});if(!s||s.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!s.ok)throw new Error(`HTTP ${s.status} trying to load well-known OAuth protected resource metadata.`);return RD.parse(await s.json())}async function ig(t,e,r=fetch){try{return await r(t,{headers:e})}catch(s){if(s instanceof TypeError)return e?ig(t,void 0,r):void 0;throw s}}function BD(t,e="",r={}){return e.endsWith("/")&&(e=e.slice(0,-1)),r.prependPathname?`${e}/.well-known/${t}`:`/.well-known/${t}${e}`}async function Q0(t,e,r=fetch){return await ig(t,{"MCP-Protocol-Version":e},r)}function WD(t,e){return!t||t.status>=400&&t.status<500&&e!=="/"}async function KD(t,e,r,s){var n,a;const o=new URL(t),l=(n=s==null?void 0:s.protocolVersion)!==null&&n!==void 0?n:Bd;let c;if(s!=null&&s.metadataUrl)c=new URL(s.metadataUrl);else{const d=BD(e,o.pathname);c=new URL(d,(a=s==null?void 0:s.metadataServerUrl)!==null&&a!==void 0?a:o),c.search=o.search}let u=await Q0(c,l,r);if(!(s!=null&&s.metadataUrl)&&WD(u,o.pathname)){const d=new URL(`/.well-known/${e}`,o);u=await Q0(d,l,r)}return u}function QD(t){const e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",s=[];if(!r)return s.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),s.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),s;let n=e.pathname;return n.endsWith("/")&&(n=n.slice(0,-1)),s.push({url:new URL(`/.well-known/oauth-authorization-server${n}`,e.origin),type:"oauth"}),s.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),s.push({url:new URL(`/.well-known/openid-configuration${n}`,e.origin),type:"oidc"}),s.push({url:new URL(`${n}/.well-known/openid-configuration`,e.origin),type:"oidc"}),s}async function GD(t,{fetchFn:e=fetch,protocolVersion:r=Bd}={}){var s;const n={"MCP-Protocol-Version":r},a=QD(t);for(const{url:o,type:l}of a){const c=await ig(o,n,e);if(c){if(!c.ok){if(c.status>=400&&c.status<500)continue;throw new Error(`HTTP ${c.status} trying to load ${l==="oauth"?"OAuth":"OpenID provider"} metadata from ${o}`)}if(l==="oauth")return JE.parse(await c.json());{const u=AD.parse(await c.json());if(!(!((s=u.code_challenge_methods_supported)===null||s===void 0)&&s.includes("S256")))throw new Error(`Incompatible OIDC provider at ${o}: does not support S256 code challenge method required by MCP specification`);return u}}}}async function ZD(t,{metadata:e,clientInformation:r,redirectUrl:s,scope:n,state:a,resource:o}){const l="code",c="S256";let u;if(e){if(u=new URL(e.authorization_endpoint),!e.response_types_supported.includes(l))throw new Error(`Incompatible auth server: does not support response type ${l}`);if(!e.code_challenge_methods_supported||!e.code_challenge_methods_supported.includes(c))throw new Error(`Incompatible auth server: does not support code challenge method ${c}`)}else u=new URL("/authorize",t);const d=await jD(),h=d.code_verifier,v=d.code_challenge;return u.searchParams.set("response_type",l),u.searchParams.set("client_id",r.client_id),u.searchParams.set("code_challenge",v),u.searchParams.set("code_challenge_method",c),u.searchParams.set("redirect_uri",String(s)),a&&u.searchParams.set("state",a),n&&u.searchParams.set("scope",n),n!=null&&n.includes("offline_access")&&u.searchParams.append("prompt","consent"),o&&u.searchParams.set("resource",o.href),{authorizationUrl:u,codeVerifier:h}}async function YD(t,{metadata:e,clientInformation:r,authorizationCode:s,codeVerifier:n,redirectUri:a,resource:o,addClientAuthentication:l,fetchFn:c}){var u;const d="authorization_code",h=e!=null&&e.token_endpoint?new URL(e.token_endpoint):new URL("/token",t);if(e!=null&&e.grant_types_supported&&!e.grant_types_supported.includes(d))throw new Error(`Incompatible auth server: does not support grant type ${d}`);const v=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),p=new URLSearchParams({grant_type:d,code:s,code_verifier:n,redirect_uri:String(a)});if(l)l(v,p,t,e);else{const f=(u=e==null?void 0:e.token_endpoint_auth_methods_supported)!==null&&u!==void 0?u:[],m=eC(r,f);tC(m,r,v,p)}o&&p.set("resource",o.href);const w=await(c??fetch)(h,{method:"POST",headers:v,body:p});if(!w.ok)throw await og(w);return XE.parse(await w.json())}async function JD(t,{metadata:e,clientInformation:r,refreshToken:s,resource:n,addClientAuthentication:a,fetchFn:o}){var l;const c="refresh_token";let u;if(e){if(u=new URL(e.token_endpoint),e.grant_types_supported&&!e.grant_types_supported.includes(c))throw new Error(`Incompatible auth server: does not support grant type ${c}`)}else u=new URL("/token",t);const d=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),h=new URLSearchParams({grant_type:c,refresh_token:s});if(a)a(d,h,t,e);else{const p=(l=e==null?void 0:e.token_endpoint_auth_methods_supported)!==null&&l!==void 0?l:[],w=eC(r,p);tC(w,r,d,h)}n&&h.set("resource",n.href);const v=await(o??fetch)(u,{method:"POST",headers:d,body:h});if(!v.ok)throw await og(v);return XE.parse({refresh_token:s,...await v.json()})}async function XD(t,{metadata:e,clientMetadata:r,fetchFn:s}){let n;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");n=new URL(e.registration_endpoint)}else n=new URL("/register",t);const a=await(s??fetch)(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw await og(a);return MD.parse(await a.json())}class eM extends Error{constructor(e,r,s){super(`SSE error: ${r}`),this.code=e,this.event=s}}class tM{constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._eventSourceInit=r==null?void 0:r.eventSourceInit,this._requestInit=r==null?void 0:r.requestInit,this._authProvider=r==null?void 0:r.authProvider,this._fetch=r==null?void 0:r.fetch}async _authThenStart(){var e;if(!this._authProvider)throw new Dr("No auth provider");let r;try{r=await Pn(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(s){throw(e=this.onerror)===null||e===void 0||e.call(this,s),s}if(r!=="AUTHORIZED")throw new Dr;return await this._startOrAuth()}async _commonHeaders(){var e;const r={};if(this._authProvider){const s=await this._authProvider.tokens();s&&(r.Authorization=`Bearer ${s.access_token}`)}return this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion),new Headers({...r,...(e=this._requestInit)===null||e===void 0?void 0:e.headers})}_startOrAuth(){var e,r,s;const n=(s=(r=(e=this===null||this===void 0?void 0:this._eventSourceInit)===null||e===void 0?void 0:e.fetch)!==null&&r!==void 0?r:this._fetch)!==null&&s!==void 0?s:fetch;return new Promise((a,o)=>{this._eventSource=new su(this._url.href,{...this._eventSourceInit,fetch:async(l,c)=>{const u=await this._commonHeaders();u.set("Accept","text/event-stream");const d=await n(l,{...c,headers:u});return d.status===401&&d.headers.has("www-authenticate")&&(this._resourceMetadataUrl=im(d)),d}}),this._abortController=new AbortController,this._eventSource.onerror=l=>{var c;if(l.code===401&&this._authProvider){this._authThenStart().then(a,o);return}const u=new eM(l.code,l.message,l);o(u),(c=this.onerror)===null||c===void 0||c.call(this,u)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",l=>{var c;const u=l;try{if(this._endpoint=new URL(u.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(d){o(d),(c=this.onerror)===null||c===void 0||c.call(this,d),this.close();return}a()}),this._eventSource.onmessage=l=>{var c,u;const d=l;let h;try{h=ru.parse(JSON.parse(d.data))}catch(v){(c=this.onerror)===null||c===void 0||c.call(this,v);return}(u=this.onmessage)===null||u===void 0||u.call(this,h)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new Dr("No auth provider");if(await Pn(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Dr("Failed to authorize")}async close(){var e,r,s;(e=this._abortController)===null||e===void 0||e.abort(),(r=this._eventSource)===null||r===void 0||r.close(),(s=this.onclose)===null||s===void 0||s.call(this)}async send(e){var r,s,n;if(!this._endpoint)throw new Error("Not connected");try{const a=await this._commonHeaders();a.set("content-type","application/json");const o={...this._requestInit,method:"POST",headers:a,body:JSON.stringify(e),signal:(r=this._abortController)===null||r===void 0?void 0:r.signal},l=await((s=this._fetch)!==null&&s!==void 0?s:fetch)(this._endpoint,o);if(!l.ok){if(l.status===401&&this._authProvider){if(this._resourceMetadataUrl=im(l),await Pn(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Dr;return this.send(e)}const c=await l.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${l.status}): ${c}`)}}catch(a){throw(n=this.onerror)===null||n===void 0||n.call(this,a),a}}setProtocolVersion(e){this._protocolVersion=e}}class rM extends TransformStream{constructor({onError:e,onRetry:r,onComment:s}={}){let n;super({start(a){n=ZE({onEvent:o=>{a.enqueue(o)},onError(o){e==="terminate"?a.error(o):typeof e=="function"&&e(o)},onRetry:r,onComment:s})},transform(a){n.feed(a)}})}}const nM={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Xf extends Error{constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}}class sM{constructor(e,r){var s;this._url=e,this._resourceMetadataUrl=void 0,this._requestInit=r==null?void 0:r.requestInit,this._authProvider=r==null?void 0:r.authProvider,this._fetch=r==null?void 0:r.fetch,this._sessionId=r==null?void 0:r.sessionId,this._reconnectionOptions=(s=r==null?void 0:r.reconnectionOptions)!==null&&s!==void 0?s:nM}async _authThenStart(){var e;if(!this._authProvider)throw new Dr("No auth provider");let r;try{r=await Pn(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(s){throw(e=this.onerror)===null||e===void 0||e.call(this,s),s}if(r!=="AUTHORIZED")throw new Dr;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){var e;const r={};if(this._authProvider){const n=await this._authProvider.tokens();n&&(r.Authorization=`Bearer ${n.access_token}`)}this._sessionId&&(r["mcp-session-id"]=this._sessionId),this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion);const s=this._normalizeHeaders((e=this._requestInit)===null||e===void 0?void 0:e.headers);return new Headers({...r,...s})}async _startOrAuthSse(e){var r,s,n;const{resumptionToken:a}=e;try{const o=await this._commonHeaders();o.set("Accept","text/event-stream"),a&&o.set("last-event-id",a);const l=await((r=this._fetch)!==null&&r!==void 0?r:fetch)(this._url,{method:"GET",headers:o,signal:(s=this._abortController)===null||s===void 0?void 0:s.signal});if(!l.ok){if(l.status===401&&this._authProvider)return await this._authThenStart();if(l.status===405)return;throw new Xf(l.status,`Failed to open SSE stream: ${l.statusText}`)}this._handleSseStream(l.body,e,!0)}catch(o){throw(n=this.onerror)===null||n===void 0||n.call(this,o),o}}_getNextReconnectionDelay(e){const r=this._reconnectionOptions.initialReconnectionDelay,s=this._reconnectionOptions.reconnectionDelayGrowFactor,n=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(s,e),n)}_normalizeHeaders(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}_scheduleReconnection(e,r=0){var s;const n=this._reconnectionOptions.maxRetries;if(n>0&&r>=n){(s=this.onerror)===null||s===void 0||s.call(this,new Error(`Maximum reconnection attempts (${n}) exceeded.`));return}const a=this._getNextReconnectionDelay(r);setTimeout(()=>{this._startOrAuthSse(e).catch(o=>{var l;(l=this.onerror)===null||l===void 0||l.call(this,new Error(`Failed to reconnect SSE stream: ${o instanceof Error?o.message:String(o)}`)),this._scheduleReconnection(e,r+1)})},a)}_handleSseStream(e,r,s){if(!e)return;const{onresumptiontoken:n,replayMessageId:a}=r;let o;(async()=>{var c,u,d,h;try{const v=e.pipeThrough(new TextDecoderStream).pipeThrough(new rM).getReader();for(;;){const{value:p,done:w}=await v.read();if(w)break;if(p.id&&(o=p.id,n==null||n(p.id)),!p.event||p.event==="message")try{const f=ru.parse(JSON.parse(p.data));a!==void 0&&Up(f)&&(f.id=a),(c=this.onmessage)===null||c===void 0||c.call(this,f)}catch(f){(u=this.onerror)===null||u===void 0||u.call(this,f)}}}catch(v){if((d=this.onerror)===null||d===void 0||d.call(this,new Error(`SSE stream disconnected: ${v}`)),s&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:o,onresumptiontoken:n,replayMessageId:a},0)}catch(p){(h=this.onerror)===null||h===void 0||h.call(this,new Error(`Failed to reconnect: ${p instanceof Error?p.message:String(p)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Dr("No auth provider");if(await Pn(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Dr("Failed to authorize")}async close(){var e,r;(e=this._abortController)===null||e===void 0||e.abort(),(r=this.onclose)===null||r===void 0||r.call(this)}async send(e,r){var s,n,a,o;try{const{resumptionToken:l,onresumptiontoken:c}=r||{};if(l){this._startOrAuthSse({resumptionToken:l,replayMessageId:DE(e)?e.id:void 0}).catch(m=>{var g;return(g=this.onerror)===null||g===void 0?void 0:g.call(this,m)});return}const u=await this._commonHeaders();u.set("content-type","application/json"),u.set("accept","application/json, text/event-stream");const d={...this._requestInit,method:"POST",headers:u,body:JSON.stringify(e),signal:(s=this._abortController)===null||s===void 0?void 0:s.signal},h=await((n=this._fetch)!==null&&n!==void 0?n:fetch)(this._url,d),v=h.headers.get("mcp-session-id");if(v&&(this._sessionId=v),!h.ok){if(h.status===401&&this._authProvider){if(this._resourceMetadataUrl=im(h),await Pn(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Dr;return this.send(e)}const m=await h.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${h.status}): ${m}`)}if(h.status===202){A4(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(m=>{var g;return(g=this.onerror)===null||g===void 0?void 0:g.call(this,m)});return}const w=(Array.isArray(e)?e:[e]).filter(m=>"method"in m&&"id"in m&&m.id!==void 0).length>0,f=h.headers.get("content-type");if(w)if(f!=null&&f.includes("text/event-stream"))this._handleSseStream(h.body,{onresumptiontoken:c},!1);else if(f!=null&&f.includes("application/json")){const m=await h.json(),g=Array.isArray(m)?m.map(y=>ru.parse(y)):[ru.parse(m)];for(const y of g)(a=this.onmessage)===null||a===void 0||a.call(this,y)}else throw new Xf(-1,`Unexpected content type: ${f}`)}catch(l){throw(o=this.onerror)===null||o===void 0||o.call(this,l),l}}get sessionId(){return this._sessionId}async terminateSession(){var e,r,s;if(this._sessionId)try{const n=await this._commonHeaders(),a={...this._requestInit,method:"DELETE",headers:n,signal:(e=this._abortController)===null||e===void 0?void 0:e.signal},o=await((r=this._fetch)!==null&&r!==void 0?r:fetch)(this._url,a);if(!o.ok&&o.status!==405)throw new Xf(o.status,`Failed to terminate session: ${o.statusText}`);this._sessionId=void 0}catch(n){throw(s=this.onerror)===null||s===void 0||s.call(this,n),n}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}}const aM=6e4;class oM{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.setNotificationHandler(Qv,r=>{const s=this._requestHandlerAbortControllers.get(r.params.requestId);s==null||s.abort(r.params.reason)}),this.setNotificationHandler(Zv,r=>{this._onprogress(r)}),this.setRequestHandler(Gv,r=>({}))}_setupTimeout(e,r,s,n,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,r),startTime:Date.now(),timeout:r,maxTotalTimeout:s,resetTimeoutOnProgress:a,onTimeout:n})}_resetTimeout(e){const r=this._timeoutInfo.get(e);if(!r)return!1;const s=Date.now()-r.startTime;if(r.maxTotalTimeout&&s>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Hs(En.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:s});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){const r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var r,s,n;this._transport=e;const a=(r=this.transport)===null||r===void 0?void 0:r.onclose;this._transport.onclose=()=>{a==null||a(),this._onclose()};const o=(s=this.transport)===null||s===void 0?void 0:s.onerror;this._transport.onerror=c=>{o==null||o(c),this._onerror(c)};const l=(n=this._transport)===null||n===void 0?void 0:n.onmessage;this._transport.onmessage=(c,u)=>{l==null||l(c,u),Up(c)||N4(c)?this._onresponse(c):DE(c)?this._onrequest(c,u):k4(c)?this._onnotification(c):this._onerror(new Error(`Unknown message type: ${JSON.stringify(c)}`))},await this._transport.start()}_onclose(){var e;const r=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);const s=new Hs(En.ConnectionClosed,"Connection closed");for(const n of r.values())n(s)}_onerror(e){var r;(r=this.onerror)===null||r===void 0||r.call(this,e)}_onnotification(e){var r;const s=(r=this._notificationHandlers.get(e.method))!==null&&r!==void 0?r:this.fallbackNotificationHandler;s!==void 0&&Promise.resolve().then(()=>s(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){var s,n;const a=(s=this._requestHandlers.get(e.method))!==null&&s!==void 0?s:this.fallbackRequestHandler,o=this._transport;if(a===void 0){o==null||o.send({jsonrpc:"2.0",id:e.id,error:{code:En.MethodNotFound,message:"Method not found"}}).catch(u=>this._onerror(new Error(`Failed to send an error response: ${u}`)));return}const l=new AbortController;this._requestHandlerAbortControllers.set(e.id,l);const c={signal:l.signal,sessionId:o==null?void 0:o.sessionId,_meta:(n=e.params)===null||n===void 0?void 0:n._meta,sendNotification:u=>this.notification(u,{relatedRequestId:e.id}),sendRequest:(u,d,h)=>this.request(u,d,{...h,relatedRequestId:e.id}),authInfo:r==null?void 0:r.authInfo,requestId:e.id,requestInfo:r==null?void 0:r.requestInfo};Promise.resolve().then(()=>a(e,c)).then(u=>{if(!l.signal.aborted)return o==null?void 0:o.send({result:u,jsonrpc:"2.0",id:e.id})},u=>{var d;if(!l.signal.aborted)return o==null?void 0:o.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:En.InternalError,message:(d=u.message)!==null&&d!==void 0?d:"Internal error"}})}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:r,...s}=e.params,n=Number(r),a=this._progressHandlers.get(n);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const o=this._responseHandlers.get(n),l=this._timeoutInfo.get(n);if(l&&o&&l.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){o(c);return}a(s)}_onresponse(e){const r=Number(e.id),s=this._responseHandlers.get(r);if(s===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),Up(e))s(e);else{const n=new Hs(e.error.code,e.error.message,e.error.data);s(n)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,r,s){const{relatedRequestId:n,resumptionToken:a,onresumptiontoken:o}=s??{};return new Promise((l,c)=>{var u,d,h,v,p,w;if(!this._transport){c(new Error("Not connected"));return}((u=this._options)===null||u===void 0?void 0:u.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(d=s==null?void 0:s.signal)===null||d===void 0||d.throwIfAborted();const f=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:f};s!=null&&s.onprogress&&(this._progressHandlers.set(f,s.onprogress),m.params={...e.params,_meta:{...((h=e.params)===null||h===void 0?void 0:h._meta)||{},progressToken:f}});const g=S=>{var E;this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),(E=this._transport)===null||E===void 0||E.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(S)}},{relatedRequestId:n,resumptionToken:a,onresumptiontoken:o}).catch(P=>this._onerror(new Error(`Failed to send cancellation: ${P}`))),c(S)};this._responseHandlers.set(f,S=>{var E;if(!(!((E=s==null?void 0:s.signal)===null||E===void 0)&&E.aborted)){if(S instanceof Error)return c(S);try{const P=r.parse(S.result);l(P)}catch(P){c(P)}}}),(v=s==null?void 0:s.signal)===null||v===void 0||v.addEventListener("abort",()=>{var S;g((S=s==null?void 0:s.signal)===null||S===void 0?void 0:S.reason)});const y=(p=s==null?void 0:s.timeout)!==null&&p!==void 0?p:aM,b=()=>g(new Hs(En.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(f,y,s==null?void 0:s.maxTotalTimeout,b,(w=s==null?void 0:s.resetTimeoutOnProgress)!==null&&w!==void 0?w:!1),this._transport.send(m,{relatedRequestId:n,resumptionToken:a,onresumptiontoken:o}).catch(S=>{this._cleanupTimeout(f),c(S)})})}async notification(e,r){var s,n;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((n=(s=this._options)===null||s===void 0?void 0:s.debouncedNotificationMethods)!==null&&n!==void 0?n:[]).includes(e.method)&&!e.params&&!(r!=null&&r.relatedRequestId)){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var c;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const u={...e,jsonrpc:"2.0"};(c=this._transport)===null||c===void 0||c.send(u,r).catch(d=>this._onerror(d))});return}const l={...e,jsonrpc:"2.0"};await this._transport.send(l,r)}setRequestHandler(e,r){const s=e.shape.method.value;this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(n,a)=>Promise.resolve(r(e.parse(n),a)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){this._notificationHandlers.set(e.shape.method.value,s=>Promise.resolve(r(e.parse(s))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}function iM(t,e){return Object.entries(e).reduce((r,[s,n])=>(n&&typeof n=="object"?r[s]=r[s]?{...r[s],...n}:n:r[s]=n,r),{...t})}var lm={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(t,e){(function(r,s){s(e)})(MC,function(r){function s(){for(var D=arguments.length,k=Array(D),M=0;M<D;M++)k[M]=arguments[M];if(k.length>1){k[0]=k[0].slice(0,-1);for(var B=k.length-1,q=1;q<B;++q)k[q]=k[q].slice(1,-1);return k[B]=k[B].slice(1),k.join("")}else return k[0]}function n(D){return"(?:"+D+")"}function a(D){return D===void 0?"undefined":D===null?"null":Object.prototype.toString.call(D).split(" ").pop().split("]").shift().toLowerCase()}function o(D){return D.toUpperCase()}function l(D){return D!=null?D instanceof Array?D:typeof D.length!="number"||D.split||D.setInterval||D.call?[D]:Array.prototype.slice.call(D):[]}function c(D,k){var M=D;if(k)for(var B in k)M[B]=k[B];return M}function u(D){var k="[A-Za-z]",M="[0-9]",B=s(M,"[A-Fa-f]"),q=n(n("%[EFef]"+B+"%"+B+B+"%"+B+B)+"|"+n("%[89A-Fa-f]"+B+"%"+B+B)+"|"+n("%"+B+B)),xe="[\\:\\/\\?\\#\\[\\]\\@]",be="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",Qe=s(xe,be),ot=D?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",bt=D?"[\\uE000-\\uF8FF]":"[]",qe=s(k,M,"[\\-\\.\\_\\~]",ot);n(k+s(k,M,"[\\+\\-\\.]")+"*"),n(n(q+"|"+s(qe,be,"[\\:]"))+"*");var nt=n(n("25[0-5]")+"|"+n("2[0-4]"+M)+"|"+n("1"+M+M)+"|"+n("0?[1-9]"+M)+"|0?0?"+M),St=n(nt+"\\."+nt+"\\."+nt+"\\."+nt),Re=n(B+"{1,4}"),ut=n(n(Re+"\\:"+Re)+"|"+St),Ct=n(n(Re+"\\:")+"{6}"+ut),dt=n("\\:\\:"+n(Re+"\\:")+"{5}"+ut),gs=n(n(Re)+"?\\:\\:"+n(Re+"\\:")+"{4}"+ut),cn=n(n(n(Re+"\\:")+"{0,1}"+Re)+"?\\:\\:"+n(Re+"\\:")+"{3}"+ut),un=n(n(n(Re+"\\:")+"{0,2}"+Re)+"?\\:\\:"+n(Re+"\\:")+"{2}"+ut),io=n(n(n(Re+"\\:")+"{0,3}"+Re)+"?\\:\\:"+Re+"\\:"+ut),xa=n(n(n(Re+"\\:")+"{0,4}"+Re)+"?\\:\\:"+ut),Rr=n(n(n(Re+"\\:")+"{0,5}"+Re)+"?\\:\\:"+Re),dn=n(n(n(Re+"\\:")+"{0,6}"+Re)+"?\\:\\:"),wa=n([Ct,dt,gs,cn,un,io,xa,Rr,dn].join("|")),Fn=n(n(qe+"|"+q)+"+");n("[vV]"+B+"+\\."+s(qe,be,"[\\:]")+"+"),n(n(q+"|"+s(qe,be))+"*");var Ni=n(q+"|"+s(qe,be,"[\\:\\@]"));return n(n(q+"|"+s(qe,be,"[\\@]"))+"+"),n(n(Ni+"|"+s("[\\/\\?]",bt))+"*"),{NOT_SCHEME:new RegExp(s("[^]",k,M,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(s("[^\\%\\:]",qe,be),"g"),NOT_HOST:new RegExp(s("[^\\%\\[\\]\\:]",qe,be),"g"),NOT_PATH:new RegExp(s("[^\\%\\/\\:\\@]",qe,be),"g"),NOT_PATH_NOSCHEME:new RegExp(s("[^\\%\\/\\@]",qe,be),"g"),NOT_QUERY:new RegExp(s("[^\\%]",qe,be,"[\\:\\@\\/\\?]",bt),"g"),NOT_FRAGMENT:new RegExp(s("[^\\%]",qe,be,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(s("[^]",qe,be),"g"),UNRESERVED:new RegExp(qe,"g"),OTHER_CHARS:new RegExp(s("[^\\%]",qe,Qe),"g"),PCT_ENCODED:new RegExp(q,"g"),IPV4ADDRESS:new RegExp("^("+St+")$"),IPV6ADDRESS:new RegExp("^\\[?("+wa+")"+n(n("\\%25|\\%(?!"+B+"{2})")+"("+Fn+")")+"?\\]?$")}}var d=u(!1),h=u(!0),v=function(){function D(k,M){var B=[],q=!0,xe=!1,be=void 0;try{for(var Qe=k[Symbol.iterator](),ot;!(q=(ot=Qe.next()).done)&&(B.push(ot.value),!(M&&B.length===M));q=!0);}catch(bt){xe=!0,be=bt}finally{try{!q&&Qe.return&&Qe.return()}finally{if(xe)throw be}}return B}return function(k,M){if(Array.isArray(k))return k;if(Symbol.iterator in Object(k))return D(k,M);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(D){if(Array.isArray(D)){for(var k=0,M=Array(D.length);k<D.length;k++)M[k]=D[k];return M}else return Array.from(D)},w=2147483647,f=36,m=1,g=26,y=38,b=700,S=72,E=128,P="-",R=/^xn--/,T=/[^\0-\x7E]/,N=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},j=f-m,_=Math.floor,A=String.fromCharCode;function C(D){throw new RangeError(O[D])}function z(D,k){for(var M=[],B=D.length;B--;)M[B]=k(D[B]);return M}function U(D,k){var M=D.split("@"),B="";M.length>1&&(B=M[0]+"@",D=M[1]),D=D.replace(N,".");var q=D.split("."),xe=z(q,k).join(".");return B+xe}function K(D){for(var k=[],M=0,B=D.length;M<B;){var q=D.charCodeAt(M++);if(q>=55296&&q<=56319&&M<B){var xe=D.charCodeAt(M++);(xe&64512)==56320?k.push(((q&1023)<<10)+(xe&1023)+65536):(k.push(q),M--)}else k.push(q)}return k}var $=function(k){return String.fromCodePoint.apply(String,p(k))},F=function(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:f},V=function(k,M){return k+22+75*(k<26)-((M!=0)<<5)},ae=function(k,M,B){var q=0;for(k=B?_(k/b):k>>1,k+=_(k/M);k>j*g>>1;q+=f)k=_(k/j);return _(q+(j+1)*k/(k+y))},se=function(k){var M=[],B=k.length,q=0,xe=E,be=S,Qe=k.lastIndexOf(P);Qe<0&&(Qe=0);for(var ot=0;ot<Qe;++ot)k.charCodeAt(ot)>=128&&C("not-basic"),M.push(k.charCodeAt(ot));for(var bt=Qe>0?Qe+1:0;bt<B;){for(var qe=q,nt=1,St=f;;St+=f){bt>=B&&C("invalid-input");var Re=F(k.charCodeAt(bt++));(Re>=f||Re>_((w-q)/nt))&&C("overflow"),q+=Re*nt;var ut=St<=be?m:St>=be+g?g:St-be;if(Re<ut)break;var Ct=f-ut;nt>_(w/Ct)&&C("overflow"),nt*=Ct}var dt=M.length+1;be=ae(q-qe,dt,qe==0),_(q/dt)>w-xe&&C("overflow"),xe+=_(q/dt),q%=dt,M.splice(q++,0,xe)}return String.fromCodePoint.apply(String,M)},W=function(k){var M=[];k=K(k);var B=k.length,q=E,xe=0,be=S,Qe=!0,ot=!1,bt=void 0;try{for(var qe=k[Symbol.iterator](),nt;!(Qe=(nt=qe.next()).done);Qe=!0){var St=nt.value;St<128&&M.push(A(St))}}catch(ji){ot=!0,bt=ji}finally{try{!Qe&&qe.return&&qe.return()}finally{if(ot)throw bt}}var Re=M.length,ut=Re;for(Re&&M.push(P);ut<B;){var Ct=w,dt=!0,gs=!1,cn=void 0;try{for(var un=k[Symbol.iterator](),io;!(dt=(io=un.next()).done);dt=!0){var xa=io.value;xa>=q&&xa<Ct&&(Ct=xa)}}catch(ji){gs=!0,cn=ji}finally{try{!dt&&un.return&&un.return()}finally{if(gs)throw cn}}var Rr=ut+1;Ct-q>_((w-xe)/Rr)&&C("overflow"),xe+=(Ct-q)*Rr,q=Ct;var dn=!0,wa=!1,Fn=void 0;try{for(var Ni=k[Symbol.iterator](),wg;!(dn=(wg=Ni.next()).done);dn=!0){var bg=wg.value;if(bg<q&&++xe>w&&C("overflow"),bg==q){for(var ec=xe,tc=f;;tc+=f){var rc=tc<=be?m:tc>=be+g?g:tc-be;if(ec<rc)break;var Sg=ec-rc,_g=f-rc;M.push(A(V(rc+Sg%_g,0))),ec=_(Sg/_g)}M.push(A(V(ec,0))),be=ae(xe,Rr,ut==Re),xe=0,++ut}}}catch(ji){wa=!0,Fn=ji}finally{try{!dn&&Ni.return&&Ni.return()}finally{if(wa)throw Fn}}++xe,++q}return M.join("")},L=function(k){return U(k,function(M){return R.test(M)?se(M.slice(4).toLowerCase()):M})},Q=function(k){return U(k,function(M){return T.test(M)?"xn--"+W(M):M})},oe={version:"2.1.0",ucs2:{decode:K,encode:$},decode:se,encode:W,toASCII:Q,toUnicode:L},Z={};function ce(D){var k=D.charCodeAt(0),M=void 0;return k<16?M="%0"+k.toString(16).toUpperCase():k<128?M="%"+k.toString(16).toUpperCase():k<2048?M="%"+(k>>6|192).toString(16).toUpperCase()+"%"+(k&63|128).toString(16).toUpperCase():M="%"+(k>>12|224).toString(16).toUpperCase()+"%"+(k>>6&63|128).toString(16).toUpperCase()+"%"+(k&63|128).toString(16).toUpperCase(),M}function Ee(D){for(var k="",M=0,B=D.length;M<B;){var q=parseInt(D.substr(M+1,2),16);if(q<128)k+=String.fromCharCode(q),M+=3;else if(q>=194&&q<224){if(B-M>=6){var xe=parseInt(D.substr(M+4,2),16);k+=String.fromCharCode((q&31)<<6|xe&63)}else k+=D.substr(M,6);M+=6}else if(q>=224){if(B-M>=9){var be=parseInt(D.substr(M+4,2),16),Qe=parseInt(D.substr(M+7,2),16);k+=String.fromCharCode((q&15)<<12|(be&63)<<6|Qe&63)}else k+=D.substr(M,9);M+=9}else k+=D.substr(M,3),M+=3}return k}function ve(D,k){function M(B){var q=Ee(B);return q.match(k.UNRESERVED)?q:B}return D.scheme&&(D.scheme=String(D.scheme).replace(k.PCT_ENCODED,M).toLowerCase().replace(k.NOT_SCHEME,"")),D.userinfo!==void 0&&(D.userinfo=String(D.userinfo).replace(k.PCT_ENCODED,M).replace(k.NOT_USERINFO,ce).replace(k.PCT_ENCODED,o)),D.host!==void 0&&(D.host=String(D.host).replace(k.PCT_ENCODED,M).toLowerCase().replace(k.NOT_HOST,ce).replace(k.PCT_ENCODED,o)),D.path!==void 0&&(D.path=String(D.path).replace(k.PCT_ENCODED,M).replace(D.scheme?k.NOT_PATH:k.NOT_PATH_NOSCHEME,ce).replace(k.PCT_ENCODED,o)),D.query!==void 0&&(D.query=String(D.query).replace(k.PCT_ENCODED,M).replace(k.NOT_QUERY,ce).replace(k.PCT_ENCODED,o)),D.fragment!==void 0&&(D.fragment=String(D.fragment).replace(k.PCT_ENCODED,M).replace(k.NOT_FRAGMENT,ce).replace(k.PCT_ENCODED,o)),D}function te(D){return D.replace(/^0*(.*)/,"$1")||"0"}function we(D,k){var M=D.match(k.IPV4ADDRESS)||[],B=v(M,2),q=B[1];return q?q.split(".").map(te).join("."):D}function ke(D,k){var M=D.match(k.IPV6ADDRESS)||[],B=v(M,3),q=B[1],xe=B[2];if(q){for(var be=q.toLowerCase().split("::").reverse(),Qe=v(be,2),ot=Qe[0],bt=Qe[1],qe=bt?bt.split(":").map(te):[],nt=ot.split(":").map(te),St=k.IPV4ADDRESS.test(nt[nt.length-1]),Re=St?7:8,ut=nt.length-Re,Ct=Array(Re),dt=0;dt<Re;++dt)Ct[dt]=qe[dt]||nt[ut+dt]||"";St&&(Ct[Re-1]=we(Ct[Re-1],k));var gs=Ct.reduce(function(Rr,dn,wa){if(!dn||dn==="0"){var Fn=Rr[Rr.length-1];Fn&&Fn.index+Fn.length===wa?Fn.length++:Rr.push({index:wa,length:1})}return Rr},[]),cn=gs.sort(function(Rr,dn){return dn.length-Rr.length})[0],un=void 0;if(cn&&cn.length>1){var io=Ct.slice(0,cn.index),xa=Ct.slice(cn.index+cn.length);un=io.join(":")+"::"+xa.join(":")}else un=Ct.join(":");return xe&&(un+="%"+xe),un}else return D}var De=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,ee="".match(/(){0}/)[1]===void 0;function fe(D){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M={},B=k.iri!==!1?h:d;k.reference==="suffix"&&(D=(k.scheme?k.scheme+":":"")+"//"+D);var q=D.match(De);if(q){ee?(M.scheme=q[1],M.userinfo=q[3],M.host=q[4],M.port=parseInt(q[5],10),M.path=q[6]||"",M.query=q[7],M.fragment=q[8],isNaN(M.port)&&(M.port=q[5])):(M.scheme=q[1]||void 0,M.userinfo=D.indexOf("@")!==-1?q[3]:void 0,M.host=D.indexOf("//")!==-1?q[4]:void 0,M.port=parseInt(q[5],10),M.path=q[6]||"",M.query=D.indexOf("?")!==-1?q[7]:void 0,M.fragment=D.indexOf("#")!==-1?q[8]:void 0,isNaN(M.port)&&(M.port=D.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?q[4]:void 0)),M.host&&(M.host=ke(we(M.host,B),B)),M.scheme===void 0&&M.userinfo===void 0&&M.host===void 0&&M.port===void 0&&!M.path&&M.query===void 0?M.reference="same-document":M.scheme===void 0?M.reference="relative":M.fragment===void 0?M.reference="absolute":M.reference="uri",k.reference&&k.reference!=="suffix"&&k.reference!==M.reference&&(M.error=M.error||"URI is not a "+k.reference+" reference.");var xe=Z[(k.scheme||M.scheme||"").toLowerCase()];if(!k.unicodeSupport&&(!xe||!xe.unicodeSupport)){if(M.host&&(k.domainHost||xe&&xe.domainHost))try{M.host=oe.toASCII(M.host.replace(B.PCT_ENCODED,Ee).toLowerCase())}catch(be){M.error=M.error||"Host's domain name can not be converted to ASCII via punycode: "+be}ve(M,d)}else ve(M,B);xe&&xe.parse&&xe.parse(M,k)}else M.error=M.error||"URI can not be parsed.";return M}function X(D,k){var M=k.iri!==!1?h:d,B=[];return D.userinfo!==void 0&&(B.push(D.userinfo),B.push("@")),D.host!==void 0&&B.push(ke(we(String(D.host),M),M).replace(M.IPV6ADDRESS,function(q,xe,be){return"["+xe+(be?"%25"+be:"")+"]"})),(typeof D.port=="number"||typeof D.port=="string")&&(B.push(":"),B.push(String(D.port))),B.length?B.join(""):void 0}var ze=/^\.\.?\//,re=/^\/\.(\/|$)/,Me=/^\/\.\.(\/|$)/,Ue=/^\/?(?:.|\n)*?(?=\/|$)/;function Ne(D){for(var k=[];D.length;)if(D.match(ze))D=D.replace(ze,"");else if(D.match(re))D=D.replace(re,"/");else if(D.match(Me))D=D.replace(Me,"/"),k.pop();else if(D==="."||D==="..")D="";else{var M=D.match(Ue);if(M){var B=M[0];D=D.slice(B.length),k.push(B)}else throw new Error("Unexpected dot segment condition")}return k.join("")}function rt(D){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M=k.iri?h:d,B=[],q=Z[(k.scheme||D.scheme||"").toLowerCase()];if(q&&q.serialize&&q.serialize(D,k),D.host&&!M.IPV6ADDRESS.test(D.host)){if(k.domainHost||q&&q.domainHost)try{D.host=k.iri?oe.toUnicode(D.host):oe.toASCII(D.host.replace(M.PCT_ENCODED,Ee).toLowerCase())}catch(Qe){D.error=D.error||"Host's domain name can not be converted to "+(k.iri?"Unicode":"ASCII")+" via punycode: "+Qe}}ve(D,M),k.reference!=="suffix"&&D.scheme&&(B.push(D.scheme),B.push(":"));var xe=X(D,k);if(xe!==void 0&&(k.reference!=="suffix"&&B.push("//"),B.push(xe),D.path&&D.path.charAt(0)!=="/"&&B.push("/")),D.path!==void 0){var be=D.path;!k.absolutePath&&(!q||!q.absolutePath)&&(be=Ne(be)),xe===void 0&&(be=be.replace(/^\/\//,"/%2F")),B.push(be)}return D.query!==void 0&&(B.push("?"),B.push(D.query)),D.fragment!==void 0&&(B.push("#"),B.push(D.fragment)),B.join("")}function pt(D,k){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},B=arguments[3],q={};return B||(D=fe(rt(D,M),M),k=fe(rt(k,M),M)),M=M||{},!M.tolerant&&k.scheme?(q.scheme=k.scheme,q.userinfo=k.userinfo,q.host=k.host,q.port=k.port,q.path=Ne(k.path||""),q.query=k.query):(k.userinfo!==void 0||k.host!==void 0||k.port!==void 0?(q.userinfo=k.userinfo,q.host=k.host,q.port=k.port,q.path=Ne(k.path||""),q.query=k.query):(k.path?(k.path.charAt(0)==="/"?q.path=Ne(k.path):((D.userinfo!==void 0||D.host!==void 0||D.port!==void 0)&&!D.path?q.path="/"+k.path:D.path?q.path=D.path.slice(0,D.path.lastIndexOf("/")+1)+k.path:q.path=k.path,q.path=Ne(q.path)),q.query=k.query):(q.path=D.path,k.query!==void 0?q.query=k.query:q.query=D.query),q.userinfo=D.userinfo,q.host=D.host,q.port=D.port),q.scheme=D.scheme),q.fragment=k.fragment,q}function qr(D,k,M){var B=c({scheme:"null"},M);return rt(pt(fe(D,B),fe(k,B),B,!0),B)}function zt(D,k){return typeof D=="string"?D=rt(fe(D,k),k):a(D)==="object"&&(D=fe(rt(D,k),k)),D}function hs(D,k,M){return typeof D=="string"?D=rt(fe(D,M),M):a(D)==="object"&&(D=rt(D,M)),typeof k=="string"?k=rt(fe(k,M),M):a(k)==="object"&&(k=rt(k,M)),D===k}function oo(D,k){return D&&D.toString().replace(!k||!k.iri?d.ESCAPE:h.ESCAPE,ce)}function Yt(D,k){return D&&D.toString().replace(!k||!k.iri?d.PCT_ENCODED:h.PCT_ENCODED,Ee)}var Br={scheme:"http",domainHost:!0,parse:function(k,M){return k.host||(k.error=k.error||"HTTP URIs must have a host."),k},serialize:function(k,M){var B=String(k.scheme).toLowerCase()==="https";return(k.port===(B?443:80)||k.port==="")&&(k.port=void 0),k.path||(k.path="/"),k}},ps={scheme:"https",domainHost:Br.domainHost,parse:Br.parse,serialize:Br.serialize};function jr(D){return typeof D.secure=="boolean"?D.secure:String(D.scheme).toLowerCase()==="wss"}var Dn={scheme:"ws",domainHost:!0,parse:function(k,M){var B=k;return B.secure=jr(B),B.resourceName=(B.path||"/")+(B.query?"?"+B.query:""),B.path=void 0,B.query=void 0,B},serialize:function(k,M){if((k.port===(jr(k)?443:80)||k.port==="")&&(k.port=void 0),typeof k.secure=="boolean"&&(k.scheme=k.secure?"wss":"ws",k.secure=void 0),k.resourceName){var B=k.resourceName.split("?"),q=v(B,2),xe=q[0],be=q[1];k.path=xe&&xe!=="/"?xe:void 0,k.query=be,k.resourceName=void 0}return k.fragment=void 0,k}},ms={scheme:"wss",domainHost:Dn.domainHost,parse:Dn.parse,serialize:Dn.serialize},ya={},vs="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ne="[0-9A-Fa-f]",Et=n(n("%[EFef]"+ne+"%"+ne+ne+"%"+ne+ne)+"|"+n("%[89A-Fa-f]"+ne+"%"+ne+ne)+"|"+n("%"+ne+ne)),Mn="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",$n="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Yl=s($n,'[\\"\\\\]'),Jl="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Xl=new RegExp(vs,"g"),de=new RegExp(Et,"g"),je=new RegExp(s("[^]",Mn,"[\\.]",'[\\"]',Yl),"g"),at=new RegExp(s("[^]",vs,Jl),"g"),Dt=at;function Nt(D){var k=Ee(D);return k.match(Xl)?k:D}var gg={scheme:"mailto",parse:function(k,M){var B=k,q=B.to=B.path?B.path.split(","):[];if(B.path=void 0,B.query){for(var xe=!1,be={},Qe=B.query.split("&"),ot=0,bt=Qe.length;ot<bt;++ot){var qe=Qe[ot].split("=");switch(qe[0]){case"to":for(var nt=qe[1].split(","),St=0,Re=nt.length;St<Re;++St)q.push(nt[St]);break;case"subject":B.subject=Yt(qe[1],M);break;case"body":B.body=Yt(qe[1],M);break;default:xe=!0,be[Yt(qe[0],M)]=Yt(qe[1],M);break}}xe&&(B.headers=be)}B.query=void 0;for(var ut=0,Ct=q.length;ut<Ct;++ut){var dt=q[ut].split("@");if(dt[0]=Yt(dt[0]),M.unicodeSupport)dt[1]=Yt(dt[1],M).toLowerCase();else try{dt[1]=oe.toASCII(Yt(dt[1],M).toLowerCase())}catch(gs){B.error=B.error||"Email address's domain name can not be converted to ASCII via punycode: "+gs}q[ut]=dt.join("@")}return B},serialize:function(k,M){var B=k,q=l(k.to);if(q){for(var xe=0,be=q.length;xe<be;++xe){var Qe=String(q[xe]),ot=Qe.lastIndexOf("@"),bt=Qe.slice(0,ot).replace(de,Nt).replace(de,o).replace(je,ce),qe=Qe.slice(ot+1);try{qe=M.iri?oe.toUnicode(qe):oe.toASCII(Yt(qe,M).toLowerCase())}catch(ut){B.error=B.error||"Email address's domain name can not be converted to "+(M.iri?"Unicode":"ASCII")+" via punycode: "+ut}q[xe]=bt+"@"+qe}B.path=q.join(",")}var nt=k.headers=k.headers||{};k.subject&&(nt.subject=k.subject),k.body&&(nt.body=k.body);var St=[];for(var Re in nt)nt[Re]!==ya[Re]&&St.push(Re.replace(de,Nt).replace(de,o).replace(at,ce)+"="+nt[Re].replace(de,Nt).replace(de,o).replace(Dt,ce));return St.length&&(B.query=St.join("&")),B}},TC=/^([^\:]+)\:(.*)/,yg={scheme:"urn",parse:function(k,M){var B=k.path&&k.path.match(TC),q=k;if(B){var xe=M.scheme||q.scheme||"urn",be=B[1].toLowerCase(),Qe=B[2],ot=xe+":"+(M.nid||be),bt=Z[ot];q.nid=be,q.nss=Qe,q.path=void 0,bt&&(q=bt.parse(q,M))}else q.error=q.error||"URN can not be parsed.";return q},serialize:function(k,M){var B=M.scheme||k.scheme||"urn",q=k.nid,xe=B+":"+(M.nid||q),be=Z[xe];be&&(k=be.serialize(k,M));var Qe=k,ot=k.nss;return Qe.path=(q||M.nid)+":"+ot,Qe}},AC=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,xg={scheme:"urn:uuid",parse:function(k,M){var B=k;return B.uuid=B.nss,B.nss=void 0,!M.tolerant&&(!B.uuid||!B.uuid.match(AC))&&(B.error=B.error||"UUID is not valid."),B},serialize:function(k,M){var B=k;return B.nss=(k.uuid||"").toLowerCase(),B}};Z[Br.scheme]=Br,Z[ps.scheme]=ps,Z[Dn.scheme]=Dn,Z[ms.scheme]=ms,Z[gg.scheme]=gg,Z[yg.scheme]=yg,Z[xg.scheme]=xg,r.SCHEMES=Z,r.pctEncChar=ce,r.pctDecChars=Ee,r.parse=fe,r.removeDotSegments=Ne,r.serialize=rt,r.resolveComponents=pt,r.resolve=qr,r.normalize=zt,r.equal=hs,r.escapeComponent=oo,r.unescapeComponent=Yt,Object.defineProperty(r,"__esModule",{value:!0})})})(lm,lm.exports);var lM=lm.exports,lg=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var s,n,a;if(Array.isArray(e)){if(s=e.length,s!=r.length)return!1;for(n=s;n--!==0;)if(!t(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(a=Object.keys(e),s=a.length,s!==Object.keys(r).length)return!1;for(n=s;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[n]))return!1;for(n=s;n--!==0;){var o=a[n];if(!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r},cM=function(e){for(var r=0,s=e.length,n=0,a;n<s;)r++,a=e.charCodeAt(n++),a>=55296&&a<=56319&&n<s&&(a=e.charCodeAt(n),(a&64512)==56320&&n++);return r},ki={copy:uM,checkDataType:cm,checkDataTypes:dM,coerceToTypes:fM,toHash:cg,getProperty:ug,escapeQuotes:dg,equal:lg,ucs2length:cM,varOccurences:mM,varReplace:vM,schemaHasRules:gM,schemaHasRulesExcept:yM,schemaUnknownRules:xM,toQuotedString:um,getPathExpr:wM,getPath:bM,getData:EM,unescapeFragment:CM,unescapeJsonPointer:hg,escapeFragment:PM,escapeJsonPointer:fg};function uM(t,e){e=e||{};for(var r in t)e[r]=t[r];return e}function cm(t,e,r,s){var n=s?" !== ":" === ",a=s?" || ":" && ",o=s?"!":"",l=s?"":"!";switch(t){case"null":return e+n+"null";case"array":return o+"Array.isArray("+e+")";case"object":return"("+o+e+a+"typeof "+e+n+'"object"'+a+l+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+n+'"number"'+a+l+"("+e+" % 1)"+a+e+n+e+(r?a+o+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+n+'"'+t+'"'+(r?a+o+"isFinite("+e+")":"")+")";default:return"typeof "+e+n+'"'+t+'"'}}function dM(t,e,r){switch(t.length){case 1:return cm(t[0],e,r,!0);default:var s="",n=cg(t);n.array&&n.object&&(s=n.null?"(":"(!"+e+" || ",s+="typeof "+e+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer;for(var a in n)s+=(s?" && ":"")+cm(a,e,r,!0);return s}}var G0=cg(["string","number","integer","boolean","null"]);function fM(t,e){if(Array.isArray(e)){for(var r=[],s=0;s<e.length;s++){var n=e[s];(G0[n]||t==="array"&&n==="array")&&(r[r.length]=n)}if(r.length)return r}else{if(G0[e])return[e];if(t==="array"&&e==="array")return["array"]}}function cg(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!0;return e}var hM=/^[a-z$_][a-z$_0-9]*$/i,pM=/'|\\/g;function ug(t){return typeof t=="number"?"["+t+"]":hM.test(t)?"."+t:"['"+dg(t)+"']"}function dg(t){return t.replace(pM,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function mM(t,e){e+="[^0-9]";var r=t.match(new RegExp(e,"g"));return r?r.length:0}function vM(t,e,r){return e+="([^0-9])",r=r.replace(/\$/g,"$$$$"),t.replace(new RegExp(e,"g"),r+"$1")}function gM(t,e){if(typeof t=="boolean")return!t;for(var r in t)if(e[r])return!0}function yM(t,e,r){if(typeof t=="boolean")return!t&&r!="not";for(var s in t)if(s!=r&&e[s])return!0}function xM(t,e){if(typeof t!="boolean"){for(var r in t)if(!e[r])return r}}function um(t){return"'"+dg(t)+"'"}function wM(t,e,r,s){var n=r?"'/' + "+e+(s?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):s?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return rC(t,n)}function bM(t,e,r){var s=um(r?"/"+fg(e):ug(e));return rC(t,s)}var SM=/^\/(?:[^~]|~0|~1)*$/,_M=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function EM(t,e,r){var s,n,a,o;if(t==="")return"rootData";if(t[0]=="/"){if(!SM.test(t))throw new Error("Invalid JSON-pointer: "+t);n=t,a="rootData"}else{if(o=t.match(_M),!o)throw new Error("Invalid JSON-pointer: "+t);if(s=+o[1],n=o[2],n=="#"){if(s>=e)throw new Error("Cannot access property/index "+s+" levels up, current level is "+e);return r[e-s]}if(s>e)throw new Error("Cannot access data "+s+" levels up, current level is "+e);if(a="data"+(e-s||""),!n)return a}for(var l=a,c=n.split("/"),u=0;u<c.length;u++){var d=c[u];d&&(a+=ug(hg(d)),l+=" && "+a)}return l}function rC(t,e){return t=='""'?e:(t+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function CM(t){return hg(decodeURIComponent(t))}function PM(t){return encodeURIComponent(fg(t))}function fg(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function hg(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}var kM=ki,nC=NM;function NM(t){kM.copy(t,this)}var sC={exports:{}},qs=sC.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var s=typeof r=="function"?r:r.pre||function(){},n=r.post||function(){};au(e,s,n,t,"",t)};qs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};qs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};qs.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};qs.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 au(t,e,r,s,n,a,o,l,c,u){if(s&&typeof s=="object"&&!Array.isArray(s)){e(s,n,a,o,l,c,u);for(var d in s){var h=s[d];if(Array.isArray(h)){if(d in qs.arrayKeywords)for(var v=0;v<h.length;v++)au(t,e,r,h[v],n+"/"+d+"/"+v,a,n,d,s,v)}else if(d in qs.propsKeywords){if(h&&typeof h=="object")for(var p in h)au(t,e,r,h[p],n+"/"+d+"/"+jM(p),a,n,d,s,p)}else(d in qs.keywords||t.allKeys&&!(d in qs.skipKeywords))&&au(t,e,r,h,n+"/"+d,a,n,d,s)}r(s,n,a,o,l,c,u)}}function jM(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}var RM=sC.exports,Zl=lM,Z0=lg,Yd=ki,nd=nC,TM=RM,pg=ga;ga.normalizeId=ra;ga.fullPath=sd;ga.url=ad;ga.ids=MM;ga.inlineRef=dm;ga.schema=Jd;function ga(t,e,r){var s=this._refs[r];if(typeof s=="string")if(this._refs[s])s=this._refs[s];else return ga.call(this,t,e,s);if(s=s||this._schemas[r],s instanceof nd)return dm(s.schema,this._opts.inlineRefs)?s.schema:s.validate||this._compile(s);var n=Jd.call(this,e,r),a,o,l;return n&&(a=n.schema,e=n.root,l=n.baseId),a instanceof nd?o=a.validate||t.call(this,a.schema,e,void 0,l):a!==void 0&&(o=dm(a,this._opts.inlineRefs)?a:t.call(this,a,e,void 0,l)),o}function Jd(t,e){var r=Zl.parse(e),s=oC(r),n=sd(this._getId(t.schema));if(Object.keys(t.schema).length===0||s!==n){var a=ra(s),o=this._refs[a];if(typeof o=="string")return AM.call(this,t,o,r);if(o instanceof nd)o.validate||this._compile(o),t=o;else if(o=this._schemas[a],o instanceof nd){if(o.validate||this._compile(o),a==ra(e))return{schema:o,root:t,baseId:n};t=o}else return;if(!t.schema)return;n=sd(this._getId(t.schema))}return aC.call(this,r,n,t.schema,t)}function AM(t,e,r){var s=Jd.call(this,t,e);if(s){var n=s.schema,a=s.baseId;t=s.root;var o=this._getId(n);return o&&(a=ad(a,o)),aC.call(this,r,a,n,t)}}var OM=Yd.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function aC(t,e,r,s){if(t.fragment=t.fragment||"",t.fragment.slice(0,1)=="/"){for(var n=t.fragment.split("/"),a=1;a<n.length;a++){var o=n[a];if(o){if(o=Yd.unescapeFragment(o),r=r[o],r===void 0)break;var l;if(!OM[o]&&(l=this._getId(r),l&&(e=ad(e,l)),r.$ref)){var c=ad(e,r.$ref),u=Jd.call(this,s,c);u&&(r=u.schema,s=u.root,e=u.baseId)}}}if(r!==void 0&&r!==s.schema)return{schema:r,root:s,baseId:e}}}var IM=Yd.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function dm(t,e){if(e===!1)return!1;if(e===void 0||e===!0)return fm(t);if(e)return hm(t)<=e}function fm(t){var e;if(Array.isArray(t)){for(var r=0;r<t.length;r++)if(e=t[r],typeof e=="object"&&!fm(e))return!1}else for(var s in t)if(s=="$ref"||(e=t[s],typeof e=="object"&&!fm(e)))return!1;return!0}function hm(t){var e=0,r;if(Array.isArray(t)){for(var s=0;s<t.length;s++)if(r=t[s],typeof r=="object"&&(e+=hm(r)),e==1/0)return 1/0}else for(var n in t){if(n=="$ref")return 1/0;if(IM[n])e++;else if(r=t[n],typeof r=="object"&&(e+=hm(r)+1),e==1/0)return 1/0}return e}function sd(t,e){e!==!1&&(t=ra(t));var r=Zl.parse(t);return oC(r)}function oC(t){return Zl.serialize(t).split("#")[0]+"#"}var DM=/#\/?$/;function ra(t){return t?t.replace(DM,""):""}function ad(t,e){return e=ra(e),Zl.resolve(t,e)}function MM(t){var e=ra(this._getId(t)),r={"":e},s={"":sd(e,!1)},n={},a=this;return TM(t,{allKeys:!0},function(o,l,c,u,d,h,v){if(l!==""){var p=a._getId(o),w=r[u],f=s[u]+"/"+d;if(v!==void 0&&(f+="/"+(typeof v=="number"?v:Yd.escapeFragment(v))),typeof p=="string"){p=w=ra(w?Zl.resolve(w,p):p);var m=a._refs[p];if(typeof m=="string"&&(m=a._refs[m]),m&&m.schema){if(!Z0(o,m.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=ra(f))if(p[0]=="#"){if(n[p]&&!Z0(o,n[p]))throw new Error('id "'+p+'" resolves to more than one schema');n[p]=o}else a._refs[p]=f}r[l]=w,s[l]=f}}),n}var eh=pg,mg={Validation:Y0($M),MissingRef:Y0(vg)};function $M(t){this.message="validation failed",this.errors=t,this.ajv=this.validation=!0}vg.message=function(t,e){return"can't resolve reference "+e+" from id "+t};function vg(t,e,r){this.message=r||vg.message(t,e),this.missingRef=eh.url(t,e),this.missingSchema=eh.normalizeId(eh.fullPath(this.missingRef))}function Y0(t){return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var iC=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,s=e.cmp&&function(a){return function(o){return function(l,c){var u={key:l,value:o[l]},d={key:c,value:o[c]};return a(u,d)}}}(e.cmp),n=[];return function a(o){if(o&&o.toJSON&&typeof o.toJSON=="function"&&(o=o.toJSON()),o!==void 0){if(typeof o=="number")return isFinite(o)?""+o:"null";if(typeof o!="object")return JSON.stringify(o);var l,c;if(Array.isArray(o)){for(c="[",l=0;l<o.length;l++)l&&(c+=","),c+=a(o[l])||"null";return c+"]"}if(o===null)return"null";if(n.indexOf(o)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var u=n.push(o)-1,d=Object.keys(o).sort(s&&s(o));for(c="",l=0;l<d.length;l++){var h=d[l],v=a(o[h]);v&&(c&&(c+=","),c+=JSON.stringify(h)+":"+v)}return n.splice(u,1),"{"+c+"}"}}(t)},lC=function(e,r,s){var n="",a=e.schema.$async===!0,o=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),l=e.self._getId(e.schema);if(e.opts.strictKeywords){var c=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(c){var u="unknown keyword: "+c;if(e.opts.strictKeywords==="log")e.logger.warn(u);else throw new Error(u)}}if(e.isTop&&(n+=" var validate = ",a&&(e.async=!0,n+="async "),n+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",l&&(e.opts.sourceCode||e.opts.processCode)&&(n+=" "+("/*# sourceURL="+l+" */")+" ")),typeof e.schema=="boolean"||!(o||e.schema.$ref)){var r="false schema",d=e.level,h=e.dataLevel,v=e.schema[r],p=e.schemaPath+e.util.getProperty(r),w=e.errSchemaPath+"/"+r,E=!e.opts.allErrors,T,f="data"+(h||""),S="valid"+d;if(e.schema===!1){e.isTop?E=!0:n+=" var "+S+" = false; ";var m=m||[];m.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(T||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: 'boolean schema is false' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var g=n;n=m.pop(),!e.compositeRule&&E?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?a?n+=" return data; ":n+=" validate.errors = null; return true; ":n+=" var "+S+" = true; ";return e.isTop&&(n+=" }; return validate; "),n}if(e.isTop){var y=e.isTop,d=e.level=0,h=e.dataLevel=0,f="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var b="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(b);else throw new Error(b)}n+=" var vErrors = null; ",n+=" var errors = 0; ",n+=" if (rootData === undefined) rootData = data; "}else{var d=e.level,h=e.dataLevel,f="data"+(h||"");if(l&&(e.baseId=e.resolve.url(e.baseId,l)),a&&!e.async)throw new Error("async schema in sync schema");n+=" var errs_"+d+" = errors;"}var S="valid"+d,E=!e.opts.allErrors,P="",R="",T,N=e.schema.type,O=Array.isArray(N);if(N&&e.opts.nullable&&e.schema.nullable===!0&&(O?N.indexOf("null")==-1&&(N=N.concat("null")):N!="null"&&(N=[N,"null"],O=!0)),O&&N.length==1&&(N=N[0],O=!1),e.schema.$ref&&o){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(o=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(n+=" "+e.RULES.all.$comment.code(e,"$comment")),N){if(e.opts.coerceTypes)var j=e.util.coerceToTypes(e.opts.coerceTypes,N);var _=e.RULES.types[N];if(j||O||_===!0||_&&!re(_)){var p=e.schemaPath+".type",w=e.errSchemaPath+"/type",p=e.schemaPath+".type",w=e.errSchemaPath+"/type",A=O?"checkDataTypes":"checkDataType";if(n+=" if ("+e.util[A](N,f,e.opts.strictNumbers,!0)+") { ",j){var C="dataType"+d,z="coerced"+d;n+=" var "+C+" = typeof "+f+"; var "+z+" = undefined; ",e.opts.coerceTypes=="array"&&(n+=" if ("+C+" == 'object' && Array.isArray("+f+") && "+f+".length == 1) { "+f+" = "+f+"[0]; "+C+" = typeof "+f+"; if ("+e.util.checkDataType(e.schema.type,f,e.opts.strictNumbers)+") "+z+" = "+f+"; } "),n+=" if ("+z+" !== undefined) ; ";var U=j;if(U)for(var K,$=-1,F=U.length-1;$<F;)K=U[$+=1],K=="string"?n+=" else if ("+C+" == 'number' || "+C+" == 'boolean') "+z+" = '' + "+f+"; else if ("+f+" === null) "+z+" = ''; ":K=="number"||K=="integer"?(n+=" else if ("+C+" == 'boolean' || "+f+" === null || ("+C+" == 'string' && "+f+" && "+f+" == +"+f+" ",K=="integer"&&(n+=" && !("+f+" % 1)"),n+=")) "+z+" = +"+f+"; "):K=="boolean"?n+=" else if ("+f+" === 'false' || "+f+" === 0 || "+f+" === null) "+z+" = false; else if ("+f+" === 'true' || "+f+" === 1) "+z+" = true; ":K=="null"?n+=" else if ("+f+" === '' || "+f+" === 0 || "+f+" === false) "+z+" = null; ":e.opts.coerceTypes=="array"&&K=="array"&&(n+=" else if ("+C+" == 'string' || "+C+" == 'number' || "+C+" == 'boolean' || "+f+" == null) "+z+" = ["+f+"]; ");n+=" else { ";var m=m||[];m.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(T||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",O?n+=""+N.join(","):n+=""+N,n+="' } ",e.opts.messages!==!1&&(n+=" , message: 'should be ",O?n+=""+N.join(","):n+=""+N,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var g=n;n=m.pop(),!e.compositeRule&&E?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } if ("+z+" !== undefined) { ";var V=h?"data"+(h-1||""):"parentData",ae=h?e.dataPathArr[h]:"parentDataProperty";n+=" "+f+" = "+z+"; ",h||(n+="if ("+V+" !== undefined)"),n+=" "+V+"["+ae+"] = "+z+"; } "}else{var m=m||[];m.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(T||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",O?n+=""+N.join(","):n+=""+N,n+="' } ",e.opts.messages!==!1&&(n+=" , message: 'should be ",O?n+=""+N.join(","):n+=""+N,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var g=n;n=m.pop(),!e.compositeRule&&E?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}n+=" } "}}if(e.schema.$ref&&!o)n+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",E&&(n+=" } if (errors === ",y?n+="0":n+="errs_"+d,n+=") { ",R+="}");else{var se=e.RULES;if(se){for(var _,W=-1,L=se.length-1;W<L;)if(_=se[W+=1],re(_)){if(_.type&&(n+=" if ("+e.util.checkDataType(_.type,f,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(_.type=="object"&&e.schema.properties){var v=e.schema.properties,Q=Object.keys(v),oe=Q;if(oe)for(var Z,ce=-1,Ee=oe.length-1;ce<Ee;){Z=oe[ce+=1];var ve=v[Z];if(ve.default!==void 0){var te=f+e.util.getProperty(Z);if(e.compositeRule){if(e.opts.strictDefaults){var b="default is ignored for: "+te;if(e.opts.strictDefaults==="log")e.logger.warn(b);else throw new Error(b)}}else n+=" if ("+te+" === undefined ",e.opts.useDefaults=="empty"&&(n+=" || "+te+" === null || "+te+" === '' "),n+=" ) "+te+" = ",e.opts.useDefaults=="shared"?n+=" "+e.useDefault(ve.default)+" ":n+=" "+JSON.stringify(ve.default)+" ",n+="; "}}}else if(_.type=="array"&&Array.isArray(e.schema.items)){var we=e.schema.items;if(we){for(var ve,$=-1,ke=we.length-1;$<ke;)if(ve=we[$+=1],ve.default!==void 0){var te=f+"["+$+"]";if(e.compositeRule){if(e.opts.strictDefaults){var b="default is ignored for: "+te;if(e.opts.strictDefaults==="log")e.logger.warn(b);else throw new Error(b)}}else n+=" if ("+te+" === undefined ",e.opts.useDefaults=="empty"&&(n+=" || "+te+" === null || "+te+" === '' "),n+=" ) "+te+" = ",e.opts.useDefaults=="shared"?n+=" "+e.useDefault(ve.default)+" ":n+=" "+JSON.stringify(ve.default)+" ",n+="; "}}}}var De=_.rules;if(De){for(var ee,fe=-1,X=De.length-1;fe<X;)if(ee=De[fe+=1],Me(ee)){var ze=ee.code(e,ee.keyword,_.type);ze&&(n+=" "+ze+" ",E&&(P+="}"))}}if(E&&(n+=" "+P+" ",P=""),_.type&&(n+=" } ",N&&N===_.type&&!j)){n+=" else { ";var p=e.schemaPath+".type",w=e.errSchemaPath+"/type",m=m||[];m.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(T||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(w)+" , params: { type: '",O?n+=""+N.join(","):n+=""+N,n+="' } ",e.opts.messages!==!1&&(n+=" , message: 'should be ",O?n+=""+N.join(","):n+=""+N,n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var g=n;n=m.pop(),!e.compositeRule&&E?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } "}E&&(n+=" if (errors === ",y?n+="0":n+="errs_"+d,n+=") { ",R+="}")}}}E&&(n+=" "+R+" "),y?(a?(n+=" if (errors === 0) return data; ",n+=" else throw new ValidationError(vErrors); "):(n+=" validate.errors = vErrors; ",n+=" return errors === 0; "),n+=" }; return validate;"):n+=" var "+S+" = errors === errs_"+d+";";function re(Ne){for(var rt=Ne.rules,pt=0;pt<rt.length;pt++)if(Me(rt[pt]))return!0}function Me(Ne){return e.schema[Ne.keyword]!==void 0||Ne.implements&&Ue(Ne)}function Ue(Ne){for(var rt=Ne.implements,pt=0;pt<rt.length;pt++)if(e.schema[rt[pt]]!==void 0)return!0}return n},Oc=pg,od=ki,cC=mg,FM=iC,J0=lC,LM=od.ucs2length,UM=lg,zM=cC.Validation,VM=pm;function pm(t,e,r,s){var n=this,a=this._opts,o=[void 0],l={},c=[],u={},d=[],h={},v=[];e=e||{schema:t,refVal:o,refs:l};var p=HM.call(this,t,e,s),w=this._compilations[p.index];if(p.compiling)return w.callValidate=b;var f=this._formats,m=this.RULES;try{var g=S(t,e,r,s);w.validate=g;var y=w.callValidate;return y&&(y.schema=g.schema,y.errors=null,y.refs=g.refs,y.refVal=g.refVal,y.root=g.root,y.$async=g.$async,a.sourceCode&&(y.source=g.source)),g}finally{qM.call(this,t,e,s)}function b(){var A=w.validate,C=A.apply(this,arguments);return b.errors=A.errors,C}function S(A,C,z,U){var K=!C||C&&C.schema==A;if(C.schema!=e.schema)return pm.call(n,A,C,z,U);var $=A.$async===!0,F=J0({isTop:!0,schema:A,isRoot:K,baseId:U,root:C,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:cC.MissingRef,RULES:m,validate:J0,util:od,resolve:Oc,resolveRef:E,usePattern:O,useDefault:j,useCustomRule:_,opts:a,formats:f,logger:n.logger,self:n});F=Ic(o,KM)+Ic(c,BM)+Ic(d,WM)+Ic(v,QM)+F,a.processCode&&(F=a.processCode(F,A));var V;try{var ae=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",F);V=ae(n,m,f,e,o,d,v,UM,LM,zM),o[0]=V}catch(se){throw n.logger.error("Error compiling schema, function code:",F),se}return V.schema=A,V.errors=null,V.refs=l,V.refVal=o,V.root=K?V:C,$&&(V.$async=!0),a.sourceCode===!0&&(V.source={code:F,patterns:c,defaults:d}),V}function E(A,C,z){C=Oc.url(A,C);var U=l[C],K,$;if(U!==void 0)return K=o[U],$="refVal["+U+"]",N(K,$);if(!z&&e.refs){var F=e.refs[C];if(F!==void 0)return K=e.refVal[F],$=P(C,K),N(K,$)}$=P(C);var V=Oc.call(n,S,e,C);if(V===void 0){var ae=r&&r[C];ae&&(V=Oc.inlineRef(ae,a.inlineRefs)?ae:pm.call(n,ae,e,r,A))}if(V===void 0)R(C);else return T(C,V),N(V,$)}function P(A,C){var z=o.length;return o[z]=C,l[A]=z,"refVal"+z}function R(A){delete l[A]}function T(A,C){var z=l[A];o[z]=C}function N(A,C){return typeof A=="object"||typeof A=="boolean"?{code:C,schema:A,inline:!0}:{code:C,$async:A&&!!A.$async}}function O(A){var C=u[A];return C===void 0&&(C=u[A]=c.length,c[C]=A),"pattern"+C}function j(A){switch(typeof A){case"boolean":case"number":return""+A;case"string":return od.toQuotedString(A);case"object":if(A===null)return"null";var C=FM(A),z=h[C];return z===void 0&&(z=h[C]=d.length,d[z]=A),"default"+z}}function _(A,C,z,U){if(n._opts.validateSchema!==!1){var K=A.definition.dependencies;if(K&&!K.every(function(oe){return Object.prototype.hasOwnProperty.call(z,oe)}))throw new Error("parent schema must have all required keywords: "+K.join(","));var $=A.definition.validateSchema;if($){var F=$(C);if(!F){var V="keyword schema is invalid: "+n.errorsText($.errors);if(n._opts.validateSchema=="log")n.logger.error(V);else throw new Error(V)}}}var ae=A.definition.compile,se=A.definition.inline,W=A.definition.macro,L;if(ae)L=ae.call(n,C,z,U);else if(W)L=W.call(n,C,z,U),a.validateSchema!==!1&&n.validateSchema(L,!0);else if(se)L=se.call(n,U,A.keyword,C,z);else if(L=A.definition.validate,!L)return;if(L===void 0)throw new Error('custom keyword "'+A.keyword+'"failed to compile');var Q=v.length;return v[Q]=L,{code:"customRule"+Q,validate:L}}}function HM(t,e,r){var s=uC.call(this,t,e,r);return s>=0?{index:s,compiling:!0}:(s=this._compilations.length,this._compilations[s]={schema:t,root:e,baseId:r},{index:s,compiling:!1})}function qM(t,e,r){var s=uC.call(this,t,e,r);s>=0&&this._compilations.splice(s,1)}function uC(t,e,r){for(var s=0;s<this._compilations.length;s++){var n=this._compilations[s];if(n.schema==t&&n.root==e&&n.baseId==r)return s}return-1}function BM(t,e){return"var pattern"+t+" = new RegExp("+od.toQuotedString(e[t])+");"}function WM(t){return"var default"+t+" = defaults["+t+"];"}function KM(t,e){return e[t]===void 0?"":"var refVal"+t+" = refVal["+t+"];"}function QM(t){return"var customRule"+t+" = customRules["+t+"];"}function Ic(t,e){if(!t.length)return"";for(var r="",s=0;s<t.length;s++)r+=e(s,t);return r}var dC={exports:{}},Xd=dC.exports=function(){this._cache={}};Xd.prototype.put=function(e,r){this._cache[e]=r};Xd.prototype.get=function(e){return this._cache[e]};Xd.prototype.del=function(e){delete this._cache[e]};Xd.prototype.clear=function(){this._cache={}};var GM=dC.exports,ZM=ki,YM=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,JM=[0,31,28,31,30,31,30,31,31,30,31,30,31],XM=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,fC=/^(?=.{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,e$=/^(?:[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,t$=/^(?:[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,hC=/^(?:(?:[^\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,pC=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,mC=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,vC=/^(?:\/(?:[^~/]|~0|~1)*)*$/,gC=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,yC=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,r$=ef;function ef(t){return t=t=="full"?"full":"fast",ZM.copy(ef[t])}ef.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\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,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":hC,url:pC,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,hostname:fC,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:bC,uuid:mC,"json-pointer":vC,"json-pointer-uri-fragment":gC,"relative-json-pointer":yC};ef.full={date:xC,time:wC,"date-time":a$,uri:i$,"uri-reference":t$,"uri-template":hC,url:pC,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:fC,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[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}))|:)))(?:%.+)?\s*$/i,regex:bC,uuid:mC,"json-pointer":vC,"json-pointer-uri-fragment":gC,"relative-json-pointer":yC};function n$(t){return t%4===0&&(t%100!==0||t%400===0)}function xC(t){var e=t.match(YM);if(!e)return!1;var r=+e[1],s=+e[2],n=+e[3];return s>=1&&s<=12&&n>=1&&n<=(s==2&&n$(r)?29:JM[s])}function wC(t,e){var r=t.match(XM);if(!r)return!1;var s=r[1],n=r[2],a=r[3],o=r[5];return(s<=23&&n<=59&&a<=59||s==23&&n==59&&a==60)&&(!e||o)}var s$=/t|\s/i;function a$(t){var e=t.split(s$);return e.length==2&&xC(e[0])&&wC(e[1],!0)}var o$=/\/|:/;function i$(t){return o$.test(t)&&e$.test(t)}var l$=/[^\\]\\Z/;function bC(t){if(l$.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}var c$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,d="data"+(o||""),h="valid"+a,v,p;if(l=="#"||l=="#/")e.isRoot?(v=e.async,p="validate"):(v=e.root.schema.$async===!0,p="root.refVal[0]");else{var w=e.resolveRef(e.baseId,l,e.isRoot);if(w===void 0){var f=e.MissingRefError.message(e.baseId,l);if(e.opts.missingRefs=="fail"){e.logger.error(f);var m=m||[];m.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",e.opts.messages!==!1&&(n+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(n+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),n+=" } "):n+=" {} ";var g=n;n=m.pop(),!e.compositeRule&&u?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(n+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(f),u&&(n+=" if (true) { ");else throw new e.MissingRefError(e.baseId,l,f)}else if(w.inline){var y=e.util.copy(e);y.level++;var b="valid"+y.level;y.schema=w.schema,y.schemaPath="",y.errSchemaPath=l;var S=e.validate(y).replace(/validate\.schema/g,w.code);n+=" "+S+" ",u&&(n+=" if ("+b+") { ")}else v=w.$async===!0||e.async&&w.$async!==!1,p=w.code}if(p){var m=m||[];m.push(n),n="",e.opts.passContext?n+=" "+p+".call(this, ":n+=" "+p+"( ",n+=" "+d+", (dataPath || '')",e.errorPath!='""'&&(n+=" + "+e.errorPath);var E=o?"data"+(o-1||""):"parentData",P=o?e.dataPathArr[o]:"parentDataProperty";n+=" , "+E+" , "+P+", rootData) ";var R=n;if(n=m.pop(),v){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(n+=" var "+h+"; "),n+=" try { await "+R+"; ",u&&(n+=" "+h+" = true; "),n+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(n+=" "+h+" = false; "),n+=" } ",u&&(n+=" if ("+h+") { ")}else n+=" if (!"+R+") { if (vErrors === null) vErrors = "+p+".errors; else vErrors = vErrors.concat("+p+".errors); errors = vErrors.length; } ",u&&(n+=" else { ")}return n},u$=function(e,r,s){var n=" ",a=e.schema[r],o=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u=e.util.copy(e),d="";u.level++;var h="valid"+u.level,v=u.baseId,p=!0,w=a;if(w)for(var f,m=-1,g=w.length-1;m<g;)f=w[m+=1],(e.opts.strictKeywords?typeof f=="object"&&Object.keys(f).length>0||f===!1:e.util.schemaHasRules(f,e.RULES.all))&&(p=!1,u.schema=f,u.schemaPath=o+"["+m+"]",u.errSchemaPath=l+"/"+m,n+=" "+e.validate(u)+" ",u.baseId=v,c&&(n+=" if ("+h+") { ",d+="}"));return c&&(p?n+=" if (true) { ":n+=" "+d.slice(0,-1)+" "),n},d$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="valid"+a,p="errs__"+a,w=e.util.copy(e),f="";w.level++;var m="valid"+w.level,g=l.every(function(T){return e.opts.strictKeywords?typeof T=="object"&&Object.keys(T).length>0||T===!1:e.util.schemaHasRules(T,e.RULES.all)});if(g){var y=w.baseId;n+=" var "+p+" = errors; var "+v+" = false; ";var b=e.compositeRule;e.compositeRule=w.compositeRule=!0;var S=l;if(S)for(var E,P=-1,R=S.length-1;P<R;)E=S[P+=1],w.schema=E,w.schemaPath=c+"["+P+"]",w.errSchemaPath=u+"/"+P,n+=" "+e.validate(w)+" ",w.baseId=y,n+=" "+v+" = "+v+" || "+m+"; if (!"+v+") { ",f+="}";e.compositeRule=w.compositeRule=b,n+=" "+f+" if (!"+v+") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else d&&(n+=" if (true) { ");return n},f$=function(e,r,s){var n=" ",a=e.schema[r],o=e.errSchemaPath+"/"+r;e.opts.allErrors;var l=e.util.toQuotedString(a);return e.opts.$comment===!0?n+=" console.log("+l+");":typeof e.opts.$comment=="function"&&(n+=" self._opts.$comment("+l+", "+e.util.toQuotedString(o)+", validate.root.schema);"),n},h$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="valid"+a,p=e.opts.$data&&l&&l.$data;p&&(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; "),p||(n+=" var schema"+a+" = validate.schema"+c+";"),n+="var "+v+" = equal("+h+", schema"+a+"); if (!"+v+") { ";var w=w||[];w.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+a+" } ",e.opts.messages!==!1&&(n+=" , message: 'should be equal to constant' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var f=n;return n=w.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+f+"]); ":n+=" validate.errors = ["+f+"]; return false; ":n+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",d&&(n+=" else { "),n},p$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="valid"+a,p="errs__"+a,w=e.util.copy(e),f="";w.level++;var m="valid"+w.level,g="i"+a,y=w.dataLevel=e.dataLevel+1,b="data"+y,S=e.baseId,E=e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all);if(n+="var "+p+" = errors;var "+v+";",E){var P=e.compositeRule;e.compositeRule=w.compositeRule=!0,w.schema=l,w.schemaPath=c,w.errSchemaPath=u,n+=" var "+m+" = false; for (var "+g+" = 0; "+g+" < "+h+".length; "+g+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);var R=h+"["+g+"]";w.dataPathArr[y]=g;var T=e.validate(w);w.baseId=S,e.util.varOccurences(T,b)<2?n+=" "+e.util.varReplace(T,b,R)+" ":n+=" var "+b+" = "+R+"; "+T+" ",n+=" if ("+m+") break; } ",e.compositeRule=w.compositeRule=P,n+=" "+f+" if (!"+m+") {"}else n+=" if ("+h+".length == 0) {";var N=N||[];N.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: 'should contain a valid item' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var O=n;return n=N.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+O+"]); ":n+=" validate.errors = ["+O+"]; return false; ":n+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { ",E&&(n+=" errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } "),e.opts.allErrors&&(n+=" } "),n},m$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="errs__"+a,p=e.util.copy(e),w="";p.level++;var f="valid"+p.level,m={},g={},y=e.opts.ownProperties;for(P in l)if(P!="__proto__"){var b=l[P],S=Array.isArray(b)?g:m;S[P]=b}n+="var "+v+" = errors;";var E=e.errorPath;n+="var missing"+a+";";for(var P in g)if(S=g[P],S.length){if(n+=" if ( "+h+e.util.getProperty(P)+" !== undefined ",y&&(n+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(P)+"') "),d){n+=" && ( ";var R=S;if(R)for(var T,N=-1,O=R.length-1;N<O;){T=R[N+=1],N&&(n+=" || ");var j=e.util.getProperty(T),_=h+j;n+=" ( ( "+_+" === undefined ",y&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(T)+"') "),n+=") && (missing"+a+" = "+e.util.toQuotedString(e.opts.jsonPointers?T:j)+") ) "}n+=")) { ";var A="missing"+a,C="' + "+A+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(E,A,!0):E+" + "+A);var z=z||[];z.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(P)+"', missingProperty: '"+C+"', depsCount: "+S.length+", deps: '"+e.util.escapeQuotes(S.length==1?S[0]:S.join(", "))+"' } ",e.opts.messages!==!1&&(n+=" , message: 'should have ",S.length==1?n+="property "+e.util.escapeQuotes(S[0]):n+="properties "+e.util.escapeQuotes(S.join(", ")),n+=" when property "+e.util.escapeQuotes(P)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var U=n;n=z.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+U+"]); ":n+=" validate.errors = ["+U+"]; return false; ":n+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{n+=" ) { ";var K=S;if(K)for(var T,$=-1,F=K.length-1;$<F;){T=K[$+=1];var j=e.util.getProperty(T),C=e.util.escapeQuotes(T),_=h+j;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(E,T,e.opts.jsonPointers)),n+=" if ( "+_+" === undefined ",y&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(T)+"') "),n+=") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(P)+"', missingProperty: '"+C+"', depsCount: "+S.length+", deps: '"+e.util.escapeQuotes(S.length==1?S[0]:S.join(", "))+"' } ",e.opts.messages!==!1&&(n+=" , message: 'should have ",S.length==1?n+="property "+e.util.escapeQuotes(S[0]):n+="properties "+e.util.escapeQuotes(S.join(", ")),n+=" when property "+e.util.escapeQuotes(P)+" is present' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}n+=" } ",d&&(w+="}",n+=" else { ")}e.errorPath=E;var V=p.baseId;for(var P in m){var b=m[P];(e.opts.strictKeywords?typeof b=="object"&&Object.keys(b).length>0||b===!1:e.util.schemaHasRules(b,e.RULES.all))&&(n+=" "+f+" = true; if ( "+h+e.util.getProperty(P)+" !== undefined ",y&&(n+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(P)+"') "),n+=") { ",p.schema=b,p.schemaPath=c+e.util.getProperty(P),p.errSchemaPath=u+"/"+e.util.escapeFragment(P),n+=" "+e.validate(p)+" ",p.baseId=V,n+=" } ",d&&(n+=" if ("+f+") { ",w+="}"))}return d&&(n+=" "+w+" if ("+v+" == errors) {"),n},v$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="valid"+a,p=e.opts.$data&&l&&l.$data;p&&(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ");var w="i"+a,f="schema"+a;p||(n+=" var "+f+" = validate.schema"+c+";"),n+="var "+v+";",p&&(n+=" if (schema"+a+" === undefined) "+v+" = true; else if (!Array.isArray(schema"+a+")) "+v+" = false; else {"),n+=""+v+" = false;for (var "+w+"=0; "+w+"<"+f+".length; "+w+"++) if (equal("+h+", "+f+"["+w+"])) { "+v+" = true; break; }",p&&(n+=" } "),n+=" if (!"+v+") { ";var m=m||[];m.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+a+" } ",e.opts.messages!==!1&&(n+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" }",d&&(n+=" else { "),n},g$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||"");if(e.opts.format===!1)return d&&(n+=" if (true) { "),n;var v=e.opts.$data&&l&&l.$data,p;v?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l;var w=e.opts.unknownFormats,f=Array.isArray(w);if(v){var m="format"+a,g="isObject"+a,y="formatType"+a;n+=" var "+m+" = formats["+p+"]; var "+g+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+y+" = "+g+" && "+m+".type || 'string'; if ("+g+") { ",e.async&&(n+=" var async"+a+" = "+m+".async; "),n+=" "+m+" = "+m+".validate; } if ( ",v&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'string') || "),n+=" (",w!="ignore"&&(n+=" ("+p+" && !"+m+" ",f&&(n+=" && self._opts.unknownFormats.indexOf("+p+") == -1 "),n+=") || "),n+=" ("+m+" && "+y+" == '"+s+"' && !(typeof "+m+" == 'function' ? ",e.async?n+=" (async"+a+" ? await "+m+"("+h+") : "+m+"("+h+")) ":n+=" "+m+"("+h+") ",n+=" : "+m+".test("+h+"))))) {"}else{var m=e.formats[l];if(!m){if(w=="ignore")return e.logger.warn('unknown format "'+l+'" ignored in schema at path "'+e.errSchemaPath+'"'),d&&(n+=" if (true) { "),n;if(f&&w.indexOf(l)>=0)return d&&(n+=" if (true) { "),n;throw new Error('unknown format "'+l+'" is used in schema at path "'+e.errSchemaPath+'"')}var g=typeof m=="object"&&!(m instanceof RegExp)&&m.validate,y=g&&m.type||"string";if(g){var b=m.async===!0;m=m.validate}if(y!=s)return d&&(n+=" if (true) { "),n;if(b){if(!e.async)throw new Error("async format in sync schema");var S="formats"+e.util.getProperty(l)+".validate";n+=" if (!(await "+S+"("+h+"))) { "}else{n+=" if (! ";var S="formats"+e.util.getProperty(l);g&&(S+=".validate"),typeof m=="function"?n+=" "+S+"("+h+") ":n+=" "+S+".test("+h+") ",n+=") { "}}var E=E||[];E.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",v?n+=""+p:n+=""+e.util.toQuotedString(l),n+=" } ",e.opts.messages!==!1&&(n+=` , message: 'should match format "`,v?n+="' + "+p+" + '":n+=""+e.util.escapeQuotes(l),n+=`"' `),e.opts.verbose&&(n+=" , schema: ",v?n+="validate.schema"+c:n+=""+e.util.toQuotedString(l),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var P=n;return n=E.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+P+"]); ":n+=" validate.errors = ["+P+"]; return false; ":n+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",d&&(n+=" else { "),n},y$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="valid"+a,p="errs__"+a,w=e.util.copy(e);w.level++;var f="valid"+w.level,m=e.schema.then,g=e.schema.else,y=m!==void 0&&(e.opts.strictKeywords?typeof m=="object"&&Object.keys(m).length>0||m===!1:e.util.schemaHasRules(m,e.RULES.all)),b=g!==void 0&&(e.opts.strictKeywords?typeof g=="object"&&Object.keys(g).length>0||g===!1:e.util.schemaHasRules(g,e.RULES.all)),S=w.baseId;if(y||b){var E;w.createErrors=!1,w.schema=l,w.schemaPath=c,w.errSchemaPath=u,n+=" var "+p+" = errors; var "+v+" = true; ";var P=e.compositeRule;e.compositeRule=w.compositeRule=!0,n+=" "+e.validate(w)+" ",w.baseId=S,w.createErrors=!0,n+=" errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.compositeRule=w.compositeRule=P,y?(n+=" if ("+f+") { ",w.schema=e.schema.then,w.schemaPath=e.schemaPath+".then",w.errSchemaPath=e.errSchemaPath+"/then",n+=" "+e.validate(w)+" ",w.baseId=S,n+=" "+v+" = "+f+"; ",y&&b?(E="ifClause"+a,n+=" var "+E+" = 'then'; "):E="'then'",n+=" } ",b&&(n+=" else { ")):n+=" if (!"+f+") { ",b&&(w.schema=e.schema.else,w.schemaPath=e.schemaPath+".else",w.errSchemaPath=e.errSchemaPath+"/else",n+=" "+e.validate(w)+" ",w.baseId=S,n+=" "+v+" = "+f+"; ",y&&b?(E="ifClause"+a,n+=" var "+E+" = 'else'; "):E="'else'",n+=" } "),n+=" if (!"+v+") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+E+" } ",e.opts.messages!==!1&&(n+=` , message: 'should match "' + `+E+` + '" schema' `),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+=" } ",d&&(n+=" else { ")}else d&&(n+=" if (true) { ");return n},x$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="valid"+a,p="errs__"+a,w=e.util.copy(e),f="";w.level++;var m="valid"+w.level,g="i"+a,y=w.dataLevel=e.dataLevel+1,b="data"+y,S=e.baseId;if(n+="var "+p+" = errors;var "+v+";",Array.isArray(l)){var E=e.schema.additionalItems;if(E===!1){n+=" "+v+" = "+h+".length <= "+l.length+"; ";var P=u;u=e.errSchemaPath+"/additionalItems",n+=" if (!"+v+") { ";var R=R||[];R.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+l.length+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have more than "+l.length+" items' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var T=n;n=R.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+T+"]); ":n+=" validate.errors = ["+T+"]; return false; ":n+=" var err = "+T+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",u=P,d&&(f+="}",n+=" else { ")}var N=l;if(N){for(var O,j=-1,_=N.length-1;j<_;)if(O=N[j+=1],e.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:e.util.schemaHasRules(O,e.RULES.all)){n+=" "+m+" = true; if ("+h+".length > "+j+") { ";var A=h+"["+j+"]";w.schema=O,w.schemaPath=c+"["+j+"]",w.errSchemaPath=u+"/"+j,w.errorPath=e.util.getPathExpr(e.errorPath,j,e.opts.jsonPointers,!0),w.dataPathArr[y]=j;var C=e.validate(w);w.baseId=S,e.util.varOccurences(C,b)<2?n+=" "+e.util.varReplace(C,b,A)+" ":n+=" var "+b+" = "+A+"; "+C+" ",n+=" } ",d&&(n+=" if ("+m+") { ",f+="}")}}if(typeof E=="object"&&(e.opts.strictKeywords?typeof E=="object"&&Object.keys(E).length>0||E===!1:e.util.schemaHasRules(E,e.RULES.all))){w.schema=E,w.schemaPath=e.schemaPath+".additionalItems",w.errSchemaPath=e.errSchemaPath+"/additionalItems",n+=" "+m+" = true; if ("+h+".length > "+l.length+") { for (var "+g+" = "+l.length+"; "+g+" < "+h+".length; "+g+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);var A=h+"["+g+"]";w.dataPathArr[y]=g;var C=e.validate(w);w.baseId=S,e.util.varOccurences(C,b)<2?n+=" "+e.util.varReplace(C,b,A)+" ":n+=" var "+b+" = "+A+"; "+C+" ",d&&(n+=" if (!"+m+") break; "),n+=" } } ",d&&(n+=" if ("+m+") { ",f+="}")}}else if(e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){w.schema=l,w.schemaPath=c,w.errSchemaPath=u,n+=" for (var "+g+" = 0; "+g+" < "+h+".length; "+g+"++) { ",w.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers,!0);var A=h+"["+g+"]";w.dataPathArr[y]=g;var C=e.validate(w);w.baseId=S,e.util.varOccurences(C,b)<2?n+=" "+e.util.varReplace(C,b,A)+" ":n+=" var "+b+" = "+A+"; "+C+" ",d&&(n+=" if (!"+m+") break; "),n+=" }"}return d&&(n+=" "+f+" if ("+p+" == errors) {"),n},X0=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,S,h="data"+(o||""),v=e.opts.$data&&l&&l.$data,p;v?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l;var w=r=="maximum",f=w?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[f],g=e.opts.$data&&m&&m.$data,y=w?"<":">",b=w?">":"<",S=void 0;if(!(v||typeof l=="number"||l===void 0))throw new Error(r+" must be number");if(!(g||m===void 0||typeof m=="number"||typeof m=="boolean"))throw new Error(f+" must be number or boolean");if(g){var E=e.util.getData(m.$data,o,e.dataPathArr),P="exclusive"+a,R="exclType"+a,T="exclIsNumber"+a,N="op"+a,O="' + "+N+" + '";n+=" var schemaExcl"+a+" = "+E+"; ",E="schemaExcl"+a,n+=" var "+P+"; var "+R+" = typeof "+E+"; if ("+R+" != 'boolean' && "+R+" != 'undefined' && "+R+" != 'number') { ";var S=f,j=j||[];j.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(S||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var _=n;n=j.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",v&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),n+=" "+R+" == 'number' ? ( ("+P+" = "+p+" === undefined || "+E+" "+y+"= "+p+") ? "+h+" "+b+"= "+E+" : "+h+" "+b+" "+p+" ) : ( ("+P+" = "+E+" === true) ? "+h+" "+b+"= "+p+" : "+h+" "+b+" "+p+" ) || "+h+" !== "+h+") { var op"+a+" = "+P+" ? '"+y+"' : '"+y+"='; ",l===void 0&&(S=f,u=e.errSchemaPath+"/"+f,p=E,v=g)}else{var T=typeof m=="number",O=y;if(T&&v){var N="'"+O+"'";n+=" if ( ",v&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),n+=" ( "+p+" === undefined || "+m+" "+y+"= "+p+" ? "+h+" "+b+"= "+m+" : "+h+" "+b+" "+p+" ) || "+h+" !== "+h+") { "}else{T&&l===void 0?(P=!0,S=f,u=e.errSchemaPath+"/"+f,p=m,b+="="):(T&&(p=Math[w?"min":"max"](m,l)),m===(T?p:!0)?(P=!0,S=f,u=e.errSchemaPath+"/"+f,b+="="):(P=!1,O+="="));var N="'"+O+"'";n+=" if ( ",v&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),n+=" "+h+" "+b+" "+p+" || "+h+" !== "+h+") { "}}S=S||r;var j=j||[];j.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(S||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+N+", limit: "+p+", exclusive: "+P+" } ",e.opts.messages!==!1&&(n+=" , message: 'should be "+O+" ",v?n+="' + "+p:n+=""+p+"'"),e.opts.verbose&&(n+=" , schema: ",v?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var _=n;return n=j.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",d&&(n+=" else { "),n},ex=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f,h="data"+(o||""),v=e.opts.$data&&l&&l.$data,p;if(v?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l,!(v||typeof l=="number"))throw new Error(r+" must be number");var w=r=="maxItems"?">":"<";n+="if ( ",v&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),n+=" "+h+".length "+w+" "+p+") { ";var f=r,m=m||[];m.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(f||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+p+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have ",r=="maxItems"?n+="more":n+="fewer",n+=" than ",v?n+="' + "+p+" + '":n+=""+l,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",v?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",d&&(n+=" else { "),n},tx=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f,h="data"+(o||""),v=e.opts.$data&&l&&l.$data,p;if(v?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l,!(v||typeof l=="number"))throw new Error(r+" must be number");var w=r=="maxLength"?">":"<";n+="if ( ",v&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),e.opts.unicode===!1?n+=" "+h+".length ":n+=" ucs2length("+h+") ",n+=" "+w+" "+p+") { ";var f=r,m=m||[];m.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(f||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+p+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT be ",r=="maxLength"?n+="longer":n+="shorter",n+=" than ",v?n+="' + "+p+" + '":n+=""+l,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",v?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",d&&(n+=" else { "),n},rx=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f,h="data"+(o||""),v=e.opts.$data&&l&&l.$data,p;if(v?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l,!(v||typeof l=="number"))throw new Error(r+" must be number");var w=r=="maxProperties"?">":"<";n+="if ( ",v&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'number') || "),n+=" Object.keys("+h+").length "+w+" "+p+") { ";var f=r,m=m||[];m.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(f||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+p+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have ",r=="maxProperties"?n+="more":n+="fewer",n+=" than ",v?n+="' + "+p+" + '":n+=""+l,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",v?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var g=n;return n=m.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",d&&(n+=" else { "),n},w$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v=e.opts.$data&&l&&l.$data,p;if(v?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l,!(v||typeof l=="number"))throw new Error(r+" must be number");n+="var division"+a+";if (",v&&(n+=" "+p+" !== undefined && ( typeof "+p+" != 'number' || "),n+=" (division"+a+" = "+h+" / "+p+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",v&&(n+=" ) "),n+=" ) { ";var w=w||[];w.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+p+" } ",e.opts.messages!==!1&&(n+=" , message: 'should be multiple of ",v?n+="' + "+p:n+=""+p+"'"),e.opts.verbose&&(n+=" , schema: ",v?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var f=n;return n=w.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+f+"]); ":n+=" validate.errors = ["+f+"]; return false; ":n+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",d&&(n+=" else { "),n},b$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="errs__"+a,p=e.util.copy(e);p.level++;var w="valid"+p.level;if(e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){p.schema=l,p.schemaPath=c,p.errSchemaPath=u,n+=" var "+v+" = errors; ";var f=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.createErrors=!1;var m;p.opts.allErrors&&(m=p.opts.allErrors,p.opts.allErrors=!1),n+=" "+e.validate(p)+" ",p.createErrors=!0,m&&(p.opts.allErrors=m),e.compositeRule=p.compositeRule=f,n+=" if ("+w+") { ";var g=g||[];g.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var y=n;n=g.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { errors = "+v+"; if (vErrors !== null) { if ("+v+") vErrors.length = "+v+"; else vErrors = null; } ",e.opts.allErrors&&(n+=" } ")}else n+=" var err = ",e.createErrors!==!1?(n+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: 'should NOT be valid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(n+=" if (false) { ");return n},S$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="valid"+a,p="errs__"+a,w=e.util.copy(e),f="";w.level++;var m="valid"+w.level,g=w.baseId,y="prevValid"+a,b="passingSchemas"+a;n+="var "+p+" = errors , "+y+" = false , "+v+" = false , "+b+" = null; ";var S=e.compositeRule;e.compositeRule=w.compositeRule=!0;var E=l;if(E)for(var P,R=-1,T=E.length-1;R<T;)P=E[R+=1],(e.opts.strictKeywords?typeof P=="object"&&Object.keys(P).length>0||P===!1:e.util.schemaHasRules(P,e.RULES.all))?(w.schema=P,w.schemaPath=c+"["+R+"]",w.errSchemaPath=u+"/"+R,n+=" "+e.validate(w)+" ",w.baseId=g):n+=" var "+m+" = true; ",R&&(n+=" if ("+m+" && "+y+") { "+v+" = false; "+b+" = ["+b+", "+R+"]; } else { ",f+="}"),n+=" if ("+m+") { "+v+" = "+y+" = true; "+b+" = "+R+"; }";return e.compositeRule=w.compositeRule=S,n+=""+f+"if (!"+v+") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+b+" } ",e.opts.messages!==!1&&(n+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),n+="} else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; }",e.opts.allErrors&&(n+=" } "),n},_$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v=e.opts.$data&&l&&l.$data,p;v?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",p="schema"+a):p=l;var w=v?"(new RegExp("+p+"))":e.usePattern(l);n+="if ( ",v&&(n+=" ("+p+" !== undefined && typeof "+p+" != 'string') || "),n+=" !"+w+".test("+h+") ) { ";var f=f||[];f.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",v?n+=""+p:n+=""+e.util.toQuotedString(l),n+=" } ",e.opts.messages!==!1&&(n+=` , message: 'should match pattern "`,v?n+="' + "+p+" + '":n+=""+e.util.escapeQuotes(l),n+=`"' `),e.opts.verbose&&(n+=" , schema: ",v?n+="validate.schema"+c:n+=""+e.util.toQuotedString(l),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",d&&(n+=" else { "),n},E$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="errs__"+a,p=e.util.copy(e),w="";p.level++;var f="valid"+p.level,m="key"+a,g="idx"+a,y=p.dataLevel=e.dataLevel+1,b="data"+y,S="dataProperties"+a,E=Object.keys(l||{}).filter($),P=e.schema.patternProperties||{},R=Object.keys(P).filter($),T=e.schema.additionalProperties,N=E.length||R.length,O=T===!1,j=typeof T=="object"&&Object.keys(T).length,_=e.opts.removeAdditional,A=O||j||_,C=e.opts.ownProperties,z=e.baseId,U=e.schema.required;if(U&&!(e.opts.$data&&U.$data)&&U.length<e.opts.loopRequired)var K=e.util.toHash(U);function $(hs){return hs!=="__proto__"}if(n+="var "+v+" = errors;var "+f+" = true;",C&&(n+=" var "+S+" = undefined;"),A){if(C?n+=" "+S+" = "+S+" || Object.keys("+h+"); for (var "+g+"=0; "+g+"<"+S+".length; "+g+"++) { var "+m+" = "+S+"["+g+"]; ":n+=" for (var "+m+" in "+h+") { ",N){if(n+=" var isAdditional"+a+" = !(false ",E.length)if(E.length>8)n+=" || validate.schema"+c+".hasOwnProperty("+m+") ";else{var F=E;if(F)for(var V,ae=-1,se=F.length-1;ae<se;)V=F[ae+=1],n+=" || "+m+" == "+e.util.toQuotedString(V)+" "}if(R.length){var W=R;if(W)for(var L,Q=-1,oe=W.length-1;Q<oe;)L=W[Q+=1],n+=" || "+e.usePattern(L)+".test("+m+") "}n+=" ); if (isAdditional"+a+") { "}if(_=="all")n+=" delete "+h+"["+m+"]; ";else{var Z=e.errorPath,ce="' + "+m+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),O)if(_)n+=" delete "+h+"["+m+"]; ";else{n+=" "+f+" = false; ";var Ee=u;u=e.errSchemaPath+"/additionalProperties";var ve=ve||[];ve.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+ce+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is an invalid additional property":n+="should NOT have additional properties",n+="' "),e.opts.verbose&&(n+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var te=n;n=ve.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+te+"]); ":n+=" validate.errors = ["+te+"]; return false; ":n+=" var err = "+te+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=Ee,d&&(n+=" break; ")}else if(j)if(_=="failing"){n+=" var "+v+" = errors; ";var we=e.compositeRule;e.compositeRule=p.compositeRule=!0,p.schema=T,p.schemaPath=e.schemaPath+".additionalProperties",p.errSchemaPath=e.errSchemaPath+"/additionalProperties",p.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var ke=h+"["+m+"]";p.dataPathArr[y]=m;var De=e.validate(p);p.baseId=z,e.util.varOccurences(De,b)<2?n+=" "+e.util.varReplace(De,b,ke)+" ":n+=" var "+b+" = "+ke+"; "+De+" ",n+=" if (!"+f+") { errors = "+v+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+h+"["+m+"]; } ",e.compositeRule=p.compositeRule=we}else{p.schema=T,p.schemaPath=e.schemaPath+".additionalProperties",p.errSchemaPath=e.errSchemaPath+"/additionalProperties",p.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var ke=h+"["+m+"]";p.dataPathArr[y]=m;var De=e.validate(p);p.baseId=z,e.util.varOccurences(De,b)<2?n+=" "+e.util.varReplace(De,b,ke)+" ":n+=" var "+b+" = "+ke+"; "+De+" ",d&&(n+=" if (!"+f+") break; ")}e.errorPath=Z}N&&(n+=" } "),n+=" } ",d&&(n+=" if ("+f+") { ",w+="}")}var ee=e.opts.useDefaults&&!e.compositeRule;if(E.length){var fe=E;if(fe)for(var V,X=-1,ze=fe.length-1;X<ze;){V=fe[X+=1];var re=l[V];if(e.opts.strictKeywords?typeof re=="object"&&Object.keys(re).length>0||re===!1:e.util.schemaHasRules(re,e.RULES.all)){var Me=e.util.getProperty(V),ke=h+Me,Ue=ee&&re.default!==void 0;p.schema=re,p.schemaPath=c+Me,p.errSchemaPath=u+"/"+e.util.escapeFragment(V),p.errorPath=e.util.getPath(e.errorPath,V,e.opts.jsonPointers),p.dataPathArr[y]=e.util.toQuotedString(V);var De=e.validate(p);if(p.baseId=z,e.util.varOccurences(De,b)<2){De=e.util.varReplace(De,b,ke);var Ne=ke}else{var Ne=b;n+=" var "+b+" = "+ke+"; "}if(Ue)n+=" "+De+" ";else{if(K&&K[V]){n+=" if ( "+Ne+" === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(V)+"') "),n+=") { "+f+" = false; ";var Z=e.errorPath,Ee=u,rt=e.util.escapeQuotes(V);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(Z,V,e.opts.jsonPointers)),u=e.errSchemaPath+"/required";var ve=ve||[];ve.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+rt+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+rt+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var te=n;n=ve.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+te+"]); ":n+=" validate.errors = ["+te+"]; return false; ":n+=" var err = "+te+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=Ee,e.errorPath=Z,n+=" } else { "}else d?(n+=" if ( "+Ne+" === undefined ",C&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(V)+"') "),n+=") { "+f+" = true; } else { "):(n+=" if ("+Ne+" !== undefined ",C&&(n+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(V)+"') "),n+=" ) { ");n+=" "+De+" } "}}d&&(n+=" if ("+f+") { ",w+="}")}}if(R.length){var pt=R;if(pt)for(var L,qr=-1,zt=pt.length-1;qr<zt;){L=pt[qr+=1];var re=P[L];if(e.opts.strictKeywords?typeof re=="object"&&Object.keys(re).length>0||re===!1:e.util.schemaHasRules(re,e.RULES.all)){p.schema=re,p.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(L),p.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(L),C?n+=" "+S+" = "+S+" || Object.keys("+h+"); for (var "+g+"=0; "+g+"<"+S+".length; "+g+"++) { var "+m+" = "+S+"["+g+"]; ":n+=" for (var "+m+" in "+h+") { ",n+=" if ("+e.usePattern(L)+".test("+m+")) { ",p.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var ke=h+"["+m+"]";p.dataPathArr[y]=m;var De=e.validate(p);p.baseId=z,e.util.varOccurences(De,b)<2?n+=" "+e.util.varReplace(De,b,ke)+" ":n+=" var "+b+" = "+ke+"; "+De+" ",d&&(n+=" if (!"+f+") break; "),n+=" } ",d&&(n+=" else "+f+" = true; "),n+=" } ",d&&(n+=" if ("+f+") { ",w+="}")}}}return d&&(n+=" "+w+" if ("+v+" == errors) {"),n},C$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="errs__"+a,p=e.util.copy(e),w="";p.level++;var f="valid"+p.level;if(n+="var "+v+" = errors;",e.opts.strictKeywords?typeof l=="object"&&Object.keys(l).length>0||l===!1:e.util.schemaHasRules(l,e.RULES.all)){p.schema=l,p.schemaPath=c,p.errSchemaPath=u;var m="key"+a,g="idx"+a,y="i"+a,b="' + "+m+" + '",S=p.dataLevel=e.dataLevel+1,E="data"+S,P="dataProperties"+a,R=e.opts.ownProperties,T=e.baseId;R&&(n+=" var "+P+" = undefined; "),R?n+=" "+P+" = "+P+" || Object.keys("+h+"); for (var "+g+"=0; "+g+"<"+P+".length; "+g+"++) { var "+m+" = "+P+"["+g+"]; ":n+=" for (var "+m+" in "+h+") { ",n+=" var startErrs"+a+" = errors; ";var N=m,O=e.compositeRule;e.compositeRule=p.compositeRule=!0;var j=e.validate(p);p.baseId=T,e.util.varOccurences(j,E)<2?n+=" "+e.util.varReplace(j,E,N)+" ":n+=" var "+E+" = "+N+"; "+j+" ",e.compositeRule=p.compositeRule=O,n+=" if (!"+f+") { for (var "+y+"=startErrs"+a+"; "+y+"<errors; "+y+"++) { vErrors["+y+"].propertyName = "+m+"; } var err = ",e.createErrors!==!1?(n+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+b+"' } ",e.opts.messages!==!1&&(n+=" , message: 'property name \\'"+b+"\\' is invalid' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; "),d&&(n+=" break; "),n+=" } }"}return d&&(n+=" "+w+" if ("+v+" == errors) {"),n},P$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="valid"+a,p=e.opts.$data&&l&&l.$data;p&&(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ");var w="schema"+a;if(!p)if(l.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var f=[],m=l;if(m)for(var g,y=-1,b=m.length-1;y<b;){g=m[y+=1];var S=e.schema.properties[g];S&&(e.opts.strictKeywords?typeof S=="object"&&Object.keys(S).length>0||S===!1:e.util.schemaHasRules(S,e.RULES.all))||(f[f.length]=g)}}else var f=l;if(p||f.length){var E=e.errorPath,P=p||f.length>=e.opts.loopRequired,R=e.opts.ownProperties;if(d)if(n+=" var missing"+a+"; ",P){p||(n+=" var "+w+" = validate.schema"+c+"; ");var T="i"+a,N="schema"+a+"["+T+"]",O="' + "+N+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(E,N,e.opts.jsonPointers)),n+=" var "+v+" = true; ",p&&(n+=" if (schema"+a+" === undefined) "+v+" = true; else if (!Array.isArray(schema"+a+")) "+v+" = false; else {"),n+=" for (var "+T+" = 0; "+T+" < "+w+".length; "+T+"++) { "+v+" = "+h+"["+w+"["+T+"]] !== undefined ",R&&(n+=" && Object.prototype.hasOwnProperty.call("+h+", "+w+"["+T+"]) "),n+="; if (!"+v+") break; } ",p&&(n+=" } "),n+=" if (!"+v+") { ";var j=j||[];j.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+O+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var _=n;n=j.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var A=f;if(A)for(var C,T=-1,z=A.length-1;T<z;){C=A[T+=1],T&&(n+=" || ");var U=e.util.getProperty(C),K=h+U;n+=" ( ( "+K+" === undefined ",R&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(C)+"') "),n+=") && (missing"+a+" = "+e.util.toQuotedString(e.opts.jsonPointers?C:U)+") ) "}n+=") { ";var N="missing"+a,O="' + "+N+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(E,N,!0):E+" + "+N);var j=j||[];j.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+O+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var _=n;n=j.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+_+"]); ":n+=" validate.errors = ["+_+"]; return false; ":n+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else if(P){p||(n+=" var "+w+" = validate.schema"+c+"; ");var T="i"+a,N="schema"+a+"["+T+"]",O="' + "+N+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(E,N,e.opts.jsonPointers)),p&&(n+=" if ("+w+" && !Array.isArray("+w+")) { var err = ",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+O+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+w+" !== undefined) { "),n+=" for (var "+T+" = 0; "+T+" < "+w+".length; "+T+"++) { if ("+h+"["+w+"["+T+"]] === undefined ",R&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", "+w+"["+T+"]) "),n+=") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+O+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",p&&(n+=" } ")}else{var $=f;if($)for(var C,F=-1,V=$.length-1;F<V;){C=$[F+=1];var U=e.util.getProperty(C),O=e.util.escapeQuotes(C),K=h+U;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(E,C,e.opts.jsonPointers)),n+=" if ( "+K+" === undefined ",R&&(n+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(C)+"') "),n+=") { var err = ",e.createErrors!==!1?(n+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+O+"' } ",e.opts.messages!==!1&&(n+=" , message: '",e.opts._errorDataPathProperty?n+="is a required property":n+="should have required property \\'"+O+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=E}else d&&(n+=" if (true) {");return n},k$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h="data"+(o||""),v="valid"+a,p=e.opts.$data&&l&&l.$data,w;if(p?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",w="schema"+a):w=l,(l||p)&&e.opts.uniqueItems!==!1){p&&(n+=" var "+v+"; if ("+w+" === false || "+w+" === undefined) "+v+" = true; else if (typeof "+w+" != 'boolean') "+v+" = false; else { "),n+=" var i = "+h+".length , "+v+" = true , j; if (i > 1) { ";var f=e.schema.items&&e.schema.items.type,m=Array.isArray(f);if(!f||f=="object"||f=="array"||m&&(f.indexOf("object")>=0||f.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+h+"[i], "+h+"[j])) { "+v+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+h+"[i]; ";var g="checkDataType"+(m?"s":"");n+=" if ("+e.util[g](f,"item",e.opts.strictNumbers,!0)+") continue; ",m&&(n+=` if (typeof item == 'string') item = '"' + item; `),n+=" if (typeof itemIndices[item] == 'number') { "+v+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",p&&(n+=" } "),n+=" if (!"+v+") { ";var y=y||[];y.push(n),n="",e.createErrors!==!1?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",p?n+="validate.schema"+c:n+=""+l,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),n+=" } "):n+=" {} ";var b=n;n=y.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",d&&(n+=" else { ")}else d&&(n+=" if (true) { ");return n},N$={$ref:c$,allOf:u$,anyOf:d$,$comment:f$,const:h$,contains:p$,dependencies:m$,enum:v$,format:g$,if:y$,items:x$,maximum:X0,minimum:X0,maxItems:ex,minItems:ex,maxLength:tx,minLength:tx,maxProperties:rx,minProperties:rx,multipleOf:w$,not:b$,oneOf:S$,pattern:_$,properties:E$,propertyNames:C$,required:P$,uniqueItems:k$,validate:lC},nx=N$,th=ki.toHash,j$=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],r=["type","$comment"],s=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],n=["number","integer","string","array","object","boolean","null"];return e.all=th(r),e.types=th(n),e.forEach(function(a){a.rules=a.rules.map(function(o){var l;if(typeof o=="object"){var c=Object.keys(o)[0];l=o[c],o=c,l.forEach(function(d){r.push(d),e.all[d]=!0})}r.push(o);var u=e.all[o]={keyword:o,code:nx[o],implements:l};return u}),e.all.$comment={keyword:"$comment",code:nx.$comment},a.type&&(e.types[a.type]=a)}),e.keywords=th(r.concat(s)),e.custom={},e},sx=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"],R$=function(t,e){for(var r=0;r<e.length;r++){t=JSON.parse(JSON.stringify(t));var s=e[r].split("/"),n=t,a;for(a=1;a<s.length;a++)n=n[s[a]];for(a=0;a<sx.length;a++){var o=sx[a],l=n[o];l&&(n[o]={anyOf:[l,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return t},T$=mg.MissingRef,A$=SC;function SC(t,e,r){var s=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(r=e,e=void 0);var n=a(t).then(function(){var l=s._addSchema(t,void 0,e);return l.validate||o(l)});return r&&n.then(function(l){r(null,l)},r),n;function a(l){var c=l.$schema;return c&&!s.getSchema(c)?SC.call(s,{$ref:c},!0):Promise.resolve()}function o(l){try{return s._compile(l)}catch(u){if(u instanceof T$)return c(u);throw u}function c(u){var d=u.missingSchema;if(p(d))throw new Error("Schema "+d+" is loaded but "+u.missingRef+" cannot be resolved");var h=s._loadingSchemas[d];return h||(h=s._loadingSchemas[d]=s._opts.loadSchema(d),h.then(v,v)),h.then(function(w){if(!p(d))return a(w).then(function(){p(d)||s.addSchema(w,d,void 0,e)})}).then(function(){return o(l)});function v(){delete s._loadingSchemas[d]}function p(w){return s._refs[w]||s._schemas[w]}}}}var O$=function(e,r,s){var n=" ",a=e.level,o=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,h,v="data"+(o||""),p="valid"+a,w="errs__"+a,f=e.opts.$data&&l&&l.$data,m;f?(n+=" var schema"+a+" = "+e.util.getData(l.$data,o,e.dataPathArr)+"; ",m="schema"+a):m=l;var g=this,y="definition"+a,b=g.definition,S="",E,P,R,T,N;if(f&&b.$data){N="keywordValidate"+a;var O=b.validateSchema;n+=" var "+y+" = RULES.custom['"+r+"'].definition; var "+N+" = "+y+".validate;"}else{if(T=e.useCustomRule(g,l,e.schema,e),!T)return;m="validate.schema"+c,N=T.code,E=b.compile,P=b.inline,R=b.macro}var j=N+".errors",_="i"+a,A="ruleErr"+a,C=b.async;if(C&&!e.async)throw new Error("async keyword in sync schema");if(P||R||(n+=""+j+" = null;"),n+="var "+w+" = errors;var "+p+";",f&&b.$data&&(S+="}",n+=" if ("+m+" === undefined) { "+p+" = true; } else { ",O&&(S+="}",n+=" "+p+" = "+y+".validateSchema("+m+"); if ("+p+") { ")),P)b.statements?n+=" "+T.validate+" ":n+=" "+p+" = "+T.validate+"; ";else if(R){var z=e.util.copy(e),S="";z.level++;var U="valid"+z.level;z.schema=T.validate,z.schemaPath="";var K=e.compositeRule;e.compositeRule=z.compositeRule=!0;var $=e.validate(z).replace(/validate\.schema/g,N);e.compositeRule=z.compositeRule=K,n+=" "+$}else{var F=F||[];F.push(n),n="",n+=" "+N+".call( ",e.opts.passContext?n+="this":n+="self",E||b.schema===!1?n+=" , "+v+" ":n+=" , "+m+" , "+v+" , validate.schema"+e.schemaPath+" ",n+=" , (dataPath || '')",e.errorPath!='""'&&(n+=" + "+e.errorPath);var V=o?"data"+(o-1||""):"parentData",ae=o?e.dataPathArr[o]:"parentDataProperty";n+=" , "+V+" , "+ae+" , rootData ) ";var se=n;n=F.pop(),b.errors===!1?(n+=" "+p+" = ",C&&(n+="await "),n+=""+se+"; "):C?(j="customErrors"+a,n+=" var "+j+" = null; try { "+p+" = await "+se+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+j+" = e.errors; else throw e; } "):n+=" "+j+" = null; "+p+" = "+se+"; "}if(b.modifying&&(n+=" if ("+V+") "+v+" = "+V+"["+ae+"];"),n+=""+S,b.valid)d&&(n+=" if (true) { ");else{n+=" if ( ",b.valid===void 0?(n+=" !",R?n+=""+U:n+=""+p):n+=" "+!b.valid+" ",n+=") { ",h=g.keyword;var F=F||[];F.push(n),n="";var F=F||[];F.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+g.keyword+"' } ",e.opts.messages!==!1&&(n+=` , message: 'should pass "`+g.keyword+`" keyword validation' `),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),n+=" } "):n+=" {} ";var W=n;n=F.pop(),!e.compositeRule&&d?e.async?n+=" throw new ValidationError(["+W+"]); ":n+=" validate.errors = ["+W+"]; return false; ":n+=" var err = "+W+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var L=n;n=F.pop(),P?b.errors?b.errors!="full"&&(n+=" for (var "+_+"="+w+"; "+_+"<errors; "+_+"++) { var "+A+" = vErrors["+_+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+A+".schemaPath === undefined) { "+A+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(n+=" "+A+".schema = "+m+"; "+A+".data = "+v+"; "),n+=" } "):b.errors===!1?n+=" "+L+" ":(n+=" if ("+w+" == errors) { "+L+" } else { for (var "+_+"="+w+"; "+_+"<errors; "+_+"++) { var "+A+" = vErrors["+_+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+A+".schemaPath === undefined) { "+A+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(n+=" "+A+".schema = "+m+"; "+A+".data = "+v+"; "),n+=" } } "):R?(n+=" var err = ",e.createErrors!==!1?(n+=" { keyword: '"+(h||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+g.keyword+"' } ",e.opts.messages!==!1&&(n+=` , message: 'should pass "`+g.keyword+`" keyword validation' `),e.opts.verbose&&(n+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; ")):b.errors===!1?n+=" "+L+" ":(n+=" if (Array.isArray("+j+")) { if (vErrors === null) vErrors = "+j+"; else vErrors = vErrors.concat("+j+"); errors = vErrors.length; for (var "+_+"="+w+"; "+_+"<errors; "+_+"++) { var "+A+" = vErrors["+_+"]; if ("+A+".dataPath === undefined) "+A+".dataPath = (dataPath || '') + "+e.errorPath+"; "+A+'.schemaPath = "'+u+'"; ',e.opts.verbose&&(n+=" "+A+".schema = "+m+"; "+A+".data = "+v+"; "),n+=" } } else { "+L+" } "),n+=" } ",d&&(n+=" else { ")}return n};const I$="http://json-schema.org/draft-07/schema#",D$="http://json-schema.org/draft-07/schema#",M$="Core schema meta-schema",$$={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:[]}},F$=["object","boolean"],L$={$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:"#"}},_C={$schema:I$,$id:D$,title:M$,definitions:$$,type:F$,properties:L$,default:!0};var ax=_C,U$={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:ax.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:ax.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}},z$=/^[a-z_$][a-z0-9_$-]*$/i,V$=O$,H$=U$,q$={add:B$,get:W$,remove:K$,validate:mm};function B$(t,e){var r=this.RULES;if(r.keywords[t])throw new Error("Keyword "+t+" is already defined");if(!z$.test(t))throw new Error("Keyword "+t+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var s=e.type;if(Array.isArray(s))for(var n=0;n<s.length;n++)o(t,s[n],e);else o(t,s,e);var a=e.metaSchema;a&&(e.$data&&this._opts.$data&&(a={anyOf:[a,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),e.validateSchema=this.compile(a,!0))}r.keywords[t]=r.all[t]=!0;function o(l,c,u){for(var d,h=0;h<r.length;h++){var v=r[h];if(v.type==c){d=v;break}}d||(d={type:c,rules:[]},r.push(d));var p={keyword:l,definition:u,custom:!0,code:V$,implements:u.implements};d.rules.push(p),r.custom[l]=p}return this}function W$(t){var e=this.RULES.custom[t];return e?e.definition:this.RULES.keywords[t]||!1}function K$(t){var e=this.RULES;delete e.keywords[t],delete e.all[t],delete e.custom[t];for(var r=0;r<e.length;r++)for(var s=e[r].rules,n=0;n<s.length;n++)if(s[n].keyword==t){s.splice(n,1);break}return this}function mm(t,e){mm.errors=null;var r=this._validateKeyword=this._validateKeyword||this.compile(H$,!0);if(r(t))return!0;if(mm.errors=r.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(r.errors));return!1}const Q$="http://json-schema.org/draft-07/schema#",G$="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Z$="Meta-schema for $data reference (JSON Schema extension proposal)",Y$="object",J$=["$data"],X$={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},eF=!1,tF={$schema:Q$,$id:G$,description:Z$,type:Y$,required:J$,properties:X$,additionalProperties:eF};var EC=VM,La=pg,rF=GM,CC=nC,nF=iC,sF=r$,aF=j$,PC=R$,kC=ki,oF=wt;wt.prototype.validate=lF;wt.prototype.compile=cF;wt.prototype.addSchema=uF;wt.prototype.addMetaSchema=dF;wt.prototype.validateSchema=fF;wt.prototype.getSchema=pF;wt.prototype.removeSchema=vF;wt.prototype.addFormat=EF;wt.prototype.errorsText=_F;wt.prototype._addSchema=gF;wt.prototype._compile=yF;wt.prototype.compileAsync=A$;var tf=q$;wt.prototype.addKeyword=tf.add;wt.prototype.getKeyword=tf.get;wt.prototype.removeKeyword=tf.remove;wt.prototype.validateKeyword=tf.validate;var NC=mg;wt.ValidationError=NC.Validation;wt.MissingRefError=NC.MissingRef;wt.$dataMetaSchema=PC;var id="http://json-schema.org/draft-07/schema",ox=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],iF=["/properties"];function wt(t){if(!(this instanceof wt))return new wt(t);t=this._opts=kC.copy(t)||{},RF(this),this._schemas={},this._refs={},this._fragments={},this._formats=sF(t.format),this._cache=t.cache||new rF,this._loadingSchemas={},this._compilations=[],this.RULES=aF(),this._getId=xF(t),t.loopRequired=t.loopRequired||1/0,t.errorDataPath=="property"&&(t._errorDataPathProperty=!0),t.serialize===void 0&&(t.serialize=nF),this._metaOpts=jF(this),t.formats&&kF(this),t.keywords&&NF(this),CF(this),typeof t.meta=="object"&&this.addMetaSchema(t.meta),t.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),PF(this)}function lF(t,e){var r;if(typeof t=="string"){if(r=this.getSchema(t),!r)throw new Error('no schema with key or ref "'+t+'"')}else{var s=this._addSchema(t);r=s.validate||this._compile(s)}var n=r(e);return r.$async!==!0&&(this.errors=r.errors),n}function cF(t,e){var r=this._addSchema(t,void 0,e);return r.validate||this._compile(r)}function uF(t,e,r,s){if(Array.isArray(t)){for(var n=0;n<t.length;n++)this.addSchema(t[n],void 0,r,s);return this}var a=this._getId(t);if(a!==void 0&&typeof a!="string")throw new Error("schema id must be string");return e=La.normalizeId(e||a),RC(this,e),this._schemas[e]=this._addSchema(t,r,s,!0),this}function dF(t,e,r){return this.addSchema(t,e,r,!0),this}function fF(t,e){var r=t.$schema;if(r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this._opts.defaultMeta||hF(this),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var s=this.validate(r,t);if(!s&&e){var n="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(n);else throw new Error(n)}return s}function hF(t){var e=t._opts.meta;return t._opts.defaultMeta=typeof e=="object"?t._getId(e)||e:t.getSchema(id)?id:void 0,t._opts.defaultMeta}function pF(t){var e=jC(this,t);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return mF(this,t)}}function mF(t,e){var r=La.schema.call(t,{schema:{}},e);if(r){var s=r.schema,n=r.root,a=r.baseId,o=EC.call(t,s,n,void 0,a);return t._fragments[e]=new CC({ref:e,fragment:!0,schema:s,root:n,baseId:a,validate:o}),o}}function jC(t,e){return e=La.normalizeId(e),t._schemas[e]||t._refs[e]||t._fragments[e]}function vF(t){if(t instanceof RegExp)return Dc(this,this._schemas,t),Dc(this,this._refs,t),this;switch(typeof t){case"undefined":return Dc(this,this._schemas),Dc(this,this._refs),this._cache.clear(),this;case"string":var e=jC(this,t);return e&&this._cache.del(e.cacheKey),delete this._schemas[t],delete this._refs[t],this;case"object":var r=this._opts.serialize,s=r?r(t):t;this._cache.del(s);var n=this._getId(t);n&&(n=La.normalizeId(n),delete this._schemas[n],delete this._refs[n])}return this}function Dc(t,e,r){for(var s in e){var n=e[s];!n.meta&&(!r||r.test(s))&&(t._cache.del(n.cacheKey),delete e[s])}}function gF(t,e,r,s){if(typeof t!="object"&&typeof t!="boolean")throw new Error("schema should be object or boolean");var n=this._opts.serialize,a=n?n(t):t,o=this._cache.get(a);if(o)return o;s=s||this._opts.addUsedSchema!==!1;var l=La.normalizeId(this._getId(t));l&&s&&RC(this,l);var c=this._opts.validateSchema!==!1&&!e,u;c&&!(u=l&&l==La.normalizeId(t.$schema))&&this.validateSchema(t,!0);var d=La.ids.call(this,t),h=new CC({id:l,schema:t,localRefs:d,cacheKey:a,meta:r});return l[0]!="#"&&s&&(this._refs[l]=h),this._cache.put(a,h),c&&u&&this.validateSchema(t,!0),h}function yF(t,e){if(t.compiling)return t.validate=n,n.schema=t.schema,n.errors=null,n.root=e||n,t.schema.$async===!0&&(n.$async=!0),n;t.compiling=!0;var r;t.meta&&(r=this._opts,this._opts=this._metaOpts);var s;try{s=EC.call(this,t.schema,e,t.localRefs)}catch(a){throw delete t.validate,a}finally{t.compiling=!1,t.meta&&(this._opts=r)}return t.validate=s,t.refs=s.refs,t.refVal=s.refVal,t.root=s.root,s;function n(){var a=t.validate,o=a.apply(this,arguments);return n.errors=a.errors,o}}function xF(t){switch(t.schemaId){case"auto":return SF;case"id":return wF;default:return bF}}function wF(t){return t.$id&&this.logger.warn("schema $id ignored",t.$id),t.id}function bF(t){return t.id&&this.logger.warn("schema id ignored",t.id),t.$id}function SF(t){if(t.$id&&t.id&&t.$id!=t.id)throw new Error("schema $id is different from id");return t.$id||t.id}function _F(t,e){if(t=t||this.errors,!t)return"No errors";e=e||{};for(var r=e.separator===void 0?", ":e.separator,s=e.dataVar===void 0?"data":e.dataVar,n="",a=0;a<t.length;a++){var o=t[a];o&&(n+=s+o.dataPath+" "+o.message+r)}return n.slice(0,-r.length)}function EF(t,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[t]=e,this}function CF(t){var e;if(t._opts.$data&&(e=tF,t.addMetaSchema(e,e.$id,!0)),t._opts.meta!==!1){var r=_C;t._opts.$data&&(r=PC(r,iF)),t.addMetaSchema(r,id,!0),t._refs["http://json-schema.org/schema"]=id}}function PF(t){var e=t._opts.schemas;if(e)if(Array.isArray(e))t.addSchema(e);else for(var r in e)t.addSchema(e[r],r)}function kF(t){for(var e in t._opts.formats){var r=t._opts.formats[e];t.addFormat(e,r)}}function NF(t){for(var e in t._opts.keywords){var r=t._opts.keywords[e];t.addKeyword(e,r)}}function RC(t,e){if(t._schemas[e]||t._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function jF(t){for(var e=kC.copy(t._opts),r=0;r<ox.length;r++)delete e[ox[r]];return e}function RF(t){var e=t._opts.logger;if(e===!1)t.logger={log:rh,warn:rh,error:rh};else{if(e===void 0&&(e=console),!(typeof e=="object"&&e.log&&e.warn&&e.error))throw new Error("logger must implement log, warn and error methods");t.logger=e}}function rh(){}const TF=vm(oF);class AF extends oM{constructor(e,r){var s;super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(s=r==null?void 0:r.capabilities)!==null&&s!==void 0?s:{},this._ajv=new TF}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=iM(this._capabilities,e)}assertCapability(e,r){var s;if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s[e]))throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Bd,capabilities:this._capabilities,clientInfo:this._clientInfo}},UE,r);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!C4.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"})}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var r,s,n,a,o;switch(e){case"logging/setLevel":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s.prompts))throw new Error(`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(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((a=this._serverCapabilities)===null||a===void 0)&&a.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((o=this._serverCapabilities)===null||o===void 0)&&o.completions))throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){var r;switch(e){case"notifications/roots/list_changed":if(!(!((r=this._capabilities.roots)===null||r===void 0)&&r.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break}}async ping(e){return this.request({method:"ping"},Ao,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},GE,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},Ao,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},rg,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},Ju,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},Yu,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},WE,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},Jv,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},Ao,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},Ao,r)}async callTool(e,r=Zd,s){const n=await this.request({method:"tools/call",params:e},r,s),a=this.getToolOutputValidator(e.name);if(a){if(!n.structuredContent&&!n.isError)throw new Hs(En.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(n.structuredContent)try{if(!a(n.structuredContent))throw new Hs(En.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(a.errors)}`)}catch(o){throw o instanceof Hs?o:new Hs(En.InvalidParams,`Failed to validate structured content: ${o instanceof Error?o.message:String(o)}`)}}return n}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(const r of e)if(r.outputSchema)try{const s=this._ajv.compile(r.outputSchema);this._cachedToolOutputValidators.set(r.name,s)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){const s=await this.request({method:"tools/list",params:e},ng,r);return this.cacheToolOutputSchemas(s.tools),s}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}function Ui(t,e){if(!t)throw new Error(e)}var ix=3e3,OF=5e3,nh=5*60*1e3;function IF(t){const{url:e,clientName:r,clientUri:s,callbackUrl:n=typeof window<"u"?To(new URL("/oauth/callback",window.location.origin).toString()):"/oauth/callback",storageKeyPrefix:a="mcp:auth",clientConfig:o={},customHeaders:l={},autoRetry:c=!1,autoReconnect:u=ix,transportType:d="auto",preventAutoAuth:h=!1,onPopupWindow:v}=t,[p,w]=x.useState("discovering"),[f,m]=x.useState([]),[g,y]=x.useState([]),[b,S]=x.useState([]),[E,P]=x.useState([]),[R,T]=x.useState(void 0),[N,O]=x.useState([]),[j,_]=x.useState(void 0),A=x.useRef(null),C=x.useRef(null),z=x.useRef(null),U=x.useRef(!1),K=x.useRef(!0),$=x.useRef(0),F=x.useRef(null),V=x.useRef(p),ae=x.useRef(u),se=x.useRef(null);x.useEffect(()=>{V.current=p,ae.current=u},[p,u]);const W=x.useCallback((ee,fe,...X)=>{const ze=X.length>0?`${fe} ${X.map(re=>JSON.stringify(re)).join(" ")}`:fe;console[ee](`[useMcp] ${ze}`),K.current&&O(re=>[...re.slice(-100),{level:ee,message:ze,timestamp:Date.now()}])},[]),L=x.useCallback(async(ee=!1)=>{ee||W("info","Disconnecting..."),U.current=!1,F.current&&clearTimeout(F.current),F.current=null;const fe=C.current;if(A.current=null,C.current=null,K.current&&!ee&&(w("discovering"),m([]),y([]),S([]),P([]),T(void 0),_(void 0)),fe)try{await fe.close(),ee||W("debug","Transport closed")}catch(X){ee||W("warn","Error closing transport:",X)}},[W]),Q=x.useCallback((ee,fe)=>{var X;if(W("error",ee,fe??""),K.current){w("failed"),T(ee);const ze=(X=z.current)==null?void 0:X.getLastAttemptedAuthUrl();ze&&(_(ze),W("info","Manual authentication URL may be available.",ze))}U.current=!1},[W]),oe=x.useCallback(async()=>{if(U.current){W("debug","Connection attempt already in progress.");return}if(!K.current){W("debug","Connect called after unmount, aborting.");return}U.current=!0,$.current+=1,T(void 0),_(void 0),se.current=null,w("discovering"),W("info",`Connecting attempt #${$.current} to ${e}...`),z.current||(z.current=new D0(e,{storageKeyPrefix:a,clientName:r,clientUri:s,callbackUrl:n,preventAutoAuth:h,onPopupWindow:v}),W("debug","BrowserOAuthClientProvider initialized in connect.")),A.current||(A.current=new AF({name:o.name||"use-mcp-react-client",version:o.version||"0.1.0"},{capabilities:{}}),W("debug","MCP Client initialized in connect."));const ee=async X=>{W("info",`Attempting connection with ${X.toUpperCase()} transport...`),V.current!=="authenticating"&&w("connecting");let ze;try{Ui(z.current,"Auth Provider must be initialized"),Ui(A.current,"Client must be initialized"),C.current&&(await C.current.close().catch(Ne=>W("warn",`Error closing previous transport: ${Ne.message}`)),C.current=null);const re={authProvider:z.current,requestInit:{headers:{Accept:"application/json, text/event-stream",...l}}},Me=To(e),Ue=new URL(Me);W("debug",`Creating ${X.toUpperCase()} transport for URL: ${Ue.toString()}`),W("debug","Transport options:",{authProvider:!!z.current,headers:l,url:Ue.toString()}),X==="http"?(W("debug","Creating StreamableHTTPClientTransport..."),ze=new sM(Ue,re),W("debug","StreamableHTTPClientTransport created successfully")):(W("debug","Creating SSEClientTransport..."),ze=new tM(Ue,re),W("debug","SSEClientTransport created successfully")),C.current=ze,W("debug",`${X.toUpperCase()} transport created and assigned to ref.`)}catch(re){return Q(`Failed to create ${X.toUpperCase()} transport: ${re instanceof Error?re.message:String(re)}`,re instanceof Error?re:void 0),"failed"}ze.onmessage=re=>{var Me,Ue;W("debug",`[Transport] Received: ${JSON.stringify(re)}`),(Ue=(Me=A.current)==null?void 0:Me.handleMessage)==null||Ue.call(Me,re)},ze.onerror=re=>{W("warn",`Transport error event (${X.toUpperCase()}):`,re),W("debug","Error details:",{message:re.message,stack:re.stack,name:re.name,cause:re.cause}),Q(`Transport error (${X.toUpperCase()}): ${re.message}`,re)},ze.onclose=()=>{if(!K.current||U.current)return;W("info",`Transport connection closed (${se.current||"unknown"} type).`);const re=V.current,Me=ae.current;if(re==="ready"&&Me){const Ue=typeof Me=="number"?Me:ix;W("info",`Attempting to reconnect in ${Ue}ms...`),w("connecting"),setTimeout(()=>{K.current&&oe()},Ue)}else re!=="failed"&&re!=="authenticating"&&Q("Connection closed unexpectedly.")};try{W("info",`Connecting client via ${X.toUpperCase()}...`),W("debug","About to call client.connect() with transport instance"),W("debug",`Transport instance type: ${ze.constructor.name}`),await A.current.connect(ze),W("info",`Client connected via ${X.toUpperCase()}. Loading tools, resources, and prompts...`),se.current=X,w("loading");const re=await A.current.request({method:"tools/list"},ng);let Me={resources:[],resourceTemplates:[]};try{Me=await A.current.request({method:"resources/list"},Yu)}catch(Ne){W("debug","Server does not support resources/list method",Ne)}let Ue={prompts:[]};try{Ue=await A.current.request({method:"prompts/list"},Ju)}catch(Ne){W("debug","Server does not support prompts/list method",Ne)}if(K.current){m(re.tools),y(Me.resources),S(Array.isArray(Me.resourceTemplates)?Me.resourceTemplates:[]),P(Ue.prompts);const Ne=[`Loaded ${re.tools.length} tools`];return(Me.resources.length>0||Me.resourceTemplates&&Me.resourceTemplates.length>0)&&(Ne.push(`${Me.resources.length} resources`),Array.isArray(Me.resourceTemplates)&&Me.resourceTemplates.length>0&&Ne.push(`${Me.resourceTemplates.length} resource templates`)),Ue.prompts.length>0&&Ne.push(`${Ue.prompts.length} prompts`),W("info",Ne.join(", ")+"."),w("ready"),$.current=0,"success"}else return"failed"}catch(re){W("debug",`Client connect error via ${X.toUpperCase()}:`,re),W("debug","Connect error details:",{message:re instanceof Error?re.message:String(re),stack:re instanceof Error?re.stack:"N/A",name:re instanceof Error?re.name:"Unknown",cause:re instanceof Error?re.cause:void 0});const Me=re instanceof Error?re:new Error(String(re)),Ue=Me.message,Ne=Ue.includes("404")||Ue.includes("Not Found"),rt=Ue.includes("405")||Ue.includes("Method Not Allowed"),pt=Ue==="Failed to fetch"||Ue==="NetworkError when attempting to fetch resource."||Ue==="Load failed";if(X==="http"&&(Ne||rt||pt))return W("warn",`HTTP transport failed (${pt?"CORS":Ne?"404":"405"}).`),"fallback";if(Me instanceof Dr||Ue.includes("Unauthorized")||Ue.includes("401")){W("info","Authentication required."),Ui(z.current,"Auth Provider not available for auth flow");const qr=await z.current.tokens();if(h&&!qr)return W("info","Authentication required but auto-auth prevented. User action needed."),w("pending_auth"),"auth_redirect";V.current!=="authenticating"&&V.current!=="pending_auth"&&(w("authenticating"),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{},nh));try{const zt=await Pn(z.current,{serverUrl:e});if(!K.current)return"failed";if(zt==="AUTHORIZED")return W("info","Authentication successful via existing token or refresh. Re-attempting connection..."),F.current&&clearTimeout(F.current),U.current=!1,oe(),"failed";if(zt==="REDIRECT")return W("info","Redirecting for authentication. Waiting for callback..."),"auth_redirect"}catch(zt){return K.current&&(F.current&&clearTimeout(F.current),Q(`Failed to initiate authentication: ${zt instanceof Error?zt.message:String(zt)}`,zt instanceof Error?zt:void 0)),"failed"}}return Q(`Failed to connect via ${X.toUpperCase()}: ${Ue}`,Me),"failed"}};let fe="failed";if(console.log({transportType:d}),d==="sse")W("debug","Using SSE-only transport mode"),fe=await ee("sse");else if(d==="http")W("debug","Using HTTP-only transport mode"),fe=await ee("http");else{W("debug","Using auto transport mode (HTTP with SSE fallback)");const X=await ee("http");if(X==="fallback"&&K.current&&V.current!=="authenticating"){W("info","HTTP failed, attempting SSE fallback...");const ze=await ee("sse");fe=ze,ze==="failed"&&K.current}else fe=X}(fe==="success"||fe==="failed")&&(U.current=!1),W("debug",`Connection sequence finished with status: ${fe}`)},[W,Q,L,Pn,e,a,r,s,n,o.name,o.version]),Z=x.useCallback(async(ee,fe)=>{if(V.current!=="ready"||!A.current)throw new Error(`MCP client is not ready (current state: ${p}). Cannot call tool "${ee}".`);W("info",`Calling tool: ${ee}`,fe);try{const X=await A.current.request({method:"tools/call",params:{name:ee,arguments:fe}},Zd);return W("info",`Tool "${ee}" call successful:`,X),X}catch(X){W("error",`Error calling tool "${ee}": ${X instanceof Error?X.message:String(X)}`,X);const ze=X instanceof Error?X:new Error(String(X));if(ze instanceof Dr||ze.message.includes("Unauthorized")||ze.message.includes("401")){W("warn","Tool call unauthorized, attempting re-authentication..."),w("authenticating"),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{},nh);try{Ui(z.current,"Auth Provider not available for tool re-auth");const re=await Pn(z.current,{serverUrl:e});if(!K.current)return;re==="AUTHORIZED"?(W("info","Re-authentication successful. Retrying tool call is recommended, or reconnecting."),F.current&&clearTimeout(F.current),U.current=!1,oe()):re==="REDIRECT"&&W("info","Redirecting for re-authentication for tool call.")}catch(re){if(!K.current)return;F.current&&clearTimeout(F.current),Q(`Re-authentication failed: ${re instanceof Error?re.message:String(re)}`,re instanceof Error?re:void 0)}}if(V.current!=="authenticating")throw X;return}},[p,e,W,Q,oe]),ce=x.useCallback(()=>{V.current==="failed"?(W("info","Retry requested..."),oe()):W("warn",`Retry called but state is not 'failed' (state: ${V.current}). Ignoring.`)},[W,oe]),Ee=x.useCallback(async()=>{var fe;W("info","Manual authentication requested...");const ee=V.current;if(ee==="failed")W("info","Attempting to reconnect and authenticate via retry..."),ce();else if(ee==="pending_auth"){W("info","Proceeding with authentication from pending state..."),w("authenticating"),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{},nh);try{Ui(z.current,"Auth Provider not available for manual auth");const X=await Pn(z.current,{serverUrl:e});if(!K.current)return;X==="AUTHORIZED"?(W("info","Manual authentication successful. Re-attempting connection..."),F.current&&clearTimeout(F.current),U.current=!1,oe()):X==="REDIRECT"&&W("info","Redirecting for manual authentication. Waiting for callback...")}catch(X){if(!K.current)return;F.current&&clearTimeout(F.current),Q(`Manual authentication failed: ${X instanceof Error?X.message:String(X)}`,X instanceof Error?X:void 0)}}else if(ee==="authenticating"){W("warn","Already attempting authentication. Check for blocked popups or wait for timeout.");const X=(fe=z.current)==null?void 0:fe.getLastAttemptedAuthUrl();X&&!j&&(_(X),W("info","Manual authentication URL retrieved:",X))}else W("info",`Client not in a state requiring manual authentication trigger (state: ${ee}). If needed, try disconnecting and reconnecting.`)},[W,ce,j,e,Q,oe]),ve=x.useCallback(()=>{if(z.current){const ee=z.current.clearStorage();W("info",`Cleared ${ee} item(s) from localStorage for ${e}.`),_(void 0),L()}else W("warn","Auth provider not initialized, cannot clear storage.")},[e,W,L]),te=x.useCallback(async()=>{if(V.current!=="ready"||!A.current)throw new Error(`MCP client is not ready (current state: ${p}). Cannot list resources.`);W("info","Listing resources...");try{const ee=await A.current.request({method:"resources/list"},Yu);K.current&&(y(ee.resources),S(Array.isArray(ee.resourceTemplates)?ee.resourceTemplates:[]),W("info",`Listed ${ee.resources.length} resources, ${Array.isArray(ee.resourceTemplates)?ee.resourceTemplates.length:0} resource templates.`))}catch(ee){throw W("error",`Error listing resources: ${ee instanceof Error?ee.message:String(ee)}`,ee),ee}},[p,W]),we=x.useCallback(async ee=>{if(V.current!=="ready"||!A.current)throw new Error(`MCP client is not ready (current state: ${p}). Cannot read resource "${ee}".`);W("info",`Reading resource: ${ee}`);try{const fe=await A.current.request({method:"resources/read",params:{uri:ee}},Jv);return W("info",`Resource "${ee}" read successfully`),fe}catch(fe){throw W("error",`Error reading resource "${ee}": ${fe instanceof Error?fe.message:String(fe)}`,fe),fe}},[p,W]),ke=x.useCallback(async()=>{if(V.current!=="ready"||!A.current)throw new Error(`MCP client is not ready (current state: ${p}). Cannot list prompts.`);W("info","Listing prompts...");try{const ee=await A.current.request({method:"prompts/list"},Ju);K.current&&(P(ee.prompts),W("info",`Listed ${ee.prompts.length} prompts.`))}catch(ee){throw W("error",`Error listing prompts: ${ee instanceof Error?ee.message:String(ee)}`,ee),ee}},[p,W]),De=x.useCallback(async(ee,fe)=>{if(V.current!=="ready"||!A.current)throw new Error(`MCP client is not ready (current state: ${p}). Cannot get prompt "${ee}".`);W("info",`Getting prompt: ${ee}`,fe);try{const X=await A.current.request({method:"prompts/get",params:{name:ee,arguments:fe}},rg);return W("info",`Prompt "${ee}" retrieved successfully`),X}catch(X){throw W("error",`Error getting prompt "${ee}": ${X instanceof Error?X.message:String(X)}`,X),X}},[p,W]);return x.useEffect(()=>{const ee=fe=>{var X;fe.origin===window.location.origin&&((X=fe.data)==null?void 0:X.type)==="mcp_auth_callback"&&(W("info","Received auth callback message.",fe.data),F.current&&clearTimeout(F.current),fe.data.success?(W("info","Authentication successful via popup. Reconnecting client..."),U.current=!1,oe()):Q(`Authentication failed in callback: ${fe.data.error||"Unknown reason."}`))};return window.addEventListener("message",ee),W("debug","Auth callback message listener added."),()=>{window.removeEventListener("message",ee),W("debug","Auth callback message listener removed."),F.current&&clearTimeout(F.current)}},[W,Q,oe]),x.useEffect(()=>(K.current=!0,W("debug","useMcp mounted, initiating connection."),$.current=0,(!z.current||z.current.serverUrl!==e)&&(z.current=new D0(e,{storageKeyPrefix:a,clientName:r,clientUri:s,callbackUrl:n,preventAutoAuth:h,onPopupWindow:v}),W("debug","BrowserOAuthClientProvider initialized/updated on mount/option change.")),oe(),()=>{K.current=!1,W("debug","useMcp unmounting, disconnecting."),L(!0)}),[e,a,n,r,s,o.name,o.version,oe,L]),x.useEffect(()=>{let ee=null;if(p==="failed"&&c&&$.current>0){const fe=typeof c=="number"?c:OF;W("info",`Connection failed, auto-retrying in ${fe}ms...`),ee=setTimeout(()=>{K.current&&V.current==="failed"&&ce()},fe)}return()=>{ee&&clearTimeout(ee)}},[p,c,ce,W]),{state:p,tools:f,resources:g,resourceTemplates:b,prompts:E,error:R,log:N,authUrl:j,callTool:Z,listResources:te,readResource:we,listPrompts:ke,getPrompt:De,retry:ce,disconnect:L,authenticate:Ee,clearStorage:ve}}function DF({service:t,autoConnect:e=!1,onConnected:r,onError:s}){const{toast:n}=or(),{state:a,tools:o,resources:l,prompts:c,error:u,authUrl:d,callTool:h,readResource:v,listResources:p,getPrompt:w,listPrompts:f,retry:m,disconnect:g,authenticate:y,clearStorage:b}=IF({url:t.url,clientName:"AgentDeck",clientUri:window.location.origin,callbackUrl:`${window.location.origin}/oauth/callback`,storageKeyPrefix:`mcp:auth:${t.id}`,autoRetry:3,autoReconnect:5e3,transportType:"auto",preventAutoAuth:!e}),S=a==="ready",E=a==="connecting"||a==="loading",P=a==="authenticating"||a==="pending_auth",R=a==="failed";return vn.useEffect(()=>{S&&r&&(r(),n({title:"Connected to MCP service",description:`Successfully connected to ${t.name}`}))},[S,r,t.name,n]),vn.useEffect(()=>{R&&u&&s&&(s(u),n({title:"MCP connection failed",description:u,variant:"destructive"}))},[R,u,s,n]),{isConnected:S,isConnecting:E,isAuthenticating:P,hasError:R,error:u,tools:o,resources:l,prompts:c,connect:()=>{m()},disconnect:g,retry:m,authenticate:y,callTool:async(A,C)=>{try{return await h(A,C)}catch(z){const U=z instanceof Error?z.message:"Unknown error";throw n({title:"Tool call failed",description:U,variant:"destructive"}),z}},readResource:async A=>{try{return await v(A)}catch(C){const z=C instanceof Error?C.message:"Unknown error";throw n({title:"Resource read failed",description:z,variant:"destructive"}),C}},listResources:async()=>{try{await p()}catch(A){const C=A instanceof Error?A.message:"Unknown error";throw n({title:"Resource listing failed",description:C,variant:"destructive"}),A}},getPrompt:async(A,C)=>{try{return await w(A,C)}catch(z){const U=z instanceof Error?z.message:"Unknown error";throw n({title:"Prompt retrieval failed",description:U,variant:"destructive"}),z}},listPrompts:async()=>{try{await f()}catch(A){const C=A instanceof Error?A.message:"Unknown error";throw n({title:"Prompt listing failed",description:C,variant:"destructive"}),A}},authUrl:d,clearStorage:b}}function MF(){const[t,e]=x.useState("https://api.githubcopilot.com/mcp"),[r,s]=x.useState("get_me"),[n,a]=x.useState("{}"),[o,l]=x.useState(""),c={id:"test-mcp-service",name:"Test MCP Service",url:t,registeredAt:new Date().toISOString(),updatedAt:new Date().toISOString()},{isConnected:u,isConnecting:d,isAuthenticating:h,hasError:v,error:p,tools:w,resources:f,prompts:m,connect:g,disconnect:y,retry:b,authenticate:S,callTool:E,authUrl:P,clearStorage:R}=DF({service:c,autoConnect:!1,onConnected:()=>{console.log("Connected to test MCP service")},onError:j=>{console.error("Test MCP service error:",j)}}),N=d?{status:"connecting",icon:n0,color:"text-yellow-500"}:h?{status:"authenticating",icon:Cc,color:"text-blue-500"}:u?{status:"connected",icon:hp,color:"text-green-500"}:v?{status:"error",icon:t0,color:"text-red-500"}:{status:"disconnected",icon:t0,color:"text-gray-500"},O=async()=>{try{let j={};n.trim()&&(j=JSON.parse(n));const _=await E(r,j);l(JSON.stringify(_,null,2))}catch(j){l(`Error: ${j instanceof Error?j.message:"Unknown error"}`)}};return i.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[i.jsxs("div",{className:"text-center",children:[i.jsx("h1",{className:"text-3xl font-bold mb-2",children:"use-mcp Integration Test"}),i.jsx("p",{className:"text-muted-foreground",children:"Testing the new use-mcp library integration with OAuth support"})]}),i.jsxs(Cs,{children:[i.jsxs(_a,{children:[i.jsxs(Ea,{className:"flex items-center gap-2",children:[i.jsx(N.icon,{className:`w-5 h-5 ${N.color}`}),"Connection Status: ",N.status]}),i.jsx(tu,{children:"Current connection state and available actions"})]}),i.jsxs(Ps,{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx(Ke,{children:"Service URL"}),i.jsx(tt,{value:t,onChange:j=>e(j.target.value),placeholder:"Enter MCP service URL"})]}),i.jsxs("div",{className:"flex gap-2",children:[!u&&!d&&i.jsx(me,{onClick:g,children:"Connect"}),u&&i.jsx(me,{onClick:y,variant:"outline",children:"Disconnect"}),v&&i.jsxs(me,{onClick:b,variant:"outline",children:[i.jsx(n0,{className:"w-4 h-4 mr-1"}),"Retry"]}),P&&!u&&i.jsxs(me,{onClick:S,variant:"outline",children:[i.jsx(Cc,{className:"w-4 h-4 mr-1"}),"Authenticate"]})]})]}),p&&i.jsxs("div",{className:"flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-md",children:[i.jsx(I1,{className:"w-4 h-4 text-destructive"}),i.jsx("span",{className:"text-sm text-destructive",children:p})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.jsxs(Cs,{children:[i.jsx(_a,{children:i.jsxs(Ea,{className:"flex items-center gap-2",children:[i.jsx(Ou,{className:"w-4 h-4"}),"Tools (",w.length,")"]})}),i.jsx(Ps,{children:w.length===0?i.jsx("p",{className:"text-sm text-muted-foreground",children:u?"No tools available":"Connect to see tools"}):i.jsxs("div",{className:"space-y-2",children:[w.slice(0,5).map((j,_)=>i.jsx("div",{className:"text-sm",children:i.jsx(hn,{variant:"outline",className:"text-xs",children:j.name})},_)),w.length>5&&i.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",w.length-5," more tools"]})]})})]}),i.jsxs(Cs,{children:[i.jsx(_a,{children:i.jsxs(Ea,{children:["Resources (",f.length,")"]})}),i.jsx(Ps,{children:i.jsx("p",{className:"text-sm text-muted-foreground",children:u?`${f.length} resources available`:"Connect to see resources"})})]}),i.jsxs(Cs,{children:[i.jsx(_a,{children:i.jsxs(Ea,{children:["Prompts (",m.length,")"]})}),i.jsx(Ps,{children:i.jsx("p",{className:"text-sm text-muted-foreground",children:u?`${m.length} prompts available`:"Connect to see prompts"})})]})]}),u&&i.jsxs(Cs,{children:[i.jsxs(_a,{children:[i.jsx(Ea,{children:"Test Tool Call"}),i.jsx(tu,{children:"Test calling a tool on the connected MCP service"})]}),i.jsxs(Ps,{className:"space-y-4",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"toolName",children:"Tool Name"}),i.jsx(tt,{id:"toolName",value:r,onChange:j=>s(j.target.value),placeholder:"e.g., get_me"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{htmlFor:"toolArgs",children:"Arguments (JSON)"}),i.jsx(tt,{id:"toolArgs",value:n,onChange:j=>a(j.target.value),placeholder:'{"key": "value"}'})]})]}),i.jsxs(me,{onClick:O,disabled:!u,children:[i.jsx(j2,{className:"w-4 h-4 mr-1"}),"Call Tool"]}),o&&i.jsxs("div",{className:"space-y-2",children:[i.jsx(Ke,{children:"Result"}),i.jsx(Gn,{value:o,readOnly:!0,rows:10,className:"font-mono text-sm"})]})]})]}),P&&i.jsxs(Cs,{children:[i.jsxs(_a,{children:[i.jsxs(Ea,{className:"flex items-center gap-2",children:[i.jsx(Cc,{className:"w-4 h-4"}),"OAuth Authentication"]}),i.jsx(tu,{children:"This service requires OAuth authentication"})]}),i.jsxs(Ps,{className:"space-y-4",children:[i.jsx("div",{className:"p-3 bg-blue-50 border border-blue-200 rounded-md",children:i.jsx("p",{className:"text-sm text-blue-800",children:'This MCP service requires OAuth authentication. Click the "Authenticate" button above to start the OAuth flow.'})}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs(me,{onClick:S,variant:"outline",children:[i.jsx(Cc,{className:"w-4 h-4 mr-1"}),"Start OAuth Flow"]}),i.jsx(me,{onClick:R,variant:"outline",children:"Clear OAuth Data"})]})]})]})]})}function $F(){return i.jsxs(LN,{children:[i.jsx(bc,{path:"/",component:WI}),i.jsx(bc,{path:"/oauth/callback",component:GI}),i.jsx(bc,{path:"/mcp-test",component:MF}),i.jsx(bc,{component:QI})]})}function FF(){return i.jsx(oj,{client:bj,children:i.jsxs(JT,{children:[i.jsx(hR,{}),i.jsx($F,{})]})})}Rb(document.getElementById("root")).render(i.jsx(x.StrictMode,{children:i.jsx(FF,{})}));
|