@agent-deck/backend 1.6.4 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/lib/agent-deck-context.d.ts +4 -2
  3. package/dist/lib/agent-deck-context.d.ts.map +1 -1
  4. package/dist/lib/agent-deck-context.js +35 -8
  5. package/dist/lib/agent-deck-context.js.map +1 -1
  6. package/dist/lib/backend-api-error.d.ts +8 -0
  7. package/dist/lib/backend-api-error.d.ts.map +1 -0
  8. package/dist/lib/backend-api-error.js +35 -0
  9. package/dist/lib/backend-api-error.js.map +1 -0
  10. package/dist/lib/bound-deck-scope.d.ts +6 -1
  11. package/dist/lib/bound-deck-scope.d.ts.map +1 -1
  12. package/dist/lib/bound-deck-scope.js +21 -2
  13. package/dist/lib/bound-deck-scope.js.map +1 -1
  14. package/dist/lib/client-scope.d.ts.map +1 -1
  15. package/dist/lib/client-scope.js +3 -3
  16. package/dist/lib/client-scope.js.map +1 -1
  17. package/dist/lib/dashboard-auth.d.ts +7 -0
  18. package/dist/lib/dashboard-auth.d.ts.map +1 -0
  19. package/dist/lib/dashboard-auth.js +38 -0
  20. package/dist/lib/dashboard-auth.js.map +1 -0
  21. package/dist/lib/http-auth.d.ts +5 -0
  22. package/dist/lib/http-auth.d.ts.map +1 -0
  23. package/dist/lib/http-auth.js +11 -0
  24. package/dist/lib/http-auth.js.map +1 -0
  25. package/dist/lib/route-policy.d.ts +13 -0
  26. package/dist/lib/route-policy.d.ts.map +1 -0
  27. package/dist/lib/route-policy.js +50 -0
  28. package/dist/lib/route-policy.js.map +1 -0
  29. package/dist/mcp-server.d.ts +4 -4
  30. package/dist/mcp-server.d.ts.map +1 -1
  31. package/dist/mcp-server.js +81 -29
  32. package/dist/mcp-server.js.map +1 -1
  33. package/dist/mcp-session-binding.d.ts +16 -3
  34. package/dist/mcp-session-binding.d.ts.map +1 -1
  35. package/dist/mcp-session-binding.js +40 -5
  36. package/dist/mcp-session-binding.js.map +1 -1
  37. package/dist/mcp-tools/policy.d.ts +20 -0
  38. package/dist/mcp-tools/policy.d.ts.map +1 -0
  39. package/dist/mcp-tools/policy.js +61 -0
  40. package/dist/mcp-tools/policy.js.map +1 -0
  41. package/dist/mcp-tools/profile.d.ts +2 -2
  42. package/dist/mcp-tools/register.d.ts +13 -0
  43. package/dist/mcp-tools/register.d.ts.map +1 -1
  44. package/dist/mcp-tools/register.js +154 -89
  45. package/dist/mcp-tools/register.js.map +1 -1
  46. package/dist/mcp-tools/test-harness.d.ts +7 -2
  47. package/dist/mcp-tools/test-harness.d.ts.map +1 -1
  48. package/dist/mcp-tools/test-harness.js +37 -9
  49. package/dist/mcp-tools/test-harness.js.map +1 -1
  50. package/dist/models/database.d.ts +2 -0
  51. package/dist/models/database.d.ts.map +1 -1
  52. package/dist/models/database.js +3 -0
  53. package/dist/models/database.js.map +1 -1
  54. package/dist/routes/credentials.d.ts.map +1 -1
  55. package/dist/routes/credentials.js +25 -23
  56. package/dist/routes/credentials.js.map +1 -1
  57. package/dist/routes/decks.d.ts.map +1 -1
  58. package/dist/routes/decks.js +48 -30
  59. package/dist/routes/decks.js.map +1 -1
  60. package/dist/routes/playbooks.d.ts +0 -2
  61. package/dist/routes/playbooks.d.ts.map +1 -1
  62. package/dist/routes/playbooks.js +58 -117
  63. package/dist/routes/playbooks.js.map +1 -1
  64. package/dist/routes/scope.d.ts.map +1 -1
  65. package/dist/routes/scope.js +4 -1
  66. package/dist/routes/scope.js.map +1 -1
  67. package/dist/routes/services.d.ts.map +1 -1
  68. package/dist/routes/services.js +55 -13
  69. package/dist/routes/services.js.map +1 -1
  70. package/dist/routes/trusted-session.d.ts +10 -0
  71. package/dist/routes/trusted-session.d.ts.map +1 -0
  72. package/dist/routes/trusted-session.js +383 -0
  73. package/dist/routes/trusted-session.js.map +1 -0
  74. package/dist/server/index.d.ts +2 -0
  75. package/dist/server/index.d.ts.map +1 -1
  76. package/dist/server/index.js +23 -1
  77. package/dist/server/index.js.map +1 -1
  78. package/dist/test/auth-fixtures.d.ts +4 -0
  79. package/dist/test/auth-fixtures.d.ts.map +1 -0
  80. package/dist/test/auth-fixtures.js +28 -0
  81. package/dist/test/auth-fixtures.js.map +1 -0
  82. package/dist/trusted-session/admin-secret.d.ts +6 -0
  83. package/dist/trusted-session/admin-secret.d.ts.map +1 -0
  84. package/dist/trusted-session/admin-secret.js +63 -0
  85. package/dist/trusted-session/admin-secret.js.map +1 -0
  86. package/dist/trusted-session/auth.d.ts +29 -0
  87. package/dist/trusted-session/auth.d.ts.map +1 -0
  88. package/dist/trusted-session/auth.js +176 -0
  89. package/dist/trusted-session/auth.js.map +1 -0
  90. package/dist/trusted-session/policy-hook.d.ts +12 -0
  91. package/dist/trusted-session/policy-hook.d.ts.map +1 -0
  92. package/dist/trusted-session/policy-hook.js +71 -0
  93. package/dist/trusted-session/policy-hook.js.map +1 -0
  94. package/dist/trusted-session/route-policy-registry.d.ts +20 -0
  95. package/dist/trusted-session/route-policy-registry.d.ts.map +1 -0
  96. package/dist/trusted-session/route-policy-registry.js +165 -0
  97. package/dist/trusted-session/route-policy-registry.js.map +1 -0
  98. package/dist/trusted-session/store.d.ts +93 -0
  99. package/dist/trusted-session/store.d.ts.map +1 -0
  100. package/dist/trusted-session/store.js +451 -0
  101. package/dist/trusted-session/store.js.map +1 -0
  102. package/package.json +3 -3
  103. package/static-ui/assets/index-DUyowkPn.js +499 -0
  104. package/static-ui/assets/index-cJDgESGn.css +1 -0
  105. package/static-ui/index.html +2 -2
  106. package/static-ui/assets/index-BG4SetCL.css +0 -1
  107. package/static-ui/assets/index-BV17LsZJ.js +0 -485
@@ -1,485 +0,0 @@
1
- var pR=Object.defineProperty;var kw=e=>{throw TypeError(e)};var mR=(e,t,n)=>t in e?pR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var co=(e,t,n)=>mR(e,typeof t!="symbol"?t+"":t,n),up=(e,t,n)=>t.has(e)||kw("Cannot "+n);var q=(e,t,n)=>(up(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?kw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),me=(e,t,n,r)=>(up(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),De=(e,t,n)=>(up(e,t,"access private method"),n);var Eu=(e,t,n,r)=>({set _(o){me(e,t,o,n)},get _(){return q(e,t,r)}});function gR(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var Jd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function al(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var B_={exports:{}},ih={},W_={exports:{}},Ve={};/**
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 Jc=Symbol.for("react.element"),yR=Symbol.for("react.portal"),vR=Symbol.for("react.fragment"),xR=Symbol.for("react.strict_mode"),wR=Symbol.for("react.profiler"),bR=Symbol.for("react.provider"),kR=Symbol.for("react.context"),_R=Symbol.for("react.forward_ref"),SR=Symbol.for("react.suspense"),CR=Symbol.for("react.memo"),ER=Symbol.for("react.lazy"),_w=Symbol.iterator;function NR(e){return e===null||typeof e!="object"?null:(e=_w&&e[_w]||e["@@iterator"],typeof e=="function"?e:null)}var K_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Z_=Object.assign,Q_={};function ll(e,t,n){this.props=e,this.context=t,this.refs=Q_,this.updater=n||K_}ll.prototype.isReactComponent={};ll.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};ll.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function G_(){}G_.prototype=ll.prototype;function Qy(e,t,n){this.props=e,this.context=t,this.refs=Q_,this.updater=n||K_}var Gy=Qy.prototype=new G_;Gy.constructor=Qy;Z_(Gy,ll.prototype);Gy.isPureReactComponent=!0;var Sw=Array.isArray,J_=Object.prototype.hasOwnProperty,Jy={current:null},Y_={key:!0,ref:!0,__self:!0,__source:!0};function X_(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)J_.call(t,r)&&!Y_.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Jc,type:e,key:s,ref:i,props:o,_owner:Jy.current}}function jR(e,t){return{$$typeof:Jc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Yy(e){return typeof e=="object"&&e!==null&&e.$$typeof===Jc}function PR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Cw=/\/+/g;function dp(e,t){return typeof e=="object"&&e!==null&&e.key!=null?PR(""+e.key):t.toString(36)}function xd(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Jc:case yR:i=!0}}if(i)return i=e,o=o(i),e=r===""?"."+dp(i,0):r,Sw(o)?(n="",e!=null&&(n=e.replace(Cw,"$&/")+"/"),xd(o,t,n,"",function(u){return u})):o!=null&&(Yy(o)&&(o=jR(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(Cw,"$&/")+"/")+e)),t.push(o)),1;if(i=0,r=r===""?".":r+":",Sw(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+dp(s,a);i+=xd(s,t,n,l,o)}else if(l=NR(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+dp(s,a++),i+=xd(s,t,n,l,o);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Nu(e,t,n){if(e==null)return e;var r=[],o=0;return xd(e,r,"","",function(s){return t.call(n,s,o++)}),r}function TR(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Cn={current:null},wd={transition:null},$R={ReactCurrentDispatcher:Cn,ReactCurrentBatchConfig:wd,ReactCurrentOwner:Jy};function eS(){throw Error("act(...) is not supported in production builds of React.")}Ve.Children={map:Nu,forEach:function(e,t,n){Nu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Nu(e,function(){t++}),t},toArray:function(e){return Nu(e,function(t){return t})||[]},only:function(e){if(!Yy(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ve.Component=ll;Ve.Fragment=vR;Ve.Profiler=wR;Ve.PureComponent=Qy;Ve.StrictMode=xR;Ve.Suspense=SR;Ve.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$R;Ve.act=eS;Ve.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Z_({},e.props),o=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=Jy.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)J_.call(t,l)&&!Y_.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Jc,type:e.type,key:o,ref:s,props:r,_owner:i}};Ve.createContext=function(e){return e={$$typeof:kR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:bR,_context:e},e.Consumer=e};Ve.createElement=X_;Ve.createFactory=function(e){var t=X_.bind(null,e);return t.type=e,t};Ve.createRef=function(){return{current:null}};Ve.forwardRef=function(e){return{$$typeof:_R,render:e}};Ve.isValidElement=Yy;Ve.lazy=function(e){return{$$typeof:ER,_payload:{_status:-1,_result:e},_init:TR}};Ve.memo=function(e,t){return{$$typeof:CR,type:e,compare:t===void 0?null:t}};Ve.startTransition=function(e){var t=wd.transition;wd.transition={};try{e()}finally{wd.transition=t}};Ve.unstable_act=eS;Ve.useCallback=function(e,t){return Cn.current.useCallback(e,t)};Ve.useContext=function(e){return Cn.current.useContext(e)};Ve.useDebugValue=function(){};Ve.useDeferredValue=function(e){return Cn.current.useDeferredValue(e)};Ve.useEffect=function(e,t){return Cn.current.useEffect(e,t)};Ve.useId=function(){return Cn.current.useId()};Ve.useImperativeHandle=function(e,t,n){return Cn.current.useImperativeHandle(e,t,n)};Ve.useInsertionEffect=function(e,t){return Cn.current.useInsertionEffect(e,t)};Ve.useLayoutEffect=function(e,t){return Cn.current.useLayoutEffect(e,t)};Ve.useMemo=function(e,t){return Cn.current.useMemo(e,t)};Ve.useReducer=function(e,t,n){return Cn.current.useReducer(e,t,n)};Ve.useRef=function(e){return Cn.current.useRef(e)};Ve.useState=function(e){return Cn.current.useState(e)};Ve.useSyncExternalStore=function(e,t,n){return Cn.current.useSyncExternalStore(e,t,n)};Ve.useTransition=function(){return Cn.current.useTransition()};Ve.version="18.3.1";W_.exports=Ve;var w=W_.exports;const Br=al(w),Yc=gR({__proto__:null,default:Br},[w]);/**
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 RR=w,IR=Symbol.for("react.element"),AR=Symbol.for("react.fragment"),OR=Object.prototype.hasOwnProperty,MR=RR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,DR={key:!0,ref:!0,__self:!0,__source:!0};function tS(e,t,n){var r,o={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)OR.call(t,r)&&!DR.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:IR,type:e,key:s,ref:i,props:o,_owner:MR.current}}ih.Fragment=AR;ih.jsx=tS;ih.jsxs=tS;B_.exports=ih;var c=B_.exports,nS={exports:{}},Yn={},rS={exports:{}},oS={};/**
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(e){function t(M,K){var N=M.length;M.push(K);e:for(;0<N;){var z=N-1>>>1,W=M[z];if(0<o(W,K))M[z]=K,M[N]=W,N=z;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var K=M[0],N=M.pop();if(N!==K){M[0]=N;e:for(var z=0,W=M.length,_=W>>>1;z<_;){var C=2*(z+1)-1,A=M[C],F=C+1,Z=M[F];if(0>o(A,N))F<W&&0>o(Z,A)?(M[z]=Z,M[F]=N,z=F):(M[z]=A,M[C]=N,z=C);else if(F<W&&0>o(Z,N))M[z]=Z,M[F]=N,z=F;else break e}}return K}function o(M,K){var N=M.sortIndex-K.sortIndex;return N!==0?N:M.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],u=[],d=1,f=null,p=3,h=!1,y=!1,m=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=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(M){for(var K=n(u);K!==null;){if(K.callback===null)r(u);else if(K.startTime<=M)r(u),K.sortIndex=K.expirationTime,t(l,K);else break;K=n(u)}}function k(M){if(m=!1,b(M),!y)if(n(l)!==null)y=!0,Q(S);else{var K=n(u);K!==null&&X(k,K.startTime-M)}}function S(M,K){y=!1,m&&(m=!1,g(O),O=-1),h=!0;var N=p;try{for(b(K),f=n(l);f!==null&&(!(f.expirationTime>K)||M&&!j());){var z=f.callback;if(typeof z=="function"){f.callback=null,p=f.priorityLevel;var W=z(f.expirationTime<=K);K=e.unstable_now(),typeof W=="function"?f.callback=W:f===n(l)&&r(l),b(K)}else r(l);f=n(l)}if(f!==null)var _=!0;else{var C=n(u);C!==null&&X(k,C.startTime-K),_=!1}return _}finally{f=null,p=N,h=!1}}var E=!1,P=null,O=-1,R=5,$=-1;function j(){return!(e.unstable_now()-$<R)}function I(){if(P!==null){var M=e.unstable_now();$=M;var K=!0;try{K=P(!0,M)}finally{K?D():(E=!1,P=null)}}else E=!1}var D;if(typeof v=="function")D=function(){v(I)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,T=L.port2;L.port1.onmessage=I,D=function(){T.postMessage(null)}}else D=function(){x(I,0)};function Q(M){P=M,E||(E=!0,D())}function X(M,K){O=x(function(){M(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,Q(S))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(M){switch(p){case 1:case 2:case 3:var K=3;break;default:K=p}var N=p;p=K;try{return M()}finally{p=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,K){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var N=p;p=M;try{return K()}finally{p=N}},e.unstable_scheduleCallback=function(M,K,N){var z=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?z+N:z):N=z,M){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=N+W,M={id:d++,callback:K,priorityLevel:M,startTime:N,expirationTime:W,sortIndex:-1},N>z?(M.sortIndex=N,t(u,M),n(l)===null&&M===n(u)&&(m?(g(O),O=-1):m=!0,X(k,N-z))):(M.sortIndex=W,t(l,M),y||h||(y=!0,Q(S))),M},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(M){var K=p;return function(){var N=p;p=K;try{return M.apply(this,arguments)}finally{p=N}}}})(oS);rS.exports=oS;var LR=rS.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 zR=w,Jn=LR;function oe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var sS=new Set,wc={};function Mi(e,t){Ha(e,t),Ha(e+"Capture",t)}function Ha(e,t){for(wc[e]=t,e=0;e<t.length;e++)sS.add(t[e])}var Po=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$m=Object.prototype.hasOwnProperty,FR=/^[: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]*$/,Ew={},Nw={};function UR(e){return $m.call(Nw,e)?!0:$m.call(Ew,e)?!1:FR.test(e)?Nw[e]=!0:(Ew[e]=!0,!1)}function qR(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function VR(e,t,n,r){if(t===null||typeof t>"u"||qR(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function En(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var rn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rn[e]=new En(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rn[t]=new En(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rn[e]=new En(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rn[e]=new En(e,2,!1,e,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(e){rn[e]=new En(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rn[e]=new En(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rn[e]=new En(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rn[e]=new En(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rn[e]=new En(e,5,!1,e.toLowerCase(),null,!1,!1)});var Xy=/[\-:]([a-z])/g;function ev(e){return e[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(e){var t=e.replace(Xy,ev);rn[t]=new En(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Xy,ev);rn[t]=new En(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Xy,ev);rn[t]=new En(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rn[e]=new En(e,1,!1,e.toLowerCase(),null,!1,!1)});rn.xlinkHref=new En("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rn[e]=new En(e,1,!1,e.toLowerCase(),null,!0,!0)});function tv(e,t,n,r){var o=rn.hasOwnProperty(t)?rn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(VR(t,n,o,r)&&(n=null),r||o===null?UR(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Mo=zR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ju=Symbol.for("react.element"),ra=Symbol.for("react.portal"),oa=Symbol.for("react.fragment"),nv=Symbol.for("react.strict_mode"),Rm=Symbol.for("react.profiler"),iS=Symbol.for("react.provider"),aS=Symbol.for("react.context"),rv=Symbol.for("react.forward_ref"),Im=Symbol.for("react.suspense"),Am=Symbol.for("react.suspense_list"),ov=Symbol.for("react.memo"),Jo=Symbol.for("react.lazy"),lS=Symbol.for("react.offscreen"),jw=Symbol.iterator;function Sl(e){return e===null||typeof e!="object"?null:(e=jw&&e[jw]||e["@@iterator"],typeof e=="function"?e:null)}var Et=Object.assign,fp;function Ul(e){if(fp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);fp=t&&t[1]||""}return`
34
- `+fp+e}var hp=!1;function pp(e,t){if(!e||hp)return"";hp=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
35
- `),s=r.stack.split(`
36
- `),i=o.length-1,a=s.length-1;1<=i&&0<=a&&o[i]!==s[a];)a--;for(;1<=i&&0<=a;i--,a--)if(o[i]!==s[a]){if(i!==1||a!==1)do if(i--,a--,0>a||o[i]!==s[a]){var l=`
37
- `+o[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{hp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ul(e):""}function HR(e){switch(e.tag){case 5:return Ul(e.type);case 16:return Ul("Lazy");case 13:return Ul("Suspense");case 19:return Ul("SuspenseList");case 0:case 2:case 15:return e=pp(e.type,!1),e;case 11:return e=pp(e.type.render,!1),e;case 1:return e=pp(e.type,!0),e;default:return""}}function Om(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case oa:return"Fragment";case ra:return"Portal";case Rm:return"Profiler";case nv:return"StrictMode";case Im:return"Suspense";case Am:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case aS:return(e.displayName||"Context")+".Consumer";case iS:return(e._context.displayName||"Context")+".Provider";case rv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ov:return t=e.displayName||null,t!==null?t:Om(e.type)||"Memo";case Jo:t=e._payload,e=e._init;try{return Om(e(t))}catch{}}return null}function BR(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Om(t);case 8:return t===nv?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ns(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function WR(e){var t=cS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pu(e){e._valueTracker||(e._valueTracker=WR(e))}function uS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=cS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Yd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Mm(e,t){var n=t.checked;return Et({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ns(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function dS(e,t){t=t.checked,t!=null&&tv(e,"checked",t,!1)}function Dm(e,t){dS(e,t);var n=Ns(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Lm(e,t.type,n):t.hasOwnProperty("defaultValue")&&Lm(e,t.type,Ns(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Tw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Lm(e,t,n){(t!=="number"||Yd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ql=Array.isArray;function va(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Ns(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function zm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(oe(91));return Et({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $w(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(oe(92));if(ql(n)){if(1<n.length)throw Error(oe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ns(n)}}function fS(e,t){var n=Ns(t.value),r=Ns(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Rw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function hS(e){switch(e){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 Fm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?hS(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Tu,pS=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Tu=Tu||document.createElement("div"),Tu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Tu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function bc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Yl={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},KR=["Webkit","ms","Moz","O"];Object.keys(Yl).forEach(function(e){KR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Yl[t]=Yl[e]})});function mS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Yl.hasOwnProperty(e)&&Yl[e]?(""+t).trim():t+"px"}function gS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=mS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var ZR=Et({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 Um(e,t){if(t){if(ZR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function qm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Vm=null;function sv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Hm=null,xa=null,wa=null;function Iw(e){if(e=tu(e)){if(typeof Hm!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=dh(t),Hm(e.stateNode,e.type,t))}}function yS(e){xa?wa?wa.push(e):wa=[e]:xa=e}function vS(){if(xa){var e=xa,t=wa;if(wa=xa=null,Iw(e),t)for(e=0;e<t.length;e++)Iw(t[e])}}function xS(e,t){return e(t)}function wS(){}var mp=!1;function bS(e,t,n){if(mp)return e(t,n);mp=!0;try{return xS(e,t,n)}finally{mp=!1,(xa!==null||wa!==null)&&(wS(),vS())}}function kc(e,t){var n=e.stateNode;if(n===null)return null;var r=dh(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(oe(231,t,typeof n));return n}var Bm=!1;if(Po)try{var Cl={};Object.defineProperty(Cl,"passive",{get:function(){Bm=!0}}),window.addEventListener("test",Cl,Cl),window.removeEventListener("test",Cl,Cl)}catch{Bm=!1}function QR(e,t,n,r,o,s,i,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Xl=!1,Xd=null,ef=!1,Wm=null,GR={onError:function(e){Xl=!0,Xd=e}};function JR(e,t,n,r,o,s,i,a,l){Xl=!1,Xd=null,QR.apply(GR,arguments)}function YR(e,t,n,r,o,s,i,a,l){if(JR.apply(this,arguments),Xl){if(Xl){var u=Xd;Xl=!1,Xd=null}else throw Error(oe(198));ef||(ef=!0,Wm=u)}}function Di(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function kS(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Aw(e){if(Di(e)!==e)throw Error(oe(188))}function XR(e){var t=e.alternate;if(!t){if(t=Di(e),t===null)throw Error(oe(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return Aw(o),e;if(s===r)return Aw(o),t;s=s.sibling}throw Error(oe(188))}if(n.return!==r.return)n=o,r=s;else{for(var i=!1,a=o.child;a;){if(a===n){i=!0,n=o,r=s;break}if(a===r){i=!0,r=o,n=s;break}a=a.sibling}if(!i){for(a=s.child;a;){if(a===n){i=!0,n=s,r=o;break}if(a===r){i=!0,r=s,n=o;break}a=a.sibling}if(!i)throw Error(oe(189))}}if(n.alternate!==r)throw Error(oe(190))}if(n.tag!==3)throw Error(oe(188));return n.stateNode.current===n?e:t}function _S(e){return e=XR(e),e!==null?SS(e):null}function SS(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=SS(e);if(t!==null)return t;e=e.sibling}return null}var CS=Jn.unstable_scheduleCallback,Ow=Jn.unstable_cancelCallback,eI=Jn.unstable_shouldYield,tI=Jn.unstable_requestPaint,Rt=Jn.unstable_now,nI=Jn.unstable_getCurrentPriorityLevel,iv=Jn.unstable_ImmediatePriority,ES=Jn.unstable_UserBlockingPriority,tf=Jn.unstable_NormalPriority,rI=Jn.unstable_LowPriority,NS=Jn.unstable_IdlePriority,ah=null,to=null;function oI(e){if(to&&typeof to.onCommitFiberRoot=="function")try{to.onCommitFiberRoot(ah,e,void 0,(e.current.flags&128)===128)}catch{}}var Rr=Math.clz32?Math.clz32:aI,sI=Math.log,iI=Math.LN2;function aI(e){return e>>>=0,e===0?32:31-(sI(e)/iI|0)|0}var $u=64,Ru=4194304;function Vl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function nf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~o;a!==0?r=Vl(a):(s&=i,s!==0&&(r=Vl(s)))}else i=n&~o,i!==0?r=Vl(i):s!==0&&(r=Vl(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Rr(t),o=1<<n,r|=e[n],t&=~o;return r}function lI(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 cI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-Rr(s),a=1<<i,l=o[i];l===-1?(!(a&n)||a&r)&&(o[i]=lI(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Km(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function jS(){var e=$u;return $u<<=1,!($u&4194240)&&($u=64),e}function gp(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Rr(t),e[t]=n}function uI(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Rr(n),s=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~s}}function av(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Rr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var Ye=0;function PS(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var TS,lv,$S,RS,IS,Zm=!1,Iu=[],ys=null,vs=null,xs=null,_c=new Map,Sc=new Map,ns=[],dI="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 Mw(e,t){switch(e){case"focusin":case"focusout":ys=null;break;case"dragenter":case"dragleave":vs=null;break;case"mouseover":case"mouseout":xs=null;break;case"pointerover":case"pointerout":_c.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sc.delete(t.pointerId)}}function El(e,t,n,r,o,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[o]},t!==null&&(t=tu(t),t!==null&&lv(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function fI(e,t,n,r,o){switch(t){case"focusin":return ys=El(ys,e,t,n,r,o),!0;case"dragenter":return vs=El(vs,e,t,n,r,o),!0;case"mouseover":return xs=El(xs,e,t,n,r,o),!0;case"pointerover":var s=o.pointerId;return _c.set(s,El(_c.get(s)||null,e,t,n,r,o)),!0;case"gotpointercapture":return s=o.pointerId,Sc.set(s,El(Sc.get(s)||null,e,t,n,r,o)),!0}return!1}function AS(e){var t=oi(e.target);if(t!==null){var n=Di(t);if(n!==null){if(t=n.tag,t===13){if(t=kS(n),t!==null){e.blockedOn=t,IS(e.priority,function(){$S(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function bd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Qm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Vm=r,n.target.dispatchEvent(r),Vm=null}else return t=tu(n),t!==null&&lv(t),e.blockedOn=n,!1;t.shift()}return!0}function Dw(e,t,n){bd(e)&&n.delete(t)}function hI(){Zm=!1,ys!==null&&bd(ys)&&(ys=null),vs!==null&&bd(vs)&&(vs=null),xs!==null&&bd(xs)&&(xs=null),_c.forEach(Dw),Sc.forEach(Dw)}function Nl(e,t){e.blockedOn===t&&(e.blockedOn=null,Zm||(Zm=!0,Jn.unstable_scheduleCallback(Jn.unstable_NormalPriority,hI)))}function Cc(e){function t(o){return Nl(o,e)}if(0<Iu.length){Nl(Iu[0],e);for(var n=1;n<Iu.length;n++){var r=Iu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ys!==null&&Nl(ys,e),vs!==null&&Nl(vs,e),xs!==null&&Nl(xs,e),_c.forEach(t),Sc.forEach(t),n=0;n<ns.length;n++)r=ns[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ns.length&&(n=ns[0],n.blockedOn===null);)AS(n),n.blockedOn===null&&ns.shift()}var ba=Mo.ReactCurrentBatchConfig,rf=!0;function pI(e,t,n,r){var o=Ye,s=ba.transition;ba.transition=null;try{Ye=1,cv(e,t,n,r)}finally{Ye=o,ba.transition=s}}function mI(e,t,n,r){var o=Ye,s=ba.transition;ba.transition=null;try{Ye=4,cv(e,t,n,r)}finally{Ye=o,ba.transition=s}}function cv(e,t,n,r){if(rf){var o=Qm(e,t,n,r);if(o===null)Ep(e,t,r,of,n),Mw(e,r);else if(fI(o,e,t,n,r))r.stopPropagation();else if(Mw(e,r),t&4&&-1<dI.indexOf(e)){for(;o!==null;){var s=tu(o);if(s!==null&&TS(s),s=Qm(e,t,n,r),s===null&&Ep(e,t,r,of,n),s===o)break;o=s}o!==null&&r.stopPropagation()}else Ep(e,t,r,null,n)}}var of=null;function Qm(e,t,n,r){if(of=null,e=sv(r),e=oi(e),e!==null)if(t=Di(e),t===null)e=null;else if(n=t.tag,n===13){if(e=kS(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return of=e,null}function OS(e){switch(e){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(nI()){case iv:return 1;case ES:return 4;case tf:case rI:return 16;case NS:return 536870912;default:return 16}default:return 16}}var ps=null,uv=null,kd=null;function MS(){if(kd)return kd;var e,t=uv,n=t.length,r,o="value"in ps?ps.value:ps.textContent,s=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[s-r];r++);return kd=o.slice(e,1<r?1-r:void 0)}function _d(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Au(){return!0}function Lw(){return!1}function Xn(e){function t(n,r,o,s,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Au:Lw,this.isPropagationStopped=Lw,this}return Et(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Au)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Au)},persist:function(){},isPersistent:Au}),t}var cl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dv=Xn(cl),eu=Et({},cl,{view:0,detail:0}),gI=Xn(eu),yp,vp,jl,lh=Et({},eu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==jl&&(jl&&e.type==="mousemove"?(yp=e.screenX-jl.screenX,vp=e.screenY-jl.screenY):vp=yp=0,jl=e),yp)},movementY:function(e){return"movementY"in e?e.movementY:vp}}),zw=Xn(lh),yI=Et({},lh,{dataTransfer:0}),vI=Xn(yI),xI=Et({},eu,{relatedTarget:0}),xp=Xn(xI),wI=Et({},cl,{animationName:0,elapsedTime:0,pseudoElement:0}),bI=Xn(wI),kI=Et({},cl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_I=Xn(kI),SI=Et({},cl,{data:0}),Fw=Xn(SI),CI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},EI={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"},NI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=NI[e])?!!t[e]:!1}function fv(){return jI}var PI=Et({},eu,{key:function(e){if(e.key){var t=CI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_d(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?EI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fv,charCode:function(e){return e.type==="keypress"?_d(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_d(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),TI=Xn(PI),$I=Et({},lh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uw=Xn($I),RI=Et({},eu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fv}),II=Xn(RI),AI=Et({},cl,{propertyName:0,elapsedTime:0,pseudoElement:0}),OI=Xn(AI),MI=Et({},lh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),DI=Xn(MI),LI=[9,13,27,32],hv=Po&&"CompositionEvent"in window,ec=null;Po&&"documentMode"in document&&(ec=document.documentMode);var zI=Po&&"TextEvent"in window&&!ec,DS=Po&&(!hv||ec&&8<ec&&11>=ec),qw=" ",Vw=!1;function LS(e,t){switch(e){case"keyup":return LI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sa=!1;function FI(e,t){switch(e){case"compositionend":return zS(t);case"keypress":return t.which!==32?null:(Vw=!0,qw);case"textInput":return e=t.data,e===qw&&Vw?null:e;default:return null}}function UI(e,t){if(sa)return e==="compositionend"||!hv&&LS(e,t)?(e=MS(),kd=uv=ps=null,sa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return DS&&t.locale!=="ko"?null:t.data;default:return null}}var qI={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 Hw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!qI[e.type]:t==="textarea"}function FS(e,t,n,r){yS(r),t=sf(t,"onChange"),0<t.length&&(n=new dv("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var tc=null,Ec=null;function VI(e){JS(e,0)}function ch(e){var t=la(e);if(uS(t))return e}function HI(e,t){if(e==="change")return t}var US=!1;if(Po){var wp;if(Po){var bp="oninput"in document;if(!bp){var Bw=document.createElement("div");Bw.setAttribute("oninput","return;"),bp=typeof Bw.oninput=="function"}wp=bp}else wp=!1;US=wp&&(!document.documentMode||9<document.documentMode)}function Ww(){tc&&(tc.detachEvent("onpropertychange",qS),Ec=tc=null)}function qS(e){if(e.propertyName==="value"&&ch(Ec)){var t=[];FS(t,Ec,e,sv(e)),bS(VI,t)}}function BI(e,t,n){e==="focusin"?(Ww(),tc=t,Ec=n,tc.attachEvent("onpropertychange",qS)):e==="focusout"&&Ww()}function WI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ch(Ec)}function KI(e,t){if(e==="click")return ch(t)}function ZI(e,t){if(e==="input"||e==="change")return ch(t)}function QI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Or=typeof Object.is=="function"?Object.is:QI;function Nc(e,t){if(Or(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!$m.call(t,o)||!Or(e[o],t[o]))return!1}return!0}function Kw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zw(e,t){var n=Kw(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Kw(n)}}function VS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?VS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function HS(){for(var e=window,t=Yd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Yd(e.document)}return t}function pv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function GI(e){var t=HS(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&VS(n.ownerDocument.documentElement,n)){if(r!==null&&pv(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=Zw(n,s);var i=Zw(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var JI=Po&&"documentMode"in document&&11>=document.documentMode,ia=null,Gm=null,nc=null,Jm=!1;function Qw(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jm||ia==null||ia!==Yd(r)||(r=ia,"selectionStart"in r&&pv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),nc&&Nc(nc,r)||(nc=r,r=sf(Gm,"onSelect"),0<r.length&&(t=new dv("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ia)))}function Ou(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var aa={animationend:Ou("Animation","AnimationEnd"),animationiteration:Ou("Animation","AnimationIteration"),animationstart:Ou("Animation","AnimationStart"),transitionend:Ou("Transition","TransitionEnd")},kp={},BS={};Po&&(BS=document.createElement("div").style,"AnimationEvent"in window||(delete aa.animationend.animation,delete aa.animationiteration.animation,delete aa.animationstart.animation),"TransitionEvent"in window||delete aa.transitionend.transition);function uh(e){if(kp[e])return kp[e];if(!aa[e])return e;var t=aa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in BS)return kp[e]=t[n];return e}var WS=uh("animationend"),KS=uh("animationiteration"),ZS=uh("animationstart"),QS=uh("transitionend"),GS=new Map,Gw="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 Is(e,t){GS.set(e,t),Mi(t,[e])}for(var _p=0;_p<Gw.length;_p++){var Sp=Gw[_p],YI=Sp.toLowerCase(),XI=Sp[0].toUpperCase()+Sp.slice(1);Is(YI,"on"+XI)}Is(WS,"onAnimationEnd");Is(KS,"onAnimationIteration");Is(ZS,"onAnimationStart");Is("dblclick","onDoubleClick");Is("focusin","onFocus");Is("focusout","onBlur");Is(QS,"onTransitionEnd");Ha("onMouseEnter",["mouseout","mouseover"]);Ha("onMouseLeave",["mouseout","mouseover"]);Ha("onPointerEnter",["pointerout","pointerover"]);Ha("onPointerLeave",["pointerout","pointerover"]);Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hl="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(" "),eA=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hl));function Jw(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,YR(r,t,void 0,e),e.currentTarget=null}function JS(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var a=r[i],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&o.isPropagationStopped())break e;Jw(o,a,u),s=l}else for(i=0;i<r.length;i++){if(a=r[i],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&o.isPropagationStopped())break e;Jw(o,a,u),s=l}}}if(ef)throw e=Wm,ef=!1,Wm=null,e}function ct(e,t){var n=t[ng];n===void 0&&(n=t[ng]=new Set);var r=e+"__bubble";n.has(r)||(YS(t,e,2,!1),n.add(r))}function Cp(e,t,n){var r=0;t&&(r|=4),YS(n,e,r,t)}var Mu="_reactListening"+Math.random().toString(36).slice(2);function jc(e){if(!e[Mu]){e[Mu]=!0,sS.forEach(function(n){n!=="selectionchange"&&(eA.has(n)||Cp(n,!1,e),Cp(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mu]||(t[Mu]=!0,Cp("selectionchange",!1,t))}}function YS(e,t,n,r){switch(OS(t)){case 1:var o=pI;break;case 4:o=mI;break;default:o=cv}n=o.bind(null,t,n,e),o=void 0,!Bm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ep(e,t,n,r,o){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(i===4)for(i=r.return;i!==null;){var l=i.tag;if((l===3||l===4)&&(l=i.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;i=i.return}for(;a!==null;){if(i=oi(a),i===null)return;if(l=i.tag,l===5||l===6){r=s=i;continue e}a=a.parentNode}}r=r.return}bS(function(){var u=s,d=sv(n),f=[];e:{var p=GS.get(e);if(p!==void 0){var h=dv,y=e;switch(e){case"keypress":if(_d(n)===0)break e;case"keydown":case"keyup":h=TI;break;case"focusin":y="focus",h=xp;break;case"focusout":y="blur",h=xp;break;case"beforeblur":case"afterblur":h=xp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=zw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=vI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=II;break;case WS:case KS:case ZS:h=bI;break;case QS:h=OI;break;case"scroll":h=gI;break;case"wheel":h=DI;break;case"copy":case"cut":case"paste":h=_I;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Uw}var m=(t&4)!==0,x=!m&&e==="scroll",g=m?p!==null?p+"Capture":null:p;m=[];for(var v=u,b;v!==null;){b=v;var k=b.stateNode;if(b.tag===5&&k!==null&&(b=k,g!==null&&(k=kc(v,g),k!=null&&m.push(Pc(v,k,b)))),x)break;v=v.return}0<m.length&&(p=new h(p,y,null,n,d),f.push({event:p,listeners:m}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Vm&&(y=n.relatedTarget||n.fromElement)&&(oi(y)||y[To]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=u,y=y?oi(y):null,y!==null&&(x=Di(y),y!==x||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=u),h!==y)){if(m=zw,k="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=Uw,k="onPointerLeave",g="onPointerEnter",v="pointer"),x=h==null?p:la(h),b=y==null?p:la(y),p=new m(k,v+"leave",h,n,d),p.target=x,p.relatedTarget=b,k=null,oi(d)===u&&(m=new m(g,v+"enter",y,n,d),m.target=b,m.relatedTarget=x,k=m),x=k,h&&y)t:{for(m=h,g=y,v=0,b=m;b;b=qi(b))v++;for(b=0,k=g;k;k=qi(k))b++;for(;0<v-b;)m=qi(m),v--;for(;0<b-v;)g=qi(g),b--;for(;v--;){if(m===g||g!==null&&m===g.alternate)break t;m=qi(m),g=qi(g)}m=null}else m=null;h!==null&&Yw(f,p,h,m,!1),y!==null&&x!==null&&Yw(f,x,y,m,!0)}}e:{if(p=u?la(u):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var S=HI;else if(Hw(p))if(US)S=ZI;else{S=WI;var E=BI}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=KI);if(S&&(S=S(e,u))){FS(f,S,n,d);break e}E&&E(e,p,u),e==="focusout"&&(E=p._wrapperState)&&E.controlled&&p.type==="number"&&Lm(p,"number",p.value)}switch(E=u?la(u):window,e){case"focusin":(Hw(E)||E.contentEditable==="true")&&(ia=E,Gm=u,nc=null);break;case"focusout":nc=Gm=ia=null;break;case"mousedown":Jm=!0;break;case"contextmenu":case"mouseup":case"dragend":Jm=!1,Qw(f,n,d);break;case"selectionchange":if(JI)break;case"keydown":case"keyup":Qw(f,n,d)}var P;if(hv)e:{switch(e){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else sa?LS(e,n)&&(O="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(O="onCompositionStart");O&&(DS&&n.locale!=="ko"&&(sa||O!=="onCompositionStart"?O==="onCompositionEnd"&&sa&&(P=MS()):(ps=d,uv="value"in ps?ps.value:ps.textContent,sa=!0)),E=sf(u,O),0<E.length&&(O=new Fw(O,e,null,n,d),f.push({event:O,listeners:E}),P?O.data=P:(P=zS(n),P!==null&&(O.data=P)))),(P=zI?FI(e,n):UI(e,n))&&(u=sf(u,"onBeforeInput"),0<u.length&&(d=new Fw("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=P))}JS(f,t)})}function Pc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function sf(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,s=o.stateNode;o.tag===5&&s!==null&&(o=s,s=kc(e,n),s!=null&&r.unshift(Pc(e,s,o)),s=kc(e,t),s!=null&&r.push(Pc(e,s,o))),e=e.return}return r}function qi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Yw(e,t,n,r,o){for(var s=t._reactName,i=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=kc(n,s),l!=null&&i.unshift(Pc(n,l,a))):o||(l=kc(n,s),l!=null&&i.push(Pc(n,l,a)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var tA=/\r\n?/g,nA=/\u0000|\uFFFD/g;function Xw(e){return(typeof e=="string"?e:""+e).replace(tA,`
38
- `).replace(nA,"")}function Du(e,t,n){if(t=Xw(t),Xw(e)!==t&&n)throw Error(oe(425))}function af(){}var Ym=null,Xm=null;function eg(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tg=typeof setTimeout=="function"?setTimeout:void 0,rA=typeof clearTimeout=="function"?clearTimeout:void 0,eb=typeof Promise=="function"?Promise:void 0,oA=typeof queueMicrotask=="function"?queueMicrotask:typeof eb<"u"?function(e){return eb.resolve(null).then(e).catch(sA)}:tg;function sA(e){setTimeout(function(){throw e})}function Np(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Cc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Cc(t)}function ws(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function tb(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ul=Math.random().toString(36).slice(2),Qr="__reactFiber$"+ul,Tc="__reactProps$"+ul,To="__reactContainer$"+ul,ng="__reactEvents$"+ul,iA="__reactListeners$"+ul,aA="__reactHandles$"+ul;function oi(e){var t=e[Qr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[To]||n[Qr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=tb(e);e!==null;){if(n=e[Qr])return n;e=tb(e)}return t}e=n,n=e.parentNode}return null}function tu(e){return e=e[Qr]||e[To],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function la(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(oe(33))}function dh(e){return e[Tc]||null}var rg=[],ca=-1;function As(e){return{current:e}}function pt(e){0>ca||(e.current=rg[ca],rg[ca]=null,ca--)}function ot(e,t){ca++,rg[ca]=e.current,e.current=t}var js={},pn=As(js),Dn=As(!1),wi=js;function Ba(e,t){var n=e.type.contextTypes;if(!n)return js;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ln(e){return e=e.childContextTypes,e!=null}function lf(){pt(Dn),pt(pn)}function nb(e,t,n){if(pn.current!==js)throw Error(oe(168));ot(pn,t),ot(Dn,n)}function XS(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(oe(108,BR(e)||"Unknown",o));return Et({},n,r)}function cf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||js,wi=pn.current,ot(pn,e),ot(Dn,Dn.current),!0}function rb(e,t,n){var r=e.stateNode;if(!r)throw Error(oe(169));n?(e=XS(e,t,wi),r.__reactInternalMemoizedMergedChildContext=e,pt(Dn),pt(pn),ot(pn,e)):pt(Dn),ot(Dn,n)}var vo=null,fh=!1,jp=!1;function eC(e){vo===null?vo=[e]:vo.push(e)}function lA(e){fh=!0,eC(e)}function Os(){if(!jp&&vo!==null){jp=!0;var e=0,t=Ye;try{var n=vo;for(Ye=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vo=null,fh=!1}catch(o){throw vo!==null&&(vo=vo.slice(e+1)),CS(iv,Os),o}finally{Ye=t,jp=!1}}return null}var ua=[],da=0,uf=null,df=0,ar=[],lr=0,bi=null,_o=1,So="";function Ks(e,t){ua[da++]=df,ua[da++]=uf,uf=e,df=t}function tC(e,t,n){ar[lr++]=_o,ar[lr++]=So,ar[lr++]=bi,bi=e;var r=_o;e=So;var o=32-Rr(r)-1;r&=~(1<<o),n+=1;var s=32-Rr(t)+o;if(30<s){var i=o-o%5;s=(r&(1<<i)-1).toString(32),r>>=i,o-=i,_o=1<<32-Rr(t)+o|n<<o|r,So=s+e}else _o=1<<s|n<<o|r,So=e}function mv(e){e.return!==null&&(Ks(e,1),tC(e,1,0))}function gv(e){for(;e===uf;)uf=ua[--da],ua[da]=null,df=ua[--da],ua[da]=null;for(;e===bi;)bi=ar[--lr],ar[lr]=null,So=ar[--lr],ar[lr]=null,_o=ar[--lr],ar[lr]=null}var Zn=null,Kn=null,vt=!1,Pr=null;function nC(e,t){var n=dr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function ob(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Zn=e,Kn=ws(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Zn=e,Kn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=bi!==null?{id:_o,overflow:So}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=dr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Zn=e,Kn=null,!0):!1;default:return!1}}function og(e){return(e.mode&1)!==0&&(e.flags&128)===0}function sg(e){if(vt){var t=Kn;if(t){var n=t;if(!ob(e,t)){if(og(e))throw Error(oe(418));t=ws(n.nextSibling);var r=Zn;t&&ob(e,t)?nC(r,n):(e.flags=e.flags&-4097|2,vt=!1,Zn=e)}}else{if(og(e))throw Error(oe(418));e.flags=e.flags&-4097|2,vt=!1,Zn=e}}}function sb(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Zn=e}function Lu(e){if(e!==Zn)return!1;if(!vt)return sb(e),vt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!eg(e.type,e.memoizedProps)),t&&(t=Kn)){if(og(e))throw rC(),Error(oe(418));for(;t;)nC(e,t),t=ws(t.nextSibling)}if(sb(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(oe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Kn=ws(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Kn=null}}else Kn=Zn?ws(e.stateNode.nextSibling):null;return!0}function rC(){for(var e=Kn;e;)e=ws(e.nextSibling)}function Wa(){Kn=Zn=null,vt=!1}function yv(e){Pr===null?Pr=[e]:Pr.push(e)}var cA=Mo.ReactCurrentBatchConfig;function Pl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(oe(309));var r=n.stateNode}if(!r)throw Error(oe(147,e));var o=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var a=o.refs;i===null?delete a[s]:a[s]=i},t._stringRef=s,t)}if(typeof e!="string")throw Error(oe(284));if(!n._owner)throw Error(oe(290,e))}return e}function zu(e,t){throw e=Object.prototype.toString.call(t),Error(oe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ib(e){var t=e._init;return t(e._payload)}function oC(e){function t(g,v){if(e){var b=g.deletions;b===null?(g.deletions=[v],g.flags|=16):b.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function r(g,v){for(g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function o(g,v){return g=Ss(g,v),g.index=0,g.sibling=null,g}function s(g,v,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<v?(g.flags|=2,v):b):(g.flags|=2,v)):(g.flags|=1048576,v)}function i(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,v,b,k){return v===null||v.tag!==6?(v=Op(b,g.mode,k),v.return=g,v):(v=o(v,b),v.return=g,v)}function l(g,v,b,k){var S=b.type;return S===oa?d(g,v,b.props.children,k,b.key):v!==null&&(v.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Jo&&ib(S)===v.type)?(k=o(v,b.props),k.ref=Pl(g,v,b),k.return=g,k):(k=Td(b.type,b.key,b.props,null,g.mode,k),k.ref=Pl(g,v,b),k.return=g,k)}function u(g,v,b,k){return v===null||v.tag!==4||v.stateNode.containerInfo!==b.containerInfo||v.stateNode.implementation!==b.implementation?(v=Mp(b,g.mode,k),v.return=g,v):(v=o(v,b.children||[]),v.return=g,v)}function d(g,v,b,k,S){return v===null||v.tag!==7?(v=vi(b,g.mode,k,S),v.return=g,v):(v=o(v,b),v.return=g,v)}function f(g,v,b){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Op(""+v,g.mode,b),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case ju:return b=Td(v.type,v.key,v.props,null,g.mode,b),b.ref=Pl(g,null,v),b.return=g,b;case ra:return v=Mp(v,g.mode,b),v.return=g,v;case Jo:var k=v._init;return f(g,k(v._payload),b)}if(ql(v)||Sl(v))return v=vi(v,g.mode,b,null),v.return=g,v;zu(g,v)}return null}function p(g,v,b,k){var S=v!==null?v.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return S!==null?null:a(g,v,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case ju:return b.key===S?l(g,v,b,k):null;case ra:return b.key===S?u(g,v,b,k):null;case Jo:return S=b._init,p(g,v,S(b._payload),k)}if(ql(b)||Sl(b))return S!==null?null:d(g,v,b,k,null);zu(g,b)}return null}function h(g,v,b,k,S){if(typeof k=="string"&&k!==""||typeof k=="number")return g=g.get(b)||null,a(v,g,""+k,S);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case ju:return g=g.get(k.key===null?b:k.key)||null,l(v,g,k,S);case ra:return g=g.get(k.key===null?b:k.key)||null,u(v,g,k,S);case Jo:var E=k._init;return h(g,v,b,E(k._payload),S)}if(ql(k)||Sl(k))return g=g.get(b)||null,d(v,g,k,S,null);zu(v,k)}return null}function y(g,v,b,k){for(var S=null,E=null,P=v,O=v=0,R=null;P!==null&&O<b.length;O++){P.index>O?(R=P,P=null):R=P.sibling;var $=p(g,P,b[O],k);if($===null){P===null&&(P=R);break}e&&P&&$.alternate===null&&t(g,P),v=s($,v,O),E===null?S=$:E.sibling=$,E=$,P=R}if(O===b.length)return n(g,P),vt&&Ks(g,O),S;if(P===null){for(;O<b.length;O++)P=f(g,b[O],k),P!==null&&(v=s(P,v,O),E===null?S=P:E.sibling=P,E=P);return vt&&Ks(g,O),S}for(P=r(g,P);O<b.length;O++)R=h(P,g,O,b[O],k),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?O:R.key),v=s(R,v,O),E===null?S=R:E.sibling=R,E=R);return e&&P.forEach(function(j){return t(g,j)}),vt&&Ks(g,O),S}function m(g,v,b,k){var S=Sl(b);if(typeof S!="function")throw Error(oe(150));if(b=S.call(b),b==null)throw Error(oe(151));for(var E=S=null,P=v,O=v=0,R=null,$=b.next();P!==null&&!$.done;O++,$=b.next()){P.index>O?(R=P,P=null):R=P.sibling;var j=p(g,P,$.value,k);if(j===null){P===null&&(P=R);break}e&&P&&j.alternate===null&&t(g,P),v=s(j,v,O),E===null?S=j:E.sibling=j,E=j,P=R}if($.done)return n(g,P),vt&&Ks(g,O),S;if(P===null){for(;!$.done;O++,$=b.next())$=f(g,$.value,k),$!==null&&(v=s($,v,O),E===null?S=$:E.sibling=$,E=$);return vt&&Ks(g,O),S}for(P=r(g,P);!$.done;O++,$=b.next())$=h(P,g,O,$.value,k),$!==null&&(e&&$.alternate!==null&&P.delete($.key===null?O:$.key),v=s($,v,O),E===null?S=$:E.sibling=$,E=$);return e&&P.forEach(function(I){return t(g,I)}),vt&&Ks(g,O),S}function x(g,v,b,k){if(typeof b=="object"&&b!==null&&b.type===oa&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case ju:e:{for(var S=b.key,E=v;E!==null;){if(E.key===S){if(S=b.type,S===oa){if(E.tag===7){n(g,E.sibling),v=o(E,b.props.children),v.return=g,g=v;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Jo&&ib(S)===E.type){n(g,E.sibling),v=o(E,b.props),v.ref=Pl(g,E,b),v.return=g,g=v;break e}n(g,E);break}else t(g,E);E=E.sibling}b.type===oa?(v=vi(b.props.children,g.mode,k,b.key),v.return=g,g=v):(k=Td(b.type,b.key,b.props,null,g.mode,k),k.ref=Pl(g,v,b),k.return=g,g=k)}return i(g);case ra:e:{for(E=b.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){n(g,v.sibling),v=o(v,b.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else t(g,v);v=v.sibling}v=Mp(b,g.mode,k),v.return=g,g=v}return i(g);case Jo:return E=b._init,x(g,v,E(b._payload),k)}if(ql(b))return y(g,v,b,k);if(Sl(b))return m(g,v,b,k);zu(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(n(g,v.sibling),v=o(v,b),v.return=g,g=v):(n(g,v),v=Op(b,g.mode,k),v.return=g,g=v),i(g)):n(g,v)}return x}var Ka=oC(!0),sC=oC(!1),ff=As(null),hf=null,fa=null,vv=null;function xv(){vv=fa=hf=null}function wv(e){var t=ff.current;pt(ff),e._currentValue=t}function ig(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ka(e,t){hf=e,vv=fa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Mn=!0),e.firstContext=null)}function hr(e){var t=e._currentValue;if(vv!==e)if(e={context:e,memoizedValue:t,next:null},fa===null){if(hf===null)throw Error(oe(308));fa=e,hf.dependencies={lanes:0,firstContext:e}}else fa=fa.next=e;return t}var si=null;function bv(e){si===null?si=[e]:si.push(e)}function iC(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,bv(t)):(n.next=o.next,o.next=n),t.interleaved=n,$o(e,r)}function $o(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Yo=!1;function kv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function aC(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Eo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function bs(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ze&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,$o(e,n)}return o=r.interleaved,o===null?(t.next=t,bv(r)):(t.next=o.next,o.next=t),r.interleaved=t,$o(e,n)}function Sd(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,av(e,n)}}function ab(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function pf(e,t,n,r){var o=e.updateQueue;Yo=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,i===null?s=u:i.next=u,i=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==i&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(s!==null){var f=o.baseState;i=0,d=u=l=null,a=s;do{var p=a.lane,h=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,m=a;switch(p=t,h=n,m.tag){case 1:if(y=m.payload,typeof y=="function"){f=y.call(h,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=m.payload,p=typeof y=="function"?y.call(h,f,p):y,p==null)break e;f=Et({},f,p);break e;case 2:Yo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=h,l=f):d=d.next=h,i|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(d===null&&(l=f),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);_i|=i,e.lanes=i,e.memoizedState=f}}function lb(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(oe(191,o));o.call(r)}}}var nu={},no=As(nu),$c=As(nu),Rc=As(nu);function ii(e){if(e===nu)throw Error(oe(174));return e}function _v(e,t){switch(ot(Rc,t),ot($c,e),ot(no,nu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Fm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Fm(t,e)}pt(no),ot(no,t)}function Za(){pt(no),pt($c),pt(Rc)}function lC(e){ii(Rc.current);var t=ii(no.current),n=Fm(t,e.type);t!==n&&(ot($c,e),ot(no,n))}function Sv(e){$c.current===e&&(pt(no),pt($c))}var kt=As(0);function mf(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pp=[];function Cv(){for(var e=0;e<Pp.length;e++)Pp[e]._workInProgressVersionPrimary=null;Pp.length=0}var Cd=Mo.ReactCurrentDispatcher,Tp=Mo.ReactCurrentBatchConfig,ki=0,St=null,Dt=null,Bt=null,gf=!1,rc=!1,Ic=0,uA=0;function cn(){throw Error(oe(321))}function Ev(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Or(e[n],t[n]))return!1;return!0}function Nv(e,t,n,r,o,s){if(ki=s,St=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Cd.current=e===null||e.memoizedState===null?pA:mA,e=n(r,o),rc){s=0;do{if(rc=!1,Ic=0,25<=s)throw Error(oe(301));s+=1,Bt=Dt=null,t.updateQueue=null,Cd.current=gA,e=n(r,o)}while(rc)}if(Cd.current=yf,t=Dt!==null&&Dt.next!==null,ki=0,Bt=Dt=St=null,gf=!1,t)throw Error(oe(300));return e}function jv(){var e=Ic!==0;return Ic=0,e}function qr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?St.memoizedState=Bt=e:Bt=Bt.next=e,Bt}function pr(){if(Dt===null){var e=St.alternate;e=e!==null?e.memoizedState:null}else e=Dt.next;var t=Bt===null?St.memoizedState:Bt.next;if(t!==null)Bt=t,Dt=e;else{if(e===null)throw Error(oe(310));Dt=e,e={memoizedState:Dt.memoizedState,baseState:Dt.baseState,baseQueue:Dt.baseQueue,queue:Dt.queue,next:null},Bt===null?St.memoizedState=Bt=e:Bt=Bt.next=e}return Bt}function Ac(e,t){return typeof t=="function"?t(e):t}function $p(e){var t=pr(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var r=Dt,o=r.baseQueue,s=n.pending;if(s!==null){if(o!==null){var i=o.next;o.next=s.next,s.next=i}r.baseQueue=o=s,n.pending=null}if(o!==null){s=o.next,r=r.baseState;var a=i=null,l=null,u=s;do{var d=u.lane;if((ki&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=f,i=r):l=l.next=f,St.lanes|=d,_i|=d}u=u.next}while(u!==null&&u!==s);l===null?i=r:l.next=a,Or(r,t.memoizedState)||(Mn=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do s=o.lane,St.lanes|=s,_i|=s,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Rp(e){var t=pr(),n=t.queue;if(n===null)throw Error(oe(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do s=e(s,i.action),i=i.next;while(i!==o);Or(s,t.memoizedState)||(Mn=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function cC(){}function uC(e,t){var n=St,r=pr(),o=t(),s=!Or(r.memoizedState,o);if(s&&(r.memoizedState=o,Mn=!0),r=r.queue,Pv(hC.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||Bt!==null&&Bt.memoizedState.tag&1){if(n.flags|=2048,Oc(9,fC.bind(null,n,r,o,t),void 0,null),Wt===null)throw Error(oe(349));ki&30||dC(n,t,o)}return o}function dC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=St.updateQueue,t===null?(t={lastEffect:null,stores:null},St.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fC(e,t,n,r){t.value=n,t.getSnapshot=r,pC(t)&&mC(e)}function hC(e,t,n){return n(function(){pC(t)&&mC(e)})}function pC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Or(e,n)}catch{return!0}}function mC(e){var t=$o(e,1);t!==null&&Ir(t,e,1,-1)}function cb(e){var t=qr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ac,lastRenderedState:e},t.queue=e,e=e.dispatch=hA.bind(null,St,e),[t.memoizedState,e]}function Oc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=St.updateQueue,t===null?(t={lastEffect:null,stores:null},St.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function gC(){return pr().memoizedState}function Ed(e,t,n,r){var o=qr();St.flags|=e,o.memoizedState=Oc(1|t,n,void 0,r===void 0?null:r)}function hh(e,t,n,r){var o=pr();r=r===void 0?null:r;var s=void 0;if(Dt!==null){var i=Dt.memoizedState;if(s=i.destroy,r!==null&&Ev(r,i.deps)){o.memoizedState=Oc(t,n,s,r);return}}St.flags|=e,o.memoizedState=Oc(1|t,n,s,r)}function ub(e,t){return Ed(8390656,8,e,t)}function Pv(e,t){return hh(2048,8,e,t)}function yC(e,t){return hh(4,2,e,t)}function vC(e,t){return hh(4,4,e,t)}function xC(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function wC(e,t,n){return n=n!=null?n.concat([e]):null,hh(4,4,xC.bind(null,t,e),n)}function Tv(){}function bC(e,t){var n=pr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ev(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function kC(e,t){var n=pr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ev(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function _C(e,t,n){return ki&21?(Or(n,t)||(n=jS(),St.lanes|=n,_i|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Mn=!0),e.memoizedState=n)}function dA(e,t){var n=Ye;Ye=n!==0&&4>n?n:4,e(!0);var r=Tp.transition;Tp.transition={};try{e(!1),t()}finally{Ye=n,Tp.transition=r}}function SC(){return pr().memoizedState}function fA(e,t,n){var r=_s(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},CC(e))EC(t,n);else if(n=iC(e,t,n,r),n!==null){var o=Sn();Ir(n,e,r,o),NC(n,t,r)}}function hA(e,t,n){var r=_s(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(CC(e))EC(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,a=s(i,n);if(o.hasEagerState=!0,o.eagerState=a,Or(a,i)){var l=t.interleaved;l===null?(o.next=o,bv(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=iC(e,t,o,r),n!==null&&(o=Sn(),Ir(n,e,r,o),NC(n,t,r))}}function CC(e){var t=e.alternate;return e===St||t!==null&&t===St}function EC(e,t){rc=gf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function NC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,av(e,n)}}var yf={readContext:hr,useCallback:cn,useContext:cn,useEffect:cn,useImperativeHandle:cn,useInsertionEffect:cn,useLayoutEffect:cn,useMemo:cn,useReducer:cn,useRef:cn,useState:cn,useDebugValue:cn,useDeferredValue:cn,useTransition:cn,useMutableSource:cn,useSyncExternalStore:cn,useId:cn,unstable_isNewReconciler:!1},pA={readContext:hr,useCallback:function(e,t){return qr().memoizedState=[e,t===void 0?null:t],e},useContext:hr,useEffect:ub,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ed(4194308,4,xC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ed(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ed(4,2,e,t)},useMemo:function(e,t){var n=qr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=qr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=fA.bind(null,St,e),[r.memoizedState,e]},useRef:function(e){var t=qr();return e={current:e},t.memoizedState=e},useState:cb,useDebugValue:Tv,useDeferredValue:function(e){return qr().memoizedState=e},useTransition:function(){var e=cb(!1),t=e[0];return e=dA.bind(null,e[1]),qr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=St,o=qr();if(vt){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),Wt===null)throw Error(oe(349));ki&30||dC(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,ub(hC.bind(null,r,s,e),[e]),r.flags|=2048,Oc(9,fC.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=qr(),t=Wt.identifierPrefix;if(vt){var n=So,r=_o;n=(r&~(1<<32-Rr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ic++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=uA++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},mA={readContext:hr,useCallback:bC,useContext:hr,useEffect:Pv,useImperativeHandle:wC,useInsertionEffect:yC,useLayoutEffect:vC,useMemo:kC,useReducer:$p,useRef:gC,useState:function(){return $p(Ac)},useDebugValue:Tv,useDeferredValue:function(e){var t=pr();return _C(t,Dt.memoizedState,e)},useTransition:function(){var e=$p(Ac)[0],t=pr().memoizedState;return[e,t]},useMutableSource:cC,useSyncExternalStore:uC,useId:SC,unstable_isNewReconciler:!1},gA={readContext:hr,useCallback:bC,useContext:hr,useEffect:Pv,useImperativeHandle:wC,useInsertionEffect:yC,useLayoutEffect:vC,useMemo:kC,useReducer:Rp,useRef:gC,useState:function(){return Rp(Ac)},useDebugValue:Tv,useDeferredValue:function(e){var t=pr();return Dt===null?t.memoizedState=e:_C(t,Dt.memoizedState,e)},useTransition:function(){var e=Rp(Ac)[0],t=pr().memoizedState;return[e,t]},useMutableSource:cC,useSyncExternalStore:uC,useId:SC,unstable_isNewReconciler:!1};function Sr(e,t){if(e&&e.defaultProps){t=Et({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ag(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Et({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ph={isMounted:function(e){return(e=e._reactInternals)?Di(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Sn(),o=_s(e),s=Eo(r,o);s.payload=t,n!=null&&(s.callback=n),t=bs(e,s,o),t!==null&&(Ir(t,e,o,r),Sd(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Sn(),o=_s(e),s=Eo(r,o);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=bs(e,s,o),t!==null&&(Ir(t,e,o,r),Sd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Sn(),r=_s(e),o=Eo(n,r);o.tag=2,t!=null&&(o.callback=t),t=bs(e,o,r),t!==null&&(Ir(t,e,r,n),Sd(t,e,r))}};function db(e,t,n,r,o,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,i):t.prototype&&t.prototype.isPureReactComponent?!Nc(n,r)||!Nc(o,s):!0}function jC(e,t,n){var r=!1,o=js,s=t.contextType;return typeof s=="object"&&s!==null?s=hr(s):(o=Ln(t)?wi:pn.current,r=t.contextTypes,s=(r=r!=null)?Ba(e,o):js),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ph,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=s),t}function fb(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ph.enqueueReplaceState(t,t.state,null)}function lg(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},kv(e);var s=t.contextType;typeof s=="object"&&s!==null?o.context=hr(s):(s=Ln(t)?wi:pn.current,o.context=Ba(e,s)),o.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(ag(e,t,s,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&ph.enqueueReplaceState(o,o.state,null),pf(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Qa(e,t){try{var n="",r=t;do n+=HR(r),r=r.return;while(r);var o=n}catch(s){o=`
39
- Error generating stack: `+s.message+`
40
- `+s.stack}return{value:e,source:t,stack:o,digest:null}}function Ip(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function cg(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var yA=typeof WeakMap=="function"?WeakMap:Map;function PC(e,t,n){n=Eo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xf||(xf=!0,xg=r),cg(e,t)},n}function TC(e,t,n){n=Eo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){cg(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){cg(e,t),typeof r!="function"&&(ks===null?ks=new Set([this]):ks.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function hb(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new yA;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=$A.bind(null,e,t,n),t.then(e,e))}function pb(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function mb(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Eo(-1,1),t.tag=2,bs(n,t,1))),n.lanes|=1),e)}var vA=Mo.ReactCurrentOwner,Mn=!1;function wn(e,t,n,r){t.child=e===null?sC(t,null,n,r):Ka(t,e.child,n,r)}function gb(e,t,n,r,o){n=n.render;var s=t.ref;return ka(t,o),r=Nv(e,t,n,r,s,o),n=jv(),e!==null&&!Mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ro(e,t,o)):(vt&&n&&mv(t),t.flags|=1,wn(e,t,r,o),t.child)}function yb(e,t,n,r,o){if(e===null){var s=n.type;return typeof s=="function"&&!Lv(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,$C(e,t,s,r,o)):(e=Td(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&o)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:Nc,n(i,r)&&e.ref===t.ref)return Ro(e,t,o)}return t.flags|=1,e=Ss(s,r),e.ref=t.ref,e.return=t,t.child=e}function $C(e,t,n,r,o){if(e!==null){var s=e.memoizedProps;if(Nc(s,r)&&e.ref===t.ref)if(Mn=!1,t.pendingProps=r=s,(e.lanes&o)!==0)e.flags&131072&&(Mn=!0);else return t.lanes=e.lanes,Ro(e,t,o)}return ug(e,t,n,r,o)}function RC(e,t,n){var r=t.pendingProps,o=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(pa,Hn),Hn|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ot(pa,Hn),Hn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ot(pa,Hn),Hn|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ot(pa,Hn),Hn|=r;return wn(e,t,o,n),t.child}function IC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ug(e,t,n,r,o){var s=Ln(n)?wi:pn.current;return s=Ba(t,s),ka(t,o),n=Nv(e,t,n,r,s,o),r=jv(),e!==null&&!Mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ro(e,t,o)):(vt&&r&&mv(t),t.flags|=1,wn(e,t,n,o),t.child)}function vb(e,t,n,r,o){if(Ln(n)){var s=!0;cf(t)}else s=!1;if(ka(t,o),t.stateNode===null)Nd(e,t),jC(t,n,r),lg(t,n,r,o),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var l=i.context,u=n.contextType;typeof u=="object"&&u!==null?u=hr(u):(u=Ln(n)?wi:pn.current,u=Ba(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==r||l!==u)&&fb(t,i,r,u),Yo=!1;var p=t.memoizedState;i.state=p,pf(t,r,i,o),l=t.memoizedState,a!==r||p!==l||Dn.current||Yo?(typeof d=="function"&&(ag(t,n,d,r),l=t.memoizedState),(a=Yo||db(t,n,a,r,p,l,u))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),i.props=r,i.state=l,i.context=u,r=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,aC(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Sr(t.type,a),i.props=u,f=t.pendingProps,p=i.context,l=n.contextType,typeof l=="object"&&l!==null?l=hr(l):(l=Ln(n)?wi:pn.current,l=Ba(t,l));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==f||p!==l)&&fb(t,i,r,l),Yo=!1,p=t.memoizedState,i.state=p,pf(t,r,i,o);var y=t.memoizedState;a!==f||p!==y||Dn.current||Yo?(typeof h=="function"&&(ag(t,n,h,r),y=t.memoizedState),(u=Yo||db(t,n,u,r,p,y,l)||!1)?(d||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,y,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,y,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),i.props=r,i.state=y,i.context=l,r=u):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return dg(e,t,n,r,s,o)}function dg(e,t,n,r,o,s){IC(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return o&&rb(t,n,!1),Ro(e,t,s);r=t.stateNode,vA.current=t;var a=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=Ka(t,e.child,null,s),t.child=Ka(t,null,a,s)):wn(e,t,a,s),t.memoizedState=r.state,o&&rb(t,n,!0),t.child}function AC(e){var t=e.stateNode;t.pendingContext?nb(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nb(e,t.context,!1),_v(e,t.containerInfo)}function xb(e,t,n,r,o){return Wa(),yv(o),t.flags|=256,wn(e,t,n,r),t.child}var fg={dehydrated:null,treeContext:null,retryLane:0};function hg(e){return{baseLanes:e,cachePool:null,transitions:null}}function OC(e,t,n){var r=t.pendingProps,o=kt.current,s=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ot(kt,o&1),e===null)return sg(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=yh(i,r,0,null),e=vi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=hg(n),t.memoizedState=fg,e):$v(t,i));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return xA(e,t,i,r,a,o,n);if(s){s=r.fallback,i=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(i&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Ss(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?s=Ss(a,s):(s=vi(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?hg(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=fg,r}return s=e.child,e=s.sibling,r=Ss(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function $v(e,t){return t=yh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Fu(e,t,n,r){return r!==null&&yv(r),Ka(t,e.child,null,n),e=$v(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xA(e,t,n,r,o,s,i){if(n)return t.flags&256?(t.flags&=-257,r=Ip(Error(oe(422))),Fu(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,o=t.mode,r=yh({mode:"visible",children:r.children},o,0,null),s=vi(s,o,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Ka(t,e.child,null,i),t.child.memoizedState=hg(i),t.memoizedState=fg,s);if(!(t.mode&1))return Fu(e,t,i,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(oe(419)),r=Ip(s,r,void 0),Fu(e,t,i,r)}if(a=(i&e.childLanes)!==0,Mn||a){if(r=Wt,r!==null){switch(i&-i){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|i)?0:o,o!==0&&o!==s.retryLane&&(s.retryLane=o,$o(e,o),Ir(r,e,o,-1))}return Dv(),r=Ip(Error(oe(421))),Fu(e,t,i,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=RA.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,Kn=ws(o.nextSibling),Zn=t,vt=!0,Pr=null,e!==null&&(ar[lr++]=_o,ar[lr++]=So,ar[lr++]=bi,_o=e.id,So=e.overflow,bi=t),t=$v(t,r.children),t.flags|=4096,t)}function wb(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ig(e.return,t,n)}function Ap(e,t,n,r,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o)}function MC(e,t,n){var r=t.pendingProps,o=r.revealOrder,s=r.tail;if(wn(e,t,r.children,n),r=kt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wb(e,n,t);else if(e.tag===19)wb(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ot(kt,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&mf(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ap(t,!1,o,n,s);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&mf(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ap(t,!0,n,null,s);break;case"together":Ap(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Nd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ro(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),_i|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(oe(153));if(t.child!==null){for(e=t.child,n=Ss(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ss(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wA(e,t,n){switch(t.tag){case 3:AC(t),Wa();break;case 5:lC(t);break;case 1:Ln(t.type)&&cf(t);break;case 4:_v(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ot(ff,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ot(kt,kt.current&1),t.flags|=128,null):n&t.child.childLanes?OC(e,t,n):(ot(kt,kt.current&1),e=Ro(e,t,n),e!==null?e.sibling:null);ot(kt,kt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return MC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ot(kt,kt.current),r)break;return null;case 22:case 23:return t.lanes=0,RC(e,t,n)}return Ro(e,t,n)}var DC,pg,LC,zC;DC=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};pg=function(){};LC=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ii(no.current);var s=null;switch(n){case"input":o=Mm(e,o),r=Mm(e,r),s=[];break;case"select":o=Et({},o,{value:void 0}),r=Et({},r,{value:void 0}),s=[];break;case"textarea":o=zm(e,o),r=zm(e,r),s=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=af)}Um(n,r);var i;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(wc.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(i in a)!a.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in l)l.hasOwnProperty(i)&&a[i]!==l[i]&&(n||(n={}),n[i]=l[i])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(wc.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ct("scroll",e),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};zC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Tl(e,t){if(!vt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function un(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bA(e,t,n){var r=t.pendingProps;switch(gv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(t),null;case 1:return Ln(t.type)&&lf(),un(t),null;case 3:return r=t.stateNode,Za(),pt(Dn),pt(pn),Cv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Lu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pr!==null&&(kg(Pr),Pr=null))),pg(e,t),un(t),null;case 5:Sv(t);var o=ii(Rc.current);if(n=t.type,e!==null&&t.stateNode!=null)LC(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(oe(166));return un(t),null}if(e=ii(no.current),Lu(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Qr]=t,r[Tc]=s,e=(t.mode&1)!==0,n){case"dialog":ct("cancel",r),ct("close",r);break;case"iframe":case"object":case"embed":ct("load",r);break;case"video":case"audio":for(o=0;o<Hl.length;o++)ct(Hl[o],r);break;case"source":ct("error",r);break;case"img":case"image":case"link":ct("error",r),ct("load",r);break;case"details":ct("toggle",r);break;case"input":Pw(r,s),ct("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ct("invalid",r);break;case"textarea":$w(r,s),ct("invalid",r)}Um(n,s),o=null;for(var i in s)if(s.hasOwnProperty(i)){var a=s[i];i==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Du(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Du(r.textContent,a,e),o=["children",""+a]):wc.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&ct("scroll",r)}switch(n){case"input":Pu(r),Tw(r,s,!0);break;case"textarea":Pu(r),Rw(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=af)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=hS(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Qr]=t,e[Tc]=r,DC(e,t,!1,!1),t.stateNode=e;e:{switch(i=qm(n,r),n){case"dialog":ct("cancel",e),ct("close",e),o=r;break;case"iframe":case"object":case"embed":ct("load",e),o=r;break;case"video":case"audio":for(o=0;o<Hl.length;o++)ct(Hl[o],e);o=r;break;case"source":ct("error",e),o=r;break;case"img":case"image":case"link":ct("error",e),ct("load",e),o=r;break;case"details":ct("toggle",e),o=r;break;case"input":Pw(e,r),o=Mm(e,r),ct("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Et({},r,{value:void 0}),ct("invalid",e);break;case"textarea":$w(e,r),o=zm(e,r),ct("invalid",e);break;default:o=r}Um(n,o),a=o;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?gS(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&pS(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&bc(e,l):typeof l=="number"&&bc(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(wc.hasOwnProperty(s)?l!=null&&s==="onScroll"&&ct("scroll",e):l!=null&&tv(e,s,l,i))}switch(n){case"input":Pu(e),Tw(e,r,!1);break;case"textarea":Pu(e),Rw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ns(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?va(e,!!r.multiple,s,!1):r.defaultValue!=null&&va(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=af)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return un(t),null;case 6:if(e&&t.stateNode!=null)zC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(oe(166));if(n=ii(Rc.current),ii(no.current),Lu(t)){if(r=t.stateNode,n=t.memoizedProps,r[Qr]=t,(s=r.nodeValue!==n)&&(e=Zn,e!==null))switch(e.tag){case 3:Du(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Du(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Qr]=t,t.stateNode=r}return un(t),null;case 13:if(pt(kt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(vt&&Kn!==null&&t.mode&1&&!(t.flags&128))rC(),Wa(),t.flags|=98560,s=!1;else if(s=Lu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(oe(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(oe(317));s[Qr]=t}else Wa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;un(t),s=!1}else Pr!==null&&(kg(Pr),Pr=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||kt.current&1?Ft===0&&(Ft=3):Dv())),t.updateQueue!==null&&(t.flags|=4),un(t),null);case 4:return Za(),pg(e,t),e===null&&jc(t.stateNode.containerInfo),un(t),null;case 10:return wv(t.type._context),un(t),null;case 17:return Ln(t.type)&&lf(),un(t),null;case 19:if(pt(kt),s=t.memoizedState,s===null)return un(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)Tl(s,!1);else{if(Ft!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=mf(e),i!==null){for(t.flags|=128,Tl(s,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ot(kt,kt.current&1|2),t.child}e=e.sibling}s.tail!==null&&Rt()>Ga&&(t.flags|=128,r=!0,Tl(s,!1),t.lanes=4194304)}else{if(!r)if(e=mf(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Tl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!vt)return un(t),null}else 2*Rt()-s.renderingStartTime>Ga&&n!==1073741824&&(t.flags|=128,r=!0,Tl(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Rt(),t.sibling=null,n=kt.current,ot(kt,r?n&1|2:n&1),t):(un(t),null);case 22:case 23:return Mv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Hn&1073741824&&(un(t),t.subtreeFlags&6&&(t.flags|=8192)):un(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function kA(e,t){switch(gv(t),t.tag){case 1:return Ln(t.type)&&lf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Za(),pt(Dn),pt(pn),Cv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sv(t),null;case 13:if(pt(kt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Wa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pt(kt),null;case 4:return Za(),null;case 10:return wv(t.type._context),null;case 22:case 23:return Mv(),null;case 24:return null;default:return null}}var Uu=!1,fn=!1,_A=typeof WeakSet=="function"?WeakSet:Set,ye=null;function ha(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pt(e,t,r)}else n.current=null}function mg(e,t,n){try{n()}catch(r){Pt(e,t,r)}}var bb=!1;function SA(e,t){if(Ym=rf,e=HS(),pv(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,a=-1,l=-1,u=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(a=i+o),f!==s||r!==0&&f.nodeType!==3||(l=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===o&&(a=i),p===s&&++d===r&&(l=i),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xm={focusedElem:e,selectionRange:n},rf=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var m=y.memoizedProps,x=y.memoizedState,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:Sr(t.type,m),x);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.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(oe(163))}}catch(k){Pt(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return y=bb,bb=!1,y}function oc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&mg(t,n,s)}o=o.next}while(o!==r)}}function mh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function gg(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function FC(e){var t=e.alternate;t!==null&&(e.alternate=null,FC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Qr],delete t[Tc],delete t[ng],delete t[iA],delete t[aA])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function UC(e){return e.tag===5||e.tag===3||e.tag===4}function kb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||UC(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function yg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=af));else if(r!==4&&(e=e.child,e!==null))for(yg(e,t,n),e=e.sibling;e!==null;)yg(e,t,n),e=e.sibling}function vg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(vg(e,t,n),e=e.sibling;e!==null;)vg(e,t,n),e=e.sibling}var Jt=null,jr=!1;function Vo(e,t,n){for(n=n.child;n!==null;)qC(e,t,n),n=n.sibling}function qC(e,t,n){if(to&&typeof to.onCommitFiberUnmount=="function")try{to.onCommitFiberUnmount(ah,n)}catch{}switch(n.tag){case 5:fn||ha(n,t);case 6:var r=Jt,o=jr;Jt=null,Vo(e,t,n),Jt=r,jr=o,Jt!==null&&(jr?(e=Jt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Jt.removeChild(n.stateNode));break;case 18:Jt!==null&&(jr?(e=Jt,n=n.stateNode,e.nodeType===8?Np(e.parentNode,n):e.nodeType===1&&Np(e,n),Cc(e)):Np(Jt,n.stateNode));break;case 4:r=Jt,o=jr,Jt=n.stateNode.containerInfo,jr=!0,Vo(e,t,n),Jt=r,jr=o;break;case 0:case 11:case 14:case 15:if(!fn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&mg(n,t,i),o=o.next}while(o!==r)}Vo(e,t,n);break;case 1:if(!fn&&(ha(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Pt(n,t,a)}Vo(e,t,n);break;case 21:Vo(e,t,n);break;case 22:n.mode&1?(fn=(r=fn)||n.memoizedState!==null,Vo(e,t,n),fn=r):Vo(e,t,n);break;default:Vo(e,t,n)}}function _b(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _A),t.forEach(function(r){var o=IA.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function vr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var s=e,i=t,a=i;e:for(;a!==null;){switch(a.tag){case 5:Jt=a.stateNode,jr=!1;break e;case 3:Jt=a.stateNode.containerInfo,jr=!0;break e;case 4:Jt=a.stateNode.containerInfo,jr=!0;break e}a=a.return}if(Jt===null)throw Error(oe(160));qC(s,i,o),Jt=null,jr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Pt(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)VC(t,e),t=t.sibling}function VC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vr(t,e),Ur(e),r&4){try{oc(3,e,e.return),mh(3,e)}catch(m){Pt(e,e.return,m)}try{oc(5,e,e.return)}catch(m){Pt(e,e.return,m)}}break;case 1:vr(t,e),Ur(e),r&512&&n!==null&&ha(n,n.return);break;case 5:if(vr(t,e),Ur(e),r&512&&n!==null&&ha(n,n.return),e.flags&32){var o=e.stateNode;try{bc(o,"")}catch(m){Pt(e,e.return,m)}}if(r&4&&(o=e.stateNode,o!=null)){var s=e.memoizedProps,i=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&dS(o,s),qm(a,i);var u=qm(a,s);for(i=0;i<l.length;i+=2){var d=l[i],f=l[i+1];d==="style"?gS(o,f):d==="dangerouslySetInnerHTML"?pS(o,f):d==="children"?bc(o,f):tv(o,d,f,u)}switch(a){case"input":Dm(o,s);break;case"textarea":fS(o,s);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?va(o,!!s.multiple,h,!1):p!==!!s.multiple&&(s.defaultValue!=null?va(o,!!s.multiple,s.defaultValue,!0):va(o,!!s.multiple,s.multiple?[]:"",!1))}o[Tc]=s}catch(m){Pt(e,e.return,m)}}break;case 6:if(vr(t,e),Ur(e),r&4){if(e.stateNode===null)throw Error(oe(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(m){Pt(e,e.return,m)}}break;case 3:if(vr(t,e),Ur(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Cc(t.containerInfo)}catch(m){Pt(e,e.return,m)}break;case 4:vr(t,e),Ur(e);break;case 13:vr(t,e),Ur(e),o=e.child,o.flags&8192&&(s=o.memoizedState!==null,o.stateNode.isHidden=s,!s||o.alternate!==null&&o.alternate.memoizedState!==null||(Av=Rt())),r&4&&_b(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(fn=(u=fn)||d,vr(t,e),fn=u):vr(t,e),Ur(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ye=e,d=e.child;d!==null;){for(f=ye=d;ye!==null;){switch(p=ye,h=p.child,p.tag){case 0:case 11:case 14:case 15:oc(4,p,p.return);break;case 1:ha(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(m){Pt(r,n,m)}}break;case 5:ha(p,p.return);break;case 22:if(p.memoizedState!==null){Cb(f);continue}}h!==null?(h.return=p,ye=h):Cb(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{o=f.stateNode,u?(s=o.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,l=f.memoizedProps.style,i=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=mS("display",i))}catch(m){Pt(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){Pt(e,e.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:vr(t,e),Ur(e),r&4&&_b(e);break;case 21:break;default:vr(t,e),Ur(e)}}function Ur(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(UC(n)){var r=n;break e}n=n.return}throw Error(oe(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(bc(o,""),r.flags&=-33);var s=kb(e);vg(e,s,o);break;case 3:case 4:var i=r.stateNode.containerInfo,a=kb(e);yg(e,a,i);break;default:throw Error(oe(161))}}catch(l){Pt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function CA(e,t,n){ye=e,HC(e)}function HC(e,t,n){for(var r=(e.mode&1)!==0;ye!==null;){var o=ye,s=o.child;if(o.tag===22&&r){var i=o.memoizedState!==null||Uu;if(!i){var a=o.alternate,l=a!==null&&a.memoizedState!==null||fn;a=Uu;var u=fn;if(Uu=i,(fn=l)&&!u)for(ye=o;ye!==null;)i=ye,l=i.child,i.tag===22&&i.memoizedState!==null?Eb(o):l!==null?(l.return=i,ye=l):Eb(o);for(;s!==null;)ye=s,HC(s),s=s.sibling;ye=o,Uu=a,fn=u}Sb(e)}else o.subtreeFlags&8772&&s!==null?(s.return=o,ye=s):Sb(e)}}function Sb(e){for(;ye!==null;){var t=ye;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:fn||mh(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!fn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Sr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&lb(t,s,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lb(t,i,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Cc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(oe(163))}fn||t.flags&512&&gg(t)}catch(p){Pt(t,t.return,p)}}if(t===e){ye=null;break}if(n=t.sibling,n!==null){n.return=t.return,ye=n;break}ye=t.return}}function Cb(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ye=n;break}ye=t.return}}function Eb(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{mh(4,t)}catch(l){Pt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Pt(t,o,l)}}var s=t.return;try{gg(t)}catch(l){Pt(t,s,l)}break;case 5:var i=t.return;try{gg(t)}catch(l){Pt(t,i,l)}}}catch(l){Pt(t,t.return,l)}if(t===e){ye=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ye=a;break}ye=t.return}}var EA=Math.ceil,vf=Mo.ReactCurrentDispatcher,Rv=Mo.ReactCurrentOwner,fr=Mo.ReactCurrentBatchConfig,Ze=0,Wt=null,At=null,nn=0,Hn=0,pa=As(0),Ft=0,Mc=null,_i=0,gh=0,Iv=0,sc=null,An=null,Av=0,Ga=1/0,yo=null,xf=!1,xg=null,ks=null,qu=!1,ms=null,wf=0,ic=0,wg=null,jd=-1,Pd=0;function Sn(){return Ze&6?Rt():jd!==-1?jd:jd=Rt()}function _s(e){return e.mode&1?Ze&2&&nn!==0?nn&-nn:cA.transition!==null?(Pd===0&&(Pd=jS()),Pd):(e=Ye,e!==0||(e=window.event,e=e===void 0?16:OS(e.type)),e):1}function Ir(e,t,n,r){if(50<ic)throw ic=0,wg=null,Error(oe(185));Xc(e,n,r),(!(Ze&2)||e!==Wt)&&(e===Wt&&(!(Ze&2)&&(gh|=n),Ft===4&&rs(e,nn)),zn(e,r),n===1&&Ze===0&&!(t.mode&1)&&(Ga=Rt()+500,fh&&Os()))}function zn(e,t){var n=e.callbackNode;cI(e,t);var r=nf(e,e===Wt?nn:0);if(r===0)n!==null&&Ow(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ow(n),t===1)e.tag===0?lA(Nb.bind(null,e)):eC(Nb.bind(null,e)),oA(function(){!(Ze&6)&&Os()}),n=null;else{switch(PS(r)){case 1:n=iv;break;case 4:n=ES;break;case 16:n=tf;break;case 536870912:n=NS;break;default:n=tf}n=YC(n,BC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function BC(e,t){if(jd=-1,Pd=0,Ze&6)throw Error(oe(327));var n=e.callbackNode;if(_a()&&e.callbackNode!==n)return null;var r=nf(e,e===Wt?nn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=bf(e,r);else{t=r;var o=Ze;Ze|=2;var s=KC();(Wt!==e||nn!==t)&&(yo=null,Ga=Rt()+500,yi(e,t));do try{PA();break}catch(a){WC(e,a)}while(!0);xv(),vf.current=s,Ze=o,At!==null?t=0:(Wt=null,nn=0,t=Ft)}if(t!==0){if(t===2&&(o=Km(e),o!==0&&(r=o,t=bg(e,o))),t===1)throw n=Mc,yi(e,0),rs(e,r),zn(e,Rt()),n;if(t===6)rs(e,r);else{if(o=e.current.alternate,!(r&30)&&!NA(o)&&(t=bf(e,r),t===2&&(s=Km(e),s!==0&&(r=s,t=bg(e,s))),t===1))throw n=Mc,yi(e,0),rs(e,r),zn(e,Rt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(oe(345));case 2:Zs(e,An,yo);break;case 3:if(rs(e,r),(r&130023424)===r&&(t=Av+500-Rt(),10<t)){if(nf(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Sn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=tg(Zs.bind(null,e,An,yo),t);break}Zs(e,An,yo);break;case 4:if(rs(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var i=31-Rr(r);s=1<<i,i=t[i],i>o&&(o=i),r&=~s}if(r=o,r=Rt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*EA(r/1960))-r,10<r){e.timeoutHandle=tg(Zs.bind(null,e,An,yo),r);break}Zs(e,An,yo);break;case 5:Zs(e,An,yo);break;default:throw Error(oe(329))}}}return zn(e,Rt()),e.callbackNode===n?BC.bind(null,e):null}function bg(e,t){var n=sc;return e.current.memoizedState.isDehydrated&&(yi(e,t).flags|=256),e=bf(e,t),e!==2&&(t=An,An=n,t!==null&&kg(t)),e}function kg(e){An===null?An=e:An.push.apply(An,e)}function NA(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],s=o.getSnapshot;o=o.value;try{if(!Or(s(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function rs(e,t){for(t&=~Iv,t&=~gh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Rr(t),r=1<<n;e[n]=-1,t&=~r}}function Nb(e){if(Ze&6)throw Error(oe(327));_a();var t=nf(e,0);if(!(t&1))return zn(e,Rt()),null;var n=bf(e,t);if(e.tag!==0&&n===2){var r=Km(e);r!==0&&(t=r,n=bg(e,r))}if(n===1)throw n=Mc,yi(e,0),rs(e,t),zn(e,Rt()),n;if(n===6)throw Error(oe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Zs(e,An,yo),zn(e,Rt()),null}function Ov(e,t){var n=Ze;Ze|=1;try{return e(t)}finally{Ze=n,Ze===0&&(Ga=Rt()+500,fh&&Os())}}function Si(e){ms!==null&&ms.tag===0&&!(Ze&6)&&_a();var t=Ze;Ze|=1;var n=fr.transition,r=Ye;try{if(fr.transition=null,Ye=1,e)return e()}finally{Ye=r,fr.transition=n,Ze=t,!(Ze&6)&&Os()}}function Mv(){Hn=pa.current,pt(pa)}function yi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,rA(n)),At!==null)for(n=At.return;n!==null;){var r=n;switch(gv(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&lf();break;case 3:Za(),pt(Dn),pt(pn),Cv();break;case 5:Sv(r);break;case 4:Za();break;case 13:pt(kt);break;case 19:pt(kt);break;case 10:wv(r.type._context);break;case 22:case 23:Mv()}n=n.return}if(Wt=e,At=e=Ss(e.current,null),nn=Hn=t,Ft=0,Mc=null,Iv=gh=_i=0,An=sc=null,si!==null){for(t=0;t<si.length;t++)if(n=si[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,s=n.pending;if(s!==null){var i=s.next;s.next=o,r.next=i}n.pending=r}si=null}return e}function WC(e,t){do{var n=At;try{if(xv(),Cd.current=yf,gf){for(var r=St.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}gf=!1}if(ki=0,Bt=Dt=St=null,rc=!1,Ic=0,Rv.current=null,n===null||n.return===null){Ft=1,Mc=t,At=null;break}e:{var s=e,i=n.return,a=n,l=t;if(t=nn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=pb(i);if(h!==null){h.flags&=-257,mb(h,i,a,s,t),h.mode&1&&hb(s,u,t),t=h,l=u;var y=t.updateQueue;if(y===null){var m=new Set;m.add(l),t.updateQueue=m}else y.add(l);break e}else{if(!(t&1)){hb(s,u,t),Dv();break e}l=Error(oe(426))}}else if(vt&&a.mode&1){var x=pb(i);if(x!==null){!(x.flags&65536)&&(x.flags|=256),mb(x,i,a,s,t),yv(Qa(l,a));break e}}s=l=Qa(l,a),Ft!==4&&(Ft=2),sc===null?sc=[s]:sc.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=PC(s,l,t);ab(s,g);break e;case 1:a=l;var v=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(ks===null||!ks.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var k=TC(s,a,t);ab(s,k);break e}}s=s.return}while(s!==null)}QC(n)}catch(S){t=S,At===n&&n!==null&&(At=n=n.return);continue}break}while(!0)}function KC(){var e=vf.current;return vf.current=yf,e===null?yf:e}function Dv(){(Ft===0||Ft===3||Ft===2)&&(Ft=4),Wt===null||!(_i&268435455)&&!(gh&268435455)||rs(Wt,nn)}function bf(e,t){var n=Ze;Ze|=2;var r=KC();(Wt!==e||nn!==t)&&(yo=null,yi(e,t));do try{jA();break}catch(o){WC(e,o)}while(!0);if(xv(),Ze=n,vf.current=r,At!==null)throw Error(oe(261));return Wt=null,nn=0,Ft}function jA(){for(;At!==null;)ZC(At)}function PA(){for(;At!==null&&!eI();)ZC(At)}function ZC(e){var t=JC(e.alternate,e,Hn);e.memoizedProps=e.pendingProps,t===null?QC(e):At=t,Rv.current=null}function QC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=kA(n,t),n!==null){n.flags&=32767,At=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ft=6,At=null;return}}else if(n=bA(n,t,Hn),n!==null){At=n;return}if(t=t.sibling,t!==null){At=t;return}At=t=e}while(t!==null);Ft===0&&(Ft=5)}function Zs(e,t,n){var r=Ye,o=fr.transition;try{fr.transition=null,Ye=1,TA(e,t,n,r)}finally{fr.transition=o,Ye=r}return null}function TA(e,t,n,r){do _a();while(ms!==null);if(Ze&6)throw Error(oe(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(oe(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(uI(e,s),e===Wt&&(At=Wt=null,nn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||qu||(qu=!0,YC(tf,function(){return _a(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=fr.transition,fr.transition=null;var i=Ye;Ye=1;var a=Ze;Ze|=4,Rv.current=null,SA(e,n),VC(n,e),GI(Xm),rf=!!Ym,Xm=Ym=null,e.current=n,CA(n),tI(),Ze=a,Ye=i,fr.transition=s}else e.current=n;if(qu&&(qu=!1,ms=e,wf=o),s=e.pendingLanes,s===0&&(ks=null),oI(n.stateNode),zn(e,Rt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(xf)throw xf=!1,e=xg,xg=null,e;return wf&1&&e.tag!==0&&_a(),s=e.pendingLanes,s&1?e===wg?ic++:(ic=0,wg=e):ic=0,Os(),null}function _a(){if(ms!==null){var e=PS(wf),t=fr.transition,n=Ye;try{if(fr.transition=null,Ye=16>e?16:e,ms===null)var r=!1;else{if(e=ms,ms=null,wf=0,Ze&6)throw Error(oe(331));var o=Ze;for(Ze|=4,ye=e.current;ye!==null;){var s=ye,i=s.child;if(ye.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(ye=u;ye!==null;){var d=ye;switch(d.tag){case 0:case 11:case 15:oc(8,d,s)}var f=d.child;if(f!==null)f.return=d,ye=f;else for(;ye!==null;){d=ye;var p=d.sibling,h=d.return;if(FC(d),d===u){ye=null;break}if(p!==null){p.return=h,ye=p;break}ye=h}}}var y=s.alternate;if(y!==null){var m=y.child;if(m!==null){y.child=null;do{var x=m.sibling;m.sibling=null,m=x}while(m!==null)}}ye=s}}if(s.subtreeFlags&2064&&i!==null)i.return=s,ye=i;else e:for(;ye!==null;){if(s=ye,s.flags&2048)switch(s.tag){case 0:case 11:case 15:oc(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,ye=g;break e}ye=s.return}}var v=e.current;for(ye=v;ye!==null;){i=ye;var b=i.child;if(i.subtreeFlags&2064&&b!==null)b.return=i,ye=b;else e:for(i=v;ye!==null;){if(a=ye,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:mh(9,a)}}catch(S){Pt(a,a.return,S)}if(a===i){ye=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,ye=k;break e}ye=a.return}}if(Ze=o,Os(),to&&typeof to.onPostCommitFiberRoot=="function")try{to.onPostCommitFiberRoot(ah,e)}catch{}r=!0}return r}finally{Ye=n,fr.transition=t}}return!1}function jb(e,t,n){t=Qa(n,t),t=PC(e,t,1),e=bs(e,t,1),t=Sn(),e!==null&&(Xc(e,1,t),zn(e,t))}function Pt(e,t,n){if(e.tag===3)jb(e,e,n);else for(;t!==null;){if(t.tag===3){jb(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ks===null||!ks.has(r))){e=Qa(n,e),e=TC(t,e,1),t=bs(t,e,1),e=Sn(),t!==null&&(Xc(t,1,e),zn(t,e));break}}t=t.return}}function $A(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Sn(),e.pingedLanes|=e.suspendedLanes&n,Wt===e&&(nn&n)===n&&(Ft===4||Ft===3&&(nn&130023424)===nn&&500>Rt()-Av?yi(e,0):Iv|=n),zn(e,t)}function GC(e,t){t===0&&(e.mode&1?(t=Ru,Ru<<=1,!(Ru&130023424)&&(Ru=4194304)):t=1);var n=Sn();e=$o(e,t),e!==null&&(Xc(e,t,n),zn(e,n))}function RA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),GC(e,n)}function IA(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(t),GC(e,n)}var JC;JC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dn.current)Mn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Mn=!1,wA(e,t,n);Mn=!!(e.flags&131072)}else Mn=!1,vt&&t.flags&1048576&&tC(t,df,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Nd(e,t),e=t.pendingProps;var o=Ba(t,pn.current);ka(t,n),o=Nv(null,t,r,e,o,n);var s=jv();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ln(r)?(s=!0,cf(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,kv(t),o.updater=ph,t.stateNode=o,o._reactInternals=t,lg(t,r,e,n),t=dg(null,t,r,!0,s,n)):(t.tag=0,vt&&s&&mv(t),wn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Nd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=OA(r),e=Sr(r,e),o){case 0:t=ug(null,t,r,e,n);break e;case 1:t=vb(null,t,r,e,n);break e;case 11:t=gb(null,t,r,e,n);break e;case 14:t=yb(null,t,r,Sr(r.type,e),n);break e}throw Error(oe(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sr(r,o),ug(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sr(r,o),vb(e,t,r,o,n);case 3:e:{if(AC(t),e===null)throw Error(oe(387));r=t.pendingProps,s=t.memoizedState,o=s.element,aC(e,t),pf(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=Qa(Error(oe(423)),t),t=xb(e,t,r,n,o);break e}else if(r!==o){o=Qa(Error(oe(424)),t),t=xb(e,t,r,n,o);break e}else for(Kn=ws(t.stateNode.containerInfo.firstChild),Zn=t,vt=!0,Pr=null,n=sC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wa(),r===o){t=Ro(e,t,n);break e}wn(e,t,r,n)}t=t.child}return t;case 5:return lC(t),e===null&&sg(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,eg(r,o)?i=null:s!==null&&eg(r,s)&&(t.flags|=32),IC(e,t),wn(e,t,i,n),t.child;case 6:return e===null&&sg(t),null;case 13:return OC(e,t,n);case 4:return _v(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ka(t,null,r,n):wn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sr(r,o),gb(e,t,r,o,n);case 7:return wn(e,t,t.pendingProps,n),t.child;case 8:return wn(e,t,t.pendingProps.children,n),t.child;case 12:return wn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,ot(ff,r._currentValue),r._currentValue=i,s!==null)if(Or(s.value,i)){if(s.children===o.children&&!Dn.current){t=Ro(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){i=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Eo(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),ig(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(oe(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),ig(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}wn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ka(t,n),o=hr(o),r=r(o),t.flags|=1,wn(e,t,r,n),t.child;case 14:return r=t.type,o=Sr(r,t.pendingProps),o=Sr(r.type,o),yb(e,t,r,o,n);case 15:return $C(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Sr(r,o),Nd(e,t),t.tag=1,Ln(r)?(e=!0,cf(t)):e=!1,ka(t,n),jC(t,r,o),lg(t,r,o,n),dg(null,t,r,!0,e,n);case 19:return MC(e,t,n);case 22:return RC(e,t,n)}throw Error(oe(156,t.tag))};function YC(e,t){return CS(e,t)}function AA(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dr(e,t,n,r){return new AA(e,t,n,r)}function Lv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function OA(e){if(typeof e=="function")return Lv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===rv)return 11;if(e===ov)return 14}return 2}function Ss(e,t){var n=e.alternate;return n===null?(n=dr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Td(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")Lv(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case oa:return vi(n.children,o,s,t);case nv:i=8,o|=8;break;case Rm:return e=dr(12,n,t,o|2),e.elementType=Rm,e.lanes=s,e;case Im:return e=dr(13,n,t,o),e.elementType=Im,e.lanes=s,e;case Am:return e=dr(19,n,t,o),e.elementType=Am,e.lanes=s,e;case lS:return yh(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case iS:i=10;break e;case aS:i=9;break e;case rv:i=11;break e;case ov:i=14;break e;case Jo:i=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=dr(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function vi(e,t,n,r){return e=dr(7,e,r,t),e.lanes=n,e}function yh(e,t,n,r){return e=dr(22,e,r,t),e.elementType=lS,e.lanes=n,e.stateNode={isHidden:!1},e}function Op(e,t,n){return e=dr(6,e,null,t),e.lanes=n,e}function Mp(e,t,n){return t=dr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function MA(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gp(0),this.expirationTimes=gp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gp(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function zv(e,t,n,r,o,s,i,a,l){return e=new MA(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=dr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},kv(s),e}function DA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ra,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function XC(e){if(!e)return js;e=e._reactInternals;e:{if(Di(e)!==e||e.tag!==1)throw Error(oe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ln(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(oe(171))}if(e.tag===1){var n=e.type;if(Ln(n))return XS(e,n,t)}return t}function eE(e,t,n,r,o,s,i,a,l){return e=zv(n,r,!0,e,o,s,i,a,l),e.context=XC(null),n=e.current,r=Sn(),o=_s(n),s=Eo(r,o),s.callback=t??null,bs(n,s,o),e.current.lanes=o,Xc(e,o,r),zn(e,r),e}function vh(e,t,n,r){var o=t.current,s=Sn(),i=_s(o);return n=XC(n),t.context===null?t.context=n:t.pendingContext=n,t=Eo(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=bs(o,t,i),e!==null&&(Ir(e,o,i,s),Sd(e,o,i)),i}function kf(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Pb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Fv(e,t){Pb(e,t),(e=e.alternate)&&Pb(e,t)}function LA(){return null}var tE=typeof reportError=="function"?reportError:function(e){console.error(e)};function Uv(e){this._internalRoot=e}xh.prototype.render=Uv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(oe(409));vh(e,t,null,null)};xh.prototype.unmount=Uv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Si(function(){vh(null,e,null,null)}),t[To]=null}};function xh(e){this._internalRoot=e}xh.prototype.unstable_scheduleHydration=function(e){if(e){var t=RS();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ns.length&&t!==0&&t<ns[n].priority;n++);ns.splice(n,0,e),n===0&&AS(e)}};function qv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function wh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Tb(){}function zA(e,t,n,r,o){if(o){if(typeof r=="function"){var s=r;r=function(){var u=kf(i);s.call(u)}}var i=eE(t,r,e,0,null,!1,!1,"",Tb);return e._reactRootContainer=i,e[To]=i.current,jc(e.nodeType===8?e.parentNode:e),Si(),i}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=kf(l);a.call(u)}}var l=zv(e,0,!1,null,null,!1,!1,"",Tb);return e._reactRootContainer=l,e[To]=l.current,jc(e.nodeType===8?e.parentNode:e),Si(function(){vh(t,l,n,r)}),l}function bh(e,t,n,r,o){var s=n._reactRootContainer;if(s){var i=s;if(typeof o=="function"){var a=o;o=function(){var l=kf(i);a.call(l)}}vh(t,i,e,o)}else i=zA(n,t,e,o,r);return kf(i)}TS=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Vl(t.pendingLanes);n!==0&&(av(t,n|1),zn(t,Rt()),!(Ze&6)&&(Ga=Rt()+500,Os()))}break;case 13:Si(function(){var r=$o(e,1);if(r!==null){var o=Sn();Ir(r,e,1,o)}}),Fv(e,1)}};lv=function(e){if(e.tag===13){var t=$o(e,134217728);if(t!==null){var n=Sn();Ir(t,e,134217728,n)}Fv(e,134217728)}};$S=function(e){if(e.tag===13){var t=_s(e),n=$o(e,t);if(n!==null){var r=Sn();Ir(n,e,t,r)}Fv(e,t)}};RS=function(){return Ye};IS=function(e,t){var n=Ye;try{return Ye=e,t()}finally{Ye=n}};Hm=function(e,t,n){switch(t){case"input":if(Dm(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=dh(r);if(!o)throw Error(oe(90));uS(r),Dm(r,o)}}}break;case"textarea":fS(e,n);break;case"select":t=n.value,t!=null&&va(e,!!n.multiple,t,!1)}};xS=Ov;wS=Si;var FA={usingClientEntryPoint:!1,Events:[tu,la,dh,yS,vS,Ov]},$l={findFiberByHostInstance:oi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},UA={bundleType:$l.bundleType,version:$l.version,rendererPackageName:$l.rendererPackageName,rendererConfig:$l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Mo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_S(e),e===null?null:e.stateNode},findFiberByHostInstance:$l.findFiberByHostInstance||LA,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 Vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vu.isDisabled&&Vu.supportsFiber)try{ah=Vu.inject(UA),to=Vu}catch{}}Yn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FA;Yn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qv(t))throw Error(oe(200));return DA(e,t,null,n)};Yn.createRoot=function(e,t){if(!qv(e))throw Error(oe(299));var n=!1,r="",o=tE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=zv(e,1,!1,null,null,n,!1,r,o),e[To]=t.current,jc(e.nodeType===8?e.parentNode:e),new Uv(t)};Yn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(oe(188)):(e=Object.keys(e).join(","),Error(oe(268,e)));return e=_S(t),e=e===null?null:e.stateNode,e};Yn.flushSync=function(e){return Si(e)};Yn.hydrate=function(e,t,n){if(!wh(t))throw Error(oe(200));return bh(null,e,t,!0,n)};Yn.hydrateRoot=function(e,t,n){if(!qv(e))throw Error(oe(405));var r=n!=null&&n.hydratedSources||null,o=!1,s="",i=tE;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=eE(t,null,e,1,n??null,o,!1,s,i),e[To]=t.current,jc(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new xh(t)};Yn.render=function(e,t,n){if(!wh(t))throw Error(oe(200));return bh(null,e,t,!1,n)};Yn.unmountComponentAtNode=function(e){if(!wh(e))throw Error(oe(40));return e._reactRootContainer?(Si(function(){bh(null,null,e,!1,function(){e._reactRootContainer=null,e[To]=null})}),!0):!1};Yn.unstable_batchedUpdates=Ov;Yn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!wh(n))throw Error(oe(200));if(e==null||e._reactInternals===void 0)throw Error(oe(38));return bh(e,t,n,!1,r)};Yn.version="18.3.1-next-f1338f8080-20240426";function nE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nE)}catch(e){console.error(e)}}nE(),nS.exports=Yn;var Li=nS.exports;const qA=al(Li);var rE,$b=Li;rE=$b.createRoot,$b.hydrateRoot;function VA(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,o,s,i=[],a="",l=e.split("/");for(l[0]||l.shift();o=l.shift();)n=o[0],n==="*"?(i.push(n),a+=o[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(r=o.indexOf("?",1),s=o.indexOf(".",1),i.push(o.substring(1,~r?r:~s?s:o.length)),a+=~r&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(a+=(~r?"?":"")+"\\"+o.substring(s))):a+="/"+o;return{keys:i,pattern:new RegExp("^"+a+(t?"(?=$|/)":"/?$"),"i")}}var oE={exports:{}},sE={};/**
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 Ja=w;function HA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var BA=typeof Object.is=="function"?Object.is:HA,WA=Ja.useState,KA=Ja.useEffect,ZA=Ja.useLayoutEffect,QA=Ja.useDebugValue;function GA(e,t){var n=t(),r=WA({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return ZA(function(){o.value=n,o.getSnapshot=t,Dp(o)&&s({inst:o})},[e,n,t]),KA(function(){return Dp(o)&&s({inst:o}),e(function(){Dp(o)&&s({inst:o})})},[e]),QA(n),n}function Dp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!BA(e,n)}catch{return!0}}function JA(e,t){return t()}var YA=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?JA:GA;sE.useSyncExternalStore=Ja.useSyncExternalStore!==void 0?Ja.useSyncExternalStore:YA;oE.exports=sE;var XA=oE.exports;const eO=Yc.useInsertionEffect,tO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nO=tO?w.useLayoutEffect:w.useEffect,rO=eO||nO,iE=e=>{const t=w.useRef([e,(...n)=>t[0](...n)]).current;return rO(()=>{t[0]=e}),t[1]},oO="popstate",Vv="pushState",Hv="replaceState",sO="hashchange",Rb=[oO,Vv,Hv,sO],iO=e=>{for(const t of Rb)addEventListener(t,e);return()=>{for(const t of Rb)removeEventListener(t,e)}},aE=(e,t)=>XA.useSyncExternalStore(iO,e,t),aO=()=>location.search,lO=({ssrSearch:e=""}={})=>aE(aO,()=>e),Ib=()=>location.pathname,cO=({ssrPath:e}={})=>aE(Ib,e?()=>e:Ib),uO=(e,{replace:t=!1,state:n=null}={})=>history[t?Hv:Vv](n,"",e),dO=(e={})=>[cO(e),uO],Ab=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Ab]>"u"){for(const e of[Vv,Hv]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Ab,{value:!0})}const fO=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",lE=(e="")=>e==="/"?"":e,hO=(e,t)=>e[0]==="~"?e.slice(1):lE(t)+e,pO=(e="",t)=>fO(Ob(lE(e)),Ob(t)),Ob=e=>{try{return decodeURI(e)}catch{return e}},cE={hook:dO,searchHook:lO,parser:VA,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},uE=w.createContext(cE),ru=()=>w.useContext(uE),dE={},fE=w.createContext(dE),mO=()=>w.useContext(fE),kh=e=>{const[t,n]=e.hook(e);return[pO(e.base,t),iE((r,o)=>n(hO(r,e.base),o))]},gO=()=>kh(ru()),hE=(e,t,n,r)=>{const{pattern:o,keys:s}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",r),i=o.exec(n)||[],[a,...l]=i;return a!==void 0?[!0,(()=>{const u=s!==!1?Object.fromEntries(s.map((f,p)=>[f,l[p]])):i.groups;let d={...l};return u&&Object.assign(d,u),d})(),...r?[a]:[]]:[!1,null]},yO=({children:e,...t})=>{var d,f;const n=ru(),r=t.hook?cE:n;let o=r;const[s,i]=((d=t.ssrPath)==null?void 0:d.split("?"))??[];i&&(t.ssrSearch=i,t.ssrPath=s),t.hrefs=t.hrefs??((f=t.hook)==null?void 0:f.hrefs);let a=w.useRef({}),l=a.current,u=l;for(let p in r){const h=p==="base"?r[p]+(t[p]||""):t[p]||r[p];l===u&&h!==u[p]&&(a.current=u={...u}),u[p]=h,(h!==r[p]||h!==o[p])&&(o=u)}return w.createElement(uE.Provider,{value:o,children:e})},Mb=({children:e,component:t},n)=>t?w.createElement(t,{params:n}):typeof e=="function"?e(n):e,vO=e=>{let t=w.useRef(dE);const n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([r,o])=>o!==n[r])?e:n},Vi=({path:e,nest:t,match:n,...r})=>{const o=ru(),[s]=kh(o),[i,a,l]=n??hE(o.parser,e,s,t),u=vO({...mO(),...a});if(!i)return null;const d=l?w.createElement(yO,{base:l},Mb(r,u)):Mb(r,u);return w.createElement(fE.Provider,{value:u,children:d})},Ya=w.forwardRef((e,t)=>{const n=ru(),[r,o]=kh(n),{to:s="",href:i=s,onClick:a,asChild:l,children:u,className:d,replace:f,state:p,...h}=e,y=iE(x=>{x.ctrlKey||x.metaKey||x.altKey||x.shiftKey||x.button!==0||(a==null||a(x),x.defaultPrevented||(x.preventDefault(),o(i,e)))}),m=n.hrefs(i[0]==="~"?i.slice(1):n.base+i,n);return l&&w.isValidElement(u)?w.cloneElement(u,{onClick:y,href:m}):w.createElement("a",{...h,onClick:y,href:m,className:d!=null&&d.call?d(r===i):d,children:u,ref:t})}),pE=e=>Array.isArray(e)?e.flatMap(t=>pE(t&&t.type===w.Fragment?t.props.children:t)):[e],xO=({children:e,location:t})=>{const n=ru(),[r]=kh(n);for(const o of pE(e)){let s=0;if(w.isValidElement(o)&&(s=hE(n.parser,o.props.path,t||r,o.props.nest))[0])return w.cloneElement(o,{match:s})}return null};var dl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ci=typeof window>"u"||"Deno"in globalThis;function kn(){}function wO(e,t){return typeof e=="function"?e(t):e}function _g(e){return typeof e=="number"&&e>=0&&e!==1/0}function mE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Cs(e,t){return typeof e=="function"?e(t):e}function ir(e,t){return typeof e=="function"?e(t):e}function Db(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Bv(i,t.options))return!1}else if(!Dc(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function Lb(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Ei(t.options.mutationKey)!==Ei(s))return!1}else if(!Dc(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Bv(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ei)(e)}function Ei(e){return JSON.stringify(e,(t,n)=>Sg(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Dc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Dc(e[n],t[n])):!1}function gE(e,t){if(e===t)return e;const n=zb(e)&&zb(t);if(n||Sg(e)&&Sg(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{},l=new Set(r);let u=0;for(let d=0;d<i;d++){const f=n?d:s[d];(!n&&l.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,u++):(a[f]=gE(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&u++)}return o===i&&u===o?e:a}return t}function _f(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function zb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sg(e){if(!Fb(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Fb(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Fb(e){return Object.prototype.toString.call(e)==="[object Object]"}function bO(e){return new Promise(t=>{setTimeout(t,e)})}function Cg(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?gE(e,t):t}function kO(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _O(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Wv=Symbol();function yE(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Wv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function vE(e,t){return typeof e=="function"?e(...t):!!e}var ci,ss,$a,O_,SO=(O_=class extends dl{constructor(){super();Se(this,ci);Se(this,ss);Se(this,$a);me(this,$a,t=>{if(!Ci&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){q(this,ss)||this.setEventListener(q(this,$a))}onUnsubscribe(){var t;this.hasListeners()||((t=q(this,ss))==null||t.call(this),me(this,ss,void 0))}setEventListener(t){var n;me(this,$a,t),(n=q(this,ss))==null||n.call(this),me(this,ss,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){q(this,ci)!==t&&(me(this,ci,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof q(this,ci)=="boolean"?q(this,ci):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ci=new WeakMap,ss=new WeakMap,$a=new WeakMap,O_),Kv=new SO,Ra,is,Ia,M_,CO=(M_=class extends dl{constructor(){super();Se(this,Ra,!0);Se(this,is);Se(this,Ia);me(this,Ia,t=>{if(!Ci&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){q(this,is)||this.setEventListener(q(this,Ia))}onUnsubscribe(){var t;this.hasListeners()||((t=q(this,is))==null||t.call(this),me(this,is,void 0))}setEventListener(t){var n;me(this,Ia,t),(n=q(this,is))==null||n.call(this),me(this,is,t(this.setOnline.bind(this)))}setOnline(t){q(this,Ra)!==t&&(me(this,Ra,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return q(this,Ra)}},Ra=new WeakMap,is=new WeakMap,Ia=new WeakMap,M_),Sf=new CO;function Eg(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function EO(e){return Math.min(1e3*2**e,3e4)}function xE(e){return(e??"online")==="online"?Sf.isOnline():!0}var wE=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function bE(e){let t=!1,n=0,r;const o=Eg(),s=()=>o.status!=="pending",i=m=>{var x;s()||(p(new wE(m)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Kv.isFocused()&&(e.networkMode==="always"||Sf.isOnline())&&e.canRun(),d=()=>xE(e.networkMode)&&e.canRun(),f=m=>{s()||(r==null||r(),o.resolve(m))},p=m=>{s()||(r==null||r(),o.reject(m))},h=()=>new Promise(m=>{var x;r=g=>{(s()||u())&&m(g)},(x=e.onPause)==null||x.call(e)}).then(()=>{var m;r=void 0,s()||(m=e.onContinue)==null||m.call(e)}),y=()=>{if(s())return;let m;const x=n===0?e.initialPromise:void 0;try{m=x??e.fn()}catch(g){m=Promise.reject(g)}Promise.resolve(m).then(f).catch(g=>{var E;if(s())return;const v=e.retry??(Ci?0:3),b=e.retryDelay??EO,k=typeof b=="function"?b(n,g):b,S=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,g);if(t||!S){p(g);return}n++,(E=e.onFail)==null||E.call(e,n,g),bO(k).then(()=>u()?void 0:h()).then(()=>{t?p(g):y()})})};return{promise:o,status:()=>o.status,cancel:i,continue:()=>(r==null||r(),o),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():h().then(y),o)}}var NO=e=>setTimeout(e,0);function jO(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=NO;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var zt=jO(),ui,D_,kE=(D_=class{constructor(){Se(this,ui)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_g(this.gcTime)&&me(this,ui,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ci?1/0:5*60*1e3))}clearGcTimeout(){q(this,ui)&&(clearTimeout(q(this,ui)),me(this,ui,void 0))}},ui=new WeakMap,D_),Aa,Oa,or,di,Ht,Kc,fi,Er,mo,L_,PO=(L_=class extends kE{constructor(t){super();Se(this,Er);Se(this,Aa);Se(this,Oa);Se(this,or);Se(this,di);Se(this,Ht);Se(this,Kc);Se(this,fi);me(this,fi,!1),me(this,Kc,t.defaultOptions),this.setOptions(t.options),this.observers=[],me(this,di,t.client),me(this,or,q(this,di).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,me(this,Aa,TO(this.options)),this.state=t.state??q(this,Aa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=q(this,Ht))==null?void 0:t.promise}setOptions(t){this.options={...q(this,Kc),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&q(this,or).remove(this)}setData(t,n){const r=Cg(this.state.data,t,this.options);return De(this,Er,mo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){De(this,Er,mo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=q(this,Ht))==null?void 0:r.promise;return(o=q(this,Ht))==null||o.cancel(t),n?n.then(kn).catch(kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(q(this,Aa))}isActive(){return this.observers.some(t=>ir(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Wv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Cs(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!mE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=q(this,Ht))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=q(this,Ht))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),q(this,or).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(q(this,Ht)&&(q(this,fi)?q(this,Ht).cancel({revert:!0}):q(this,Ht).cancelRetry()),this.scheduleGc()),q(this,or).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,Er,mo).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,d,f,p,h,y,m,x,g,v,b;if(this.state.fetchStatus!=="idle"&&((l=q(this,Ht))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(q(this,Ht))return q(this,Ht).continueRetry(),q(this,Ht).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(S=>S.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,o=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(me(this,fi,!0),r.signal)})},s=()=>{const k=yE(this.options,n),E=(()=>{const P={client:q(this,di),queryKey:this.queryKey,meta:this.meta};return o(P),P})();return me(this,fi,!1),this.options.persister?this.options.persister(k,E,this):k(E)},a=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:q(this,di),state:this.state,fetchFn:s};return o(k),k})();(u=this.options.behavior)==null||u.onFetch(a,this),me(this,Oa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&De(this,Er,mo).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta}),me(this,Ht,bE({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onFail:(k,S)=>{De(this,Er,mo).call(this,{type:"failed",failureCount:k,error:S})},onPause:()=>{De(this,Er,mo).call(this,{type:"pause"})},onContinue:()=>{De(this,Er,mo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const k=await q(this,Ht).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(h=(p=q(this,or).config).onSuccess)==null||h.call(p,k,this),(m=(y=q(this,or).config).onSettled)==null||m.call(y,k,this.state.error,this),k}catch(k){if(k instanceof wE){if(k.silent)return q(this,Ht).promise;if(k.revert){if(this.setState({...q(this,Oa),fetchStatus:"idle"}),this.state.data===void 0)throw k;return this.state.data}}throw De(this,Er,mo).call(this,{type:"error",error:k}),(g=(x=q(this,or).config).onError)==null||g.call(x,k,this),(b=(v=q(this,or).config).onSettled)==null||b.call(v,this.state.data,k,this),k}finally{this.scheduleGc()}}},Aa=new WeakMap,Oa=new WeakMap,or=new WeakMap,di=new WeakMap,Ht=new WeakMap,Kc=new WeakMap,fi=new WeakMap,Er=new WeakSet,mo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,..._E(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return me(this,Oa,t.manual?o:void 0),o;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),zt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),q(this,or).notify({query:this,type:"updated",action:t})})},L_);function _E(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xE(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function TO(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Wr,z_,$O=(z_=class extends dl{constructor(t={}){super();Se(this,Wr);this.config=t,me(this,Wr,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Bv(o,n);let i=this.get(s);return i||(i=new PO({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){q(this,Wr).has(t.queryHash)||(q(this,Wr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=q(this,Wr).get(t.queryHash);n&&(t.destroy(),n===t&&q(this,Wr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){zt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return q(this,Wr).get(t)}getAll(){return[...q(this,Wr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Db(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Db(t,r)):n}notify(t){zt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){zt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){zt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Wr=new WeakMap,z_),Kr,vn,hi,Zr,Qo,F_,RO=(F_=class extends kE{constructor(t){super();Se(this,Zr);Se(this,Kr);Se(this,vn);Se(this,hi);this.mutationId=t.mutationId,me(this,vn,t.mutationCache),me(this,Kr,[]),this.state=t.state||SE(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){q(this,Kr).includes(t)||(q(this,Kr).push(t),this.clearGcTimeout(),q(this,vn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){me(this,Kr,q(this,Kr).filter(n=>n!==t)),this.scheduleGc(),q(this,vn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){q(this,Kr).length||(this.state.status==="pending"?this.scheduleGc():q(this,vn).remove(this))}continue(){var t;return((t=q(this,hi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,i,a,l,u,d,f,p,h,y,m,x,g,v,b,k,S,E,P,O;const n=()=>{De(this,Zr,Qo).call(this,{type:"continue"})};me(this,hi,bE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,$)=>{De(this,Zr,Qo).call(this,{type:"failed",failureCount:R,error:$})},onPause:()=>{De(this,Zr,Qo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>q(this,vn).canRun(this)}));const r=this.state.status==="pending",o=!q(this,hi).canStart();try{if(r)n();else{De(this,Zr,Qo).call(this,{type:"pending",variables:t,isPaused:o}),await((i=(s=q(this,vn).config).onMutate)==null?void 0:i.call(s,t,this));const $=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));$!==this.state.context&&De(this,Zr,Qo).call(this,{type:"pending",context:$,variables:t,isPaused:o})}const R=await q(this,hi).start();return await((d=(u=q(this,vn).config).onSuccess)==null?void 0:d.call(u,R,t,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,R,t,this.state.context)),await((y=(h=q(this,vn).config).onSettled)==null?void 0:y.call(h,R,null,this.state.variables,this.state.context,this)),await((x=(m=this.options).onSettled)==null?void 0:x.call(m,R,null,t,this.state.context)),De(this,Zr,Qo).call(this,{type:"success",data:R}),R}catch(R){try{throw await((v=(g=q(this,vn).config).onError)==null?void 0:v.call(g,R,t,this.state.context,this)),await((k=(b=this.options).onError)==null?void 0:k.call(b,R,t,this.state.context)),await((E=(S=q(this,vn).config).onSettled)==null?void 0:E.call(S,void 0,R,this.state.variables,this.state.context,this)),await((O=(P=this.options).onSettled)==null?void 0:O.call(P,void 0,R,t,this.state.context)),R}finally{De(this,Zr,Qo).call(this,{type:"error",error:R})}}finally{q(this,vn).runNext(this)}}},Kr=new WeakMap,vn=new WeakMap,hi=new WeakMap,Zr=new WeakSet,Qo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),zt.batch(()=>{q(this,Kr).forEach(r=>{r.onMutationUpdate(t)}),q(this,vn).notify({mutation:this,type:"updated",action:t})})},F_);function SE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xo,Nr,Zc,U_,IO=(U_=class extends dl{constructor(t={}){super();Se(this,xo);Se(this,Nr);Se(this,Zc);this.config=t,me(this,xo,new Set),me(this,Nr,new Map),me(this,Zc,0)}build(t,n,r){const o=new RO({mutationCache:this,mutationId:++Eu(this,Zc)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){q(this,xo).add(t);const n=Hu(t);if(typeof n=="string"){const r=q(this,Nr).get(n);r?r.push(t):q(this,Nr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(q(this,xo).delete(t)){const n=Hu(t);if(typeof n=="string"){const r=q(this,Nr).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&q(this,Nr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Hu(t);if(typeof n=="string"){const r=q(this,Nr).get(n),o=r==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Hu(t);if(typeof n=="string"){const o=(r=q(this,Nr).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zt.batch(()=>{q(this,xo).forEach(t=>{this.notify({type:"removed",mutation:t})}),q(this,xo).clear(),q(this,Nr).clear()})}getAll(){return Array.from(q(this,xo))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Lb(n,r))}findAll(t={}){return this.getAll().filter(n=>Lb(t,n))}notify(t){zt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return zt.batch(()=>Promise.all(t.map(n=>n.continue().catch(kn))))}},xo=new WeakMap,Nr=new WeakMap,Zc=new WeakMap,U_);function Hu(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Ub(e){return{onFetch:(t,n)=>{var d,f,p,h,y;const r=t.options,o=(p=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],i=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const x=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},g=yE(t.options,t.fetchOptions),v=async(b,k,S)=>{if(m)return Promise.reject();if(k==null&&b.pages.length)return Promise.resolve(b);const P=(()=>{const j={client:t.client,queryKey:t.queryKey,pageParam:k,direction:S?"backward":"forward",meta:t.options.meta};return x(j),j})(),O=await g(P),{maxPages:R}=t.options,$=S?_O:kO;return{pages:$(b.pages,O,R),pageParams:$(b.pageParams,k,R)}};if(o&&s.length){const b=o==="backward",k=b?AO:qb,S={pages:s,pageParams:i},E=k(r,S);a=await v(S,E,b)}else{const b=e??s.length;do{const k=l===0?i[0]??r.initialPageParam:qb(r,a);if(l>0&&k==null)break;a=await v(a,k),l++}while(l<b)}return a};t.options.persister?t.fetchFn=()=>{var m,x;return(x=(m=t.options).persister)==null?void 0:x.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function qb(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function AO(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var jt,as,ls,Ma,Da,cs,La,za,q_,OO=(q_=class{constructor(e={}){Se(this,jt);Se(this,as);Se(this,ls);Se(this,Ma);Se(this,Da);Se(this,cs);Se(this,La);Se(this,za);me(this,jt,e.queryCache||new $O),me(this,as,e.mutationCache||new IO),me(this,ls,e.defaultOptions||{}),me(this,Ma,new Map),me(this,Da,new Map),me(this,cs,0)}mount(){Eu(this,cs)._++,q(this,cs)===1&&(me(this,La,Kv.subscribe(async e=>{e&&(await this.resumePausedMutations(),q(this,jt).onFocus())})),me(this,za,Sf.subscribe(async e=>{e&&(await this.resumePausedMutations(),q(this,jt).onOnline())})))}unmount(){var e,t;Eu(this,cs)._--,q(this,cs)===0&&((e=q(this,La))==null||e.call(this),me(this,La,void 0),(t=q(this,za))==null||t.call(this),me(this,za,void 0))}isFetching(e){return q(this,jt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return q(this,as).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=q(this,jt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=q(this,jt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Cs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return q(this,jt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=q(this,jt).get(r.queryHash),s=o==null?void 0:o.state.data,i=wO(t,s);if(i!==void 0)return q(this,jt).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return zt.batch(()=>q(this,jt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=q(this,jt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=q(this,jt);zt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=q(this,jt);return zt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=zt.batch(()=>q(this,jt).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(kn).catch(kn)}invalidateQueries(e,t={}){return zt.batch(()=>(q(this,jt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=zt.batch(()=>q(this,jt).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(kn)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(kn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=q(this,jt).build(this,t);return n.isStaleByTime(Cs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kn).catch(kn)}fetchInfiniteQuery(e){return e.behavior=Ub(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kn).catch(kn)}ensureInfiniteQueryData(e){return e.behavior=Ub(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Sf.isOnline()?q(this,as).resumePausedMutations():Promise.resolve()}getQueryCache(){return q(this,jt)}getMutationCache(){return q(this,as)}getDefaultOptions(){return q(this,ls)}setDefaultOptions(e){me(this,ls,e)}setQueryDefaults(e,t){q(this,Ma).set(Ei(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...q(this,Ma).values()],n={};return t.forEach(r=>{Dc(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){q(this,Da).set(Ei(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...q(this,Da).values()],n={};return t.forEach(r=>{Dc(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...q(this,ls).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bv(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Wv&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...q(this,ls).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){q(this,jt).clear(),q(this,as).clear()}},jt=new WeakMap,as=new WeakMap,ls=new WeakMap,Ma=new WeakMap,Da=new WeakMap,cs=new WeakMap,La=new WeakMap,za=new WeakMap,q_),Pn,He,Qc,xn,pi,Fa,wo,us,Gc,Ua,qa,mi,gi,ds,Va,Ge,Bl,Ng,jg,Pg,Tg,$g,Rg,Ig,CE,V_,MO=(V_=class extends dl{constructor(t,n){super();Se(this,Ge);Se(this,Pn);Se(this,He);Se(this,Qc);Se(this,xn);Se(this,pi);Se(this,Fa);Se(this,wo);Se(this,us);Se(this,Gc);Se(this,Ua);Se(this,qa);Se(this,mi);Se(this,gi);Se(this,ds);Se(this,Va,new Set);this.options=n,me(this,Pn,t),me(this,us,null),me(this,wo,Eg()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(q(this,He).addObserver(this),Vb(q(this,He),this.options)?De(this,Ge,Bl).call(this):this.updateResult(),De(this,Ge,Tg).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ag(q(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ag(q(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,De(this,Ge,$g).call(this),De(this,Ge,Rg).call(this),q(this,He).removeObserver(this)}setOptions(t){const n=this.options,r=q(this,He);if(this.options=q(this,Pn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ir(this.options.enabled,q(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");De(this,Ge,Ig).call(this),q(this,He).setOptions(this.options),n._defaulted&&!_f(this.options,n)&&q(this,Pn).getQueryCache().notify({type:"observerOptionsUpdated",query:q(this,He),observer:this});const o=this.hasListeners();o&&Hb(q(this,He),r,this.options,n)&&De(this,Ge,Bl).call(this),this.updateResult(),o&&(q(this,He)!==r||ir(this.options.enabled,q(this,He))!==ir(n.enabled,q(this,He))||Cs(this.options.staleTime,q(this,He))!==Cs(n.staleTime,q(this,He)))&&De(this,Ge,Ng).call(this);const s=De(this,Ge,jg).call(this);o&&(q(this,He)!==r||ir(this.options.enabled,q(this,He))!==ir(n.enabled,q(this,He))||s!==q(this,ds))&&De(this,Ge,Pg).call(this,s)}getOptimisticResult(t){const n=q(this,Pn).getQueryCache().build(q(this,Pn),t),r=this.createResult(n,t);return LO(this,r)&&(me(this,xn,r),me(this,Fa,this.options),me(this,pi,q(this,He).state)),r}getCurrentResult(){return q(this,xn)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&!this.options.experimental_prefetchInRender&&q(this,wo).status==="pending"&&q(this,wo).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,o))})}trackProp(t){q(this,Va).add(t)}getCurrentQuery(){return q(this,He)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=q(this,Pn).defaultQueryOptions(t),r=q(this,Pn).getQueryCache().build(q(this,Pn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return De(this,Ge,Bl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),q(this,xn)))}createResult(t,n){var R;const r=q(this,He),o=this.options,s=q(this,xn),i=q(this,pi),a=q(this,Fa),u=t!==r?t.state:q(this,Qc),{state:d}=t;let f={...d},p=!1,h;if(n._optimisticResults){const $=this.hasListeners(),j=!$&&Vb(t,n),I=$&&Hb(t,r,n,o);(j||I)&&(f={...f,..._E(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:m,status:x}=f;h=f.data;let g=!1;if(n.placeholderData!==void 0&&h===void 0&&x==="pending"){let $;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?($=s.data,g=!0):$=typeof n.placeholderData=="function"?n.placeholderData((R=q(this,qa))==null?void 0:R.state.data,q(this,qa)):n.placeholderData,$!==void 0&&(x="success",h=Cg(s==null?void 0:s.data,$,n),p=!0)}if(n.select&&h!==void 0&&!g)if(s&&h===(i==null?void 0:i.data)&&n.select===q(this,Gc))h=q(this,Ua);else try{me(this,Gc,n.select),h=n.select(h),h=Cg(s==null?void 0:s.data,h,n),me(this,Ua,h),me(this,us,null)}catch($){me(this,us,$)}q(this,us)&&(y=q(this,us),h=q(this,Ua),m=Date.now(),x="error");const v=f.fetchStatus==="fetching",b=x==="pending",k=x==="error",S=b&&v,E=h!==void 0,O={status:x,fetchStatus:f.fetchStatus,isPending:b,isSuccess:x==="success",isError:k,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:m,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!b,isLoadingError:k&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:k&&E,isStale:Zv(t,n),refetch:this.refetch,promise:q(this,wo),isEnabled:ir(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=D=>{O.status==="error"?D.reject(O.error):O.data!==void 0&&D.resolve(O.data)},j=()=>{const D=me(this,wo,O.promise=Eg());$(D)},I=q(this,wo);switch(I.status){case"pending":t.queryHash===r.queryHash&&$(I);break;case"fulfilled":(O.status==="error"||O.data!==I.value)&&j();break;case"rejected":(O.status!=="error"||O.error!==I.reason)&&j();break}}return O}updateResult(){const t=q(this,xn),n=this.createResult(q(this,He),this.options);if(me(this,pi,q(this,He).state),me(this,Fa,this.options),q(this,pi).data!==void 0&&me(this,qa,q(this,He)),_f(n,t))return;me(this,xn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,s=typeof o=="function"?o():o;if(s==="all"||!s&&!q(this,Va).size)return!0;const i=new Set(s??q(this,Va));return this.options.throwOnError&&i.add("error"),Object.keys(q(this,xn)).some(a=>{const l=a;return q(this,xn)[l]!==t[l]&&i.has(l)})};De(this,Ge,CE).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&De(this,Ge,Tg).call(this)}},Pn=new WeakMap,He=new WeakMap,Qc=new WeakMap,xn=new WeakMap,pi=new WeakMap,Fa=new WeakMap,wo=new WeakMap,us=new WeakMap,Gc=new WeakMap,Ua=new WeakMap,qa=new WeakMap,mi=new WeakMap,gi=new WeakMap,ds=new WeakMap,Va=new WeakMap,Ge=new WeakSet,Bl=function(t){De(this,Ge,Ig).call(this);let n=q(this,He).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kn)),n},Ng=function(){De(this,Ge,$g).call(this);const t=Cs(this.options.staleTime,q(this,He));if(Ci||q(this,xn).isStale||!_g(t))return;const r=mE(q(this,xn).dataUpdatedAt,t)+1;me(this,mi,setTimeout(()=>{q(this,xn).isStale||this.updateResult()},r))},jg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(q(this,He)):this.options.refetchInterval)??!1},Pg=function(t){De(this,Ge,Rg).call(this),me(this,ds,t),!(Ci||ir(this.options.enabled,q(this,He))===!1||!_g(q(this,ds))||q(this,ds)===0)&&me(this,gi,setInterval(()=>{(this.options.refetchIntervalInBackground||Kv.isFocused())&&De(this,Ge,Bl).call(this)},q(this,ds)))},Tg=function(){De(this,Ge,Ng).call(this),De(this,Ge,Pg).call(this,De(this,Ge,jg).call(this))},$g=function(){q(this,mi)&&(clearTimeout(q(this,mi)),me(this,mi,void 0))},Rg=function(){q(this,gi)&&(clearInterval(q(this,gi)),me(this,gi,void 0))},Ig=function(){const t=q(this,Pn).getQueryCache().build(q(this,Pn),this.options);if(t===q(this,He))return;const n=q(this,He);me(this,He,t),me(this,Qc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},CE=function(t){zt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(q(this,xn))}),q(this,Pn).getQueryCache().notify({query:q(this,He),type:"observerResultsUpdated"})})},V_);function DO(e,t){return ir(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Vb(e,t){return DO(e,t)||e.state.data!==void 0&&Ag(e,t,t.refetchOnMount)}function Ag(e,t,n){if(ir(t.enabled,e)!==!1&&Cs(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Zv(e,t)}return!1}function Hb(e,t,n,r){return(e!==t||ir(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Zv(e,n)}function Zv(e,t){return ir(t.enabled,e)!==!1&&e.isStaleByTime(Cs(t.staleTime,e))}function LO(e,t){return!_f(e.getCurrentResult(),t)}var fs,hs,Tn,bo,jo,$d,Og,H_,zO=(H_=class extends dl{constructor(n,r){super();Se(this,jo);Se(this,fs);Se(this,hs);Se(this,Tn);Se(this,bo);me(this,fs,n),this.setOptions(r),this.bindMethods(),De(this,jo,$d).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=q(this,fs).defaultMutationOptions(n),_f(this.options,r)||q(this,fs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:q(this,Tn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ei(r.mutationKey)!==Ei(this.options.mutationKey)?this.reset():((o=q(this,Tn))==null?void 0:o.state.status)==="pending"&&q(this,Tn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=q(this,Tn))==null||n.removeObserver(this)}onMutationUpdate(n){De(this,jo,$d).call(this),De(this,jo,Og).call(this,n)}getCurrentResult(){return q(this,hs)}reset(){var n;(n=q(this,Tn))==null||n.removeObserver(this),me(this,Tn,void 0),De(this,jo,$d).call(this),De(this,jo,Og).call(this)}mutate(n,r){var o;return me(this,bo,r),(o=q(this,Tn))==null||o.removeObserver(this),me(this,Tn,q(this,fs).getMutationCache().build(q(this,fs),this.options)),q(this,Tn).addObserver(this),q(this,Tn).execute(n)}},fs=new WeakMap,hs=new WeakMap,Tn=new WeakMap,bo=new WeakMap,jo=new WeakSet,$d=function(){var r;const n=((r=q(this,Tn))==null?void 0:r.state)??SE();me(this,hs,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Og=function(n){zt.batch(()=>{var r,o,s,i,a,l,u,d;if(q(this,bo)&&this.hasListeners()){const f=q(this,hs).variables,p=q(this,hs).context;(n==null?void 0:n.type)==="success"?((o=(r=q(this,bo)).onSuccess)==null||o.call(r,n.data,f,p),(i=(s=q(this,bo)).onSettled)==null||i.call(s,n.data,null,f,p)):(n==null?void 0:n.type)==="error"&&((l=(a=q(this,bo)).onError)==null||l.call(a,n.error,f,p),(d=(u=q(this,bo)).onSettled)==null||d.call(u,void 0,n.error,f,p))}this.listeners.forEach(f=>{f(q(this,hs))})})},H_),EE=w.createContext(void 0),Kt=e=>{const t=w.useContext(EE);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},FO=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(EE.Provider,{value:e,children:t})),NE=w.createContext(!1),UO=()=>w.useContext(NE);NE.Provider;function qO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var VO=w.createContext(qO()),HO=()=>w.useContext(VO),BO=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},WO=e=>{w.useEffect(()=>{e.clearReset()},[e])},KO=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||vE(n,[e.error,r])),ZO=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},QO=(e,t)=>e.isLoading&&e.isFetching&&!t,GO=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Bb=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function JO(e,t,n){var f,p,h,y,m;const r=UO(),o=HO(),s=Kt(),i=s.defaultQueryOptions(e);(p=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,i),i._optimisticResults=r?"isRestoring":"optimistic",ZO(i),BO(i,o),WO(o);const a=!s.getQueryCache().get(i.queryHash),[l]=w.useState(()=>new t(s,i)),u=l.getOptimisticResult(i),d=!r&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(x=>{const g=d?l.subscribe(zt.batchCalls(x)):kn;return l.updateResult(),g},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(i)},[i,l]),GO(i,u))throw Bb(i,l,o);if(KO({result:u,errorResetBoundary:o,throwOnError:i.throwOnError,query:s.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw u.error;if((y=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||y.call(h,i,u),i.experimental_prefetchInRender&&!Ci&&QO(u,r)){const x=a?Bb(i,l,o):(m=s.getQueryCache().get(i.queryHash))==null?void 0:m.promise;x==null||x.catch(kn).finally(()=>{l.updateResult()})}return i.notifyOnChangeProps?u:l.trackResult(u)}function ut(e,t){return JO(e,MO)}function dt(e,t){const n=Kt(),[r]=w.useState(()=>new zO(n,e));w.useEffect(()=>{r.setOptions(e)},[r,e]);const o=w.useSyncExternalStore(w.useCallback(i=>r.subscribe(zt.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=w.useCallback((i,a)=>{r.mutate(i,a).catch(kn)},[r]);if(o.error&&vE(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const YO="x-agent-deck-client",XO="dashboard",jE={[YO]:XO};async function PE(e){if(e.ok)return;let t=e.statusText;try{const n=await e.text();try{const r=JSON.parse(n);t=r.error||r.message||t}catch{n.trim()&&(t=`${e.status}: ${n}`)}}catch(n){console.warn("Response body parsing failed:",n)}throw new Error(t)}async function Ce(e,t,n){const r=await fetch(t,{method:e,headers:{...jE,...n?{"Content-Type":"application/json"}:{}},body:n?JSON.stringify(n):void 0});return await PE(r),r}const eM=({on401:e})=>async({queryKey:t})=>{const n=t.join("/"),r=await fetch(n,{headers:jE});return await PE(r),await r.json()},tM=new OO({defaultOptions:{queries:{queryFn:eM({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!0,staleTime:0,gcTime:10*60*1e3,retry:!1},mutations:{retry:!1}}}),nM=1,rM=1e6;let Lp=0;function oM(){return Lp=(Lp+1)%Number.MAX_SAFE_INTEGER,Lp.toString()}const zp=new Map,Wb=e=>{if(zp.has(e))return;const t=setTimeout(()=>{zp.delete(e),ac({type:"REMOVE_TOAST",toastId:e})},rM);zp.set(e,t)},sM=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,nM)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Wb(n):e.toasts.forEach(r=>{Wb(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Rd=[];let Id={toasts:[]};function ac(e){Id=sM(Id,e),Rd.forEach(t=>{t(Id)})}function iM({...e}){const t=oM(),n=o=>ac({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>ac({type:"DISMISS_TOAST",toastId:t});return ac({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function qt(){const[e,t]=w.useState(Id);return w.useEffect(()=>(Rd.push(t),()=>{const n=Rd.indexOf(t);n>-1&&Rd.splice(n,1)}),[e]),{...e,toast:iM,dismiss:n=>ac({type:"DISMISS_TOAST",toastId:n})}}function be(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Kb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function TE(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Kb(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Kb(e[o],null)}}}}function Xe(...e){return w.useCallback(TE(...e),e)}function aM(e,t){const n=w.createContext(t),r=s=>{const{children:i,...a}=s,l=w.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:i})};r.displayName=e+"Provider";function o(s){const i=w.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Do(e,t=[]){let n=[];function r(s,i){const a=w.createContext(i),l=n.length;n=[...n,i];const u=f=>{var g;const{scope:p,children:h,...y}=f,m=((g=p==null?void 0:p[e])==null?void 0:g[l])||a,x=w.useMemo(()=>y,Object.values(y));return c.jsx(m.Provider,{value:x,children:h})};u.displayName=s+"Provider";function d(f,p){var m;const h=((m=p==null?void 0:p[e])==null?void 0:m[l])||a,y=w.useContext(h);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(i=>w.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,lM(o,...t)]}function lM(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Ni(e){const t=uM(e),n=w.forwardRef((r,o)=>{const{children:s,...i}=r,a=w.Children.toArray(s),l=a.find(fM);if(l){const u=l.props.children,d=a.map(f=>f===l?w.Children.count(u)>1?w.Children.only(null):w.isValidElement(u)?u.props.children:null:f);return c.jsx(t,{...i,ref:o,children:w.isValidElement(u)?w.cloneElement(u,void 0,d):null})}return c.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}var cM=Ni("Slot");function uM(e){const t=w.forwardRef((n,r)=>{const{children:o,...s}=n;if(w.isValidElement(o)){const i=pM(o),a=hM(s,o.props);return o.type!==w.Fragment&&(a.ref=r?TE(r,i):i),w.cloneElement(o,a)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $E=Symbol("radix.slottable");function dM(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=$E,t}function fM(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$E}function hM(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function pM(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Qv(e){const t=e+"CollectionProvider",[n,r]=Do(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:x,children:g}=m,v=Br.useRef(null),b=Br.useRef(new Map).current;return c.jsx(o,{scope:x,itemMap:b,collectionRef:v,children:g})};i.displayName=t;const a=e+"CollectionSlot",l=Ni(a),u=Br.forwardRef((m,x)=>{const{scope:g,children:v}=m,b=s(a,g),k=Xe(x,b.collectionRef);return c.jsx(l,{ref:k,children:v})});u.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=Ni(d),h=Br.forwardRef((m,x)=>{const{scope:g,children:v,...b}=m,k=Br.useRef(null),S=Xe(x,k),E=s(d,g);return Br.useEffect(()=>(E.itemMap.set(k,{ref:k,...b}),()=>void E.itemMap.delete(k))),c.jsx(p,{[f]:"",ref:S,children:v})});h.displayName=d;function y(m){const x=s(e+"CollectionConsumer",m);return Br.useCallback(()=>{const v=x.collectionRef.current;if(!v)return[];const b=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((E,P)=>b.indexOf(E.ref.current)-b.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:i,Slot:u,ItemSlot:h},y,r]}var mM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=mM.reduce((e,t)=>{const n=Ni(`Primitive.${t}`),r=w.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function RE(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}function mr(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function gM(e,t=globalThis==null?void 0:globalThis.document){const n=mr(e);w.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var yM="DismissableLayer",Mg="dismissableLayer.update",vM="dismissableLayer.pointerDownOutside",xM="dismissableLayer.focusOutside",Zb,IE=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fl=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,u=w.useContext(IE),[d,f]=w.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=w.useState({}),y=Xe(t,P=>f(P)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(x),v=d?m.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,k=v>=g,S=bM(P=>{const O=P.target,R=[...u.branches].some($=>$.contains(O));!k||R||(o==null||o(P),i==null||i(P),P.defaultPrevented||a==null||a())},p),E=kM(P=>{const O=P.target;[...u.branches].some($=>$.contains(O))||(s==null||s(P),i==null||i(P),P.defaultPrevented||a==null||a())},p);return gM(P=>{v===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&a&&(P.preventDefault(),a()))},p),w.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Zb=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Qb(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Zb)}},[d,p,n,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Qb())},[d,u]),w.useEffect(()=>{const P=()=>h({});return document.addEventListener(Mg,P),()=>document.removeEventListener(Mg,P)},[]),c.jsx(Ae.div,{...l,ref:y,style:{pointerEvents:b?k?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,E.onFocusCapture),onBlurCapture:be(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,S.onPointerDownCapture)})});fl.displayName=yM;var wM="DismissableLayerBranch",AE=w.forwardRef((e,t)=>{const n=w.useContext(IE),r=w.useRef(null),o=Xe(t,r);return w.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(Ae.div,{...e,ref:o})});AE.displayName=wM;function bM(e,t=globalThis==null?void 0:globalThis.document){const n=mr(e),r=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){OE(vM,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kM(e,t=globalThis==null?void 0:globalThis.document){const n=mr(e),r=w.useRef(!1);return w.useEffect(()=>{const o=s=>{s.target&&!r.current&&OE(xM,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Qb(){const e=new CustomEvent(Mg);document.dispatchEvent(e)}function OE(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?RE(o,s):o.dispatchEvent(s)}var _M=fl,SM=AE,on=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},CM="Portal",ou=w.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,s]=w.useState(!1);on(()=>s(!0),[]);const i=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?qA.createPortal(c.jsx(Ae.div,{...r,ref:t}),i):null});ou.displayName=CM;function EM(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var Lo=e=>{const{present:t,children:n}=e,r=NM(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=Xe(r.ref,jM(o));return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:s}):null};Lo.displayName="Presence";function NM(e){const[t,n]=w.useState(),r=w.useRef(null),o=w.useRef(e),s=w.useRef("none"),i=e?"mounted":"unmounted",[a,l]=EM(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=Bu(r.current);s.current=a==="mounted"?u:"none"},[a]),on(()=>{const u=r.current,d=o.current;if(d!==e){const p=s.current,h=Bu(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),on(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=h=>{const m=Bu(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},p=h=>{h.target===t&&(s.current=Bu(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Bu(e){return(e==null?void 0:e.animationName)||"none"}function jM(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var PM=Yc[" useInsertionEffect ".trim().toString()]||on;function ji({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=TM({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=w.useRef(e!==void 0);w.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"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=a},[a,r])}const u=w.useCallback(d=>{var f;if(a){const p=$M(d)?d(e):d;p!==e&&((f=i.current)==null||f.call(i,p))}else s(d)},[a,e,s,i]);return[l,u]}function TM({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),o=w.useRef(n),s=w.useRef(t);return PM(()=>{s.current=t},[t]),w.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function $M(e){return typeof e=="function"}var ME=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"}),RM="VisuallyHidden",_h=w.forwardRef((e,t)=>c.jsx(Ae.span,{...e,ref:t,style:{...ME,...e.style}}));_h.displayName=RM;var IM=_h,Gv="ToastProvider",[Jv,AM,OM]=Qv("Toast"),[DE,tte]=Do("Toast",[OM]),[MM,Sh]=DE(Gv),LE=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:s=50,children:i}=e,[a,l]=w.useState(null),[u,d]=w.useState(0),f=w.useRef(!1),p=w.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Gv}\`. Expected non-empty \`string\`.`),c.jsx(Jv.Provider,{scope:t,children:c.jsx(MM,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:w.useCallback(()=>d(h=>h+1),[]),onToastRemove:w.useCallback(()=>d(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:i})})};LE.displayName=Gv;var zE="ToastViewport",DM=["F8"],Dg="toast.viewportPause",Lg="toast.viewportResume",FE=w.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=DM,label:o="Notifications ({hotkey})",...s}=e,i=Sh(zE,n),a=AM(n),l=w.useRef(null),u=w.useRef(null),d=w.useRef(null),f=w.useRef(null),p=Xe(t,f,i.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=i.toastCount>0;w.useEffect(()=>{const x=g=>{var b;r.length!==0&&r.every(k=>g[k]||g.code===k)&&((b=f.current)==null||b.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),w.useEffect(()=>{const x=l.current,g=f.current;if(y&&x&&g){const v=()=>{if(!i.isClosePausedRef.current){const E=new CustomEvent(Dg);g.dispatchEvent(E),i.isClosePausedRef.current=!0}},b=()=>{if(i.isClosePausedRef.current){const E=new CustomEvent(Lg);g.dispatchEvent(E),i.isClosePausedRef.current=!1}},k=E=>{!x.contains(E.relatedTarget)&&b()},S=()=>{x.contains(document.activeElement)||b()};return x.addEventListener("focusin",v),x.addEventListener("focusout",k),x.addEventListener("pointermove",v),x.addEventListener("pointerleave",S),window.addEventListener("blur",v),window.addEventListener("focus",b),()=>{x.removeEventListener("focusin",v),x.removeEventListener("focusout",k),x.removeEventListener("pointermove",v),x.removeEventListener("pointerleave",S),window.removeEventListener("blur",v),window.removeEventListener("focus",b)}}},[y,i.isClosePausedRef]);const m=w.useCallback(({tabbingDirection:x})=>{const v=a().map(b=>{const k=b.ref.current,S=[k,...GM(k)];return x==="forwards"?S:S.reverse()});return(x==="forwards"?v.reverse():v).flat()},[a]);return w.useEffect(()=>{const x=f.current;if(x){const g=v=>{var S,E,P;const b=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!b){const O=document.activeElement,R=v.shiftKey;if(v.target===x&&R){(S=u.current)==null||S.focus();return}const I=m({tabbingDirection:R?"backwards":"forwards"}),D=I.findIndex(L=>L===O);Fp(I.slice(D+1))?v.preventDefault():R?(E=u.current)==null||E.focus():(P=d.current)==null||P.focus()}};return x.addEventListener("keydown",g),()=>x.removeEventListener("keydown",g)}},[a,m]),c.jsxs(SM,{ref:l,role:"region","aria-label":o.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&c.jsx(zg,{ref:u,onFocusFromOutsideViewport:()=>{const x=m({tabbingDirection:"forwards"});Fp(x)}}),c.jsx(Jv.Slot,{scope:n,children:c.jsx(Ae.ol,{tabIndex:-1,...s,ref:p})}),y&&c.jsx(zg,{ref:d,onFocusFromOutsideViewport:()=>{const x=m({tabbingDirection:"backwards"});Fp(x)}})]})});FE.displayName=zE;var UE="ToastFocusProxy",zg=w.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,s=Sh(UE,n);return c.jsx(_h,{tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const a=i.relatedTarget;!((u=s.viewport)!=null&&u.contains(a))&&r()}})});zg.displayName=UE;var su="Toast",LM="toast.swipeStart",zM="toast.swipeMove",FM="toast.swipeCancel",UM="toast.swipeEnd",qE=w.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:s,...i}=e,[a,l]=ji({prop:r,defaultProp:o??!0,onChange:s,caller:su});return c.jsx(Lo,{present:n||a,children:c.jsx(HM,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:mr(e.onPause),onResume:mr(e.onResume),onSwipeStart:be(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:be(e.onSwipeMove,u=>{const{x:d,y:f}=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",`${f}px`)}),onSwipeCancel:be(e.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:be(e.onSwipeEnd,u=>{const{x:d,y:f}=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",`${f}px`),l(!1)})})})});qE.displayName=su;var[qM,VM]=DE(su,{onClose(){}}),HM=w.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:s,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:h,...y}=e,m=Sh(su,n),[x,g]=w.useState(null),v=Xe(t,L=>g(L)),b=w.useRef(null),k=w.useRef(null),S=o||m.duration,E=w.useRef(0),P=w.useRef(S),O=w.useRef(0),{onToastAdd:R,onToastRemove:$}=m,j=mr(()=>{var T;(x==null?void 0:x.contains(document.activeElement))&&((T=m.viewport)==null||T.focus()),i()}),I=w.useCallback(L=>{!L||L===1/0||(window.clearTimeout(O.current),E.current=new Date().getTime(),O.current=window.setTimeout(j,L))},[j]);w.useEffect(()=>{const L=m.viewport;if(L){const T=()=>{I(P.current),u==null||u()},Q=()=>{const X=new Date().getTime()-E.current;P.current=P.current-X,window.clearTimeout(O.current),l==null||l()};return L.addEventListener(Dg,Q),L.addEventListener(Lg,T),()=>{L.removeEventListener(Dg,Q),L.removeEventListener(Lg,T)}}},[m.viewport,S,l,u,I]),w.useEffect(()=>{s&&!m.isClosePausedRef.current&&I(S)},[s,S,m.isClosePausedRef,I]),w.useEffect(()=>(R(),()=>$()),[R,$]);const D=w.useMemo(()=>x?QE(x):null,[x]);return m.viewport?c.jsxs(c.Fragment,{children:[D&&c.jsx(BM,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:D}),c.jsx(qM,{scope:n,onClose:j,children:Li.createPortal(c.jsx(Jv.ItemSlot,{scope:n,children:c.jsx(_M,{asChild:!0,onEscapeKeyDown:be(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||j(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(Ae.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...y,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:be(e.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:be(e.onPointerDown,L=>{L.button===0&&(b.current={x:L.clientX,y:L.clientY})}),onPointerMove:be(e.onPointerMove,L=>{if(!b.current)return;const T=L.clientX-b.current.x,Q=L.clientY-b.current.y,X=!!k.current,M=["left","right"].includes(m.swipeDirection),K=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,N=M?K(0,T):0,z=M?0:K(0,Q),W=L.pointerType==="touch"?10:2,_={x:N,y:z},C={originalEvent:L,delta:_};X?(k.current=_,Wu(zM,f,C,{discrete:!1})):Gb(_,m.swipeDirection,W)?(k.current=_,Wu(LM,d,C,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(T)>W||Math.abs(Q)>W)&&(b.current=null)}),onPointerUp:be(e.onPointerUp,L=>{const T=k.current,Q=L.target;if(Q.hasPointerCapture(L.pointerId)&&Q.releasePointerCapture(L.pointerId),k.current=null,b.current=null,T){const X=L.currentTarget,M={originalEvent:L,delta:T};Gb(T,m.swipeDirection,m.swipeThreshold)?Wu(UM,h,M,{discrete:!0}):Wu(FM,p,M,{discrete:!0}),X.addEventListener("click",K=>K.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),BM=e=>{const{__scopeToast:t,children:n,...r}=e,o=Sh(su,t),[s,i]=w.useState(!1),[a,l]=w.useState(!1);return ZM(()=>i(!0)),w.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:c.jsx(ou,{asChild:!0,children:c.jsx(_h,{...r,children:s&&c.jsxs(c.Fragment,{children:[o.label," ",n]})})})},WM="ToastTitle",VE=w.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(Ae.div,{...r,ref:t})});VE.displayName=WM;var KM="ToastDescription",HE=w.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(Ae.div,{...r,ref:t})});HE.displayName=KM;var BE="ToastAction",WE=w.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?c.jsx(ZE,{altText:n,asChild:!0,children:c.jsx(Yv,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${BE}\`. Expected non-empty \`string\`.`),null)});WE.displayName=BE;var KE="ToastClose",Yv=w.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=VM(KE,n);return c.jsx(ZE,{asChild:!0,children:c.jsx(Ae.button,{type:"button",...r,ref:t,onClick:be(e.onClick,o.onClose)})})});Yv.displayName=KE;var ZE=w.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return c.jsx(Ae.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function QE(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),QM(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!o)if(s){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...QE(r))}}),t}function Wu(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?RE(o,s):o.dispatchEvent(s)}var Gb=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),s=r>o;return t==="left"||t==="right"?s&&r>n:!s&&o>n};function ZM(e=()=>{}){const t=mr(e);on(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function QM(e){return e.nodeType===e.ELEMENT_NODE}function GM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Fp(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var JM=LE,GE=FE,JE=qE,YE=VE,XE=HE,eN=WE,tN=Yv;function nN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=nN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rN(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=nN(e))&&(r&&(r+=" "),r+=t);return r}const Jb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Yb=rN,Ch=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Yb(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],f=s==null?void 0:s[u];if(d===null)return null;const p=Jb(d)||Jb(f);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(y=>{let[m,x]=y;return Array.isArray(x)?x.includes({...s,...a}[m]):{...s,...a}[m]===x})?[...u,f,p]:u},[]);return Yb(e,i,l,n==null?void 0:n.class,n==null?void 0:n.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 YM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oN=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).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 XM={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 e4=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>w.createElement("svg",{ref:l,...XM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:oN("lucide",o),...a},[...i.map(([u,d])=>w.createElement(u,d)),...Array.isArray(s)?s:[s]]));/**
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 Fe=(e,t)=>{const n=w.forwardRef(({className:r,...o},s)=>w.createElement(e4,{ref:s,iconNode:t,className:oN(`lucide-${YM(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
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 t4=Fe("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 sN=Fe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
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 iN=Fe("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"}]]);/**
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 Xv=Fe("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"}]]);/**
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 n4=Fe("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"}]]);/**
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 Up=Fe("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"}]]);/**
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 aN=Fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
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 Eh=Fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
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 lN=Fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
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 cN=Fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
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 r4=Fe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 uN=Fe("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"}]]);/**
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 Fg=Fe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
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 Xb=Fe("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"}]]);/**
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 o4=Fe("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"}]]);/**
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 e0=Fe("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"}]]);/**
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 ek=Fe("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"}]]);/**
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 dN=Fe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
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 Co=Fe("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"}]]);/**
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 s4=Fe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
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 i4=Fe("GitPullRequest",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);/**
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 Ug=Fe("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"}]]);/**
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 Ku=Fe("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"}]]);/**
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 Cf=Fe("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"}]]);/**
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 a4=Fe("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"}]]);/**
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 tk=Fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
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 l4=Fe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
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 ai=Fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
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 c4=Fe("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
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 fN=Fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
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 Ef=Fe("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"}]]);/**
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 u4=Fe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
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=Fe("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"}]]);/**
234
- * @license lucide-react v0.453.0 - ISC
235
- *
236
- * This source code is licensed under the ISC license.
237
- * See the LICENSE file in the root directory of this source tree.
238
- */const cr=Fe("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"}]]);/**
239
- * @license lucide-react v0.453.0 - ISC
240
- *
241
- * This source code is licensed under the ISC license.
242
- * See the LICENSE file in the root directory of this source tree.
243
- */const d4=Fe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
244
- * @license lucide-react v0.453.0 - ISC
245
- *
246
- * This source code is licensed under the ISC license.
247
- * See the LICENSE file in the root directory of this source tree.
248
- */const f4=Fe("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"}]]);/**
249
- * @license lucide-react v0.453.0 - ISC
250
- *
251
- * This source code is licensed under the ISC license.
252
- * See the LICENSE file in the root directory of this source tree.
253
- */const t0=Fe("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"}]]);/**
254
- * @license lucide-react v0.453.0 - ISC
255
- *
256
- * This source code is licensed under the ISC license.
257
- * See the LICENSE file in the root directory of this source tree.
258
- */const Nf=Fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),n0="-",h4=e=>{const t=m4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(n0);return a[0]===""&&a.length!==1&&a.shift(),hN(a,t)||p4(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},hN=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?hN(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(n0);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},nk=/^\[(.+)\]$/,p4=e=>{if(nk.test(e)){const t=nk.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},m4=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return y4(Object.entries(e.classGroups),n).forEach(([s,i])=>{qg(i,r,s,t)}),r},qg=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:rk(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(g4(o)){qg(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{qg(i,rk(t,s),n,r)})})},rk=(e,t)=>{let n=e;return t.split(n0).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},g4=e=>e.isThemeGetter,y4=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,v4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},pN="!",x4=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let u=0,d=0,f;for(let x=0;x<a.length;x++){let g=a[x];if(u===0){if(g===o&&(r||a.slice(x,x+s)===t)){l.push(a.slice(d,x)),d=x+s;continue}if(g==="/"){f=x;continue}}g==="["?u++:g==="]"&&u--}const p=l.length===0?a:a.substring(d),h=p.startsWith(pN),y=h?p.substring(1):p,m=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:i}):i},w4=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},b4=e=>({cache:v4(e.cacheSize),parseClassName:x4(e),...h4(e)}),k4=/\s+/,_4=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(k4);let a="";for(let l=i.length-1;l>=0;l-=1){const u=i[l],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let y=!!h,m=r(y?p.substring(0,h):p);if(!m){if(!y){a=u+(a.length>0?" "+a:a);continue}if(m=r(p),!m){a=u+(a.length>0?" "+a:a);continue}y=!1}const x=w4(d).join(":"),g=f?x+pN:x,v=g+m;if(s.includes(v))continue;s.push(v);const b=o(m,y);for(let k=0;k<b.length;++k){const S=b[k];s.push(g+S)}a=u+(a.length>0?" "+a:a)}return a};function S4(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=mN(t))&&(r&&(r+=" "),r+=n);return r}const mN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=mN(e[r]))&&(n&&(n+=" "),n+=t);return n};function C4(e,...t){let n,r,o,s=i;function i(l){const u=t.reduce((d,f)=>f(d),e());return n=b4(u),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=_4(l,n);return o(l,d),d}return function(){return s(S4.apply(null,arguments))}}const lt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},gN=/^\[(?:([a-z-]+):)?(.+)\]$/i,E4=/^\d+\/\d+$/,N4=new Set(["px","full","screen"]),j4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,P4=/\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$/,T4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,$4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,uo=e=>Sa(e)||N4.has(e)||E4.test(e),Ho=e=>hl(e,"length",F4),Sa=e=>!!e&&!Number.isNaN(Number(e)),qp=e=>hl(e,"number",Sa),Rl=e=>!!e&&Number.isInteger(Number(e)),I4=e=>e.endsWith("%")&&Sa(e.slice(0,-1)),Oe=e=>gN.test(e),Bo=e=>j4.test(e),A4=new Set(["length","size","percentage"]),O4=e=>hl(e,A4,yN),M4=e=>hl(e,"position",yN),D4=new Set(["image","url"]),L4=e=>hl(e,D4,q4),z4=e=>hl(e,"",U4),Il=()=>!0,hl=(e,t,n)=>{const r=gN.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},F4=e=>P4.test(e)&&!T4.test(e),yN=()=>!1,U4=e=>$4.test(e),q4=e=>R4.test(e),V4=()=>{const e=lt("colors"),t=lt("spacing"),n=lt("blur"),r=lt("brightness"),o=lt("borderColor"),s=lt("borderRadius"),i=lt("borderSpacing"),a=lt("borderWidth"),l=lt("contrast"),u=lt("grayscale"),d=lt("hueRotate"),f=lt("invert"),p=lt("gap"),h=lt("gradientColorStops"),y=lt("gradientColorStopPositions"),m=lt("inset"),x=lt("margin"),g=lt("opacity"),v=lt("padding"),b=lt("saturate"),k=lt("scale"),S=lt("sepia"),E=lt("skew"),P=lt("space"),O=lt("translate"),R=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",Oe,t],I=()=>[Oe,t],D=()=>["",uo,Ho],L=()=>["auto",Sa,Oe],T=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",Oe],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Sa,Oe];return{cacheSize:500,separator:":",theme:{colors:[Il],spacing:[uo,Ho],blur:["none","",Bo,Oe],brightness:z(),borderColor:[e],borderRadius:["none","","full",Bo,Oe],borderSpacing:I(),borderWidth:D(),contrast:z(),grayscale:K(),hueRotate:z(),invert:K(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[I4,Ho],inset:j(),margin:j(),opacity:z(),padding:I(),saturate:z(),scale:z(),sepia:K(),skew:z(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Oe]}],container:["container"],columns:[{columns:[Bo]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:[...T(),Oe]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Rl,Oe]}],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",Oe]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",Rl,Oe]}],"grid-cols":[{"grid-cols":[Il]}],"col-start-end":[{col:["auto",{span:["full",Rl,Oe]},Oe]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Il]}],"row-start-end":[{row:["auto",{span:[Rl,Oe]},Oe]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Oe]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Oe,t]}],"min-w":[{"min-w":[Oe,t,"min","max","fit"]}],"max-w":[{"max-w":[Oe,t,"none","full","min","max","fit","prose",{screen:[Bo]},Bo]}],h:[{h:[Oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Bo,Ho]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qp]}],"font-family":[{font:[Il]}],"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",Oe]}],"line-clamp":[{"line-clamp":["none",Sa,qp]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",uo,Oe]}],"list-image":[{"list-image":["none",Oe]}],"list-style-type":[{list:["none","disc","decimal",Oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",uo,Ho]}],"underline-offset":[{"underline-offset":["auto",uo,Oe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe]}],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",Oe]}],"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:[...T(),M4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",O4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},L4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Q(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Q()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Q()]}],"outline-offset":[{"outline-offset":[uo,Oe]}],"outline-w":[{outline:[uo,Ho]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[uo,Ho]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Bo,z4]}],"shadow-color":[{shadow:[Il]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Bo,Oe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Oe]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",Oe]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Rl,Oe]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Oe]}],accent:[{accent:["auto",e]}],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",Oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[uo,Ho,qp]}],stroke:[{stroke:[e,"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"]}}},H4=C4(V4);function $e(...e){return H4(rN(e))}const B4=JM,vN=w.forwardRef(({className:e,...t},n)=>c.jsx(GE,{ref:n,className:$e("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]",e),...t}));vN.displayName=GE.displayName;const W4=Ch("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"}}),xN=w.forwardRef(({className:e,variant:t,...n},r)=>c.jsx(JE,{ref:r,className:$e(W4({variant:t}),e),...n}));xN.displayName=JE.displayName;const K4=w.forwardRef(({className:e,...t},n)=>c.jsx(eN,{ref:n,className:$e("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",e),...t}));K4.displayName=eN.displayName;const wN=w.forwardRef(({className:e,...t},n)=>c.jsx(tN,{ref:n,className:$e("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",e),"toast-close":"",...t,children:c.jsx(Nf,{className:"h-4 w-4"})}));wN.displayName=tN.displayName;const bN=w.forwardRef(({className:e,...t},n)=>c.jsx(YE,{ref:n,className:$e("text-sm font-semibold",e),...t}));bN.displayName=YE.displayName;const kN=w.forwardRef(({className:e,...t},n)=>c.jsx(XE,{ref:n,className:$e("text-sm opacity-90",e),...t}));kN.displayName=XE.displayName;function Z4(){const{toasts:e}=qt();return c.jsxs(B4,{children:[e.map(function({id:t,title:n,description:r,action:o,...s}){return c.jsxs(xN,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(bN,{children:n}),r&&c.jsx(kN,{children:r})]}),o,c.jsx(wN,{})]},t)}),c.jsx(vN,{})]})}var Q4=Yc[" useId ".trim().toString()]||(()=>{}),G4=0;function No(e){const[t,n]=w.useState(Q4());return on(()=>{n(r=>r??String(G4++))},[e]),t?`radix-${t}`:""}const J4=["top","right","bottom","left"],Ps=Math.min,Bn=Math.max,jf=Math.round,Zu=Math.floor,ro=e=>({x:e,y:e}),Y4={left:"right",right:"left",bottom:"top",top:"bottom"},X4={start:"end",end:"start"};function Vg(e,t,n){return Bn(e,Ps(t,n))}function Io(e,t){return typeof e=="function"?e(t):e}function Ao(e){return e.split("-")[0]}function pl(e){return e.split("-")[1]}function r0(e){return e==="x"?"y":"x"}function o0(e){return e==="y"?"height":"width"}const eD=new Set(["top","bottom"]);function Xr(e){return eD.has(Ao(e))?"y":"x"}function s0(e){return r0(Xr(e))}function tD(e,t,n){n===void 0&&(n=!1);const r=pl(e),o=s0(e),s=o0(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Pf(i)),[i,Pf(i)]}function nD(e){const t=Pf(e);return[Hg(e),t,Hg(t)]}function Hg(e){return e.replace(/start|end/g,t=>X4[t])}const ok=["left","right"],sk=["right","left"],rD=["top","bottom"],oD=["bottom","top"];function sD(e,t,n){switch(e){case"top":case"bottom":return n?t?sk:ok:t?ok:sk;case"left":case"right":return t?rD:oD;default:return[]}}function iD(e,t,n,r){const o=pl(e);let s=sD(Ao(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Hg)))),s}function Pf(e){return e.replace(/left|right|bottom|top/g,t=>Y4[t])}function aD(e){return{top:0,right:0,bottom:0,left:0,...e}}function _N(e){return typeof e!="number"?aD(e):{top:e,right:e,bottom:e,left:e}}function Tf(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ik(e,t,n){let{reference:r,floating:o}=e;const s=Xr(t),i=s0(t),a=o0(i),l=Ao(t),u=s==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:d,y:r.y-o.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(pl(t)){case"start":h[i]-=p*(n&&u?-1:1);break;case"end":h[i]+=p*(n&&u?-1:1);break}return h}const lD=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=ik(u,r,l),p=r,h={},y=0;for(let m=0;m<a.length;m++){const{name:x,fn:g}=a[m],{x:v,y:b,data:k,reset:S}=await g({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:u,platform:i,elements:{reference:e,floating:t}});d=v??d,f=b??f,h={...h,[x]:{...h[x],...k}},S&&y<=50&&(y++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(u=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:d,y:f}=ik(u,p,l)),m=-1)}return{x:d,y:f,placement:p,strategy:o,middlewareData:h}};async function Lc(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Io(t,e),y=_N(h),x=a[p?f==="floating"?"reference":"floating":f],g=Tf(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:d,strategy:l})),v=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),k=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},S=Tf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-S.top+y.top)/k.y,bottom:(S.bottom-g.bottom+y.bottom)/k.y,left:(g.left-S.left+y.left)/k.x,right:(S.right-g.right+y.right)/k.x}}const cD=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=Io(e,t)||{};if(u==null)return{};const f=_N(d),p={x:n,y:r},h=s0(o),y=o0(h),m=await i.getDimensions(u),x=h==="y",g=x?"top":"left",v=x?"bottom":"right",b=x?"clientHeight":"clientWidth",k=s.reference[y]+s.reference[h]-p[h]-s.floating[y],S=p[h]-s.reference[h],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let P=E?E[b]:0;(!P||!await(i.isElement==null?void 0:i.isElement(E)))&&(P=a.floating[b]||s.floating[y]);const O=k/2-S/2,R=P/2-m[y]/2-1,$=Ps(f[g],R),j=Ps(f[v],R),I=$,D=P-m[y]-j,L=P/2-m[y]/2+O,T=Vg(I,L,D),Q=!l.arrow&&pl(o)!=null&&L!==T&&s.reference[y]/2-(L<I?$:j)-m[y]/2<0,X=Q?L<I?L-I:L-D:0;return{[h]:p[h]+X,data:{[h]:T,centerOffset:L-T-X,...Q&&{alignmentOffset:X}},reset:Q}}}),uD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...x}=Io(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=Ao(o),v=Xr(a),b=Ao(a)===a,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),S=p||(b||!m?[Pf(a)]:nD(a)),E=y!=="none";!p&&E&&S.push(...iD(a,m,y,k));const P=[a,...S],O=await Lc(t,x),R=[];let $=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&R.push(O[g]),f){const L=tD(o,i,k);R.push(O[L[0]],O[L[1]])}if($=[...$,{placement:o,overflows:R}],!R.every(L=>L<=0)){var j,I;const L=(((j=s.flip)==null?void 0:j.index)||0)+1,T=P[L];if(T&&(!(f==="alignment"?v!==Xr(T):!1)||$.every(M=>Xr(M.placement)===v?M.overflows[0]>0:!0)))return{data:{index:L,overflows:$},reset:{placement:T}};let Q=(I=$.filter(X=>X.overflows[0]<=0).sort((X,M)=>X.overflows[1]-M.overflows[1])[0])==null?void 0:I.placement;if(!Q)switch(h){case"bestFit":{var D;const X=(D=$.filter(M=>{if(E){const K=Xr(M.placement);return K===v||K==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(K=>K>0).reduce((K,N)=>K+N,0)]).sort((M,K)=>M[1]-K[1])[0])==null?void 0:D[0];X&&(Q=X);break}case"initialPlacement":Q=a;break}if(o!==Q)return{reset:{placement:Q}}}return{}}}};function ak(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lk(e){return J4.some(t=>e[t]>=0)}const dD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Io(e,t);switch(r){case"referenceHidden":{const s=await Lc(t,{...o,elementContext:"reference"}),i=ak(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:lk(i)}}}case"escaped":{const s=await Lc(t,{...o,altBoundary:!0}),i=ak(s,n.floating);return{data:{escapedOffsets:i,escaped:lk(i)}}}default:return{}}}}},SN=new Set(["left","top"]);async function fD(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ao(n),a=pl(n),l=Xr(n)==="y",u=SN.has(i)?-1:1,d=s&&l?-1:1,f=Io(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),l?{x:h*d,y:p*u}:{x:p*u,y:h*d}}const hD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await fD(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},pD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:x=>{let{x:g,y:v}=x;return{x:g,y:v}}},...l}=Io(e,t),u={x:n,y:r},d=await Lc(t,l),f=Xr(Ao(o)),p=r0(f);let h=u[p],y=u[f];if(s){const x=p==="y"?"top":"left",g=p==="y"?"bottom":"right",v=h+d[x],b=h-d[g];h=Vg(v,h,b)}if(i){const x=f==="y"?"top":"left",g=f==="y"?"bottom":"right",v=y+d[x],b=y-d[g];y=Vg(v,y,b)}const m=a.fn({...t,[p]:h,[f]:y});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:s,[f]:i}}}}}},mD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Io(e,t),d={x:n,y:r},f=Xr(o),p=r0(f);let h=d[p],y=d[f];const m=Io(a,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const b=p==="y"?"height":"width",k=s.reference[p]-s.floating[b]+x.mainAxis,S=s.reference[p]+s.reference[b]-x.mainAxis;h<k?h=k:h>S&&(h=S)}if(u){var g,v;const b=p==="y"?"width":"height",k=SN.has(Ao(o)),S=s.reference[f]-s.floating[b]+(k&&((g=i.offset)==null?void 0:g[f])||0)+(k?0:x.crossAxis),E=s.reference[f]+s.reference[b]+(k?0:((v=i.offset)==null?void 0:v[f])||0)-(k?x.crossAxis:0);y<S?y=S:y>E&&(y=E)}return{[p]:h,[f]:y}}}},gD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...u}=Io(e,t),d=await Lc(t,u),f=Ao(o),p=pl(o),h=Xr(o)==="y",{width:y,height:m}=s.floating;let x,g;f==="top"||f==="bottom"?(x=f,g=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,x=p==="end"?"top":"bottom");const v=m-d.top-d.bottom,b=y-d.left-d.right,k=Ps(m-d[x],v),S=Ps(y-d[g],b),E=!t.middlewareData.shift;let P=k,O=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=v),E&&!p){const $=Bn(d.left,0),j=Bn(d.right,0),I=Bn(d.top,0),D=Bn(d.bottom,0);h?O=y-2*($!==0||j!==0?$+j:Bn(d.left,d.right)):P=m-2*(I!==0||D!==0?I+D:Bn(d.top,d.bottom))}await l({...t,availableWidth:O,availableHeight:P});const R=await i.getDimensions(a.floating);return y!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Nh(){return typeof window<"u"}function ml(e){return CN(e)?(e.nodeName||"").toLowerCase():"#document"}function Qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function so(e){var t;return(t=(CN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function CN(e){return Nh()?e instanceof Node||e instanceof Qn(e).Node:!1}function Mr(e){return Nh()?e instanceof Element||e instanceof Qn(e).Element:!1}function oo(e){return Nh()?e instanceof HTMLElement||e instanceof Qn(e).HTMLElement:!1}function ck(e){return!Nh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qn(e).ShadowRoot}const yD=new Set(["inline","contents"]);function au(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Dr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!yD.has(o)}const vD=new Set(["table","td","th"]);function xD(e){return vD.has(ml(e))}const wD=[":popover-open",":modal"];function jh(e){return wD.some(t=>{try{return e.matches(t)}catch{return!1}})}const bD=["transform","translate","scale","rotate","perspective"],kD=["transform","translate","scale","rotate","perspective","filter"],_D=["paint","layout","strict","content"];function i0(e){const t=a0(),n=Mr(e)?Dr(e):e;return bD.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||kD.some(r=>(n.willChange||"").includes(r))||_D.some(r=>(n.contain||"").includes(r))}function SD(e){let t=Ts(e);for(;oo(t)&&!Xa(t);){if(i0(t))return t;if(jh(t))return null;t=Ts(t)}return null}function a0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const CD=new Set(["html","body","#document"]);function Xa(e){return CD.has(ml(e))}function Dr(e){return Qn(e).getComputedStyle(e)}function Ph(e){return Mr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ts(e){if(ml(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ck(e)&&e.host||so(e);return ck(t)?t.host:t}function EN(e){const t=Ts(e);return Xa(t)?e.ownerDocument?e.ownerDocument.body:e.body:oo(t)&&au(t)?t:EN(t)}function zc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=EN(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Qn(o);if(s){const a=Bg(i);return t.concat(i,i.visualViewport||[],au(o)?o:[],a&&n?zc(a):[])}return t.concat(o,zc(o,[],n))}function Bg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function NN(e){const t=Dr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=oo(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=jf(n)!==s||jf(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function l0(e){return Mr(e)?e:e.contextElement}function Ca(e){const t=l0(e);if(!oo(t))return ro(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=NN(t);let i=(s?jf(n.width):n.width)/r,a=(s?jf(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const ED=ro(0);function jN(e){const t=Qn(e);return!a0()||!t.visualViewport?ED:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ND(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qn(e)?!1:t}function Pi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=l0(e);let i=ro(1);t&&(r?Mr(r)&&(i=Ca(r)):i=Ca(e));const a=ND(s,n,r)?jN(s):ro(0);let l=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,d=o.width/i.x,f=o.height/i.y;if(s){const p=Qn(s),h=r&&Mr(r)?Qn(r):r;let y=p,m=Bg(y);for(;m&&r&&h!==y;){const x=Ca(m),g=m.getBoundingClientRect(),v=Dr(m),b=g.left+(m.clientLeft+parseFloat(v.paddingLeft))*x.x,k=g.top+(m.clientTop+parseFloat(v.paddingTop))*x.y;l*=x.x,u*=x.y,d*=x.x,f*=x.y,l+=b,u+=k,y=Qn(m),m=Bg(y)}}return Tf({width:d,height:f,x:l,y:u})}function Th(e,t){const n=Ph(e).scrollLeft;return t?t.left+n:Pi(so(e)).left+n}function PN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Th(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function jD(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=so(r),a=t?jh(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=ro(1);const d=ro(0),f=oo(r);if((f||!f&&!s)&&((ml(r)!=="body"||au(i))&&(l=Ph(r)),oo(r))){const h=Pi(r);u=Ca(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=i&&!f&&!s?PN(i,l):ro(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function PD(e){return Array.from(e.getClientRects())}function TD(e){const t=so(e),n=Ph(e),r=e.ownerDocument.body,o=Bn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Bn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Th(e);const a=-n.scrollTop;return Dr(r).direction==="rtl"&&(i+=Bn(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const uk=25;function $D(e,t){const n=Qn(e),r=so(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const d=a0();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=Th(r);if(u<=0){const d=r.ownerDocument,f=d.body,p=getComputedStyle(f),h=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,y=Math.abs(r.clientWidth-f.clientWidth-h);y<=uk&&(s-=y)}else u<=uk&&(s+=u);return{width:s,height:i,x:a,y:l}}const RD=new Set(["absolute","fixed"]);function ID(e,t){const n=Pi(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=oo(e)?Ca(e):ro(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:i,height:a,x:l,y:u}}function dk(e,t,n){let r;if(t==="viewport")r=$D(e,n);else if(t==="document")r=TD(so(e));else if(Mr(t))r=ID(t,n);else{const o=jN(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Tf(r)}function TN(e,t){const n=Ts(e);return n===t||!Mr(n)||Xa(n)?!1:Dr(n).position==="fixed"||TN(n,t)}function AD(e,t){const n=t.get(e);if(n)return n;let r=zc(e,[],!1).filter(a=>Mr(a)&&ml(a)!=="body"),o=null;const s=Dr(e).position==="fixed";let i=s?Ts(e):e;for(;Mr(i)&&!Xa(i);){const a=Dr(i),l=i0(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&RD.has(o.position)||au(i)&&!l&&TN(e,i))?r=r.filter(d=>d!==i):o=a,i=Ts(i)}return t.set(e,r),r}function OD(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?jh(t)?[]:AD(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((u,d)=>{const f=dk(t,d,o);return u.top=Bn(f.top,u.top),u.right=Ps(f.right,u.right),u.bottom=Ps(f.bottom,u.bottom),u.left=Bn(f.left,u.left),u},dk(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function MD(e){const{width:t,height:n}=NN(e);return{width:t,height:n}}function DD(e,t,n){const r=oo(t),o=so(t),s=n==="fixed",i=Pi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=ro(0);function u(){l.x=Th(o)}if(r||!r&&!s)if((ml(t)!=="body"||au(o))&&(a=Ph(t)),r){const h=Pi(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&u();s&&!r&&o&&u();const d=o&&!r&&!s?PN(o,a):ro(0),f=i.left+a.scrollLeft-l.x-d.x,p=i.top+a.scrollTop-l.y-d.y;return{x:f,y:p,width:i.width,height:i.height}}function Vp(e){return Dr(e).position==="static"}function fk(e,t){if(!oo(e)||Dr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return so(e)===n&&(n=n.ownerDocument.body),n}function $N(e,t){const n=Qn(e);if(jh(e))return n;if(!oo(e)){let o=Ts(e);for(;o&&!Xa(o);){if(Mr(o)&&!Vp(o))return o;o=Ts(o)}return n}let r=fk(e,t);for(;r&&xD(r)&&Vp(r);)r=fk(r,t);return r&&Xa(r)&&Vp(r)&&!i0(r)?n:r||SD(e)||n}const LD=async function(e){const t=this.getOffsetParent||$N,n=this.getDimensions,r=await n(e.floating);return{reference:DD(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zD(e){return Dr(e).direction==="rtl"}const FD={convertOffsetParentRelativeRectToViewportRelativeRect:jD,getDocumentElement:so,getClippingRect:OD,getOffsetParent:$N,getElementRects:LD,getClientRects:PD,getDimensions:MD,getScale:Ca,isElement:Mr,isRTL:zD};function RN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UD(e,t){let n=null,r;const o=so(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=u;if(a||t(),!p||!h)return;const y=Zu(f),m=Zu(o.clientWidth-(d+p)),x=Zu(o.clientHeight-(f+h)),g=Zu(d),b={rootMargin:-y+"px "+-m+"px "+-x+"px "+-g+"px",threshold:Bn(0,Ps(1,l))||1};let k=!0;function S(E){const P=E[0].intersectionRatio;if(P!==l){if(!k)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!RN(u,e.getBoundingClientRect())&&i(),k=!1}try{n=new IntersectionObserver(S,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(e)}return i(!0),s}function qD(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=l0(e),d=o||s?[...u?zc(u):[],...zc(t)]:[];d.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const f=u&&a?UD(u,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let y,m=l?Pi(e):null;l&&x();function x(){const g=Pi(e);m&&!RN(m,g)&&n(),m=g,y=requestAnimationFrame(x)}return n(),()=>{var g;d.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(y)}}const VD=hD,HD=pD,BD=uD,WD=gD,KD=dD,hk=cD,ZD=mD,QD=(e,t,n)=>{const r=new Map,o={platform:FD,...n},s={...o.platform,_c:r};return lD(e,t,{...o,platform:s})};var GD=typeof document<"u",JD=function(){},Ad=GD?w.useLayoutEffect:JD;function $f(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!$f(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!$f(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function IN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pk(e,t){const n=IN(e);return Math.round(t*n)/n}function Hp(e){const t=w.useRef(e);return Ad(()=>{t.current=e}),t}function YD(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,f]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=w.useState(r);$f(p,r)||h(r);const[y,m]=w.useState(null),[x,g]=w.useState(null),v=w.useCallback(M=>{M!==E.current&&(E.current=M,m(M))},[]),b=w.useCallback(M=>{M!==P.current&&(P.current=M,g(M))},[]),k=s||y,S=i||x,E=w.useRef(null),P=w.useRef(null),O=w.useRef(d),R=l!=null,$=Hp(l),j=Hp(o),I=Hp(u),D=w.useCallback(()=>{if(!E.current||!P.current)return;const M={placement:t,strategy:n,middleware:p};j.current&&(M.platform=j.current),QD(E.current,P.current,M).then(K=>{const N={...K,isPositioned:I.current!==!1};L.current&&!$f(O.current,N)&&(O.current=N,Li.flushSync(()=>{f(N)}))})},[p,t,n,j,I]);Ad(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[u]);const L=w.useRef(!1);Ad(()=>(L.current=!0,()=>{L.current=!1}),[]),Ad(()=>{if(k&&(E.current=k),S&&(P.current=S),k&&S){if($.current)return $.current(k,S,D);D()}},[k,S,D,$,R]);const T=w.useMemo(()=>({reference:E,floating:P,setReference:v,setFloating:b}),[v,b]),Q=w.useMemo(()=>({reference:k,floating:S}),[k,S]),X=w.useMemo(()=>{const M={position:n,left:0,top:0};if(!Q.floating)return M;const K=pk(Q.floating,d.x),N=pk(Q.floating,d.y);return a?{...M,transform:"translate("+K+"px, "+N+"px)",...IN(Q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:N}},[n,a,Q.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:D,refs:T,elements:Q,floatingStyles:X}),[d,D,T,Q,X])}const XD=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?hk({element:r.current,padding:o}).fn(n):{}:r?hk({element:r,padding:o}).fn(n):{}}}},eL=(e,t)=>({...VD(e),options:[e,t]}),tL=(e,t)=>({...HD(e),options:[e,t]}),nL=(e,t)=>({...ZD(e),options:[e,t]}),rL=(e,t)=>({...BD(e),options:[e,t]}),oL=(e,t)=>({...WD(e),options:[e,t]}),sL=(e,t)=>({...KD(e),options:[e,t]}),iL=(e,t)=>({...XD(e),options:[e,t]});var aL="Arrow",AN=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return c.jsx(Ae.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});AN.displayName=aL;var lL=AN;function cL(e){const[t,n]=w.useState(void 0);return on(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var c0="Popper",[ON,gl]=Do(c0),[uL,MN]=ON(c0),DN=e=>{const{__scopePopper:t,children:n}=e,[r,o]=w.useState(null);return c.jsx(uL,{scope:t,anchor:r,onAnchorChange:o,children:n})};DN.displayName=c0;var LN="PopperAnchor",zN=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=MN(LN,n),i=w.useRef(null),a=Xe(t,i),l=w.useRef(null);return w.useEffect(()=>{const u=l.current;l.current=(r==null?void 0:r.current)||i.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:c.jsx(Ae.div,{...o,ref:a})});zN.displayName=LN;var u0="PopperContent",[dL,fL]=ON(u0),FN=w.forwardRef((e,t)=>{var Z,Y,ae,de,U,H;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:y,...m}=e,x=MN(u0,n),[g,v]=w.useState(null),b=Xe(t,J=>v(J)),[k,S]=w.useState(null),E=cL(k),P=(E==null?void 0:E.width)??0,O=(E==null?void 0:E.height)??0,R=r+(s!=="center"?"-"+s:""),$=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(u)?u:[u],I=j.length>0,D={padding:$,boundary:j.filter(pL),altBoundary:I},{refs:L,floatingStyles:T,placement:Q,isPositioned:X,middlewareData:M}=YD({strategy:"fixed",placement:R,whileElementsMounted:(...J)=>qD(...J,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[eL({mainAxis:o+O,alignmentAxis:i}),l&&tL({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?nL():void 0,...D}),l&&rL({...D}),oL({...D,apply:({elements:J,rects:te,availableWidth:B,availableHeight:ne})=>{const{width:re,height:Te}=te.reference,ce=J.floating.style;ce.setProperty("--radix-popper-available-width",`${B}px`),ce.setProperty("--radix-popper-available-height",`${ne}px`),ce.setProperty("--radix-popper-anchor-width",`${re}px`),ce.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),k&&iL({element:k,padding:a}),mL({arrowWidth:P,arrowHeight:O}),p&&sL({strategy:"referenceHidden",...D})]}),[K,N]=VN(Q),z=mr(y);on(()=>{X&&(z==null||z())},[X,z]);const W=(Z=M.arrow)==null?void 0:Z.x,_=(Y=M.arrow)==null?void 0:Y.y,C=((ae=M.arrow)==null?void 0:ae.centerOffset)!==0,[A,F]=w.useState();return on(()=>{g&&F(window.getComputedStyle(g).zIndex)},[g]),c.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:X?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:A,"--radix-popper-transform-origin":[(de=M.transformOrigin)==null?void 0:de.x,(U=M.transformOrigin)==null?void 0:U.y].join(" "),...((H=M.hide)==null?void 0:H.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(dL,{scope:n,placedSide:K,onArrowChange:S,arrowX:W,arrowY:_,shouldHideArrow:C,children:c.jsx(Ae.div,{"data-side":K,"data-align":N,...m,ref:b,style:{...m.style,animation:X?void 0:"none"}})})})});FN.displayName=u0;var UN="PopperArrow",hL={top:"bottom",right:"left",bottom:"top",left:"right"},qN=w.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=fL(UN,r),i=hL[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(lL,{...o,ref:n,style:{...o.style,display:"block"}})})});qN.displayName=UN;function pL(e){return e!==null}var mL=e=>({name:"transformOrigin",options:e,fn(t){var x,g,v;const{placement:n,rects:r,middlewareData:o}=t,i=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[u,d]=VN(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((g=o.arrow)==null?void 0:g.x)??0)+a/2,h=(((v=o.arrow)==null?void 0:v.y)??0)+l/2;let y="",m="";return u==="bottom"?(y=i?f:`${p}px`,m=`${-l}px`):u==="top"?(y=i?f:`${p}px`,m=`${r.floating.height+l}px`):u==="right"?(y=`${-l}px`,m=i?f:`${h}px`):u==="left"&&(y=`${r.floating.width+l}px`,m=i?f:`${h}px`),{data:{x:y,y:m}}}});function VN(e){const[t,n="center"]=e.split("-");return[t,n]}var HN=DN,$h=zN,d0=FN,f0=qN,[Rh,nte]=Do("Tooltip",[gl]),h0=gl(),BN="TooltipProvider",gL=700,mk="tooltip.open",[yL,WN]=Rh(BN),KN=e=>{const{__scopeTooltip:t,delayDuration:n=gL,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=w.useRef(!0),a=w.useRef(!1),l=w.useRef(0);return w.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),c.jsx(yL,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:w.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})};KN.displayName=BN;var ZN="Tooltip",[rte,Ih]=Rh(ZN),Wg="TooltipTrigger",vL=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ih(Wg,n),s=WN(Wg,n),i=h0(n),a=w.useRef(null),l=Xe(t,a,o.onTriggerChange),u=w.useRef(!1),d=w.useRef(!1),f=w.useCallback(()=>u.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx($h,{asChild:!0,...i,children:c.jsx(Ae.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:be(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:be(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:be(e.onPointerDown,()=>{o.open&&o.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:be(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:be(e.onBlur,o.onClose),onClick:be(e.onClick,o.onClose)})})});vL.displayName=Wg;var xL="TooltipPortal",[ote,wL]=Rh(xL,{forceMount:void 0}),el="TooltipContent",QN=w.forwardRef((e,t)=>{const n=wL(el,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,i=Ih(el,e.__scopeTooltip);return c.jsx(Lo,{present:r||i.open,children:i.disableHoverableContent?c.jsx(GN,{side:o,...s,ref:t}):c.jsx(bL,{side:o,...s,ref:t})})}),bL=w.forwardRef((e,t)=>{const n=Ih(el,e.__scopeTooltip),r=WN(el,e.__scopeTooltip),o=w.useRef(null),s=Xe(t,o),[i,a]=w.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=w.useCallback(()=>{a(null),f(!1)},[f]),h=w.useCallback((y,m)=>{const x=y.currentTarget,g={x:y.clientX,y:y.clientY},v=EL(g,x.getBoundingClientRect()),b=NL(g,v),k=jL(m.getBoundingClientRect()),S=TL([...b,...k]);a(S),f(!0)},[f]);return w.useEffect(()=>()=>p(),[p]),w.useEffect(()=>{if(l&&d){const y=x=>h(x,d),m=x=>h(x,l);return l.addEventListener("pointerleave",y),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",m)}}},[l,d,h,p]),w.useEffect(()=>{if(i){const y=m=>{const x=m.target,g={x:m.clientX,y:m.clientY},v=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),b=!PL(g,i);v?p():b&&(p(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,d,i,u,p]),c.jsx(GN,{...e,ref:s})}),[kL,_L]=Rh(ZN,{isInside:!1}),SL=dM("TooltipContent"),GN=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:i,...a}=e,l=Ih(el,n),u=h0(n),{onClose:d}=l;return w.useEffect(()=>(document.addEventListener(mk,d),()=>document.removeEventListener(mk,d)),[d]),w.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),c.jsx(fl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:c.jsxs(d0,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.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:[c.jsx(SL,{children:r}),c.jsx(kL,{scope:n,isInside:!0,children:c.jsx(IM,{id:l.contentId,role:"tooltip",children:o||r})})]})})});QN.displayName=el;var JN="TooltipArrow",CL=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=h0(n);return _L(JN,n).isInside?null:c.jsx(f0,{...o,...r,ref:t})});CL.displayName=JN;function EL(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function NL(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function jL(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function PL(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],u=a.x,d=a.y,f=l.x,p=l.y;d>r!=p>r&&n<(f-u)*(r-d)/(p-d)+u&&(o=!o)}return o}function TL(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),$L(t)}function $L(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var RL=KN,YN=QN;const IL=RL,AL=w.forwardRef(({className:e,sideOffset:t=4,...n},r)=>c.jsx(YN,{ref:r,sideOffset:t,className:$e("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]",e),...n}));AL.displayName=YN.displayName;const OL={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 ML(e){return e?{total:e.total,byKind:e.byKind,serviceWarnings:new Map(Object.entries(e.services)),credentialWarnings:new Map(Object.entries(e.credentials)),playbookWarnings:new Map(Object.entries(e.playbooks))}:OL}const bn="#92E4DD",Rn="#F9386D",Cr="#FFFFFF",Gr="bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900";function Vr(e){return bn}function Jr(e){return{borderColor:e,color:e,boxShadow:`0 0 20px ${e}20`}}const DL=Ch("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:{gold:"bg-[#C4B643] text-[#0A0A07] hover:bg-[#D4C760] border border-[#C4B643] font-medium",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"}}),le=w.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?cM:"button";return c.jsx(i,{className:$e(DL({variant:t,size:n,className:e})),ref:s,...o})});le.displayName="Button";function Ea({warnings:e}){if(!(e!=null&&e.length))return null;const t=e.find(r=>r.severity==="error")??e[0],n=t.severity==="error";return c.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 ${n?"bg-red-500/90 text-white border border-red-300/60":"bg-amber-500/90 text-black border border-amber-200/60"}`,title:e.map(r=>r.message).join(" · "),"data-testid":"card-warning-badge",children:[c.jsx(cr,{className:"h-2.5 w-2.5 shrink-0"}),c.jsx("span",{className:"max-w-[72px] truncate",children:t.message})]})}const gk="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 LL(e){return e.iconUrl?e.iconUrl:null}function XN({service:e}){const t=Vr(),n=LL(e),[r,o]=w.useState(!1);return n&&!r?c.jsx("img",{src:n,alt:"",className:"w-7 h-7 object-contain rounded-sm",draggable:!1,onError:()=>o(!0)}):c.jsx("div",{style:{width:28,height:28,backgroundColor:t,WebkitMask:`url(${gk}) no-repeat center / contain`,mask:`url(${gk}) no-repeat center / contain`},"aria-hidden":!0})}function p0(e){return e?"ring-2 ring-inset ring-yellow-400/90 shadow-[0_0_10px_rgba(250,204,21,0.2)]":""}function m0(){return c.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 zL({service:e,onDragStart:t,onDragEnd:n,isInActiveDeck:r,onCardClick:o,isInCollection:s=!1,onMouseEnter:i,onMouseLeave:a,activeDeck:l,warnings:u}){const d=Kt(),{toast:f}=qt(),p=Vr(),h=dt({mutationFn:async()=>{if(!l)throw new Error("No active deck found");return Ce("POST",`/api/decks/${l.id}/services`,{serviceId:e.id,position:0})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Service added to deck",description:`${e.name} has been added to your active deck.`})},onError:g=>{f({title:"Failed to add service",description:g.message,variant:"destructive"})}}),y=dt({mutationFn:async()=>Ce("DELETE",`/api/services/${e.id}`,{}),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/services"]}),d.invalidateQueries({queryKey:["/api/collection/warnings"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Service deleted",description:`${e.name} has been deleted successfully.`})},onError:g=>{f({title:"Failed to delete service",description:g.message,variant:"destructive"})}}),m=g=>{g.stopPropagation(),h.mutate()},x=g=>{g.stopPropagation(),window.confirm(`Are you sure you want to delete ${e.name}? This action cannot be undone.`)&&y.mutate()};return c.jsx("div",{className:"relative group cursor-pointer",draggable:!r,onDragStart:g=>t(g,e),onDragEnd:n,onClick:()=>o==null?void 0:o(e),"data-testid":`card-${e.id}`,onMouseEnter:i,onMouseLeave:a,children:c.jsxs("div",{className:`
259
- w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
260
- transform transition-all duration-300 shadow-lg hover:shadow-2xl
261
- bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
262
- relative overflow-hidden
263
- ${p0(r)}
264
- ${s?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
265
- `,style:{borderColor:p,boxShadow:`0 0 20px ${p}20`},children:[c.jsx(Ea,{warnings:u}),r&&c.jsx(m0,{}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:p},children:e.type==="mcp"?"RM":e.type==="local-mcp"?"LM":"A"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:p},children:e.type==="mcp"?"RM":e.type==="local-mcp"?"LM":"A"})}),c.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:c.jsx(le,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:x,title:`Delete ${e.name}`,children:c.jsx(iu,{className:"w-3 h-3"})})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:p},children:c.jsx(XN,{service:e})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2","data-testid":`text-service-name-${e.id}`,style:{color:p},children:e.name}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:p,borderColor:p},children:e.type==="mcp"?"Remote MCP":e.type==="local-mcp"?"Local MCP":"A2A"})]}),c.jsx("div",{className:"absolute bottom-6 inset-x-1",children:c.jsx(le,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:p,borderColor:p},onClick:m,disabled:r||h.isPending,"data-testid":`button-add-to-deck-${e.id}`,children:r?"IN DECK":"ADD"})}),c.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 FL=w.memo(zL);function UL(e){return e.iconUrl?e.iconUrl:null}function ej({credential:e,color:t}){const n=UL(e);return n?c.jsx("img",{src:n,alt:"",className:"h-7 w-7 object-contain rounded-sm",draggable:!1}):c.jsx(Ug,{className:"h-7 w-7",strokeWidth:2.25,style:{color:t}})}function qL({credential:e,isInActiveDeck:t,activeDeck:n,isInCollection:r=!0,onDragStart:o,onDragEnd:s,onMouseEnter:i,onMouseLeave:a,onCardClick:l,warnings:u}){const d=Kt(),{toast:f}=qt(),p=Rn,h=dt({mutationFn:async()=>{if(!n)throw new Error("No active deck found");return Ce("POST",`/api/decks/${n.id}/credentials`,{credentialId:e.id})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Added to deck",description:`${e.label} is in your active deck.`})},onError:m=>{f({title:"Failed to add to deck",description:m.message,variant:"destructive"})}}),y=dt({mutationFn:async()=>Ce("DELETE",`/api/credentials/${e.id}`),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/credentials/vault"]}),d.invalidateQueries({queryKey:["/api/decks"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"API key removed",description:`${e.label} was deleted from your vault.`})},onError:m=>{f({title:"Failed to remove API key",description:m.message,variant:"destructive"})}});return c.jsx("div",{className:"relative group cursor-pointer",draggable:!t&&!!o,onDragStart:o?m=>o(m,e):void 0,onDragEnd:s,onClick:()=>l==null?void 0:l(e),"data-testid":`card-${e.id}`,onMouseEnter:i,onMouseLeave:a,children:c.jsxs("div",{className:`
266
- w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
267
- transform transition-all duration-300 shadow-lg hover:shadow-2xl
268
- bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
269
- relative overflow-hidden
270
- ${p0(t)}
271
- ${r?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
272
- `,style:{borderColor:p,boxShadow:`0 0 20px ${p}20`},children:[c.jsx(Ea,{warnings:u}),t&&c.jsx(m0,{}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:p},children:"AK"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:p},children:"AK"})}),c.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:c.jsx(le,{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(`Remove ${e.label} from your vault?`)&&y.mutate()},title:`Remove ${e.label}`,children:c.jsx(iu,{className:"w-3 h-3"})})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:p},children:c.jsx(ej,{credential:e,color:p})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2","data-testid":`text-credential-name-${e.id}`,style:{color:p},children:e.label}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:p,borderColor:p},children:e.hasSecret?"API Key":"Missing key"})]}),c.jsx("div",{className:"absolute bottom-6 inset-x-1",children:c.jsx(le,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:p,borderColor:p},onClick:m=>{m.stopPropagation(),h.mutate()},disabled:t||h.isPending||!n,"data-testid":`button-add-to-deck-${e.id}`,children:t?"IN DECK":"ADD"})}),c.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 VL=w.memo(qL);function HL({playbook:e,isInActiveDeck:t,activeDeck:n,isInCollection:r=!0,onDragStart:o,onDragEnd:s,onMouseEnter:i,onMouseLeave:a,onCardClick:l,warnings:u}){const d=Kt(),{toast:f}=qt(),p=Cr,h=e.dependsOnCredentialIds.length+e.dependsOnServiceIds.length,y=dt({mutationFn:async()=>{if(!n)throw new Error("No deck selected");return Ce("POST",`/api/decks/${n.id}/playbooks`,{playbookId:e.id})},onSuccess:()=>{d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Playbook added to deck",description:`${e.title} is on this deck.`})},onError:x=>{f({title:"Failed to add playbook",description:x.message,variant:"destructive"})}}),m=dt({mutationFn:async()=>Ce("DELETE",`/api/playbooks/${e.id}`),onSuccess:()=>{d.invalidateQueries({queryKey:["/api/playbooks/vault"]}),d.invalidateQueries({queryKey:["/api/decks"]}),f({title:"Playbook deleted",description:`${e.title} was removed from your collection.`})},onError:x=>{f({title:"Failed to delete playbook",description:x.message,variant:"destructive"})}});return c.jsx("div",{className:"relative group cursor-pointer",draggable:!t&&!!o,onDragStart:o?x=>o(x,e):void 0,onDragEnd:s,onClick:()=>l==null?void 0:l(e),"data-testid":`card-${e.id}`,onMouseEnter:i,onMouseLeave:a,children:c.jsxs("div",{className:`
273
- w-32 h-48 aspect-[2/3] rounded-lg border-2 p-3
274
- transform transition-all duration-300 shadow-lg hover:shadow-2xl
275
- bg-gradient-to-b from-gray-900 via-gray-800 to-gray-900
276
- relative overflow-hidden
277
- ${p0(t)}
278
- ${r?"hover:scale-110 hover:rotate-0":"hover:scale-105"}
279
- `,style:{borderColor:p,boxShadow:`0 0 20px ${p}20`},children:[c.jsx(Ea,{warnings:u}),t&&c.jsx(m0,{}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:p},children:"PB"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:p},children:"PB"})}),c.jsx("div",{className:"absolute top-1 right-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200 z-10",children:c.jsx(le,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:x=>{x.stopPropagation(),window.confirm(`Delete playbook "${e.title}"?`)&&m.mutate()},title:`Delete ${e.title}`,children:c.jsx(iu,{className:"w-3 h-3"})})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:p},children:c.jsx(Xv,{className:"h-7 w-7",strokeWidth:2.25})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:p},children:e.title}),c.jsxs("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:p,borderColor:p},children:["Playbook",h>0?` · ${h} deps`:""]})]}),c.jsx("div",{className:"absolute bottom-6 inset-x-1",children:c.jsx(le,{size:"sm",className:"w-full text-[8px] px-1 py-1 h-5 bg-black/20 hover:bg-black/40 border",style:{color:p,borderColor:p},onClick:x=>{x.stopPropagation(),y.mutate()},disabled:t||y.isPending||!n,children:t?"IN DECK":"ADD"})}),c.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 BL=w.memo(HL),Fc=128,tj=192,tl=48,WL=10,Rf=12,Qu=64,Gu=4,yk=14,nj=12,rj=1.08;function KL(e=nj,t=rj){const n=e*Math.PI/180,r=Fc*Math.sin(n)+tj*Math.cos(n);return Math.ceil(r*t)+8}const Kg=KL();function oj(e,t=tl){return e===0?0:Fc+Math.max(0,e-1)*(Fc-t)}function ZL(e=WL,t=tl,n=Rf){return oj(e,t)+2*n}function QL(e,t=tl){return oj(e,t)+2*Rf}const GL=ZL();function JL(e,t,n,r=nj){const o=t+n/2,s=n/2;if(s<=0)return 0;const i=(e-o)/s;return Math.max(-r,Math.min(r,i*r))}function YL(e){return{flexShrink:0,marginLeft:e===0?0:`-${tl}px`}}function XL(e,t,n){return n===e?999999:t-e}function ez({cardCount:e,children:t}){const n=w.useRef(null),r=w.useRef([]),o=w.useRef(0),s=w.useRef(void 0),[i,a]=w.useState(!1),[l,u]=w.useState(!1),[d,f]=w.useState(!1),[p,h]=w.useState(!1),[y,m]=w.useState(!1),x=w.useRef(!1),g=w.useRef(!1),[v,b]=w.useState(null),k=w.useRef(null);k.current=v;const S=w.useCallback(()=>{const j=n.current;if(!j)return;const I=j.getBoundingClientRect(),D=k.current;r.current.forEach((L,T)=>{if(!L)return;const Q=L.getBoundingClientRect(),X=Q.left+Q.width/2,M=D===T?0:JL(X,I.left,I.width),K=D===T?rj:1;L.style.transform=`rotate(${M}deg) scale(${K})`,L.style.transformOrigin="center center",L.style.zIndex=String(XL(T,e,D))})},[e]),E=w.useCallback(j=>{const I=n.current;if(!I)return;const D=Fc-tl;I.scrollBy({left:j==="left"?-D:D,behavior:"smooth"})},[]),P=w.useCallback(()=>{const j=n.current;if(!j)return;const D=QL(e,tl)>j.clientWidth+2;a(D),u(D&&j.scrollLeft>4),f(D&&j.scrollLeft+j.clientWidth<j.scrollWidth-4),S()},[e,S]);w.useLayoutEffect(()=>{const j=n.current;if(!j)return;P();const I=new ResizeObserver(P);return I.observe(j),j.addEventListener("scroll",P,{passive:!0}),()=>{I.disconnect(),j.removeEventListener("scroll",P)}},[e,P]),w.useEffect(()=>{const j=()=>{const I=n.current,D=o.current;if(I&&D!==0){I.scrollLeft+=D,S();const Q=I.scrollLeft>4,X=I.scrollLeft+I.clientWidth<I.scrollWidth-4;u(Q),f(X)}const L=D<0,T=D>0;L!==x.current&&(x.current=L,h(L)),T!==g.current&&(g.current=T,m(T)),s.current=requestAnimationFrame(j)};return s.current=requestAnimationFrame(j),()=>{s.current!==void 0&&cancelAnimationFrame(s.current)}},[S]);const O=j=>{const I=n.current;if(!I||!i){o.current=0;return}const D=I.getBoundingClientRect(),L=j.clientX-D.left;if(L<Qu&&l){const T=1-L/Qu;o.current=-(Gu+T*(yk-Gu))}else if(L>D.width-Qu&&d){const T=1-(D.width-L)/Qu;o.current=Gu+T*(yk-Gu)}else o.current=0;S()},R=()=>{o.current=0,x.current=!1,g.current=!1,h(!1),m(!1)};if(w.useLayoutEffect(()=>{r.current.length=e,S()},[e,v,S]),e===0)return c.jsx(c.Fragment,{children:t});const $=(j,I)=>`absolute ${j==="left"?"left-2":"right-2"} top-1/2 z-30 -translate-y-1/2 rounded-full bg-gray-950/90 p-1.5 text-yellow-300 shadow-lg ring-1 ring-black/50 transition-all duration-150 hover:bg-gray-950 hover:ring-yellow-300/40 ${I?"scale-110":"scale-100"}`;return c.jsxs("div",{className:"relative flex h-full w-full min-w-0 max-w-full items-center justify-center overflow-hidden","data-testid":"deck-fan",onMouseMove:O,onMouseLeave:R,children:[i&&l&&c.jsx("button",{type:"button",className:$("left",p),"aria-label":"Scroll deck left","data-testid":"deck-scroll-left",onClick:()=>E("left"),children:c.jsx(lN,{className:"h-6 w-6",strokeWidth:2.5})}),i&&d&&c.jsx("button",{type:"button",className:$("right",y),"aria-label":"Scroll deck right","data-testid":"deck-scroll-right",onClick:()=>E("right"),children:c.jsx(cN,{className:"h-6 w-6",strokeWidth:2.5})}),c.jsx("div",{ref:n,className:"max-w-full overflow-x-auto overflow-y-visible [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{width:GL,maxWidth:"100%"},children:c.jsx("div",{className:"flex items-center justify-start isolate group/fan",style:{minHeight:Kg,paddingLeft:Rf,paddingRight:Rf},children:w.Children.map(t,(j,I)=>c.jsx("div",{ref:D=>{r.current[I]=D},className:"relative flex items-center justify-center transition-[transform,box-shadow] duration-500 will-change-transform",style:{...YL(I),minHeight:Kg},onMouseEnter:()=>b(I),onMouseLeave:()=>b(null),children:j},j&&typeof j=="object"&&"key"in j?j.key:I))})})]})}const Je=w.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:$e("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",e),ref:r,...n}));Je.displayName="Input";function tz({deck:e,services:t,credentials:n=[],playbooks:r=[],collectionWarnings:o,onDrop:s,onDragStart:i,onCredentialDragStart:a,onPlaybookDragStart:l,onDragEnd:u,onCardClick:d,onPlaybookClick:f,onCredentialClick:p}){const[h,y]=w.useState(!1),[m,x]=w.useState(e.name),g=w.useRef(null),v=Kt(),{toast:b}=qt();w.useEffect(()=>{x(e.name),y(!1)},[e.id,e.name]),w.useEffect(()=>{var R,$;h&&((R=g.current)==null||R.focus(),($=g.current)==null||$.select())},[h]);const k=dt({mutationFn:async R=>(await Ce("PUT",`/api/decks/${e.id}`,{name:R})).json(),onSuccess:R=>{if(!R.success)throw new Error(R.error||"Rename failed");v.invalidateQueries({queryKey:["/api/decks"]}),y(!1)},onError:R=>{x(e.name),y(!1),b({title:"Could not rename deck",description:R.message,variant:"destructive"})}}),S=()=>{const R=m.trim();if(!R||R===e.name){x(e.name),y(!1);return}k.mutate(R)},E=R=>{R.preventDefault(),s(R)},P=R=>{R.preventDefault()},O=t.length+n.length+r.length;return c.jsxs("div",{className:"flex h-full min-w-0 flex-col overflow-hidden",children:[c.jsxs("h3",{className:"mb-4 flex min-w-0 shrink-0 items-center text-lg font-bold",children:[c.jsx("i",{className:"fas fa-layer-group mr-2 text-blue-400"}),"Deck",h?c.jsx(Je,{ref:g,value:m,disabled:k.isPending,onChange:R=>x(R.target.value),onBlur:S,onKeyDown:R=>{R.key==="Enter"?(R.preventDefault(),S()):R.key==="Escape"&&(R.preventDefault(),x(e.name),y(!1))},className:"ml-2 h-7 max-w-[12rem] border-white/20 bg-white/10 px-2 text-sm font-normal text-white sm:max-w-[16rem]","data-testid":"input-deck-name","aria-label":"Deck name"}):c.jsx("button",{type:"button",className:"ml-2 min-w-0 truncate text-left text-sm font-normal text-gray-400 hover:text-white hover:underline",title:"Click to rename",onClick:()=>y(!0),"data-testid":"button-rename-deck",children:e.name}),c.jsxs("span",{className:"ml-2 shrink-0 text-sm font-normal text-gray-400",children:["(",O," cards)"]})]}),c.jsx("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden rounded-xl border-2 border-dashed px-4 py-2 min-w-0",onDrop:E,onDragOver:P,style:{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:c.jsx("div",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden min-w-0",children:O===0?c.jsx("div",{className:"flex items-center justify-center",style:{minHeight:Kg},children:c.jsx("div",{className:"flex items-center justify-center rounded-lg border-2 border-dashed border-gray-500 opacity-50 transition-opacity hover:opacity-75",style:{width:Fc,height:tj},"data-testid":"deck-empty-placeholder",children:c.jsx(ai,{className:"h-8 w-8 text-gray-500"})})}):c.jsxs(ez,{cardCount:O,children:[n.map((R,$)=>c.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:Rn,boxShadow:`0 0 20px ${Rn}20`},draggable:!0,onDragStart:j=>a(j,R,!0),onDragEnd:u,onClick:()=>p==null?void 0:p(R),"data-testid":`deck-card-${R.id}`,children:[c.jsx(Ea,{warnings:o==null?void 0:o.credentialWarnings.get(R.id)}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:Rn},children:"AK"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:Rn},children:"AK"})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:Rn},children:c.jsx(ej,{credential:R,color:Rn})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:Rn},children:R.label}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:Rn,borderColor:Rn},children:R.hasSecret?"API Key":"Missing key"})]})]},R.id)),r.map((R,$)=>c.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:Cr,boxShadow:`0 0 20px ${Cr}20`},draggable:!0,onDragStart:j=>l(j,R,!0),onDragEnd:u,onClick:()=>f==null?void 0:f(R),"data-testid":`deck-card-${R.id}`,children:[c.jsx(Ea,{warnings:o==null?void 0:o.playbookWarnings.get(R.id)}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:Cr},children:"PB"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:Cr},children:"PB"})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:Cr},children:c.jsx(Xv,{className:"h-7 w-7",strokeWidth:2.25})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:Cr},children:R.title}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:Cr,borderColor:Cr},children:"Playbook"})]})]},R.id)),t.map(R=>c.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:Vr(),boxShadow:`0 0 20px ${Vr()}20`},draggable:!0,onDragStart:$=>i($,R,!0),onDragEnd:u,onClick:()=>d==null?void 0:d(R),"data-testid":`deck-card-${R.id}`,children:[c.jsx(Ea,{warnings:o==null?void 0:o.serviceWarnings.get(R.id)}),c.jsx("div",{className:"absolute top-1 left-1 text-xs font-bold",children:c.jsx("div",{className:"leading-none",style:{color:Vr()},children:R.type==="mcp"?"RM":R.type==="local-mcp"?"LM":"A"})}),c.jsx("div",{className:"absolute bottom-1 right-1 text-xs font-bold rotate-180",children:c.jsx("div",{className:"leading-none",style:{color:Vr()},children:R.type==="mcp"?"RM":R.type==="local-mcp"?"LM":"A"})}),c.jsxs("div",{className:"absolute inset-x-2 top-6 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"mb-2",style:{color:Vr()},children:c.jsx(XN,{service:R})}),c.jsx("h3",{className:"font-bold text-xs mb-1 line-clamp-2",style:{color:Vr()},children:R.name}),c.jsx("div",{className:"text-[8px] px-1 py-0.5 rounded border opacity-70",style:{color:Vr(),borderColor:Vr()},children:R.type==="mcp"?"Remote MCP":R.type==="local-mcp"?"Local MCP":"A2A"})]})]},R.id))]})})})]})}var Bp=0;function g0(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vk()),document.body.insertAdjacentElement("beforeend",e[1]??vk()),Bp++,()=>{Bp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Bp--}},[])}function vk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Wp="focusScope.autoFocusOnMount",Kp="focusScope.autoFocusOnUnmount",xk={bubbles:!1,cancelable:!0},nz="FocusScope",Ah=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=w.useState(null),u=mr(o),d=mr(s),f=w.useRef(null),p=Xe(t,m=>l(m)),h=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let m=function(b){if(h.paused||!a)return;const k=b.target;a.contains(k)?f.current=k:Go(f.current,{select:!0})},x=function(b){if(h.paused||!a)return;const k=b.relatedTarget;k!==null&&(a.contains(k)||Go(f.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&Go(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const v=new MutationObserver(g);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),v.disconnect()}}},[r,a,h.paused]),w.useEffect(()=>{if(a){bk.add(h);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Wp,xk);a.addEventListener(Wp,u),a.dispatchEvent(g),g.defaultPrevented||(rz(lz(sj(a)),{select:!0}),document.activeElement===m&&Go(a))}return()=>{a.removeEventListener(Wp,u),setTimeout(()=>{const g=new CustomEvent(Kp,xk);a.addEventListener(Kp,d),a.dispatchEvent(g),g.defaultPrevented||Go(m??document.body,{select:!0}),a.removeEventListener(Kp,d),bk.remove(h)},0)}}},[a,u,d,h]);const y=w.useCallback(m=>{if(!n&&!r||h.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(x&&g){const v=m.currentTarget,[b,k]=oz(v);b&&k?!m.shiftKey&&g===k?(m.preventDefault(),n&&Go(b,{select:!0})):m.shiftKey&&g===b&&(m.preventDefault(),n&&Go(k,{select:!0})):g===v&&m.preventDefault()}},[n,r,h.paused]);return c.jsx(Ae.div,{tabIndex:-1,...i,ref:p,onKeyDown:y})});Ah.displayName=nz;function rz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Go(r,{select:t}),document.activeElement!==n)return}function oz(e){const t=sj(e),n=wk(t,e),r=wk(t.reverse(),e);return[n,r]}function sj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wk(e,t){for(const n of e)if(!sz(n,{upTo:t}))return n}function sz(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function iz(e){return e instanceof HTMLInputElement&&"select"in e}function Go(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&iz(e)&&t&&e.select()}}var bk=az();function az(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=kk(e,t),e.unshift(t)},remove(t){var n;e=kk(e,t),(n=e[0])==null||n.resume()}}}function kk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lz(e){return e.filter(t=>t.tagName!=="A")}var cz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Hi=new WeakMap,Ju=new WeakMap,Yu={},Zp=0,ij=function(e){return e&&(e.host||ij(e.parentNode))},uz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ij(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},dz=function(e,t,n,r){var o=uz(t,Array.isArray(e)?e:[e]);Yu[n]||(Yu[n]=new WeakMap);var s=Yu[n],i=[],a=new Set,l=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))d(p);else try{var h=p.getAttribute(r),y=h!==null&&h!=="false",m=(Hi.get(p)||0)+1,x=(s.get(p)||0)+1;Hi.set(p,m),s.set(p,x),i.push(p),m===1&&y&&Ju.set(p,!0),x===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return d(t),a.clear(),Zp++,function(){i.forEach(function(f){var p=Hi.get(f)-1,h=s.get(f)-1;Hi.set(f,p),s.set(f,h),p||(Ju.has(f)||f.removeAttribute(r),Ju.delete(f)),h||f.removeAttribute(n)}),Zp--,Zp||(Hi=new WeakMap,Hi=new WeakMap,Ju=new WeakMap,Yu={})}},y0=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=cz(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),dz(r,o,n,"aria-hidden")):function(){return null}},Yr=function(){return Yr=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Yr.apply(this,arguments)};function aj(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function fz(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Od="right-scroll-bar-position",Md="width-before-scroll-bar",hz="with-scroll-bars-hidden",pz="--removed-body-scroll-bar-size";function Qp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mz(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var gz=typeof window<"u"?w.useLayoutEffect:w.useEffect,_k=new WeakMap;function yz(e,t){var n=mz(null,function(r){return e.forEach(function(o){return Qp(o,r)})});return gz(function(){var r=_k.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Qp(a,null)}),s.forEach(function(a){o.has(a)||Qp(a,i)})}_k.set(n,e)},[e]),n}function vz(e){return e}function xz(e,t){t===void 0&&(t=vz);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var d=i;i=[],d.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),n}}}};return o}function wz(e){e===void 0&&(e={});var t=xz(null);return t.options=Yr({async:!0,ssr:!1},e),t}var lj=function(e){var t=e.sideCar,n=aj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Yr({},n))};lj.isSideCarExport=!0;function bz(e,t){return e.useMedium(t),lj}var cj=wz(),Gp=function(){},Oh=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:Gp,onWheelCapture:Gp,onTouchMoveCapture:Gp}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,h=e.noRelative,y=e.noIsolation,m=e.inert,x=e.allowPinchZoom,g=e.as,v=g===void 0?"div":g,b=e.gapMode,k=aj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,E=yz([n,t]),P=Yr(Yr({},k),o);return w.createElement(w.Fragment,null,d&&w.createElement(S,{sideCar:cj,removeScrollBar:u,shards:f,noRelative:h,noIsolation:y,inert:m,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:b}),i?w.cloneElement(w.Children.only(a),Yr(Yr({},P),{ref:E})):w.createElement(v,Yr({},P,{className:l,ref:E}),a))});Oh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Oh.classNames={fullWidth:Md,zeroRight:Od};var kz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _z(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kz();return t&&e.setAttribute("nonce",t),e}function Sz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Cz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ez=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_z())&&(Sz(t,n),Cz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Nz=function(){var e=Ez();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},uj=function(){var e=Nz(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},jz={left:0,top:0,right:0,gap:0},Jp=function(e){return parseInt(e||"",10)||0},Pz=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Jp(n),Jp(r),Jp(o)]},Tz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return jz;var t=Pz(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$z=uj(),Na="data-scroll-locked",Rz=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
280
- .`.concat(hz,` {
281
- overflow: hidden `).concat(r,`;
282
- padding-right: `).concat(a,"px ").concat(r,`;
283
- }
284
- body[`).concat(Na,`] {
285
- overflow: hidden `).concat(r,`;
286
- overscroll-behavior: contain;
287
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
288
- padding-left: `.concat(o,`px;
289
- padding-top: `).concat(s,`px;
290
- padding-right: `).concat(i,`px;
291
- margin-left:0;
292
- margin-top:0;
293
- margin-right: `).concat(a,"px ").concat(r,`;
294
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
295
- }
296
-
297
- .`).concat(Od,` {
298
- right: `).concat(a,"px ").concat(r,`;
299
- }
300
-
301
- .`).concat(Md,` {
302
- margin-right: `).concat(a,"px ").concat(r,`;
303
- }
304
-
305
- .`).concat(Od," .").concat(Od,` {
306
- right: 0 `).concat(r,`;
307
- }
308
-
309
- .`).concat(Md," .").concat(Md,` {
310
- margin-right: 0 `).concat(r,`;
311
- }
312
-
313
- body[`).concat(Na,`] {
314
- `).concat(pz,": ").concat(a,`px;
315
- }
316
- `)},Sk=function(){var e=parseInt(document.body.getAttribute(Na)||"0",10);return isFinite(e)?e:0},Iz=function(){w.useEffect(function(){return document.body.setAttribute(Na,(Sk()+1).toString()),function(){var e=Sk()-1;e<=0?document.body.removeAttribute(Na):document.body.setAttribute(Na,e.toString())}},[])},Az=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Iz();var s=w.useMemo(function(){return Tz(o)},[o]);return w.createElement($z,{styles:Rz(s,!t,o,n?"":"!important")})},Zg=!1;if(typeof window<"u")try{var Xu=Object.defineProperty({},"passive",{get:function(){return Zg=!0,!0}});window.addEventListener("test",Xu,Xu),window.removeEventListener("test",Xu,Xu)}catch{Zg=!1}var Bi=Zg?{passive:!1}:!1,Oz=function(e){return e.tagName==="TEXTAREA"},dj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Oz(e)&&n[t]==="visible")},Mz=function(e){return dj(e,"overflowY")},Dz=function(e){return dj(e,"overflowX")},Ck=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=fj(e,r);if(o){var s=hj(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Lz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},zz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},fj=function(e,t){return e==="v"?Mz(t):Dz(t)},hj=function(e,t){return e==="v"?Lz(t):zz(t)},Fz=function(e,t){return e==="h"&&t==="rtl"?-1:1},Uz=function(e,t,n,r,o){var s=Fz(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),u=!1,d=i>0,f=0,p=0;do{if(!a)break;var h=hj(e,a),y=h[0],m=h[1],x=h[2],g=m-x-s*y;(y||g)&&fj(e,a)&&(f+=g,p+=y);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(f)<1||!d&&Math.abs(p)<1)&&(u=!0),u},ed=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ek=function(e){return[e.deltaX,e.deltaY]},Nk=function(e){return e&&"current"in e?e.current:e},qz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vz=function(e){return`
317
- .block-interactivity-`.concat(e,` {pointer-events: none;}
318
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
319
- `)},Hz=0,Wi=[];function Bz(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),o=w.useState(Hz++)[0],s=w.useState(uj)[0],i=w.useRef(e);w.useEffect(function(){i.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=fz([e.lockRef.current],(e.shards||[]).map(Nk),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=w.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var g=ed(m),v=n.current,b="deltaX"in m?m.deltaX:v[0]-g[0],k="deltaY"in m?m.deltaY:v[1]-g[1],S,E=m.target,P=Math.abs(b)>Math.abs(k)?"h":"v";if("touches"in m&&P==="h"&&E.type==="range")return!1;var O=Ck(P,E);if(!O)return!0;if(O?S=P:(S=P==="v"?"h":"v",O=Ck(P,E)),!O)return!1;if(!r.current&&"changedTouches"in m&&(b||k)&&(r.current=S),!S)return!0;var R=r.current||S;return Uz(R,x,m,R==="h"?b:k)},[]),l=w.useCallback(function(m){var x=m;if(!(!Wi.length||Wi[Wi.length-1]!==s)){var g="deltaY"in x?Ek(x):ed(x),v=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&qz(S.delta,g)})[0];if(v&&v.should){x.cancelable&&x.preventDefault();return}if(!v){var b=(i.current.shards||[]).map(Nk).filter(Boolean).filter(function(S){return S.contains(x.target)}),k=b.length>0?a(x,b[0]):!i.current.noIsolation;k&&x.cancelable&&x.preventDefault()}}},[]),u=w.useCallback(function(m,x,g,v){var b={name:m,delta:x,target:g,should:v,shadowParent:Wz(g)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(k){return k!==b})},1)},[]),d=w.useCallback(function(m){n.current=ed(m),r.current=void 0},[]),f=w.useCallback(function(m){u(m.type,Ek(m),m.target,a(m,e.lockRef.current))},[]),p=w.useCallback(function(m){u(m.type,ed(m),m.target,a(m,e.lockRef.current))},[]);w.useEffect(function(){return Wi.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Bi),document.addEventListener("touchmove",l,Bi),document.addEventListener("touchstart",d,Bi),function(){Wi=Wi.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,Bi),document.removeEventListener("touchmove",l,Bi),document.removeEventListener("touchstart",d,Bi)}},[]);var h=e.removeScrollBar,y=e.inert;return w.createElement(w.Fragment,null,y?w.createElement(s,{styles:Vz(o)}):null,h?w.createElement(Az,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Wz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Kz=bz(cj,Bz);var Mh=w.forwardRef(function(e,t){return w.createElement(Oh,Yr({},e,{ref:t,sideCar:Kz}))});Mh.classNames=Oh.classNames;var Dh="Popover",[pj,ste]=Do(Dh,[gl]),lu=gl(),[Zz,Ms]=pj(Dh),mj=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=lu(t),l=w.useRef(null),[u,d]=w.useState(!1),[f,p]=ji({prop:r,defaultProp:o??!1,onChange:s,caller:Dh});return c.jsx(HN,{...a,children:c.jsx(Zz,{scope:t,contentId:No(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:w.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:u,onCustomAnchorAdd:w.useCallback(()=>d(!0),[]),onCustomAnchorRemove:w.useCallback(()=>d(!1),[]),modal:i,children:n})})};mj.displayName=Dh;var gj="PopoverAnchor",Qz=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ms(gj,n),s=lu(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return w.useEffect(()=>(i(),()=>a()),[i,a]),c.jsx($h,{...s,...r,ref:t})});Qz.displayName=gj;var yj="PopoverTrigger",vj=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ms(yj,n),s=lu(n),i=Xe(t,o.triggerRef),a=c.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":_j(o.open),...r,ref:i,onClick:be(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:c.jsx($h,{asChild:!0,...s,children:a})});vj.displayName=yj;var v0="PopoverPortal",[Gz,Jz]=pj(v0,{forceMount:void 0}),xj=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=Ms(v0,t);return c.jsx(Gz,{scope:t,forceMount:n,children:c.jsx(Lo,{present:n||s.open,children:c.jsx(ou,{asChild:!0,container:o,children:r})})})};xj.displayName=v0;var nl="PopoverContent",wj=w.forwardRef((e,t)=>{const n=Jz(nl,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=Ms(nl,e.__scopePopover);return c.jsx(Lo,{present:r||s.open,children:s.modal?c.jsx(Xz,{...o,ref:t}):c.jsx(eF,{...o,ref:t})})});wj.displayName=nl;var Yz=Ni("PopoverContent.RemoveScroll"),Xz=w.forwardRef((e,t)=>{const n=Ms(nl,e.__scopePopover),r=w.useRef(null),o=Xe(t,r),s=w.useRef(!1);return w.useEffect(()=>{const i=r.current;if(i)return y0(i)},[]),c.jsx(Mh,{as:Yz,allowPinchZoom:!0,children:c.jsx(bj,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:be(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),eF=w.forwardRef((e,t)=>{const n=Ms(nl,e.__scopePopover),r=w.useRef(!1),o=w.useRef(!1);return c.jsx(bj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),bj=w.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=Ms(nl,n),h=lu(n);return g0(),c.jsx(Ah,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(fl,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1),children:c.jsx(d0,{"data-state":_j(p.open),role:"dialog",id:p.contentId,...h,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),kj="PopoverClose",tF=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Ms(kj,n);return c.jsx(Ae.button,{type:"button",...r,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});tF.displayName=kj;var nF="PopoverArrow",rF=w.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=lu(n);return c.jsx(f0,{...o,...r,ref:t})});rF.displayName=nF;function _j(e){return e?"open":"closed"}var oF=mj,sF=vj,iF=xj,Sj=wj;const aF=oF,lF=sF,Cj=w.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>c.jsx(iF,{children:c.jsx(Sj,{ref:o,align:t,sideOffset:n,className:$e("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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-popover-content-transform-origin]",e),...r})}));Cj.displayName=Sj.displayName;function cF(e,t){const n=new Date(e).getTime();if(Number.isNaN(n))return"";const r=Math.max(0,Math.floor((t.getTime()-n)/1e3));if(r<60)return`${r}s`;const o=Math.floor(r/60);if(o<60)return`${o}m`;const s=Math.floor(o/60);return s<24?`${s}h`:`${Math.floor(s/24)}d`}function uF(e,t=24){return e.length>t?`${e.slice(0,t-1)}…`:e}function dF(e){const t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}function fF(e){const t=new Map;for(const n of e)t.set(n.deckId,(t.get(n.deckId)??0)+1);return t}function hF(e,t){const n=e>0?`${e} cards`:"Empty";if(t<=0)return n;const r=t===1?"1 session":`${t} sessions`;return`${n}, ${r}`}const pF=3e3;function mF({highlightDeckId:e}){const{data:t}=ut({queryKey:["/api/scope/bindings"],refetchInterval:pF}),n=(t==null?void 0:t.data)??[],r=w.useMemo(()=>new Date,[t]),o=w.useMemo(()=>{const i=new Map;for(const a of n){const l=a.workspaceRoot||`deck:${a.deckId}`,u=a.workspaceRoot?`${dF(a.workspaceRoot)}/`:`◆ ${a.deckName}`,d=i.get(l)??{label:u,rows:[]};d.rows.push(a),i.set(l,d)}return[...i.entries()].sort(([a],[l])=>a.localeCompare(l)).map(([a,{label:l,rows:u}])=>({key:a,label:l,rows:[...u].sort((d,f)=>d.lastActivityAt<f.lastActivityAt?1:-1)}))},[n]);if(n.length===0)return null;const s=e?n.filter(i=>i.deckId===e).length:0;return c.jsxs(aF,{children:[c.jsx(lF,{asChild:!0,children:c.jsxs(le,{type:"button",variant:"outline",size:"sm",className:"h-7 shrink-0 border-white/20 bg-black/30 px-2 text-xs text-gray-200 hover:bg-white/10 hover:text-white","data-testid":"live-session-badges-trigger",title:"Live MCP session binds — click for badges",children:[c.jsx(c4,{className:"mr-1 h-3 w-3",style:{color:bn},"aria-hidden":!0}),c.jsxs("span",{className:"font-mono",children:["⌘",n.length]}),s>0&&s<n.length?c.jsxs("span",{className:"ml-1 text-gray-400",children:["(",s," here)"]}):null]})}),c.jsxs(Cj,{align:"end",className:"w-80 border-white/10 bg-gray-950/95 p-0 text-gray-100","data-testid":"live-session-badges-panel",children:[c.jsxs("div",{className:"border-b border-white/10 px-3 py-2",children:[c.jsx("p",{className:"text-sm font-semibold",style:{color:bn},children:"Live sessions"}),c.jsxs("p",{className:"text-xs text-gray-400",children:["Match ",c.jsx("span",{className:"font-mono",children:"⌘badge"})," to the chat opener"]})]}),c.jsx("div",{className:"max-h-64 overflow-y-auto p-2",children:o.map(({key:i,label:a,rows:l})=>c.jsxs("div",{className:"mb-2 last:mb-0",children:[c.jsx("p",{className:"px-1 pb-1 text-[10px] uppercase tracking-wide text-gray-500",children:a}),c.jsx("ul",{className:"space-y-1",children:l.map(u=>{const d=u.clientName??"agent",f=cF(u.lastActivityAt,r),p=f?`${d} · ${f}`:d,h=e===u.deckId;return c.jsxs("li",{className:$e("rounded-md px-2 py-1.5 font-mono text-xs",h?"bg-[#92E4DD]/10 ring-1 ring-[#92E4DD]/40":"bg-white/5"),"data-testid":`live-session-row-${u.badge}`,children:[c.jsx("span",{className:"text-gray-100",children:uF(u.deckName)})," ",c.jsxs("span",{style:{color:bn},children:["⌘",u.badge]}),c.jsx("span",{className:"mt-0.5 block font-sans text-[10px] text-gray-400",children:p})]},u.badge)})})]},i))})]})]})}var Lh="Dialog",[Ej,ite]=Do(Lh),[gF,Lr]=Ej(Lh),Nj=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=w.useRef(null),l=w.useRef(null),[u,d]=ji({prop:r,defaultProp:o??!1,onChange:s,caller:Lh});return c.jsx(gF,{scope:t,triggerRef:a,contentRef:l,contentId:No(),titleId:No(),descriptionId:No(),open:u,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(f=>!f),[d]),modal:i,children:n})};Nj.displayName=Lh;var jj="DialogTrigger",yF=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Lr(jj,n),s=Xe(t,o.triggerRef);return c.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":b0(o.open),...r,ref:s,onClick:be(e.onClick,o.onOpenToggle)})});yF.displayName=jj;var x0="DialogPortal",[vF,Pj]=Ej(x0,{forceMount:void 0}),Tj=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Lr(x0,t);return c.jsx(vF,{scope:t,forceMount:n,children:w.Children.map(r,i=>c.jsx(Lo,{present:n||s.open,children:c.jsx(ou,{asChild:!0,container:o,children:i})}))})};Tj.displayName=x0;var If="DialogOverlay",$j=w.forwardRef((e,t)=>{const n=Pj(If,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Lr(If,e.__scopeDialog);return s.modal?c.jsx(Lo,{present:r||s.open,children:c.jsx(wF,{...o,ref:t})}):null});$j.displayName=If;var xF=Ni("DialogOverlay.RemoveScroll"),wF=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Lr(If,n);return c.jsx(Mh,{as:xF,allowPinchZoom:!0,shards:[o.contentRef],children:c.jsx(Ae.div,{"data-state":b0(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ti="DialogContent",Rj=w.forwardRef((e,t)=>{const n=Pj(Ti,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Lr(Ti,e.__scopeDialog);return c.jsx(Lo,{present:r||s.open,children:s.modal?c.jsx(bF,{...o,ref:t}):c.jsx(kF,{...o,ref:t})})});Rj.displayName=Ti;var bF=w.forwardRef((e,t)=>{const n=Lr(Ti,e.__scopeDialog),r=w.useRef(null),o=Xe(t,n.contentRef,r);return w.useEffect(()=>{const s=r.current;if(s)return y0(s)},[]),c.jsx(Ij,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:be(e.onFocusOutside,s=>s.preventDefault())})}),kF=w.forwardRef((e,t)=>{const n=Lr(Ti,e.__scopeDialog),r=w.useRef(!1),o=w.useRef(!1);return c.jsx(Ij,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Ij=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Lr(Ti,n),l=w.useRef(null),u=Xe(t,l);return g0(),c.jsxs(c.Fragment,{children:[c.jsx(Ah,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:c.jsx(fl,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":b0(a.open),...i,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(_F,{titleId:a.titleId}),c.jsx(CF,{contentRef:l,descriptionId:a.descriptionId})]})]})}),w0="DialogTitle",Aj=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Lr(w0,n);return c.jsx(Ae.h2,{id:o.titleId,...r,ref:t})});Aj.displayName=w0;var Oj="DialogDescription",Mj=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Lr(Oj,n);return c.jsx(Ae.p,{id:o.descriptionId,...r,ref:t})});Mj.displayName=Oj;var Dj="DialogClose",Lj=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Lr(Dj,n);return c.jsx(Ae.button,{type:"button",...r,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});Lj.displayName=Dj;function b0(e){return e?"open":"closed"}var zj="DialogTitleWarning",[ate,Fj]=aM(zj,{contentName:Ti,titleName:w0,docsSlug:"dialog"}),_F=({titleId:e})=>{const t=Fj(zj),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
320
-
321
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
322
-
323
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},SF="DialogDescriptionWarning",CF=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fj(SF).contentName}}.`;return w.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},EF=Nj,NF=Tj,Uj=$j,qj=Rj,Vj=Aj,Hj=Mj,jF=Lj;const Ds=EF,PF=NF,Bj=w.forwardRef(({className:e,...t},n)=>c.jsx(Uj,{ref:n,className:$e("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",e),...t}));Bj.displayName=Uj.displayName;const zo=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(PF,{children:[c.jsx(Bj,{}),c.jsxs(qj,{ref:r,className:$e("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",e),...n,children:[t,c.jsxs(jF,{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:[c.jsx(Nf,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zo.displayName=qj.displayName;const Fo=({className:e,...t})=>c.jsx("div",{className:$e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Fo.displayName="DialogHeader";const Uo=w.forwardRef(({className:e,...t},n)=>c.jsx(Vj,{ref:n,className:$e("text-lg font-semibold leading-none tracking-tight",e),...t}));Uo.displayName=Vj.displayName;const zi=w.forwardRef(({className:e,...t},n)=>c.jsx(Hj,{ref:n,className:$e("text-sm text-muted-foreground",e),...t}));zi.displayName=Hj.displayName;const ko=w.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:$e("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",e),ref:n,...t}));ko.displayName="Textarea";var TF="Label",Wj=w.forwardRef((e,t)=>c.jsx(Ae.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Wj.displayName=TF;var Kj=Wj;const $F=Ch("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Be=w.forwardRef(({className:e,...t},n)=>c.jsx(Kj,{ref:n,className:$e($F(),e),...t}));Be.displayName=Kj.displayName;var RF=w.createContext(void 0);function k0(e){const t=w.useContext(RF);return e||t||"ltr"}var Yp="rovingFocusGroup.onEntryFocus",IF={bubbles:!1,cancelable:!0},cu="RovingFocusGroup",[Qg,Zj,AF]=Qv(cu),[OF,Qj]=Do(cu,[AF]),[MF,DF]=OF(cu),Gj=w.forwardRef((e,t)=>c.jsx(Qg.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(Qg.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(LF,{...e,ref:t})})}));Gj.displayName=cu;var LF=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=w.useRef(null),h=Xe(t,p),y=k0(s),[m,x]=ji({prop:i,defaultProp:a??null,onChange:l,caller:cu}),[g,v]=w.useState(!1),b=mr(u),k=Zj(n),S=w.useRef(!1),[E,P]=w.useState(0);return w.useEffect(()=>{const O=p.current;if(O)return O.addEventListener(Yp,b),()=>O.removeEventListener(Yp,b)},[b]),c.jsx(MF,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:m,onItemFocus:w.useCallback(O=>x(O),[x]),onItemShiftTab:w.useCallback(()=>v(!0),[]),onFocusableItemAdd:w.useCallback(()=>P(O=>O+1),[]),onFocusableItemRemove:w.useCallback(()=>P(O=>O-1),[]),children:c.jsx(Ae.div,{tabIndex:g||E===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:be(e.onMouseDown,()=>{S.current=!0}),onFocus:be(e.onFocus,O=>{const R=!S.current;if(O.target===O.currentTarget&&R&&!g){const $=new CustomEvent(Yp,IF);if(O.currentTarget.dispatchEvent($),!$.defaultPrevented){const j=k().filter(Q=>Q.focusable),I=j.find(Q=>Q.active),D=j.find(Q=>Q.id===m),T=[I,D,...j].filter(Boolean).map(Q=>Q.ref.current);Xj(T,d)}}S.current=!1}),onBlur:be(e.onBlur,()=>v(!1))})})}),Jj="RovingFocusGroupItem",Yj=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,children:i,...a}=e,l=No(),u=s||l,d=DF(Jj,n),f=d.currentTabStopId===u,p=Zj(n),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:m}=d;return w.useEffect(()=>{if(r)return h(),()=>y()},[r,h,y]),c.jsx(Qg.ItemSlot,{scope:n,id:u,focusable:r,active:o,children:c.jsx(Ae.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:be(e.onMouseDown,x=>{r?d.onItemFocus(u):x.preventDefault()}),onFocus:be(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:be(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){d.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const g=UF(x,d.orientation,d.dir);if(g!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let b=p().filter(k=>k.focusable).map(k=>k.ref.current);if(g==="last")b.reverse();else if(g==="prev"||g==="next"){g==="prev"&&b.reverse();const k=b.indexOf(x.currentTarget);b=d.loop?qF(b,k+1):b.slice(k+1)}setTimeout(()=>Xj(b))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:m!=null}):i})})});Yj.displayName=Jj;var zF={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function FF(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function UF(e,t,n){const r=FF(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return zF[r]}function Xj(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function qF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var VF=Gj,HF=Yj,zh="Tabs",[BF,lte]=Do(zh,[Qj]),eP=Qj(),[WF,_0]=BF(zh),tP=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:s,orientation:i="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=k0(a),[f,p]=ji({prop:r,onChange:o,defaultProp:s??"",caller:zh});return c.jsx(WF,{scope:n,baseId:No(),value:f,onValueChange:p,orientation:i,dir:d,activationMode:l,children:c.jsx(Ae.div,{dir:d,"data-orientation":i,...u,ref:t})})});tP.displayName=zh;var nP="TabsList",rP=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,s=_0(nP,n),i=eP(n);return c.jsx(VF,{asChild:!0,...i,orientation:s.orientation,dir:s.dir,loop:r,children:c.jsx(Ae.div,{role:"tablist","aria-orientation":s.orientation,...o,ref:t})})});rP.displayName=nP;var oP="TabsTrigger",sP=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...s}=e,i=_0(oP,n),a=eP(n),l=lP(i.baseId,r),u=cP(i.baseId,r),d=r===i.value;return c.jsx(HF,{asChild:!0,...a,focusable:!o,active:d,children:c.jsx(Ae.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...s,ref:t,onMouseDown:be(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?i.onValueChange(r):f.preventDefault()}),onKeyDown:be(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(r)}),onFocus:be(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!o&&f&&i.onValueChange(r)})})})});sP.displayName=oP;var iP="TabsContent",aP=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:s,...i}=e,a=_0(iP,n),l=lP(a.baseId,r),u=cP(a.baseId,r),d=r===a.value,f=w.useRef(d);return w.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),c.jsx(Lo,{present:o||d,children:({present:p})=>c.jsx(Ae.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&s})})});aP.displayName=iP;function lP(e,t){return`${e}-trigger-${t}`}function cP(e,t){return`${e}-content-${t}`}var KF=tP,uP=rP,dP=sP,fP=aP;const ZF=KF,hP=w.forwardRef(({className:e,...t},n)=>c.jsx(uP,{ref:n,className:$e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));hP.displayName=uP.displayName;const Gg=w.forwardRef(({className:e,...t},n)=>c.jsx(dP,{ref:n,className:$e("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",e),...t}));Gg.displayName=dP.displayName;const Jg=w.forwardRef(({className:e,...t},n)=>c.jsx(fP,{ref:n,className:$e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Jg.displayName=fP.displayName;function lc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pP(e){return lc(e)&&typeof e.command=="string"}function Xp(e){return!lc(e)||Object.keys(e).length===0?!1:Object.values(e).every(pP)}function QF(e){let t=e.trim();return t.startsWith("```")?t.replace(/^```(?:json)?\s*\n?/i,"").replace(/\n?```\s*$/,"").trim():t}function GF(e){if(!lc(e))throw new Error("Configuration must be a JSON object");if(lc(e.config)&&Xp(e.config.mcpServers))return{mcpServers:e.config.mcpServers};if(Xp(e.mcpServers))return{mcpServers:e.mcpServers};if(lc(e)&&typeof e.command=="string"){const t=typeof e.name=="string"&&e.name.trim()?e.name.trim():"local-server",{name:n,...r}=e;if(!pP(r))throw new Error("Missing or invalid command");return{mcpServers:{[t]:r}}}if(Xp(e))return{mcpServers:e};throw new Error(`Invalid configuration: expected a top-level "mcpServers" object. Example:
324
- {
325
- "mcpServers": {
326
- "google-drive": {
327
- "command": "npx",
328
- "args": ["-y", "@piotr-agier/google-drive-mcp"]
329
- }
330
- }
331
- }`)}function JF(e){let t;try{t=JSON.parse(QF(e))}catch(n){throw new Error(`Failed to parse JSON: ${n instanceof Error?n.message:"Unknown error"}`)}return GF(t)}function YF({type:e,open:t,onOpenChange:n}){const[r,o]=w.useState("remote"),[s,i]=w.useState("json"),[a,l]=w.useState(`{
332
- "mcpServers": {
333
- "memory": {
334
- "command": "npx",
335
- "args": ["-y", "@modelcontextprotocol/server-memory"],
336
- "env": {
337
- "MEMORY_FILE_PATH": "/path/to/custom/memory.json"
338
- }
339
- }
340
- }
341
- }`),[u,d]=w.useState(null),[f,p]=w.useState(null),[h,y]=w.useState(null),[m,x]=w.useState({name:"",type:"mcp",url:"http://localhost:8000/mcp",description:"",headers_enabled:!1,headers:{},cardColor:bn}),[g,v]=w.useState(`{
342
-
343
- }`),[b,k]=w.useState(null),[S,E]=w.useState({name:"",type:"local-mcp",command:"",args:[""],env:{},description:"",cardColor:bn}),[P,O]=w.useState({name:"",type:"a2a",manifest_url:"http://localhost:8001/.well-known/a2a/manifest.json",description:"",cardColor:bn}),R=Kt(),{toast:$}=qt(),j=()=>{try{p(null);const C=JF(a),A=Object.entries(C.mcpServers);if(A.length===0)throw new Error("No MCP servers found in configuration");if(A.length>1)throw new Error("Multiple servers not supported. Please configure one server at a time.");const[F,Z]=A[0],{command:Y,args:ae,env:de,description:U}=Z;if(!Y||typeof Y!="string")throw new Error("Missing or invalid command");if(!ae||!Array.isArray(ae))throw new Error("Missing or invalid args array");const H={name:F,command:Y,args:ae.map(String),env:de&&typeof de=="object"?de:void 0,description:U&&typeof U=="string"?U:void 0};d(H),i("review"),E({name:H.name,type:"local-mcp",command:H.command,args:H.args,env:H.env||{},description:H.description||"",cardColor:bn}),I(F)}catch(C){p(C instanceof Error?C.message:"Failed to parse JSON"),d(null)}},I=async C=>{try{const Z=((await Ce("GET","/api/services")).data||[]).find(Y=>Y.name===C);y(Z?C:null)}catch(A){console.error("Failed to check name conflict:",A)}},D=async C=>{await I(C)},L=dt({mutationFn:async C=>{if(e==="mcp"&&r==="local"){const A={mcpServers:{[C.name]:{command:C.command,args:C.args.filter(F=>F.trim()!==""),...Object.keys(C.env).length>0&&{env:C.env}}}};return console.log("Importing local MCP server:",A),Ce("POST","/api/local-mcp/import",{config:JSON.stringify(A)})}else{const A={name:C.name,type:e,url:e==="mcp"?C.url:C.manifest_url,description:C.description,cardColor:C.cardColor,...C.headers_enabled&&{headers:C.headers}};return console.log("Sending service data:",A),Ce("POST","/api/services",A)}},onSuccess:()=>{R.invalidateQueries({queryKey:["/api/services"]}),R.invalidateQueries({queryKey:["/api/collection/warnings"]}),$({title:"Service registered successfully!",description:`${(e==="mcp"?r==="remote"?m:S:P).name} has been added to your collection.`}),Q()},onError:C=>{var A;console.error("Registration failed:",C),console.error("Error details:",{message:C==null?void 0:C.message,name:C==null?void 0:C.name,stack:C==null?void 0:C.stack,toString:C==null?void 0:C.toString(),constructor:(A=C==null?void 0:C.constructor)==null?void 0:A.name}),$({title:"Registration failed",description:(C==null?void 0:C.message)||"Failed to register service. Please try again.",variant:"destructive"})}}),T=async()=>{if(e==="mcp"&&r==="local"){if(s==="json")j();else if(s==="review"){if(await D(S.name),h){$({title:"Name Conflict",description:`A service with the name "${S.name}" already exists. Please choose a different name.`,variant:"destructive"});return}L.mutate(S)}}else{const C=e==="mcp"?r==="remote"?m:S:P;if(await D(C.name),h){$({title:"Name Conflict",description:`A service with the name "${C.name}" already exists. Please choose a different name.`,variant:"destructive"});return}if(e==="mcp"&&r==="remote"&&m.headers_enabled){const A=K();if(A===null)return;L.mutate({...m,headers:A});return}L.mutate(C)}},Q=()=>{i("json"),l(`{
344
- "mcpServers": {
345
- "memory": {
346
- "command": "npx",
347
- "args": ["-y", "@modelcontextprotocol/server-memory"],
348
- "env": {
349
- "MEMORY_FILE_PATH": "/path/to/custom/memory.json"
350
- }
351
- }
352
- }
353
- }`),d(null),p(null),y(null),x({name:"",type:"mcp",url:"http://localhost:8000/mcp",description:"",headers_enabled:!1,headers:{},cardColor:bn}),v(`{
354
-
355
- }`),k(null),E({name:"",type:"local-mcp",command:"",args:[""],env:{},description:"",cardColor:bn}),O({name:"",type:"a2a",manifest_url:"http://localhost:8001/.well-known/a2a/manifest.json",description:"",cardColor:bn}),n(!1)},X=(C,A)=>{x(F=>({...F,[C]:A}))},M=C=>{X("headers_enabled",C),C&&g.trim()===`{
356
-
357
- }`&&v(`{
358
- "Authorization": "Bearer "
359
- }`),C||k(null)},K=()=>{const C=g.trim();if(!C||C==="{}")return{};try{const A=JSON.parse(C);if(typeof A!="object"||A===null||Array.isArray(A))return k('Headers must be a JSON object (e.g. {"Authorization": "Bearer token"})'),null;for(const[F,Z]of Object.entries(A))if(typeof Z!="string")return k(`Header "${F}" must be a string value`),null;return k(null),A}catch{return k("Invalid JSON — fix syntax before registering"),null}},N=(C,A)=>{E(F=>({...F,[C]:A}))},z=(C,A)=>{O(F=>({...F,[C]:A}))},W=()=>{if(e==="mcp"&&r==="local"){if(s==="json")return"Parse Configuration";if(s==="review")return h?"Register Anyway":"Register Service"}return"Register Service"},_=()=>{var C,A;if(e==="mcp"&&r==="local"){if(s==="json")return!a.trim();if(s==="review")return!S.name.trim()||!S.command.trim()}else{const F=e==="mcp"?r==="remote"?m:S:P;return!F.name.trim()||e==="mcp"&&r==="remote"&&!((C=F.url)!=null&&C.trim())||e==="a2a"&&!((A=F.manifest_url)!=null&&A.trim())}return!1};return c.jsx(Ds,{open:t,onOpenChange:n,children:c.jsxs(zo,{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:[c.jsxs(Fo,{children:[c.jsxs(Uo,{className:"text-2xl font-bold flex items-center",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:[e==="mcp"?c.jsx(Ef,{className:"w-6 h-6 mr-3",style:{color:"#92E4DD"}}):c.jsx(n4,{className:"w-6 h-6 mr-3",style:{color:"#92E4DD"}}),"Register ",e==="mcp"?"MCP Server":"A2A Agent"]}),c.jsx(zi,{className:"mt-2",style:{color:"#92E4DD",opacity:.8},children:e==="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."})]}),e==="mcp"?c.jsxs(ZF,{value:r,onValueChange:C=>o(C),className:"w-full",children:[c.jsxs(hP,{className:"grid w-full grid-cols-2 bg-white/10 border border-white/20",children:[c.jsxs(Gg,{value:"remote",className:"data-[state=active]:bg-white/20 data-[state=active]:text-white text-gray-400",children:[c.jsx(Ef,{className:"w-4 h-4 mr-2"}),"Remote MCP"]}),c.jsxs(Gg,{value:"local",className:"data-[state=active]:bg-white/20 data-[state=active]:text-white text-gray-400",children:[c.jsx(u4,{className:"w-4 h-4 mr-2"}),"Local MCP"]})]}),c.jsxs(Jg,{value:"remote",className:"space-y-4 mt-4",children:[c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Server Name"}),c.jsx(Je,{id:"name",placeholder:"e.g., Database Tools",value:m.name,onChange:C=>{X("name",C.target.value),C.target.value.trim()?D(C.target.value):y(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-service-name"}),h&&c.jsxs("div",{className:"flex items-center gap-2 mt-1 text-red-400 text-sm",children:[c.jsx(cr,{className:"w-4 h-4"}),c.jsx("span",{children:"A service with this name already exists"})]})]}),c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"url",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"MCP URL"}),c.jsx(Je,{id:"url",type:"url",placeholder:"http://localhost:8080/mcp or https://mcp.notion.com/mcp",value:m.url,onChange:C=>X("url",C.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-mcp-url"}),c.jsxs("div",{className:"mt-1 text-xs text-gray-400",children:[c.jsx("p",{children:"Supported formats:"}),c.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[c.jsxs("li",{children:["HTTP MCP: ",c.jsx("code",{children:"http://localhost:8080/mcp"})]}),c.jsxs("li",{children:["SSE MCP: ",c.jsx("code",{children:"https://be.omnimcp.ai/api/v1/mcp/.../sse"})]}),c.jsxs("li",{children:["Notion MCP: ",c.jsx("code",{children:"https://mcp.notion.com/mcp"})]})]})]})]}),c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),c.jsx(ko,{id:"description",placeholder:"Brief description of capabilities...",value:m.description,onChange:C=>X("description",C.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-description"})]})]}),c.jsxs(Jg,{value:"local",className:"space-y-4 mt-4",children:[s==="json"&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"local-json",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Local MCP Configuration (JSON)"}),c.jsx(ko,{id:"local-json",placeholder:`{
360
- "mcpServers": {
361
- "memory": {
362
- "command": "npx",
363
- "args": ["-y", "@modelcontextprotocol/server-memory"]
364
- }
365
- }
366
- }`,value:a,onChange:C=>l(C.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"}),c.jsxs("div",{className:"mt-2 text-xs text-gray-400",children:[c.jsx("p",{children:"Enter your local MCP server configuration in JSON format."}),c.jsx("p",{children:"Example:"}),c.jsx("pre",{className:"bg-white/10 p-2 rounded-md text-xs text-gray-300",children:`{
367
- "mcpServers": {
368
- "memory": {
369
- "command": "npx",
370
- "args": ["-y", "@modelcontextprotocol/server-memory"],
371
- "env": {
372
- "MEMORY_FILE_PATH": "/path/to/custom/memory.json"
373
- }
374
- }
375
- }
376
- }`})]})]}),c.jsxs(le,{type:"button",className:"flex-1 border",style:{background:"linear-gradient(135deg, #C4B643, #D4C760)",borderColor:"#C4B643",color:"#0A0A07"},onClick:j,disabled:!a.trim()||a.trim().length<10,"data-testid":"button-parse-json",children:[c.jsx(Fg,{className:"w-4 h-4 mr-2",style:{color:"#0A0A07"}}),"Parse Configuration"]})]}),s==="review"&&c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"local-name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Server Name"}),c.jsx(Je,{id:"local-name",placeholder:"e.g., Memory Server",value:S.name,onChange:C=>{N("name",C.target.value),C.target.value.trim()?D(C.target.value):y(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-local-service-name"}),h&&c.jsxs("div",{className:"mt-2 text-xs text-red-400 flex items-center",children:[c.jsx(cr,{className:"w-4 h-4 mr-1"}),'A service with the name "',h,'" already exists.']})]}),c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"command",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Command"}),c.jsx(Je,{id:"command",placeholder:"e.g., npx, python, node",value:S.command,onChange:C=>N("command",C.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-command"}),c.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"The command to execute (e.g., npx, python, node)"})]}),c.jsxs("div",{children:[c.jsx(Be,{className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Arguments"}),S.args.map((C,A)=>c.jsxs("div",{className:"flex gap-2 mb-2",children:[c.jsx(Je,{placeholder:`Argument ${A+1}`,value:C,onChange:F=>{const Z=[...S.args];Z[A]=F.target.value,N("args",Z)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-arg-${A}`}),A===S.args.length-1&&c.jsx(le,{type:"button",size:"sm",onClick:()=>N("args",[...S.args,""]),className:"bg-white/20 hover:bg-white/30 text-white",children:c.jsx(ai,{className:"w-4 h-4"})}),S.args.length>1&&c.jsx(le,{type:"button",size:"sm",variant:"destructive",onClick:()=>{const F=S.args.filter((Z,Y)=>Y!==A);N("args",F)},className:"bg-red-500/80 hover:bg-red-500 text-white",children:c.jsx(Nf,{className:"w-4 h-4"})})]},A)),c.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"Command arguments (e.g., -y, @modelcontextprotocol/server-memory)"})]}),c.jsxs("div",{children:[c.jsx(Be,{className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Environment Variables"}),Object.entries(S.env).length===0?c.jsx("div",{className:"text-gray-400 text-sm italic",children:"No environment variables configured"}):c.jsx("div",{className:"space-y-2",children:Object.entries(S.env).map(([C,A],F)=>c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Je,{placeholder:"Variable name",value:C,onChange:Z=>{const Y={...S.env};delete Y[C],Y[Z.target.value]=A,N("env",Y)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-env-key-${F}`}),c.jsx(Je,{placeholder:"Value",value:A,onChange:Z=>{const Y={...S.env};Y[C]=Z.target.value,N("env",Y)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400","data-testid":`input-env-value-${F}`}),c.jsx(le,{type:"button",size:"sm",variant:"destructive",onClick:()=>{const Z={...S.env};delete Z[C],N("env",Z)},className:"bg-red-500/80 hover:bg-red-500 text-white",children:c.jsx(Nf,{className:"w-4 h-4"})})]},F))}),c.jsxs(le,{type:"button",size:"sm",onClick:()=>{const C={...S.env};C[""]="",N("env",C)},className:"mt-2 bg-white/20 hover:bg-white/30 text-white",children:[c.jsx(ai,{className:"w-4 h-4 mr-2"}),"Add Environment Variable"]}),c.jsx("div",{className:"mt-1 text-xs text-gray-400",children:"Environment variables for the MCP server process"})]}),c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"local-description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),c.jsx(ko,{id:"local-description",placeholder:"Brief description of capabilities...",value:S.description,onChange:C=>N("description",C.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-local-description"})]}),c.jsxs("div",{className:"flex gap-3",children:[c.jsx(le,{type:"button",variant:"outline",className:"flex-1 border-white/20 text-white hover:bg-white/10",onClick:()=>i("json"),"data-testid":"button-back-to-json",children:"← Back to JSON"}),c.jsxs(le,{type:"button",variant:"ghost",className:`flex-1 border-2 hover:opacity-90 ${Gr}`,style:Jr(bn),onClick:T,disabled:_(),"data-testid":"button-register",children:[c.jsx(ai,{className:"w-4 h-4 mr-2"}),L.isPending?"Registering...":W()]})]})]}),s==="complete"&&c.jsxs("div",{className:"text-center py-8",children:[c.jsx(Fg,{className:"w-16 h-16 text-green-500 mx-auto mb-4"}),c.jsx("h3",{className:"text-xl font-bold mb-2",style:{color:"#92E4DD"},children:"Local MCP Registered!"}),c.jsx("p",{className:"text-gray-400 mb-4",children:"Your local MCP server has been successfully registered."}),c.jsx(le,{type:"button",className:"flex-1 border",style:{background:"linear-gradient(135deg, #C4B643, #D4C760)",borderColor:"#C4B643",color:"#0A0A07"},onClick:Q,"data-testid":"button-close",children:"Close"})]})]})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"name",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Agent Name"}),c.jsx(Je,{id:"name",placeholder:"e.g., Code Assistant",value:P.name,onChange:C=>{z("name",C.target.value),C.target.value.trim()?D(C.target.value):y(null)},className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-service-name"}),h&&c.jsxs("div",{className:"flex items-center gap-2 mt-1 text-red-400 text-sm",children:[c.jsx(cr,{className:"w-4 h-4"}),c.jsx("span",{children:"A service with this name already exists"})]})]}),c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"manifest_url",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Manifest URL"}),c.jsx(Je,{id:"manifest_url",type:"url",placeholder:"http://localhost:8001/.well-known/a2a/manifest.json",value:P.manifest_url,onChange:C=>z("manifest_url",C.target.value),className:"bg-white/10 border-white/20 text-white placeholder-gray-400",required:!0,"data-testid":"input-manifest-url"})]}),c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"description",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"Description"}),c.jsx(ko,{id:"description",placeholder:"Brief description of capabilities...",value:P.description,onChange:C=>z("description",C.target.value),rows:3,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none","data-testid":"textarea-description"})]})]}),e==="mcp"&&r==="remote"&&c.jsxs("div",{className:"space-y-4 border border-white/10 rounded-lg p-4",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("input",{type:"checkbox",id:"headers_enabled",checked:m.headers_enabled,onChange:C=>M(C.target.checked),className:"rounded border-white/20 bg-white/10"}),c.jsx(Be,{htmlFor:"headers_enabled",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"🔐 Authentication Required"})]}),c.jsx("div",{className:"text-xs text-gray-400",children:c.jsx("p",{children:"Enable this if your MCP server requires authentication (API keys, tokens, etc.)."})}),m.headers_enabled&&c.jsxs("div",{className:"space-y-3 pl-6",children:[c.jsxs("div",{className:"text-xs text-gray-400 mb-2",children:[c.jsx("p",{children:"Configure HTTP headers for authentication. Common examples:"}),c.jsxs("ul",{className:"list-disc list-inside ml-2 mt-1 space-y-1",children:[c.jsxs("li",{children:[c.jsx("code",{children:"Authorization: Bearer YOUR_TOKEN"})," - For API tokens"]}),c.jsxs("li",{children:[c.jsx("code",{children:"X-API-Key: YOUR_API_KEY"})," - For API keys"]}),c.jsxs("li",{children:[c.jsx("code",{children:"X-Custom-Header: value"})," - For custom headers"]})]})]}),c.jsxs("div",{children:[c.jsx(Be,{htmlFor:"headers",className:"text-sm font-semibold",style:{color:"#92E4DD"},children:"HTTP Headers (JSON)"}),c.jsx(ko,{id:"headers",placeholder:`{
377
- "Authorization": "Bearer YOUR_TOKEN_HERE",
378
- "X-API-Key": "YOUR_API_KEY_HERE"
379
- }`,value:g,onChange:C=>{v(C.target.value),b&&k(null)},onBlur:()=>{g.trim()&&K()},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&&c.jsxs("p",{className:"text-red-400 text-xs mt-1 flex items-center gap-1",children:[c.jsx(cr,{className:"w-3 h-3 shrink-0"}),b]}),c.jsx("div",{className:"text-xs text-gray-400 mt-1",children:c.jsx("p",{children:"Enter headers as JSON. Keys are header names, values are header values."})})]})]})]}),f&&c.jsxs("div",{className:"text-red-400 text-sm mt-2",children:[c.jsx(cr,{className:"w-4 h-4 mr-1"}),f]}),h&&c.jsxs("div",{className:"text-red-400 text-sm mt-2",children:[c.jsx(cr,{className:"w-4 h-4 mr-1"}),'A service with the name "',h,'" already exists. You can register it anyway, but it might overwrite the existing one.']}),c.jsxs("div",{className:"flex space-x-3 pt-4",children:[c.jsx(le,{type:"button",variant:"secondary",className:"flex-1 border text-white",style:{background:"#ad095e",borderColor:"#ad095e"},onClick:Q,"data-testid":"button-cancel",children:"Cancel"}),!(e==="mcp"&&r==="local")&&c.jsxs(le,{type:"button",variant:"ghost",className:`flex-1 border-2 hover:opacity-90 ${Gr}`,style:Jr(bn),disabled:L.isPending||_(),"data-testid":"button-register",onClick:T,children:[c.jsx(ai,{className:"w-4 h-4 mr-2"}),L.isPending?"Registering...":"Register Service"]})]})]})})}async function mP(e){return(await(await Ce("POST","/api/export",{scope:e.scope??"collection",...e.deckId?{deckId:e.deckId}:{}})).json()).data}async function XF(e){return(await(await Ce("POST","/api/import",e)).json()).data}function gP(e,t){const n=new Blob([`${JSON.stringify(e,null,2)}
380
- `],{type:"application/json"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=t,o.click(),URL.revokeObjectURL(r)}function e3(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)||"deck"}function jk(e){const{services:t,playbooks:n,decks:r}=e.counts;return`Decks +${r.created} / skipped ${r.reused}. Services +${t.created} / skipped ${t.reused}. Playbooks +${n.created} / skipped ${n.reused}.`}function t3({decks:e,editingDeckId:t,onSelectDeck:n,isLoading:r}){const[o,s]=w.useState(!1),[i,a]=w.useState(""),l=Kt(),{toast:u}=qt(),{data:d}=ut({queryKey:["/api/scope/bindings"],refetchInterval:3e3}),f=w.useMemo(()=>fF((d==null?void 0:d.data)??[]),[d]),p=dt({mutationFn:async k=>Ce("POST","/api/decks",{name:k,isActive:!1}),onSuccess:async(k,S)=>{var P;const E=await k.json();l.invalidateQueries({queryKey:["/api/decks"]}),(P=E.data)!=null&&P.id&&n(E.data.id),u({title:"Deck created",description:`${S} has been created successfully.`}),s(!1),a("")},onError:k=>{u({title:"Failed to create deck",description:k.message,variant:"destructive"})}}),h=dt({mutationFn:async k=>{const S=await mP({scope:"deck",deckId:k.id});return gP(S,`${e3(k.name)}.agent-deck.json`),S},onSuccess:(k,S)=>{u({title:"Deck exported",description:`${S.name}: ${k.services.length} services, ${k.playbooks.length} playbooks`})},onError:k=>{u({title:"Export failed",description:k.message,variant:"destructive"})}}),y=(k,S)=>{k.stopPropagation(),h.mutate(S)},m=dt({mutationFn:async k=>Ce("DELETE",`/api/decks/${k}`,{}),onSuccess:()=>{l.invalidateQueries({queryKey:["/api/decks"]}),u({title:"Deck deleted",description:"Your deck has been deleted successfully."})},onError:k=>{k.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:k.message,variant:"destructive"})}}),x=async(k,S)=>{k.stopPropagation();try{await navigator.clipboard.writeText(S.id),u({title:"Copied deck id",description:"Use with bind_workspace({ workspaceRoot, deckId }) in your agent."})}catch(E){u({title:"Failed to copy deck id",description:E instanceof Error?E.message:"Unknown error",variant:"destructive"})}},g=(k,S)=>{k.stopPropagation(),window.confirm("Are you sure you want to delete this deck? This action cannot be undone.")&&m.mutate(S)},v=k=>{k.preventDefault();const S=i.trim();S&&p.mutate(S)},b=k=>{var S,E,P;return(((S=k.services)==null?void 0:S.length)??0)+(((E=k.credentials)==null?void 0:E.length)??0)+(((P=k.playbooks)==null?void 0:P.length)??0)};return r?c.jsx("div",{className:"bg-black/40 backdrop-blur-md rounded-2xl border border-white/10 p-6 shadow-2xl",children:c.jsxs("div",{className:"animate-pulse space-y-4",children:[c.jsx("div",{className:"h-6 bg-white/10 rounded"}),c.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((k,S)=>c.jsx("div",{className:"h-16 bg-white/5 rounded-lg"},S))})]})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"h-full flex flex-col","data-testid":"deck-management-panel",children:[c.jsxs("h2",{className:"text-lg font-bold mb-3 flex items-center",children:[c.jsx(Cf,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),c.jsx("span",{style:{color:"#92E4DD"},children:"My Decks"})]}),c.jsx("div",{className:"mb-3",children:c.jsxs(le,{onClick:()=>s(!0),className:"w-full border text-sm py-2",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},"data-testid":"create-deck-button",children:[c.jsx(ai,{className:"w-3 h-3 mr-2"}),"Add Deck"]})}),c.jsx("div",{className:"flex-1 overflow-y-auto",children:c.jsx("div",{className:"space-y-2",children:e.map(k=>{const S=k.id===t,E=b(k),P=f.get(k.id)??0,O=hF(E,P);return c.jsxs("div",{className:`p-2 rounded-lg border cursor-pointer transition-all relative group ${S?"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:()=>n(k.id),"data-testid":`deck-item-${k.id}`,children:[c.jsxs("div",{className:"absolute top-1 right-1 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:[c.jsx(le,{size:"sm",variant:"secondary",className:"h-5 w-5 p-0",onClick:R=>y(R,k),title:"Export this deck","data-testid":`export-deck-${k.id}`,children:c.jsx(dN,{className:"w-2 h-2"})}),c.jsx(le,{size:"sm",variant:"secondary",className:"h-5 w-5 p-0",onClick:R=>x(R,k),title:"Copy deck id for bind_workspace",children:c.jsx(e0,{className:"w-2 h-2"})}),c.jsx(le,{size:"sm",variant:"destructive",className:"h-5 w-5 p-0 bg-red-500/80 hover:bg-red-500 border-red-400",onClick:R=>g(R,k.id),title:"Delete deck",children:c.jsx(iu,{className:"w-2 h-2"})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:`font-semibold text-sm pr-16 ${S?"text-yellow-300":"text-white"}`,children:k.name}),c.jsx("p",{className:"text-xs text-gray-400 select-none pointer-events-none",children:O})]})]},k.id)})})})]}),c.jsx(Ds,{open:o,onOpenChange:s,children:c.jsxs(zo,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsx(Fo,{children:c.jsxs(Uo,{className:"flex items-center text-xl font-bold",children:[c.jsx(Cf,{className:"mr-2 h-5 w-5",style:{color:"#92E4DD"}}),"Create New Deck"]})}),c.jsxs("form",{onSubmit:v,className:"space-y-4","data-testid":"form-create-deck",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"deckName",children:"Deck Name"}),c.jsx(Je,{id:"deckName",placeholder:"e.g., Hiring stack",value:i,onChange:k=>a(k.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#A8C4C0]/60",required:!0,"data-testid":"input-deck-name"})]}),c.jsxs("div",{className:"flex gap-3 pt-2",children:[c.jsx(le,{type:"button",variant:"outline",className:"flex-1 rounded-full border-white/20 text-[#E8F6F4] hover:bg-white/10",onClick:()=>s(!1),"data-testid":"button-cancel-create",children:"Cancel"}),c.jsx(le,{type:"submit",className:"flex-1 rounded-full border px-6 text-sm font-semibold hover:opacity-90",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},disabled:p.isPending,"data-testid":"button-submit-create",children:p.isPending?"Creating…":"Create Deck"})]})]})]})})]})}function n3({open:e,onOpenChange:t}){const[n,r]=w.useState(""),[o,s]=w.useState(""),i=Kt(),{toast:a}=qt(),l=dt({mutationFn:async()=>Ce("POST","/api/credentials",{label:n.trim(),value:o}),onSuccess:()=>{i.invalidateQueries({queryKey:["/api/credentials/vault"]}),i.invalidateQueries({queryKey:["/api/decks"]}),a({title:"API key saved",description:`${n.trim()} is stored securely. Your agent can use it from the active deck.`}),t(!1),r(""),s("")},onError:d=>{a({title:"Could not save API key",description:d.message,variant:"destructive"})}}),u=n.trim().length>0&&o.trim().length>0;return c.jsx(Ds,{open:e,onOpenChange:t,children:c.jsxs(zo,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(Fo,{children:[c.jsx(Uo,{className:"text-[#E8F6F4]",children:"Register API key"}),c.jsx(zi,{className:"text-[#A8C4C0]",children:"Name the service and paste the key. Agent Deck handles the rest — stored in your vault, never shown again."})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"credential-name",className:"text-[#CFEAE6]",children:"Service name"}),c.jsx(Je,{id:"credential-name",placeholder:"OpenAI, Linear, Slack…",value:n,onChange:d=>r(d.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"credential-value",className:"text-[#CFEAE6]",children:"API key"}),c.jsx(Je,{id:"credential-value",type:"password",placeholder:"Paste key from the service dashboard",value:o,onChange:d=>s(d.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),c.jsx(le,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${Gr}`,style:Jr(Rn),onClick:()=>l.mutate(),disabled:!u||l.isPending,children:"Save to vault"})]})]})})}function r3({open:e,onOpenChange:t}){const[n,r]=w.useState(""),[o,s]=w.useState(""),[i,a]=w.useState(""),[l,u]=w.useState(""),[d,f]=w.useState(""),[p,h]=w.useState([]),[y,m]=w.useState([]),x=Kt(),{toast:g}=qt(),{data:v}=ut({queryKey:["/api/credentials/vault"],enabled:e}),{data:b}=ut({queryKey:["/api/services"],enabled:e}),k=(v==null?void 0:v.data)??[],S=(b==null?void 0:b.data)??[],E=dt({mutationFn:async()=>Ce("POST","/api/playbooks",{title:n.trim(),body:o,triggers:i.split(",").map(R=>R.trim()).filter(Boolean),dependsOnCredentialIds:p,dependsOnServiceIds:y,exec:l.trim()||void 0,skill:d.trim()||void 0,autoDetectDependencies:!0}),onSuccess:()=>{x.invalidateQueries({queryKey:["/api/playbooks/vault"]}),g({title:"Playbook saved",description:`${n.trim()} is in your collection.`}),t(!1),r(""),s(""),a(""),u(""),f(""),h([]),m([])},onError:R=>{g({title:"Could not save playbook",description:R.message,variant:"destructive"})}}),P=(R,$,j)=>{j(R.includes($)?R.filter(I=>I!==$):[...R,$])},O=n.trim().length>0&&o.trim().length>0;return c.jsx(Ds,{open:e,onOpenChange:t,children:c.jsxs(zo,{className:"sm:max-w-2xl max-h-[90vh] overflow-y-auto border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(Fo,{children:[c.jsx(Uo,{children:"Register Playbook"}),c.jsxs(zi,{className:"text-[#A8C4C0]",children:["Prefer"," ",c.jsx("span",{className:"font-mono text-xs",children:"register_playbook"})," /"," ",c.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."]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"playbook-title",children:"Title"}),c.jsx(Je,{id:"playbook-title",placeholder:"Hiring inbox, Ashby API guide…",value:n,onChange:R=>r(R.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4]"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"playbook-triggers",children:"Triggers (comma-separated, max 16)"}),c.jsx(Je,{id:"playbook-triggers",placeholder:"check inbox, review applicants",value:i,onChange:R=>a(R.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4]"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"playbook-body",children:"Instructions (markdown)"}),c.jsx(ko,{id:"playbook-body",rows:8,placeholder:`# Steps
381
- 1. …
382
- 2. …`,value:o,onChange:R=>s(R.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-sm"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{children:"Extra API key deps (optional)"}),c.jsx("p",{className:"text-xs text-gray-500",children:"Merged with auto-detected refs from content."}),c.jsx("div",{className:"max-h-28 overflow-y-auto rounded border border-white/10 p-2 space-y-1",children:k.length===0?c.jsx("p",{className:"text-xs text-gray-500",children:"No API keys registered yet."}):k.map(R=>c.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:p.includes(R.id),onChange:()=>P(p,R.id,h)}),R.label]},R.id))})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{children:"Extra MCP deps (optional)"}),c.jsx("p",{className:"text-xs text-gray-500",children:"Merged with auto-detected refs from content."}),c.jsx("div",{className:"max-h-28 overflow-y-auto rounded border border-white/10 p-2 space-y-1",children:S.length===0?c.jsx("p",{className:"text-xs text-gray-500",children:"No MCP services registered yet."}):S.map(R=>c.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:y.includes(R.id),onChange:()=>P(y,R.id,m)}),R.name]},R.id))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"playbook-exec",children:"Suggested exec (optional)"}),c.jsx(Je,{id:"playbook-exec",placeholder:"agent-deck exec --connections … -- uv run …",value:l,onChange:R=>u(R.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-xs"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"playbook-skill",children:"Skill path hint (optional)"}),c.jsx(Je,{id:"playbook-skill",placeholder:".cursor/skills/…/SKILL.md",value:d,onChange:R=>f(R.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] font-mono text-xs"})]}),c.jsx(le,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${Gr}`,style:Jr(Cr),onClick:()=>E.mutate(),disabled:!O||E.isPending,children:"Save to collection"})]})]})})}async function uu(e){const t=await e.json();if(!t.success)throw new Error(t.error??"Request failed");return t.data}function Pk(e){return e.length===0?null:e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} and ${e.length-3} more`}async function Yg(e){const t=e?`?status=${encodeURIComponent(e)}`:"",n=await Ce("GET",`/api/playbook-patches${t}`);return uu(n)}async function o3(e){const t=await Ce("GET",`/api/playbook-patches/${e}/preview`);return uu(t)}async function s3(e){const t=await Ce("POST",`/api/playbook-patches/${e}/accept`);return uu(t)}async function i3(e,t){const n=await Ce("POST",`/api/playbook-patches/${e}/reject`,{});return uu(n)}async function a3(e){const t=await Ce("GET",`/api/playbooks/${e}/events/count`);return uu(t)}async function S0(e){const t=await e.json();if(!t.success)throw new Error(t.error??"Request failed");return t.data}async function yP(e){const t=new URLSearchParams({available:"1"});e&&t.set("playbookId",e);const n=await Ce("GET",`/api/feedback-signals/count?${t.toString()}`);return(await S0(n)).open}async function l3(e){const t=new URLSearchParams;e!=null&&e.status&&t.set("status",e.status),e!=null&&e.playbookId&&t.set("playbookId",e.playbookId),e!=null&&e.deckId&&t.set("deckId",e.deckId),(e==null?void 0:e.excludeInProposal)!==void 0&&t.set("excludeInProposal",e.excludeInProposal?"true":"false");const n=t.toString()?`?${t.toString()}`:"",r=await Ce("GET",`/api/feedback-signals${n}`);return S0(r)}async function c3(e){const t=await Ce("POST","/api/feedback-signals/discard",{signalIds:e});return S0(t)}function u3(e){return!!e.linkedPatchId&&e.status==="open"}function Dd(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n")}"`}function d3(e){return e==null||e===""?"null":Dd(e)}function f3(e){return`Propose playbook updates from these Agent Deck feedback signals (copied from the Feedback table).
383
-
384
- For each coherent pattern:
385
- 1. Call \`propose_playbook_patch\` with consolidated item ops (prefer \`add_item\`) — or kind \`create\` when there is no playbook.
386
- 2. Pass **every** consumed row \`id\` in \`signal_ids\` so we can track which feedback is parked / solved.
387
- 3. Do not invent a list-feedback MCP tool. Discard noise in the dashboard.
388
-
389
- Signals (\`id\` required for tracking):
390
-
391
- \`\`\`yaml
392
- ${e.map(n=>{const r=[`- id: ${n.id}`,` playbook: ${d3(n.candidatePlaybookId)}`,` feedback: ${Dd(n.userFeedbackExcerpt)}`,` failure: ${Dd(n.failureSummary)}`];return n.correctedOutputHint&&r.push(` hint: ${Dd(n.correctedOutputHint)}`),n.candidateDeckId&&r.push(` deck: ${n.candidateDeckId}`),r.join(`
393
- `)}).join(`
394
- `)}
395
- \`\`\``}function h3({playbookId:e,open:t,onOpenChange:n}){const{data:r,isLoading:o}=ut({queryKey:e?[`/api/playbooks/${e}`]:["playbook-detail-disabled"],enabled:t&&!!e}),{data:s}=ut({queryKey:[`/api/playbooks/${e}/events/count`],queryFn:()=>a3(e),enabled:t&&!!e}),{data:i}=ut({queryKey:["/api/feedback-signals/count","available",e],queryFn:()=>yP(e),enabled:t&&!!e}),a=r==null?void 0:r.data,l=((a==null?void 0:a.dependencies.missingCredentialIds.length)??0)+((a==null?void 0:a.dependencies.missingServiceIds.length)??0);return c.jsx(Ds,{open:t,onOpenChange:n,children:c.jsxs(zo,{className:"sm:max-w-6xl max-h-[90vh] overflow-y-auto border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(Fo,{children:[c.jsx(Uo,{children:(a==null?void 0:a.title)??"Playbook"}),c.jsx(zi,{className:"text-[#A8C4C0]",children:(a==null?void 0:a.id)??e})]}),o||!a?c.jsx("p",{className:"text-sm text-gray-400",children:"Loading…"}):c.jsxs("div",{className:"space-y-4 text-sm",children:[c.jsxs("p",{className:"rounded-md border border-white/10 bg-white/5 px-3 py-2 text-[#A8C4C0]",children:["Agent corrections file as"," ",c.jsx("span",{className:"font-mono text-xs",children:"propose_playbook_patch"})," proposals — review in the queue. Direct"," ",c.jsx("span",{className:"font-mono text-xs",children:"update_playbook"})," is for explicit edits only."]}),typeof s=="number"&&c.jsxs("p",{className:"text-xs text-gray-500",children:["Fetched ",s," time",s===1?"":"s"," (undertriggering signal)",typeof i=="number"&&i>0?` · ${i} open feedback signal${i===1?"":"s"}`:null]}),typeof s!="number"&&typeof i=="number"&&i>0&&c.jsxs("p",{className:"text-xs text-gray-500",children:[i," open feedback signal",i===1?"":"s"]}),a.triggers.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Triggers"}),c.jsx("p",{className:"text-gray-300",children:a.triggers.join(", ")})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Dependencies"}),a.dependencies.credentials.length===0&&a.dependencies.services.length===0&&l===0?c.jsx("p",{className:"text-gray-400",children:"None declared."}):c.jsxs("ul",{className:"space-y-1 text-gray-300",children:[a.dependencies.credentials.map(u=>c.jsxs("li",{children:["API key: ",u.label]},u.id)),a.dependencies.services.map(u=>c.jsxs("li",{children:["MCP: ",u.label]},u.id)),a.dependencies.missingCredentialIds.map(u=>c.jsxs("li",{className:"text-amber-300 flex items-center gap-1",children:[c.jsx(cr,{className:"w-3 h-3"})," Missing API key: ",u]},u)),a.dependencies.missingServiceIds.map(u=>c.jsxs("li",{className:"text-amber-300 flex items-center gap-1",children:[c.jsx(cr,{className:"w-3 h-3"})," Missing MCP: ",u]},u))]})]}),a.exec&&c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Suggested exec"}),c.jsx("pre",{className:"rounded bg-black/40 p-2 text-xs overflow-x-auto",children:a.exec})]}),a.skill&&c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Skill hint"}),c.jsx("p",{className:"font-mono text-xs text-gray-300",children:a.skill})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-amber-200 mb-1",children:"Instructions"}),c.jsx("div",{className:"rounded bg-black/30 p-3 whitespace-pre-wrap text-gray-200",children:a.body})]})]})]})})}function p3({credentialId:e,open:t,onOpenChange:n}){const r=Kt(),{toast:o}=qt(),[s,i]=w.useState(""),[a,l]=w.useState(""),[u,d]=w.useState(""),{data:f,isLoading:p}=ut({queryKey:e?[`/api/credentials/${e}`]:["credential-detail-disabled"],enabled:t&&!!e}),h=f==null?void 0:f.data;w.useEffect(()=>{h&&(i(h.label),l(h.docsUrl??""),d(""))},[h==null?void 0:h.id,h==null?void 0:h.label,h==null?void 0:h.docsUrl]);const y=dt({mutationFn:async()=>{if(!e)throw new Error("No credential selected");const x=s.trim();if(!x)throw new Error("Name is required");const g=a.trim();if(g)try{new URL(g)}catch{throw new Error("Documentation link must be a valid URL")}await Ce("PUT",`/api/credentials/${e}`,{label:x,docsUrl:g}),u.trim()&&await Ce("POST",`/api/credentials/${e}/rotate`,{value:u.trim()})},onSuccess:()=>{r.invalidateQueries({queryKey:["/api/credentials/vault"]}),e&&r.invalidateQueries({queryKey:[`/api/credentials/${e}`]}),r.invalidateQueries({queryKey:["/api/collection/warnings"]}),r.invalidateQueries({queryKey:["/api/decks"]}),o({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(""),n(!1)},onError:x=>{o({title:"Could not save API key",description:x.message,variant:"destructive"})}}),m=s.trim().length>0&&(s.trim()!==(h==null?void 0:h.label)||a.trim()!==((h==null?void 0:h.docsUrl)??"")||u.trim().length>0);return c.jsx(Ds,{open:t,onOpenChange:n,children:c.jsxs(zo,{className:"sm:max-w-md border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(Fo,{children:[c.jsx(Uo,{className:"text-[#E8F6F4]",children:(h==null?void 0:h.label)??"API key"}),c.jsx(zi,{className:"font-mono text-xs text-[#A8C4C0]",children:(h==null?void 0:h.id)??e})]}),p||!h?c.jsx("p",{className:"text-sm text-gray-400",children:"Loading…"}):c.jsxs("div",{className:"space-y-4",children:[!h.hasSecret&&c.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:[c.jsx(cr,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.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."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"credential-detail-name",className:"text-[#CFEAE6]",children:"Name"}),c.jsx(Je,{id:"credential-detail-name",value:s,onChange:x=>i(x.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"credential-detail-key",className:"text-[#CFEAE6]",children:h.hasSecret?"Rotate API key":"API key"}),c.jsx(Je,{id:"credential-detail-key",type:"password",placeholder:h.hasSecret?"Leave blank to keep current key":"Paste key from the service dashboard",value:u,onChange:x=>d(x.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"}),h.hasSecret&&c.jsx("p",{className:"text-xs text-[#6B8581]",children:"Stored securely in Keychain. Enter a new value only when rotating."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"credential-detail-docs",className:"text-[#CFEAE6]",children:"Documentation link"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Je,{id:"credential-detail-docs",type:"url",placeholder:"https://…",value:a,onChange:x=>l(x.target.value),className:"border-white/15 bg-[#0F0F0C] text-[#E8F6F4] placeholder:text-[#6B8581]"}),a.trim()&&c.jsx(le,{type:"button",variant:"outline",size:"icon",className:"shrink-0 border-white/15 bg-[#0F0F0C] text-[#A8C4C0] hover:bg-white/5",onClick:()=>window.open(a.trim(),"_blank","noopener,noreferrer"),title:"Open documentation",children:c.jsx(Co,{className:"h-4 w-4"})})]})]}),c.jsx(le,{variant:"ghost",className:`w-full border-2 hover:opacity-90 ${Gr}`,style:Jr(Rn),onClick:()=>y.mutate(),disabled:!m||y.isPending,children:y.isPending?"Saving…":"Save changes"})]})]})})}const m3=Ch("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 Yt({className:e,variant:t,...n}){return c.jsx("div",{className:$e(m3({variant:t}),e),...n})}function Tk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function g3(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Tk(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Tk(e[o],null)}}}}function C0(...e){return w.useCallback(g3(...e),e)}function y3(e,t=[]){let n=[];function r(s,i){const a=w.createContext(i);a.displayName=s+"Context";const l=n.length;n=[...n,i];const u=f=>{var g;const{scope:p,children:h,...y}=f,m=((g=p==null?void 0:p[e])==null?void 0:g[l])||a,x=w.useMemo(()=>y,Object.values(y));return c.jsx(m.Provider,{value:x,children:h})};u.displayName=s+"Provider";function d(f,p,h={}){var g;const{optional:y=!1}=h,m=((g=p==null?void 0:p[e])==null?void 0:g[l])||a,x=w.useContext(m);if(x)return x;if(i!==void 0)return i;if(!y)throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,d]}const o=()=>{const s=n.map(i=>w.createContext(i));return function(a){const l=(a==null?void 0:a[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,v3(o,...t)]}function v3(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...a,...f}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function $k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)}}var Af=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},x3=Yc[" useInsertionEffect ".trim().toString()]||Af;function w3({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=b3({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const d=w.useRef(e!==void 0);w.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"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=a},[a,r])}const u=w.useCallback(d=>{var f;if(a){const p=k3(d)?d(e):d;p!==e&&((f=i.current)==null||f.call(i,p))}else s(d)},[a,e,s,i]);return[l,u]}function b3({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),o=w.useRef(n),s=w.useRef(t);return x3(()=>{s.current=t},[t]),w.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}function k3(e){return typeof e=="function"}function _3(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function S3(e){const[t,n]=w.useState(void 0);return Af(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;i=u.inlineSize,a=u.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function C3(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var vP=e=>{const{present:t,children:n}=e,r=E3(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=N3(r.ref,j3(o));return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:s}):null};vP.displayName="Presence";function E3(e){const[t,n]=w.useState(),r=w.useRef(null),o=w.useRef(e),s=w.useRef("none"),i=w.useRef(void 0),a=e?"mounted":"unmounted",[l,u]=C3(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{l==="mounted"?(s.current=i.current??Al(r.current),i.current=void 0):s.current="none"},[l]),Af(()=>{const d=r.current,f=o.current;if(f!==e){const h=s.current,y=Al(d);e?(i.current=y,u("MOUNT")):y==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&h!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Af(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=y=>{const x=Al(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&x&&(u("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=y=>{y.target===t&&(s.current=Al(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(d=>{if(d){const f=getComputedStyle(d);r.current=f,i.current=Al(f)}else r.current=null;n(d)},[])}}function Rk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function N3(...e){const t=w.useRef(e);return t.current=e,w.useCallback(n=>{const r=t.current;let o=!1;const s=r.map(i=>{const a=Rk(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():Rk(r[i],null)}}},[])}function Al(e){return(e==null?void 0:e.animationName)||"none"}function j3(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function P3(e){const t=w.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const l=[];Ik(o)&&typeof td=="function"&&(o=td(o._payload)),w.Children.forEach(o,p=>{var h;if(A3(p)){a=!0;const y=p;let m="child"in y.props?y.props.child:y.props.children;Ik(m)&&typeof td=="function"&&(m=td(m._payload)),i=$3(y,m),l.push((h=i==null?void 0:i.props)==null?void 0:h.children)}else l.push(p)}),i?i=w.cloneElement(i,void 0,l):!a&&w.Children.count(o)===1&&w.isValidElement(o)&&(i=o);const u=i?I3(i):void 0,d=C0(r,u);if(!i){if(o||o===0)throw new Error(a?L3(e):D3(e));return o}const f=R3(s,i.props??{});return i.type!==w.Fragment&&(f.ref=r?d:u),w.cloneElement(i,f)});return t.displayName=`${e}.Slot`,t}var T3=Symbol.for("radix.slottable"),$3=(e,t)=>{if("child"in e.props){const n=e.props.child;return w.isValidElement(n)?w.cloneElement(n,void 0,e.props.children(n.props.children)):null}return w.isValidElement(t)?t:null};function R3(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function I3(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function A3(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===T3}var O3=Symbol.for("react.lazy");function Ik(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===O3&&"_payload"in e&&M3(e._payload)}function M3(e){return typeof e=="object"&&e!==null&&"then"in e}var D3=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,L3=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,td=Yc[" use ".trim().toString()],z3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],E0=z3.reduce((e,t)=>{const n=P3(`Primitive.${t}`),r=w.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Fh="Checkbox",[F3,cte]=y3(Fh),[U3,N0]=F3(Fh);function q3(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:s,form:i,name:a,onCheckedChange:l,required:u,value:d="on",internal_do_not_use_render:f}=e,[p,h]=w3({prop:n,defaultProp:o??!1,onChange:l,caller:Fh}),[y,m]=w.useState(null),[x,g]=w.useState(null),v=w.useRef(!1),b=y?!!i||!!y.closest("form"):!0,k={checked:p,disabled:s,setChecked:h,control:y,setControl:m,name:a,form:i,value:d,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:Es(o)?!1:o,isFormControl:b,bubbleInput:x,setBubbleInput:g};return c.jsx(U3,{scope:t,...k,children:V3(f)?f(k):r})}var xP="CheckboxTrigger",wP=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:s,value:i,disabled:a,checked:l,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:y}=N0(xP,e),m=C0(o,d),x=w.useRef(l);return w.useEffect(()=>{const g=s==null?void 0:s.form;if(g){const v=()=>f(x.current);return g.addEventListener("reset",v),()=>g.removeEventListener("reset",v)}},[s,f]),c.jsx(E0.button,{type:"button",role:"checkbox","aria-checked":Es(l)?"mixed":l,"aria-required":u,"data-state":CP(l),"data-disabled":a?"":void 0,disabled:a,value:i,...r,ref:m,onKeyDown:$k(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:$k(n,g=>{f(v=>Es(v)?!0:!v),y&&h&&(p.current=g.isPropagationStopped(),p.current||g.stopPropagation())})})});wP.displayName=xP;var j0=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:a,value:l,onCheckedChange:u,form:d,...f}=e;return c.jsx(q3,{__scopeCheckbox:n,checked:o,defaultChecked:s,disabled:a,required:i,onCheckedChange:u,name:r,form:d,value:l,internal_do_not_use_render:({isFormControl:p})=>c.jsxs(c.Fragment,{children:[c.jsx(wP,{...f,ref:t,__scopeCheckbox:n}),p&&c.jsx(SP,{__scopeCheckbox:n})]})})});j0.displayName=Fh;var bP="CheckboxIndicator",kP=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=N0(bP,n);return c.jsx(vP,{present:r||Es(s.checked)||s.checked===!0,children:c.jsx(E0.span,{"data-state":CP(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});kP.displayName=bP;var _P="CheckboxBubbleInput",SP=w.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:s,defaultChecked:i,required:a,disabled:l,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:h}=N0(_P,e),y=C0(n,h),m=_3(s),x=S3(r);w.useEffect(()=>{const v=p;if(!v)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set,E=!o.current;if(m!==s&&S){const P=new Event("click",{bubbles:E});v.indeterminate=Es(s),S.call(v,Es(s)?!1:s),v.dispatchEvent(P)}},[p,m,s,o]);const g=w.useRef(Es(s)?!1:s);return c.jsx(E0.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??g.current,required:a,disabled:l,name:u,value:d,form:f,...t,tabIndex:-1,ref:y,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});SP.displayName=_P;function V3(e){return typeof e=="function"}function Es(e){return e==="indeterminate"}function CP(e){return Es(e)?"indeterminate":e?"checked":"unchecked"}const Of=w.forwardRef(({className:e,...t},n)=>c.jsx(j0,{ref:n,className:$e("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",e),...t,children:c.jsx(kP,{className:$e("flex items-center justify-center text-current"),children:c.jsx(aN,{className:"h-4 w-4"})})}));Of.displayName=j0.displayName;const EP=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:n,className:$e("w-full caption-bottom text-sm",e),...t})}));EP.displayName="Table";const NP=w.forwardRef(({className:e,...t},n)=>c.jsx("thead",{ref:n,className:$e("[&_tr]:border-b",e),...t}));NP.displayName="TableHeader";const jP=w.forwardRef(({className:e,...t},n)=>c.jsx("tbody",{ref:n,className:$e("[&_tr:last-child]:border-0",e),...t}));jP.displayName="TableBody";const H3=w.forwardRef(({className:e,...t},n)=>c.jsx("tfoot",{ref:n,className:$e("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));H3.displayName="TableFooter";const Gi=w.forwardRef(({className:e,...t},n)=>c.jsx("tr",{ref:n,className:$e("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Gi.displayName="TableRow";const Ld=w.forwardRef(({className:e,...t},n)=>c.jsx("th",{ref:n,className:$e("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Ld.displayName="TableHead";const Qs=w.forwardRef(({className:e,...t},n)=>c.jsx("td",{ref:n,className:$e("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Qs.displayName="TableCell";const B3=w.forwardRef(({className:e,...t},n)=>c.jsx("caption",{ref:n,className:$e("mt-4 text-sm text-muted-foreground",e),...t}));B3.displayName="TableCaption";function W3(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const K3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Z3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Q3={};function Ak(e,t){return(Q3.jsx?Z3:K3).test(e)}const G3=/[ \t\n\f\r]/g;function J3(e){return typeof e=="object"?e.type==="text"?Ok(e.value):!1:Ok(e)}function Ok(e){return e.replace(G3,"")===""}class du{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}du.prototype.normal={};du.prototype.property={};du.prototype.space=void 0;function PP(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new du(n,r,t)}function Xg(e){return e.toLowerCase()}class Fn{constructor(t,n){this.attribute=n,this.property=t}}Fn.prototype.attribute="";Fn.prototype.booleanish=!1;Fn.prototype.boolean=!1;Fn.prototype.commaOrSpaceSeparated=!1;Fn.prototype.commaSeparated=!1;Fn.prototype.defined=!1;Fn.prototype.mustUseProperty=!1;Fn.prototype.number=!1;Fn.prototype.overloadedBoolean=!1;Fn.prototype.property="";Fn.prototype.spaceSeparated=!1;Fn.prototype.space=void 0;let Y3=0;const Re=Fi(),It=Fi(),ey=Fi(),se=Fi(),et=Fi(),xi=Fi(),Vn=Fi();function Fi(){return 2**++Y3}const ty=Object.freeze(Object.defineProperty({__proto__:null,boolean:Re,booleanish:It,commaOrSpaceSeparated:Vn,commaSeparated:xi,number:se,overloadedBoolean:ey,spaceSeparated:et},Symbol.toStringTag,{value:"Module"})),em=Object.keys(ty);class P0 extends Fn{constructor(t,n,r,o){let s=-1;if(super(t,n),Mk(this,"space",o),typeof r=="number")for(;++s<em.length;){const i=em[s];Mk(this,em[s],(r&ty[i])===ty[i])}}}P0.prototype.defined=!0;function Mk(e,t,n){n&&(e[t]=n)}function yl(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const s=new P0(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Xg(r)]=r,n[Xg(s.attribute)]=r}return new du(t,n,e.space)}const TP=yl({properties:{ariaActiveDescendant:null,ariaAtomic:It,ariaAutoComplete:null,ariaBusy:It,ariaChecked:It,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,ariaControls:et,ariaCurrent:null,ariaDescribedBy:et,ariaDetails:null,ariaDisabled:It,ariaDropEffect:et,ariaErrorMessage:null,ariaExpanded:It,ariaFlowTo:et,ariaGrabbed:It,ariaHasPopup:null,ariaHidden:It,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:et,ariaLevel:se,ariaLive:null,ariaModal:It,ariaMultiLine:It,ariaMultiSelectable:It,ariaOrientation:null,ariaOwns:et,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:It,ariaReadOnly:It,ariaRelevant:null,ariaRequired:It,ariaRoleDescription:et,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:It,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $P(e,t){return t in e?e[t]:t}function RP(e,t){return $P(e,t.toLowerCase())}const X3=yl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xi,acceptCharset:et,accessKey:et,action:null,allow:null,allowFullScreen:Re,allowPaymentRequest:Re,allowUserMedia:Re,alpha:Re,alt:null,as:null,async:Re,autoCapitalize:null,autoComplete:et,autoFocus:Re,autoPlay:Re,blocking:et,capture:null,charSet:null,checked:Re,cite:null,className:et,closedBy:null,colorSpace:null,cols:se,colSpan:se,command:null,commandFor:null,content:null,contentEditable:It,controls:Re,controlsList:et,coords:se|xi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Re,defer:Re,dir:null,dirName:null,disabled:Re,download:ey,draggable:It,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Re,formTarget:null,headers:et,height:se,hidden:ey,high:se,href:null,hrefLang:null,htmlFor:et,httpEquiv:et,id:null,imageSizes:null,imageSrcSet:null,inert:Re,inputMode:null,integrity:null,is:null,isMap:Re,itemId:null,itemProp:et,itemRef:et,itemScope:Re,itemType:et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Re,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:Re,muted:Re,name:null,nonce:null,noModule:Re,noValidate:Re,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Re,optimum:se,pattern:null,ping:et,placeholder:null,playsInline:Re,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Re,referrerPolicy:null,rel:et,required:Re,reversed:Re,rows:se,rowSpan:se,sandbox:et,scope:null,scoped:Re,seamless:Re,selected:Re,shadowRootClonable:Re,shadowRootCustomElementRegistry:Re,shadowRootDelegatesFocus:Re,shadowRootMode:null,shadowRootSerializable:Re,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:It,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:Re,useMap:null,value:It,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:et,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Re,declare:Re,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:Re,noHref:Re,noShade:Re,noWrap:Re,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:It,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Re,disablePictureInPicture:Re,disableRemotePlayback:Re,exportParts:xi,part:et,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:RP}),e5=yl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Vn,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,className:et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:Re,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xi,g2:xi,glyphName:xi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:Vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:se,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vn,rev:Vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vn,requiredFeatures:Vn,requiredFonts:Vn,requiredFormats:Vn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:Vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Vn,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$P}),IP=yl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),AP=yl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:RP}),OP=yl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),t5={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},n5=/[A-Z]/g,Dk=/-[a-z]/g,r5=/^data[-\w.:]+$/i;function o5(e,t){const n=Xg(t);let r=t,o=Fn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&r5.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Dk,i5);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Dk.test(s)){let i=s.replace(n5,s5);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}o=P0}return new o(r,t)}function s5(e){return"-"+e.toLowerCase()}function i5(e){return e.charAt(1).toUpperCase()}const a5=PP([TP,X3,IP,AP,OP],"html"),T0=PP([TP,e5,IP,AP,OP],"svg");function l5(e){return e.join(" ").trim()}var $0={},Lk=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,c5=/\n/g,u5=/^\s*/,d5=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,f5=/^:\s*/,h5=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,p5=/^[;\s]*/,m5=/^\s+|\s+$/g,g5=`
396
- `,zk="/",Fk="*",Xs="",y5="comment",v5="declaration";function x5(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(y){var m=y.match(c5);m&&(n+=m.length);var x=y.lastIndexOf(g5);r=~x?y.length-x:r+y.length}function s(){var y={line:n,column:r};return function(m){return m.position=new i(y),u(),m}}function i(y){this.start=y,this.end={line:n,column:r},this.source=t.source}i.prototype.content=e;function a(y){var m=new Error(t.source+":"+n+":"+r+": "+y);if(m.reason=y,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function l(y){var m=y.exec(e);if(m){var x=m[0];return o(x),e=e.slice(x.length),m}}function u(){l(u5)}function d(y){var m;for(y=y||[];m=f();)m!==!1&&y.push(m);return y}function f(){var y=s();if(!(zk!=e.charAt(0)||Fk!=e.charAt(1))){for(var m=2;Xs!=e.charAt(m)&&(Fk!=e.charAt(m)||zk!=e.charAt(m+1));)++m;if(m+=2,Xs===e.charAt(m-1))return a("End of comment missing");var x=e.slice(2,m-2);return r+=2,o(x),e=e.slice(m),r+=2,y({type:y5,comment:x})}}function p(){var y=s(),m=l(d5);if(m){if(f(),!l(f5))return a("property missing ':'");var x=l(h5),g=y({type:v5,property:Uk(m[0].replace(Lk,Xs)),value:x?Uk(x[0].replace(Lk,Xs)):Xs});return l(p5),g}}function h(){var y=[];d(y);for(var m;m=p();)m!==!1&&(y.push(m),d(y));return y}return u(),h()}function Uk(e){return e?e.replace(m5,Xs):Xs}var w5=x5,b5=Jd&&Jd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty($0,"__esModule",{value:!0});$0.default=_5;const k5=b5(w5);function _5(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,k5.default)(e),o=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:i,value:a}=s;o?t(i,a,s):a&&(n=n||{},n[i]=a)}),n}var Uh={};Object.defineProperty(Uh,"__esModule",{value:!0});Uh.camelCase=void 0;var S5=/^--[a-zA-Z0-9_-]+$/,C5=/-([a-z])/g,E5=/^[^-]+$/,N5=/^-(webkit|moz|ms|o|khtml)-/,j5=/^-(ms)-/,P5=function(e){return!e||E5.test(e)||S5.test(e)},T5=function(e,t){return t.toUpperCase()},qk=function(e,t){return"".concat(t,"-")},$5=function(e,t){return t===void 0&&(t={}),P5(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(j5,qk):e=e.replace(N5,qk),e.replace(C5,T5))};Uh.camelCase=$5;var R5=Jd&&Jd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},I5=R5($0),A5=Uh;function ny(e,t){var n={};return!e||typeof e!="string"||(0,I5.default)(e,function(r,o){r&&o&&(n[(0,A5.camelCase)(r,t)]=o)}),n}ny.default=ny;var O5=ny;const M5=al(O5),MP=DP("end"),R0=DP("start");function DP(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function D5(e){const t=R0(e),n=MP(e);if(t&&n)return{start:t,end:n}}function cc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vk(e.position):"start"in e||"end"in e?Vk(e):"line"in e||"column"in e?ry(e):""}function ry(e){return Hk(e&&e.line)+":"+Hk(e&&e.column)}function Vk(e){return ry(e&&e.start)+"-"+ry(e&&e.end)}function Hk(e){return e&&typeof e=="number"?e:1}class mn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",s={},i=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?o=t:!s.cause&&t&&(i=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=a?a.line:void 0,this.name=cc(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=i&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}mn.prototype.file="";mn.prototype.name="";mn.prototype.reason="";mn.prototype.message="";mn.prototype.stack="";mn.prototype.column=void 0;mn.prototype.line=void 0;mn.prototype.ancestors=void 0;mn.prototype.cause=void 0;mn.prototype.fatal=void 0;mn.prototype.place=void 0;mn.prototype.ruleId=void 0;mn.prototype.source=void 0;const I0={}.hasOwnProperty,L5=new Map,z5=/[A-Z]/g,F5=new Set(["table","tbody","thead","tfoot","tr"]),U5=new Set(["td","th"]),LP="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function q5(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=G5(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Q5(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?T0:a5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=zP(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function zP(e,t,n){if(t.type==="element")return V5(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return H5(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return W5(e,t,n);if(t.type==="mdxjsEsm")return B5(e,t);if(t.type==="root")return K5(e,t,n);if(t.type==="text")return Z5(e,t)}function V5(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=T0,e.schema=o),e.ancestors.push(t);const s=UP(e,t.tagName,!1),i=J5(e,t);let a=O0(e,t);return F5.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!J3(l):!0})),FP(e,i,s,t),A0(i,a),e.ancestors.pop(),e.schema=r,e.create(t,s,i,n)}function H5(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Uc(e,t.position)}function B5(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Uc(e,t.position)}function W5(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=T0,e.schema=o),e.ancestors.push(t);const s=t.name===null?e.Fragment:UP(e,t.name,!0),i=Y5(e,t),a=O0(e,t);return FP(e,i,s,t),A0(i,a),e.ancestors.pop(),e.schema=r,e.create(t,s,i,n)}function K5(e,t,n){const r={};return A0(r,O0(e,t)),e.create(t,e.Fragment,r,n)}function Z5(e,t){return t.value}function FP(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function A0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Q5(e,t,n){return r;function r(o,s,i,a){const u=Array.isArray(i.children)?n:t;return a?u(s,i,a):u(s,i)}}function G5(e,t){return n;function n(r,o,s,i){const a=Array.isArray(s.children),l=R0(r);return t(o,s,i,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function J5(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&I0.call(t.properties,o)){const s=X5(e,o,t.properties[o]);if(s){const[i,a]=s;e.tableCellAlignToStyle&&i==="align"&&typeof a=="string"&&U5.has(t.tagName)?r=a:n[i]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Y5(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const i=s.expression;i.type;const a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Uc(e,t.position);else{const o=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Uc(e,t.position);else s=r.value===null?!0:r.value;n[o]=s}return n}function O0(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:L5;for(;++r<t.children.length;){const s=t.children[r];let i;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=o.get(l)||0;i=l+"-"+u,o.set(l,u+1)}}const a=zP(e,s,i);a!==void 0&&n.push(a)}return n}function X5(e,t,n){const r=o5(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?W3(n):l5(n)),r.property==="style"){let o=typeof n=="object"?n:eU(e,String(n));return e.stylePropertyNameCase==="css"&&(o=tU(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?t5[r.property]||r.property:r.attribute,n]}}function eU(e,t){try{return M5(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=LP+"#cannot-parse-style-attribute",o}}function UP(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let s=-1,i;for(;++s<o.length;){const a=Ak(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};i=i?{type:"MemberExpression",object:i,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=i}else r=Ak(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return I0.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Uc(e)}function Uc(e,t){const n=new mn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=LP+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tU(e){const t={};let n;for(n in e)I0.call(e,n)&&(t[nU(n)]=e[n]);return t}function nU(e){let t=e.replace(z5,rU);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function rU(e){return"-"+e.toLowerCase()}const tm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},oU={};function M0(e,t){const n=oU,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return qP(e,r,o)}function qP(e,t,n){if(sU(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Bk(e.children,t,n)}return Array.isArray(e)?Bk(e,t,n):""}function Bk(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=qP(e[o],t,n);return r.join("")}function sU(e){return!!(e&&typeof e=="object")}const Wk=document.createElement("i");function D0(e){const t="&"+e+";";Wk.innerHTML=t;const n=Wk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Gn(e,t,n,r){const o=e.length;let s=0,i;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);s<r.length;)i=r.slice(s,s+1e4),i.unshift(t,0),e.splice(...i),s+=1e4,t+=1e4}function ur(e,t){return e.length>0?(Gn(e,e.length,0,t),e):t}const Kk={}.hasOwnProperty;function VP(e){const t={};let n=-1;for(;++n<e.length;)iU(t,e[n]);return t}function iU(e,t){let n;for(n in t){const o=(Kk.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let i;if(s)for(i in s){Kk.call(o,i)||(o[i]=[]);const a=s[i];aU(o[i],Array.isArray(a)?a:a?[a]:[])}}}function aU(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Gn(e,0,0,r)}function HP(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ar(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const _n=Ls(/[A-Za-z]/),hn=Ls(/[\dA-Za-z]/),lU=Ls(/[#-'*+\--9=?A-Z^-~]/);function Mf(e){return e!==null&&(e<32||e===127)}const oy=Ls(/\d/),cU=Ls(/[\dA-Fa-f]/),uU=Ls(/[!-/:-@[-`{-~]/);function Ee(e){return e!==null&&e<-2}function nt(e){return e!==null&&(e<0||e===32)}function qe(e){return e===-2||e===-1||e===32}const qh=Ls(new RegExp("\\p{P}|\\p{S}","u")),$i=Ls(/\s/);function Ls(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function vl(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const s=e.charCodeAt(n);let i="";if(s===37&&hn(e.charCodeAt(n+1))&&hn(e.charCodeAt(n+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(i=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(i=String.fromCharCode(s,a),o=1):i="�"}else i=String.fromCharCode(s);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function Ke(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let s=0;return i;function i(l){return qe(l)?(e.enter(n),a(l)):t(l)}function a(l){return qe(l)&&s++<o?(e.consume(l),a):(e.exit(n),t(l))}}const dU={tokenize:fU};function fU(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ke(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,i(a)}function i(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Ee(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),i)}}const hU={tokenize:pU},Zk={tokenize:mU};function pU(e){const t=this,n=[];let r=0,o,s,i;return a;function a(b){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,l,u)(b)}return u(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&v();const k=t.events.length;let S=k,E;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){E=t.events[S][1].end;break}g(r);let P=k;for(;P<t.events.length;)t.events[P][1].end={...E},P++;return Gn(t.events,S+1,0,t.events.slice(k)),t.events.length=P,u(b)}return a(b)}function u(b){if(r===n.length){if(!o)return p(b);if(o.currentConstruct&&o.currentConstruct.concrete)return y(b);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zk,d,f)(b)}function d(b){return o&&v(),g(r),p(b)}function f(b){return t.parser.lazy[t.now().line]=r!==n.length,i=t.now().offset,y(b)}function p(b){return t.containerState={},e.attempt(Zk,h,y)(b)}function h(b){return r++,n.push([t.currentConstruct,t.containerState]),p(b)}function y(b){if(b===null){o&&v(),g(0),e.consume(b);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),m(b)}function m(b){if(b===null){x(e.exit("chunkFlow"),!0),g(0),e.consume(b);return}return Ee(b)?(e.consume(b),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),m)}function x(b,k){const S=t.sliceStream(b);if(k&&S.push(null),b.previous=s,s&&(s.next=b),s=b,o.defineSkip(b.start),o.write(S),t.parser.lazy[b.start.line]){let E=o.events.length;for(;E--;)if(o.events[E][1].start.offset<i&&(!o.events[E][1].end||o.events[E][1].end.offset>i))return;const P=t.events.length;let O=P,R,$;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(R){$=t.events[O][1].end;break}R=!0}for(g(r),E=P;E<t.events.length;)t.events[E][1].end={...$},E++;Gn(t.events,O+1,0,t.events.slice(P)),t.events.length=E}}function g(b){let k=n.length;for(;k-- >b;){const S=n[k];t.containerState=S[1],S[0].exit.call(t,e)}n.length=b}function v(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function mU(e,t,n){return Ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rl(e){if(e===null||nt(e)||$i(e))return 1;if(qh(e))return 2}function Vh(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const sy={name:"attention",resolveAll:gU,tokenize:yU};function gU(e,t){let n=-1,r,o,s,i,a,l,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[n][1].start};Qk(f,-l),Qk(p,l),i={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[r][1].end={...i.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ur(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ur(u,[["enter",o,t],["enter",i,t],["exit",i,t],["enter",s,t]]),u=ur(u,Vh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ur(u,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=ur(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Gn(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yU(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=rl(r);let s;return i;function i(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const u=e.exit("attentionSequence"),d=rl(l),f=!d||d===2&&o||n.includes(l),p=!o||o===2&&d||n.includes(r);return u._open=!!(s===42?f:f&&(o||!p)),u._close=!!(s===42?p:p&&(d||!f)),t(l)}}function Qk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const vU={name:"autolink",tokenize:xU};function xU(e,t,n){let r=0;return o;function o(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(h){return _n(h)?(e.consume(h),i):h===64?n(h):u(h)}function i(h){return h===43||h===45||h===46||hn(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||hn(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Mf(h)?n(h):(e.consume(h),l)}function u(h){return h===64?(e.consume(h),d):lU(h)?(e.consume(h),u):n(h)}function d(h){return hn(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,d):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||hn(h))&&r++<63){const y=h===45?p:f;return e.consume(h),y}return n(h)}}const fu={partial:!0,tokenize:wU};function wU(e,t,n){return r;function r(s){return qe(s)?Ke(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Ee(s)?t(s):n(s)}}const BP={continuation:{tokenize:kU},exit:_U,name:"blockQuote",tokenize:bU};function bU(e,t,n){const r=this;return o;function o(i){if(i===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),s}return n(i)}function s(i){return qe(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(i))}}function kU(e,t,n){const r=this;return o;function o(i){return qe(i)?Ke(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):s(i)}function s(i){return e.attempt(BP,t,n)(i)}}function _U(e){e.exit("blockQuote")}const WP={name:"characterEscape",tokenize:SU};function SU(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return uU(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const KP={name:"characterReference",tokenize:CU};function CU(e,t,n){const r=this;let o=0,s,i;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,i=hn,d(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,i=cU,d):(e.enter("characterReferenceValue"),s=7,i=oy,d(f))}function d(f){if(f===59&&o){const p=e.exit("characterReferenceValue");return i===hn&&!D0(r.sliceSerialize(p))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return i(f)&&o++<s?(e.consume(f),d):n(f)}}const Gk={partial:!0,tokenize:NU},Jk={concrete:!0,name:"codeFenced",tokenize:EU};function EU(e,t,n){const r=this,o={partial:!0,tokenize:S};let s=0,i=0,a;return l;function l(E){return u(E)}function u(E){const P=r.events[r.events.length-1];return s=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(E)}function d(E){return E===a?(i++,e.consume(E),d):i<3?n(E):(e.exit("codeFencedFenceSequence"),qe(E)?Ke(e,f,"whitespace")(E):f(E))}function f(E){return E===null||Ee(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Gk,m,k)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||Ee(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(E)):qe(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ke(e,h,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),p)}function h(E){return E===null||Ee(E)?f(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),y(E))}function y(E){return E===null||Ee(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(E)):E===96&&E===a?n(E):(e.consume(E),y)}function m(E){return e.attempt(o,k,x)(E)}function x(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),g}function g(E){return s>0&&qe(E)?Ke(e,v,"linePrefix",s+1)(E):v(E)}function v(E){return E===null||Ee(E)?e.check(Gk,m,k)(E):(e.enter("codeFlowValue"),b(E))}function b(E){return E===null||Ee(E)?(e.exit("codeFlowValue"),v(E)):(e.consume(E),b)}function k(E){return e.exit("codeFenced"),t(E)}function S(E,P,O){let R=0;return $;function $(T){return E.enter("lineEnding"),E.consume(T),E.exit("lineEnding"),j}function j(T){return E.enter("codeFencedFence"),qe(T)?Ke(E,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):I(T)}function I(T){return T===a?(E.enter("codeFencedFenceSequence"),D(T)):O(T)}function D(T){return T===a?(R++,E.consume(T),D):R>=i?(E.exit("codeFencedFenceSequence"),qe(T)?Ke(E,L,"whitespace")(T):L(T)):O(T)}function L(T){return T===null||Ee(T)?(E.exit("codeFencedFence"),P(T)):O(T)}}}function NU(e,t,n){const r=this;return o;function o(i){return i===null?n(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s)}function s(i){return r.parser.lazy[r.now().line]?n(i):t(i)}}const nm={name:"codeIndented",tokenize:PU},jU={partial:!0,tokenize:TU};function PU(e,t,n){const r=this;return o;function o(u){return e.enter("codeIndented"),Ke(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?i(u):n(u)}function i(u){return u===null?l(u):Ee(u)?e.attempt(jU,i,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||Ee(u)?(e.exit("codeFlowValue"),i(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function TU(e,t,n){const r=this;return o;function o(i){return r.parser.lazy[r.now().line]?n(i):Ee(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):Ke(e,s,"linePrefix",5)(i)}function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):Ee(i)?o(i):n(i)}}const $U={name:"codeText",previous:IU,resolve:RU,tokenize:AU};function RU(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function IU(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function AU(e,t,n){let r=0,o,s;return i;function i(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(s=e.enter("codeTextSequence"),o=0,d(f)):Ee(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||Ee(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),o++,d):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",u(f))}}class OU{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Ol(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ol(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ol(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ol(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ol(this.left,n.reverse())}}}function Ol(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ZP(e){const t={};let n=-1,r,o,s,i,a,l,u;const d=new OU(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,MU(d,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,o=void 0;s--;)if(i=d.get(s),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(o&&(d.get(o)[1].type="lineEndingBlank"),i[1].type="lineEnding",o=s);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;o&&(r[1].end={...d.get(o)[1].start},a=d.slice(o,n),a.unshift(r),d.splice(o,n-o+1,a))}}return Gn(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function MU(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const s=[];let i=n._tokenizer;i||(i=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));const a=i.events,l=[],u={};let d,f,p=-1,h=n,y=0,m=0;const x=[m];for(;h;){for(;e.get(++o)[1]!==h;);s.push(o),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&i.defineSkip(h.start),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(d),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(m=p+1,x.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(i.events=[],h?(h._tokenizer=void 0,h.previous=void 0):x.pop(),p=x.length;p--;){const g=a.slice(x[p],x[p+1]),v=s.pop();l.push([v,v+g.length-1]),e.splice(v,2,g)}for(l.reverse(),p=-1;++p<l.length;)u[y+l[p][0]]=y+l[p][1],y+=l[p][1]-l[p][0]-1;return u}const DU={resolve:zU,tokenize:FU},LU={partial:!0,tokenize:UU};function zU(e){return ZP(e),e}function FU(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?s(a):Ee(a)?e.check(LU,i,s)(a):(e.consume(a),o)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function i(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function UU(e,t,n){const r=this;return o;function o(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),Ke(e,s,"linePrefix")}function s(i){if(i===null||Ee(i))return n(i);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function QP(e,t,n,r,o,s,i,a,l){const u=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(r),e.enter(o),e.enter(s),e.consume(g),e.exit(s),p):g===null||g===32||g===41||Mf(g)?n(g):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(g))}function p(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===62?(e.exit("chunkString"),e.exit(a),p(g)):g===null||g===60||Ee(g)?n(g):(e.consume(g),g===92?y:h)}function y(g){return g===60||g===62||g===92?(e.consume(g),h):h(g)}function m(g){return!d&&(g===null||g===41||nt(g))?(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(g)):d<u&&g===40?(e.consume(g),d++,m):g===41?(e.consume(g),d--,m):g===null||g===32||g===40||Mf(g)?n(g):(e.consume(g),g===92?x:m)}function x(g){return g===40||g===41||g===92?(e.consume(g),m):m(g)}}function GP(e,t,n,r,o,s){const i=this;let a=0,l;return u;function u(h){return e.enter(r),e.enter(o),e.consume(h),e.exit(o),e.enter(s),d}function d(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in i.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):Ee(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||Ee(h)||a++>999?(e.exit("chunkString"),d(h)):(e.consume(h),l||(l=!qe(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,f):f(h)}}function JP(e,t,n,r,o,s){let i;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),i=p===40?41:p,l):n(p)}function l(p){return p===i?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(s),u(p))}function u(p){return p===i?(e.exit(s),l(i)):p===null?n(p):Ee(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Ke(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===i||p===null||Ee(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:d)}function f(p){return p===i||p===92?(e.consume(p),d):d(p)}}function uc(e,t){let n;return r;function r(o){return Ee(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):qe(o)?Ke(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const qU={name:"definition",tokenize:HU},VU={partial:!0,tokenize:BU};function HU(e,t,n){const r=this;let o;return s;function s(h){return e.enter("definition"),i(h)}function i(h){return GP.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return o=Ar(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return nt(h)?uc(e,u)(h):u(h)}function u(h){return QP(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return e.attempt(VU,f,f)(h)}function f(h){return qe(h)?Ke(e,p,"whitespace")(h):p(h)}function p(h){return h===null||Ee(h)?(e.exit("definition"),r.parser.defined.push(o),t(h)):n(h)}}function BU(e,t,n){return r;function r(a){return nt(a)?uc(e,o)(a):n(a)}function o(a){return JP(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return qe(a)?Ke(e,i,"whitespace")(a):i(a)}function i(a){return a===null||Ee(a)?t(a):n(a)}}const WU={name:"hardBreakEscape",tokenize:KU};function KU(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Ee(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const ZU={name:"headingAtx",resolve:QU,tokenize:GU};function QU(e,t){let n=e.length-2,r=3,o,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Gn(e,r,n-r+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function GU(e,t,n){let r=0;return o;function o(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),i(d)}function i(d){return d===35&&r++<6?(e.consume(d),i):d===null||nt(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Ee(d)?(e.exit("atxHeading"),t(d)):qe(d)?Ke(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||nt(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}const JU=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Yk=["pre","script","style","textarea"],YU={concrete:!0,name:"htmlFlow",resolveTo:t9,tokenize:n9},XU={partial:!0,tokenize:o9},e9={partial:!0,tokenize:r9};function t9(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function n9(e,t,n){const r=this;let o,s,i,a,l;return u;function u(_){return d(_)}function d(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),f}function f(_){return _===33?(e.consume(_),p):_===47?(e.consume(_),s=!0,m):_===63?(e.consume(_),o=3,r.interrupt?t:N):_n(_)?(e.consume(_),i=String.fromCharCode(_),x):n(_)}function p(_){return _===45?(e.consume(_),o=2,h):_===91?(e.consume(_),o=5,a=0,y):_n(_)?(e.consume(_),o=4,r.interrupt?t:N):n(_)}function h(_){return _===45?(e.consume(_),r.interrupt?t:N):n(_)}function y(_){const C="CDATA[";return _===C.charCodeAt(a++)?(e.consume(_),a===C.length?r.interrupt?t:I:y):n(_)}function m(_){return _n(_)?(e.consume(_),i=String.fromCharCode(_),x):n(_)}function x(_){if(_===null||_===47||_===62||nt(_)){const C=_===47,A=i.toLowerCase();return!C&&!s&&Yk.includes(A)?(o=1,r.interrupt?t(_):I(_)):JU.includes(i.toLowerCase())?(o=6,C?(e.consume(_),g):r.interrupt?t(_):I(_)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):s?v(_):b(_))}return _===45||hn(_)?(e.consume(_),i+=String.fromCharCode(_),x):n(_)}function g(_){return _===62?(e.consume(_),r.interrupt?t:I):n(_)}function v(_){return qe(_)?(e.consume(_),v):$(_)}function b(_){return _===47?(e.consume(_),$):_===58||_===95||_n(_)?(e.consume(_),k):qe(_)?(e.consume(_),b):$(_)}function k(_){return _===45||_===46||_===58||_===95||hn(_)?(e.consume(_),k):S(_)}function S(_){return _===61?(e.consume(_),E):qe(_)?(e.consume(_),S):b(_)}function E(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),l=_,P):qe(_)?(e.consume(_),E):O(_)}function P(_){return _===l?(e.consume(_),l=null,R):_===null||Ee(_)?n(_):(e.consume(_),P)}function O(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||nt(_)?S(_):(e.consume(_),O)}function R(_){return _===47||_===62||qe(_)?b(_):n(_)}function $(_){return _===62?(e.consume(_),j):n(_)}function j(_){return _===null||Ee(_)?I(_):qe(_)?(e.consume(_),j):n(_)}function I(_){return _===45&&o===2?(e.consume(_),Q):_===60&&o===1?(e.consume(_),X):_===62&&o===4?(e.consume(_),z):_===63&&o===3?(e.consume(_),N):_===93&&o===5?(e.consume(_),K):Ee(_)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(XU,W,D)(_)):_===null||Ee(_)?(e.exit("htmlFlowData"),D(_)):(e.consume(_),I)}function D(_){return e.check(e9,L,W)(_)}function L(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),T}function T(_){return _===null||Ee(_)?D(_):(e.enter("htmlFlowData"),I(_))}function Q(_){return _===45?(e.consume(_),N):I(_)}function X(_){return _===47?(e.consume(_),i="",M):I(_)}function M(_){if(_===62){const C=i.toLowerCase();return Yk.includes(C)?(e.consume(_),z):I(_)}return _n(_)&&i.length<8?(e.consume(_),i+=String.fromCharCode(_),M):I(_)}function K(_){return _===93?(e.consume(_),N):I(_)}function N(_){return _===62?(e.consume(_),z):_===45&&o===2?(e.consume(_),N):I(_)}function z(_){return _===null||Ee(_)?(e.exit("htmlFlowData"),W(_)):(e.consume(_),z)}function W(_){return e.exit("htmlFlow"),t(_)}}function r9(e,t,n){const r=this;return o;function o(i){return Ee(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s):n(i)}function s(i){return r.parser.lazy[r.now().line]?n(i):t(i)}}function o9(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(fu,t,n)}}const s9={name:"htmlText",tokenize:i9};function i9(e,t,n){const r=this;let o,s,i;return a;function a(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),l}function l(N){return N===33?(e.consume(N),u):N===47?(e.consume(N),S):N===63?(e.consume(N),b):_n(N)?(e.consume(N),O):n(N)}function u(N){return N===45?(e.consume(N),d):N===91?(e.consume(N),s=0,y):_n(N)?(e.consume(N),v):n(N)}function d(N){return N===45?(e.consume(N),h):n(N)}function f(N){return N===null?n(N):N===45?(e.consume(N),p):Ee(N)?(i=f,X(N)):(e.consume(N),f)}function p(N){return N===45?(e.consume(N),h):f(N)}function h(N){return N===62?Q(N):N===45?p(N):f(N)}function y(N){const z="CDATA[";return N===z.charCodeAt(s++)?(e.consume(N),s===z.length?m:y):n(N)}function m(N){return N===null?n(N):N===93?(e.consume(N),x):Ee(N)?(i=m,X(N)):(e.consume(N),m)}function x(N){return N===93?(e.consume(N),g):m(N)}function g(N){return N===62?Q(N):N===93?(e.consume(N),g):m(N)}function v(N){return N===null||N===62?Q(N):Ee(N)?(i=v,X(N)):(e.consume(N),v)}function b(N){return N===null?n(N):N===63?(e.consume(N),k):Ee(N)?(i=b,X(N)):(e.consume(N),b)}function k(N){return N===62?Q(N):b(N)}function S(N){return _n(N)?(e.consume(N),E):n(N)}function E(N){return N===45||hn(N)?(e.consume(N),E):P(N)}function P(N){return Ee(N)?(i=P,X(N)):qe(N)?(e.consume(N),P):Q(N)}function O(N){return N===45||hn(N)?(e.consume(N),O):N===47||N===62||nt(N)?R(N):n(N)}function R(N){return N===47?(e.consume(N),Q):N===58||N===95||_n(N)?(e.consume(N),$):Ee(N)?(i=R,X(N)):qe(N)?(e.consume(N),R):Q(N)}function $(N){return N===45||N===46||N===58||N===95||hn(N)?(e.consume(N),$):j(N)}function j(N){return N===61?(e.consume(N),I):Ee(N)?(i=j,X(N)):qe(N)?(e.consume(N),j):R(N)}function I(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),o=N,D):Ee(N)?(i=I,X(N)):qe(N)?(e.consume(N),I):(e.consume(N),L)}function D(N){return N===o?(e.consume(N),o=void 0,T):N===null?n(N):Ee(N)?(i=D,X(N)):(e.consume(N),D)}function L(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||nt(N)?R(N):(e.consume(N),L)}function T(N){return N===47||N===62||nt(N)?R(N):n(N)}function Q(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function X(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),M}function M(N){return qe(N)?Ke(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):K(N)}function K(N){return e.enter("htmlTextData"),i(N)}}const L0={name:"labelEnd",resolveAll:u9,resolveTo:d9,tokenize:f9},a9={tokenize:h9},l9={tokenize:p9},c9={tokenize:m9};function u9(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&Gn(e,0,e.length,n),e}function d9(e,t){let n=e.length,r=0,o,s,i,a;for(;n--;)if(o=e[n][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(i){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(i=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[i][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[i-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=ur(a,e.slice(s+1,s+r+3)),a=ur(a,[["enter",d,t]]),a=ur(a,Vh(t.parser.constructs.insideSpan.null,e.slice(s+r+4,i-3),t)),a=ur(a,[["exit",d,t],e[i-2],e[i-1],["exit",u,t]]),a=ur(a,e.slice(i+1)),a=ur(a,[["exit",l,t]]),Gn(e,s,e.length,a),e}function f9(e,t,n){const r=this;let o=r.events.length,s,i;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){s=r.events[o][1];break}return a;function a(p){return s?s._inactive?f(p):(i=r.parser.defined.includes(Ar(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(a9,d,i?d:f)(p):p===91?e.attempt(l9,d,i?u:f)(p):i?d(p):f(p)}function u(p){return e.attempt(c9,d,f)(p)}function d(p){return t(p)}function f(p){return s._balanced=!0,n(p)}}function h9(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return nt(f)?uc(e,s)(f):s(f)}function s(f){return f===41?d(f):QP(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function i(f){return nt(f)?uc(e,l)(f):d(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?JP(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function u(f){return nt(f)?uc(e,d)(f):d(f)}function d(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function p9(e,t,n){const r=this;return o;function o(a){return GP.call(r,e,s,i,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Ar(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function i(a){return n(a)}}function m9(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const g9={name:"labelStartImage",resolveAll:L0.resolveAll,tokenize:y9};function y9(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),i):n(a)}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const v9={name:"labelStartLink",resolveAll:L0.resolveAll,tokenize:x9};function x9(e,t,n){const r=this;return o;function o(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),s}function s(i){return i===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(i):t(i)}}const rm={name:"lineEnding",tokenize:w9};function w9(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ke(e,t,"linePrefix")}}const zd={name:"thematicBreak",tokenize:b9};function b9(e,t,n){let r=0,o;return s;function s(u){return e.enter("thematicBreak"),i(u)}function i(u){return o=u,a(u)}function a(u){return u===o?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||Ee(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===o?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),qe(u)?Ke(e,a,"whitespace")(u):a(u))}}const jn={continuation:{tokenize:C9},exit:N9,name:"list",tokenize:S9},k9={partial:!0,tokenize:j9},_9={partial:!0,tokenize:E9};function S9(e,t,n){const r=this,o=r.events[r.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,i=0;return a;function a(h){const y=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:oy(h)){if(r.containerState.type||(r.containerState.type=y,e.enter(y,{_container:!0})),y==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(zd,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return oy(h)&&++i<10?(e.consume(h),l):(!r.interrupt||i<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(fu,r.interrupt?n:d,e.attempt(k9,p,f))}function d(h){return r.containerState.initialBlankLine=!0,s++,p(h)}function f(h){return qe(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function C9(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(fu,o,s);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ke(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!qe(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(_9,t,i)(a))}function i(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ke(e,e.attempt(jn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function E9(e,t,n){const r=this;return Ke(e,o,"listItemIndent",r.containerState.size+1);function o(s){const i=r.events[r.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(s):n(s)}}function N9(e){e.exit(this.containerState.type)}function j9(e,t,n){const r=this;return Ke(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const i=r.events[r.events.length-1];return!qe(s)&&i&&i[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Xk={name:"setextUnderline",resolveTo:P9,tokenize:T9};function P9(e,t){let n=e.length,r,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const i={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",i,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=i,e.push(["exit",i,t]),e}function T9(e,t,n){const r=this;let o;return s;function s(u){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),o=u,i(u)):n(u)}function i(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===o?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),qe(u)?Ke(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Ee(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const $9={tokenize:R9};function R9(e){const t=this,n=e.attempt(fu,r,e.attempt(this.parser.constructs.flowInitial,o,Ke(e,e.attempt(this.parser.constructs.flow,o,e.attempt(DU,o)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const I9={resolveAll:XP()},A9=YP("string"),O9=YP("text");function YP(e){return{resolveAll:XP(e==="text"?M9:void 0),tokenize:t};function t(n){const r=this,o=this.parser.constructs[e],s=n.attempt(o,i,a);return i;function i(d){return u(d)?s(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function u(d){if(d===null)return!0;const f=o[d];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function XP(e){return t;function t(n,r){let o=-1,s;for(;++o<=n.length;)s===void 0?n[o]&&n[o][1].type==="data"&&(s=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==s+2&&(n[s][1].end=n[o-1][1].end,n.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(n,r):n}}function M9(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let s=o.length,i=-1,a=0,l;for(;s--;){const u=o[s];if(typeof u=="string"){for(i=u.length;u.charCodeAt(i-1)===32;)a++,i--;if(i)break;i=-1}else if(u===-2)l=!0,a++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?i:r.start._bufferIndex+i,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const D9={42:jn,43:jn,45:jn,48:jn,49:jn,50:jn,51:jn,52:jn,53:jn,54:jn,55:jn,56:jn,57:jn,62:BP},L9={91:qU},z9={[-2]:nm,[-1]:nm,32:nm},F9={35:ZU,42:zd,45:[Xk,zd],60:YU,61:Xk,95:zd,96:Jk,126:Jk},U9={38:KP,92:WP},q9={[-5]:rm,[-4]:rm,[-3]:rm,33:g9,38:KP,42:sy,60:[vU,s9],91:v9,92:[WU,WP],93:L0,95:sy,96:$U},V9={null:[sy,I9]},H9={null:[42,95]},B9={null:[]},W9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:H9,contentInitial:L9,disable:B9,document:D9,flow:F9,flowInitial:z9,insideSpan:V9,string:U9,text:q9},Symbol.toStringTag,{value:"Module"}));function K9(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},s=[];let i=[],a=[];const l={attempt:P(S),check:P(E),consume:v,enter:b,exit:k,interrupt:P(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:y,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function f(j){return i=ur(i,j),x(),i[i.length-1]!==null?[]:(O(t,0),u.events=Vh(s,u.events,u),u.events)}function p(j,I){return Q9(h(j),I)}function h(j){return Z9(i,j)}function y(){const{_bufferIndex:j,_index:I,line:D,column:L,offset:T}=r;return{_bufferIndex:j,_index:I,line:D,column:L,offset:T}}function m(j){o[j.line]=j.column,$()}function x(){let j;for(;r._index<i.length;){const I=i[r._index];if(typeof I=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<I.length;)g(I.charCodeAt(r._bufferIndex));else g(I)}}function g(j){d=d(j)}function v(j){Ee(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,$()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=j}function b(j,I){const D=I||{};return D.type=j,D.start=y(),u.events.push(["enter",D,u]),a.push(D),D}function k(j){const I=a.pop();return I.end=y(),u.events.push(["exit",I,u]),I}function S(j,I){O(j,I.from)}function E(j,I){I.restore()}function P(j,I){return D;function D(L,T,Q){let X,M,K,N;return Array.isArray(L)?W(L):"tokenize"in L?W([L]):z(L);function z(F){return Z;function Z(Y){const ae=Y!==null&&F[Y],de=Y!==null&&F.null,U=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(de)?de:de?[de]:[]];return W(U)(Y)}}function W(F){return X=F,M=0,F.length===0?Q:_(F[M])}function _(F){return Z;function Z(Y){return N=R(),K=F,F.partial||(u.currentConstruct=F),F.name&&u.parser.constructs.disable.null.includes(F.name)?A():F.tokenize.call(I?Object.assign(Object.create(u),I):u,l,C,A)(Y)}}function C(F){return j(K,N),T}function A(F){return N.restore(),++M<X.length?_(X[M]):Q}}}function O(j,I){j.resolveAll&&!s.includes(j)&&s.push(j),j.resolve&&Gn(u.events,I,u.events.length-I,j.resolve(u.events.slice(I),u)),j.resolveTo&&(u.events=j.resolveTo(u.events,u))}function R(){const j=y(),I=u.previous,D=u.currentConstruct,L=u.events.length,T=Array.from(a);return{from:L,restore:Q};function Q(){r=j,u.previous=I,u.currentConstruct=D,u.events.length=L,a=T,$()}}function $(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function Z9(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,s=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(r,s)];else{if(i=e.slice(n,o),r>-1){const a=i[0];typeof a=="string"?i[0]=a.slice(r):i.shift()}s>0&&i.push(e[o].slice(0,s))}return i}function Q9(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const s=e[n];let i;if(typeof s=="string")i=s;else switch(s){case-5:{i="\r";break}case-4:{i=`
397
- `;break}case-3:{i=`\r
398
- `;break}case-2:{i=t?" ":" ";break}case-1:{if(!t&&o)continue;i=" ";break}default:i=String.fromCharCode(s)}o=s===-2,r.push(i)}return r.join("")}function G9(e){const r={constructs:VP([W9,...(e||{}).extensions||[]]),content:o(dU),defined:[],document:o(hU),flow:o($9),lazy:{},string:o(A9),text:o(O9)};return r;function o(s){return i;function i(a){return K9(r,s,a)}}}function J9(e){for(;!ZP(e););return e}const e1=/[\0\t\n\r]/g;function Y9(){let e=1,t="",n=!0,r;return o;function o(s,i,a){const l=[];let u,d,f,p,h;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(i||void 0).decode(s)),f=0,t="",n&&(s.charCodeAt(0)===65279&&f++,n=void 0);f<s.length;){if(e1.lastIndex=f,u=e1.exec(s),p=u&&u.index!==void 0?u.index:s.length,h=s.charCodeAt(p),!u){t=s.slice(f);break}if(h===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(s.slice(f,p)),e+=p-f),h){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const X9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function e6(e){return e.replace(X9,t6)}function t6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),s=o===120||o===88;return HP(n.slice(s?2:1),s?16:10)}return D0(n)||e}const eT={}.hasOwnProperty;function n6(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),r6(n)(J9(G9(n).document().write(Y9()(e,t,!0))))}function r6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ce),autolinkProtocol:R,autolinkEmail:R,atxHeading:s(B),blockQuote:s(de),characterEscape:R,characterReference:R,codeFenced:s(U),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:s(U,i),codeText:s(H,i),codeTextData:R,data:R,codeFlowValue:R,definition:s(J),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:s(te),hardBreakEscape:s(ne),hardBreakTrailing:s(ne),htmlFlow:s(re,i),htmlFlowData:R,htmlText:s(re,i),htmlTextData:R,image:s(Te),label:i,link:s(ce),listItem:s(Ne),listItemValue:p,listOrdered:s(ke,f),listUnordered:s(ke),paragraph:s(rt),reference:_,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:s(B),strong:s(Tt),thematicBreak:s(qn)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ae,autolinkProtocol:Y,blockQuote:l(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:A,characterReferenceMarkerNumeric:A,characterReferenceValue:F,characterReference:Z,codeFenced:l(x),codeFencedFence:m,codeFencedFenceInfo:h,codeFencedFenceMeta:y,codeFlowValue:$,codeIndented:l(g),codeText:l(T),codeTextData:$,data:$,definition:l(),definitionDestinationString:k,definitionLabelString:v,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(I),hardBreakTrailing:l(I),htmlFlow:l(D),htmlFlowData:$,htmlText:l(L),htmlTextData:$,image:l(X),label:K,labelText:M,lineEnding:j,link:l(Q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:C,resourceDestinationString:N,resourceTitleString:z,resource:W,setextHeading:l(O),setextHeadingLineSequence:P,setextHeadingText:E,strong:l(),thematicBreak:l()}};tT(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(G){let ie={type:"root",children:[]};const _e={stack:[ie],tokenStack:[],config:t,enter:a,exit:u,buffer:i,resume:d,data:n},Pe=[];let We=-1;for(;++We<G.length;)if(G[We][1].type==="listOrdered"||G[We][1].type==="listUnordered")if(G[We][0]==="enter")Pe.push(We);else{const Qt=Pe.pop();We=o(G,Qt,We)}for(We=-1;++We<G.length;){const Qt=t[G[We][0]];eT.call(Qt,G[We][1].type)&&Qt[G[We][1].type].call(Object.assign({sliceSerialize:G[We][2].sliceSerialize},_e),G[We][1])}if(_e.tokenStack.length>0){const Qt=_e.tokenStack[_e.tokenStack.length-1];(Qt[1]||t1).call(_e,void 0,Qt[0])}for(ie.position={start:Wo(G.length>0?G[0][1].start:{line:1,column:1,offset:0}),end:Wo(G.length>0?G[G.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We<t.transforms.length;)ie=t.transforms[We](ie)||ie;return ie}function o(G,ie,_e){let Pe=ie-1,We=-1,Qt=!1,nr,Nn,zr,Fr;for(;++Pe<=_e;){const Ot=G[Pe];switch(Ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ot[0]==="enter"?We++:We--,Fr=void 0;break}case"lineEndingBlank":{Ot[0]==="enter"&&(nr&&!Fr&&!We&&!zr&&(zr=Pe),Fr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Fr=void 0}if(!We&&Ot[0]==="enter"&&Ot[1].type==="listItemPrefix"||We===-1&&Ot[0]==="exit"&&(Ot[1].type==="listUnordered"||Ot[1].type==="listOrdered")){if(nr){let rr=Pe;for(Nn=void 0;rr--;){const gn=G[rr];if(gn[1].type==="lineEnding"||gn[1].type==="lineEndingBlank"){if(gn[0]==="exit")continue;Nn&&(G[Nn][1].type="lineEndingBlank",Qt=!0),gn[1].type="lineEnding",Nn=rr}else if(!(gn[1].type==="linePrefix"||gn[1].type==="blockQuotePrefix"||gn[1].type==="blockQuotePrefixWhitespace"||gn[1].type==="blockQuoteMarker"||gn[1].type==="listItemIndent"))break}zr&&(!Nn||zr<Nn)&&(nr._spread=!0),nr.end=Object.assign({},Nn?G[Nn][1].start:Ot[1].end),G.splice(Nn||Pe,0,["exit",nr,Ot[2]]),Pe++,_e++}if(Ot[1].type==="listItemPrefix"){const rr={type:"listItem",_spread:!1,start:Object.assign({},Ot[1].start),end:void 0};nr=rr,G.splice(Pe,0,["enter",rr,Ot[2]]),Pe++,_e++,zr=void 0,Fr=!0}}}return G[ie][1]._spread=Qt,_e}function s(G,ie){return _e;function _e(Pe){a.call(this,G(Pe),Pe),ie&&ie.call(this,Pe)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(G,ie,_e){this.stack[this.stack.length-1].children.push(G),this.stack.push(G),this.tokenStack.push([ie,_e||void 0]),G.position={start:Wo(ie.start),end:void 0}}function l(G){return ie;function ie(_e){G&&G.call(this,_e),u.call(this,_e)}}function u(G,ie){const _e=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==G.type&&(ie?ie.call(this,G,Pe[0]):(Pe[1]||t1).call(this,G,Pe[0]));else throw new Error("Cannot close `"+G.type+"` ("+cc({start:G.start,end:G.end})+"): it’s not open");_e.position.end=Wo(G.end)}function d(){return M0(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(G){if(this.data.expectingFirstListItemValue){const ie=this.stack[this.stack.length-2];ie.start=Number.parseInt(this.sliceSerialize(G),10),this.data.expectingFirstListItemValue=void 0}}function h(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.lang=G}function y(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.meta=G}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.value=G.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function g(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.value=G.replace(/(\r?\n|\r)$/g,"")}function v(G){const ie=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ie,_e.identifier=Ar(this.sliceSerialize(G)).toLowerCase()}function b(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.title=G}function k(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.url=G}function S(G){const ie=this.stack[this.stack.length-1];if(!ie.depth){const _e=this.sliceSerialize(G).length;ie.depth=_e}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function P(G){const ie=this.stack[this.stack.length-1];ie.depth=this.sliceSerialize(G).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function R(G){const _e=this.stack[this.stack.length-1].children;let Pe=_e[_e.length-1];(!Pe||Pe.type!=="text")&&(Pe=it(),Pe.position={start:Wo(G.start),end:void 0},_e.push(Pe)),this.stack.push(Pe)}function $(G){const ie=this.stack.pop();ie.value+=this.sliceSerialize(G),ie.position.end=Wo(G.end)}function j(G){const ie=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=ie.children[ie.children.length-1];_e.position.end=Wo(G.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ie.type)&&(R.call(this,G),$.call(this,G))}function I(){this.data.atHardBreak=!0}function D(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.value=G}function L(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.value=G}function T(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.value=G}function Q(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=ie,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function X(){const G=this.stack[this.stack.length-1];if(this.data.inReference){const ie=this.data.referenceType||"shortcut";G.type+="Reference",G.referenceType=ie,delete G.url,delete G.title}else delete G.identifier,delete G.label;this.data.referenceType=void 0}function M(G){const ie=this.sliceSerialize(G),_e=this.stack[this.stack.length-2];_e.label=e6(ie),_e.identifier=Ar(ie).toLowerCase()}function K(){const G=this.stack[this.stack.length-1],ie=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const Pe=G.children;_e.children=Pe}else _e.alt=ie}function N(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.url=G}function z(){const G=this.resume(),ie=this.stack[this.stack.length-1];ie.title=G}function W(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function C(G){const ie=this.resume(),_e=this.stack[this.stack.length-1];_e.label=ie,_e.identifier=Ar(this.sliceSerialize(G)).toLowerCase(),this.data.referenceType="full"}function A(G){this.data.characterReferenceType=G.type}function F(G){const ie=this.sliceSerialize(G),_e=this.data.characterReferenceType;let Pe;_e?(Pe=HP(ie,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=D0(ie);const We=this.stack[this.stack.length-1];We.value+=Pe}function Z(G){const ie=this.stack.pop();ie.position.end=Wo(G.end)}function Y(G){$.call(this,G);const ie=this.stack[this.stack.length-1];ie.url=this.sliceSerialize(G)}function ae(G){$.call(this,G);const ie=this.stack[this.stack.length-1];ie.url="mailto:"+this.sliceSerialize(G)}function de(){return{type:"blockquote",children:[]}}function U(){return{type:"code",lang:null,meta:null,value:""}}function H(){return{type:"inlineCode",value:""}}function J(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function te(){return{type:"emphasis",children:[]}}function B(){return{type:"heading",depth:0,children:[]}}function ne(){return{type:"break"}}function re(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function ce(){return{type:"link",title:null,url:"",children:[]}}function ke(G){return{type:"list",ordered:G.type==="listOrdered",start:null,spread:G._spread,children:[]}}function Ne(G){return{type:"listItem",spread:G._spread,checked:null,children:[]}}function rt(){return{type:"paragraph",children:[]}}function Tt(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function qn(){return{type:"thematicBreak"}}}function Wo(e){return{line:e.line,column:e.column,offset:e.offset}}function tT(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?tT(e,r):o6(e,r)}}function o6(e,t){let n;for(n in t)if(eT.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function t1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+cc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+cc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+cc({start:t.start,end:t.end})+") is still open")}function s6(e){const t=this;t.parser=n;function n(r){return n6(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function i6(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function a6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
399
- `}]}function l6(e,t){const n=t.value?t.value+`
400
- `:"",r={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function c6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=vl(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let i,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function f6(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function h6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function nT(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&i.type==="text"?i.value+=r:o.push({type:"text",value:r}),o}function p6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nT(e,t);const o={src:vl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,s),e.applyData(t,s)}function m6(e,t){const n={src:vl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function g6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function y6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nT(e,t);const o={href:vl(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const s={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function v6(e,t){const n={href:vl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function x6(e,t,n){const r=e.all(t),o=n?w6(n):rT(t),s={},i=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const d=r[a];(o||a!==0||d.type!=="element"||d.tagName!=="p")&&i.push({type:"text",value:`
401
- `}),d.type==="element"&&d.tagName==="p"&&!o?i.push(...d.children):i.push(d)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&i.push({type:"text",value:`
402
- `});const u={type:"element",tagName:"li",properties:s,children:i};return e.patch(t,u),e.applyData(t,u)}function w6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=rT(n[r])}return t}function rT(e){const t=e.spread;return t??e.children.length>1}function b6(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const i=r[o];if(i.type==="element"&&i.tagName==="li"&&i.properties&&Array.isArray(i.properties.className)&&i.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function k6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function S6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function C6(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const i={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],i),o.push(i)}if(n.length>0){const i={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=R0(t.children[1]),l=MP(t.children[t.children.length-1]);a&&l&&(i.position={start:a,end:l}),o.push(i)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,s),e.applyData(t,s)}function E6(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",i=n&&n.type==="table"?n.align:void 0,a=i?i.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const f=t.children[l],p={},h=i?i[l]:void 0;h&&(p.align=h);let y={type:"element",tagName:s,properties:p,children:[]};f&&(y.children=e.all(f),e.patch(f,y),y=e.applyData(f,y)),u.push(y)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function N6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const n1=9,r1=32;function j6(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const s=[];for(;r;)s.push(o1(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return s.push(o1(t.slice(o),o>0,!1)),s.join("")}function o1(e,t,n){let r=0,o=e.length;if(t){let s=e.codePointAt(r);for(;s===n1||s===r1;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(o-1);for(;s===n1||s===r1;)o--,s=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function P6(e,t){const n={type:"text",value:j6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function T6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const $6={blockquote:i6,break:a6,code:l6,delete:c6,emphasis:u6,footnoteReference:d6,heading:f6,html:h6,imageReference:p6,image:m6,inlineCode:g6,linkReference:y6,link:v6,listItem:x6,list:b6,paragraph:k6,root:_6,strong:S6,table:C6,tableCell:N6,tableRow:E6,text:P6,thematicBreak:T6,toml:nd,yaml:nd,definition:nd,footnoteDefinition:nd};function nd(){}const oT=-1,Hh=0,dc=1,Df=2,z0=3,F0=4,U0=5,q0=6,sT=7,iT=8,s1=typeof self=="object"?self:globalThis,R6=(e,t)=>{const n=(o,s)=>(e.set(s,o),o),r=o=>{if(e.has(o))return e.get(o);const[s,i]=t[o];switch(s){case Hh:case oT:return n(i,o);case dc:{const a=n([],o);for(const l of i)a.push(r(l));return a}case Df:{const a=n({},o);for(const[l,u]of i)a[r(l)]=r(u);return a}case z0:return n(new Date(i),o);case F0:{const{source:a,flags:l}=i;return n(new RegExp(a,l),o)}case U0:{const a=n(new Map,o);for(const[l,u]of i)a.set(r(l),r(u));return a}case q0:{const a=n(new Set,o);for(const l of i)a.add(r(l));return a}case sT:{const{name:a,message:l}=i;return n(new s1[a](l),o)}case iT:return n(BigInt(i),o);case"BigInt":return n(Object(BigInt(i)),o);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{const{buffer:a}=new Uint8Array(i);return n(new DataView(a),i)}}return n(new s1[s](i),o)};return r},i1=e=>R6(new Map,e)(0),Ki="",{toString:I6}={},{keys:A6}=Object,Ml=e=>{const t=typeof e;if(t!=="object"||!e)return[Hh,t];const n=I6.call(e).slice(8,-1);switch(n){case"Array":return[dc,Ki];case"Object":return[Df,Ki];case"Date":return[z0,Ki];case"RegExp":return[F0,Ki];case"Map":return[U0,Ki];case"Set":return[q0,Ki];case"DataView":return[dc,n]}return n.includes("Array")?[dc,n]:n.includes("Error")?[sT,n]:[Df,n]},rd=([e,t])=>e===Hh&&(t==="function"||t==="symbol"),O6=(e,t,n,r)=>{const o=(i,a)=>{const l=r.push(i)-1;return n.set(a,l),l},s=i=>{if(n.has(i))return n.get(i);let[a,l]=Ml(i);switch(a){case Hh:{let d=i;switch(l){case"bigint":a=iT,d=i.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return o([oT],i)}return o([a,d],i)}case dc:{if(l){let p=i;return l==="DataView"?p=new Uint8Array(i.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(i)),o([l,[...p]],i)}const d=[],f=o([a,d],i);for(const p of i)d.push(s(p));return f}case Df:{if(l)switch(l){case"BigInt":return o([l,i.toString()],i);case"Boolean":case"Number":case"String":return o([l,i.valueOf()],i)}if(t&&"toJSON"in i)return s(i.toJSON());const d=[],f=o([a,d],i);for(const p of A6(i))(e||!rd(Ml(i[p])))&&d.push([s(p),s(i[p])]);return f}case z0:return o([a,i.toISOString()],i);case F0:{const{source:d,flags:f}=i;return o([a,{source:d,flags:f}],i)}case U0:{const d=[],f=o([a,d],i);for(const[p,h]of i)(e||!(rd(Ml(p))||rd(Ml(h))))&&d.push([s(p),s(h)]);return f}case q0:{const d=[],f=o([a,d],i);for(const p of i)(e||!rd(Ml(p)))&&d.push(s(p));return f}}const{message:u}=i;return o([a,{name:l,message:u}],i)};return s},a1=(e,{json:t,lossy:n}={})=>{const r=[];return O6(!(t||n),!!t,new Map,r)(e),r},Lf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?i1(a1(e,t)):structuredClone(e):(e,t)=>i1(a1(e,t));function M6(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function D6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function L6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||M6,r=e.options.footnoteBackLabel||D6,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const d=e.all(u),f=String(u.identifier).toUpperCase(),p=vl(f.toLowerCase());let h=0;const y=[],m=e.footnoteCounts.get(f);for(;m!==void 0&&++h<=m;){y.length>0&&y.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,h);typeof v=="string"&&(v={type:"text",value:v}),y.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const v=x.children[x.children.length-1];v&&v.type==="text"?v.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...y)}else d.push(...y);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(d,!0)};e.patch(u,g),a.push(g)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Lf(i),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
403
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
404
- `}]}}const Bh=function(e){if(e==null)return q6;if(typeof e=="function")return Wh(e);if(typeof e=="object")return Array.isArray(e)?z6(e):F6(e);if(typeof e=="string")return U6(e);throw new Error("Expected function, string, or object as test")};function z6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Bh(e[n]);return Wh(r);function r(...o){let s=-1;for(;++s<t.length;)if(t[s].apply(this,o))return!0;return!1}}function F6(e){const t=e;return Wh(n);function n(r){const o=r;let s;for(s in e)if(o[s]!==t[s])return!1;return!0}}function U6(e){return Wh(t);function t(n){return n&&n.type===e}}function Wh(e){return t;function t(n,r,o){return!!(V6(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function q6(){return!0}function V6(e){return e!==null&&typeof e=="object"&&"type"in e}const aT=[],H6=!0,iy=!1,B6="skip";function lT(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const s=Bh(o),i=r?-1:1;a(e,void 0,[])();function a(l,u,d){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=aT,y,m,x;if((!t||s(l,u,d[d.length-1]||void 0))&&(h=W6(n(l,d)),h[0]===iy))return h;if("children"in l&&l.children){const g=l;if(g.children&&h[0]!==B6)for(m=(r?g.children.length:-1)+i,x=d.concat(g);m>-1&&m<g.children.length;){const v=g.children[m];if(y=a(v,m,x)(),y[0]===iy)return y;m=typeof y[1]=="number"?y[1]:m+i}}return h}}}function W6(e){return Array.isArray(e)?e:typeof e=="number"?[H6,e]:e==null?aT:[e]}function V0(e,t,n,r){let o,s,i;typeof t=="function"&&typeof n!="function"?(s=void 0,i=t,o=n):(s=t,i=n,o=r),lT(e,s,a,o);function a(l,u){const d=u[u.length-1],f=d?d.children.indexOf(l):void 0;return i(l,f,d)}}const ay={}.hasOwnProperty,K6={};function Z6(e,t){const n=t||K6,r=new Map,o=new Map,s=new Map,i={...$6,...n.handlers},a={all:u,applyData:G6,definitionById:r,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:i,one:l,options:n,patch:Q6,wrap:Y6};return V0(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:o,p=String(d.identifier).toUpperCase();f.has(p)||f.set(p,d)}}),a;function l(d,f){const p=d.type,h=a.handlers[p];if(ay.call(a.handlers,p)&&h)return h(a,d,f);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in d){const{children:m,...x}=d,g=Lf(x);return g.children=a.all(d),g}return Lf(d)}return(a.options.unknownHandler||J6)(a,d,f)}function u(d){const f=[];if("children"in d){const p=d.children;let h=-1;for(;++h<p.length;){const y=a.one(p[h],d);if(y){if(h&&p[h-1].type==="break"&&(!Array.isArray(y)&&y.type==="text"&&(y.value=l1(y.value)),!Array.isArray(y)&&y.type==="element")){const m=y.children[0];m&&m.type==="text"&&(m.value=l1(m.value))}Array.isArray(y)?f.push(...y):f.push(y)}}}return f}}function Q6(e,t){e.position&&(t.position=D5(e))}function G6(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const i="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:i}}n.type==="element"&&s&&Object.assign(n.properties,Lf(s)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function J6(e,t){const n=t.data||{},r="value"in t&&!(ay.call(n,"hProperties")||ay.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Y6(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
405
- `});++r<e.length;)r&&n.push({type:"text",value:`
406
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
407
- `}),n}function l1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function c1(e,t){const n=Z6(e,t),r=n.one(e,void 0),o=L6(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
408
- `},o),s}function X6(e,t){return e&&"run"in e?async function(n,r){const o=c1(n,{file:r,...t});await e.run(o,r)}:function(n,r){return c1(n,{file:r,...e||t})}}function u1(e){if(e)throw e}var Fd=Object.prototype.hasOwnProperty,cT=Object.prototype.toString,d1=Object.defineProperty,f1=Object.getOwnPropertyDescriptor,h1=function(t){return typeof Array.isArray=="function"?Array.isArray(t):cT.call(t)==="[object Array]"},p1=function(t){if(!t||cT.call(t)!=="[object Object]")return!1;var n=Fd.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Fd.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||Fd.call(t,o)},m1=function(t,n){d1&&n.name==="__proto__"?d1(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},g1=function(t,n){if(n==="__proto__")if(Fd.call(t,n)){if(f1)return f1(t,n).value}else return;return t[n]},e8=function e(){var t,n,r,o,s,i,a=arguments[0],l=1,u=arguments.length,d=!1;for(typeof a=="boolean"&&(d=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=g1(a,n),o=g1(t,n),a!==o&&(d&&o&&(p1(o)||(s=h1(o)))?(s?(s=!1,i=r&&h1(r)?r:[]):i=r&&p1(r)?r:{},m1(a,{name:n,newValue:e(d,i,o)})):typeof o<"u"&&m1(a,{name:n,newValue:o}));return a};const om=al(e8);function ly(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function t8(){const e=[],t={run:n,use:r};return t;function n(...o){let s=-1;const i=o.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);a(null,...o);function a(l,...u){const d=e[++s];let f=-1;if(l){i(l);return}for(;++f<o.length;)(u[f]===null||u[f]===void 0)&&(u[f]=o[f]);o=u,d?n8(d,a)(...u):i(null,...u)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function n8(e,t){let n;return r;function r(...i){const a=e.length>i.length;let l;a&&i.push(o);try{l=e.apply(this,i)}catch(u){const d=u;if(a&&n)throw d;return o(d)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,o):l instanceof Error?o(l):s(l))}function o(i,...a){n||(n=!0,t(i,...a))}function s(i){o(null,i)}}const Hr={basename:r8,dirname:o8,extname:s8,join:i8,sep:"/"};function r8(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');hu(e);let n=0,r=-1,o=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else r<0&&(s=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let i=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){n=o+1;break}}else i<0&&(s=!0,i=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=i));return n===r?r=i:r<0&&(r=e.length),e.slice(n,r)}function o8(e){if(hu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function s8(e){hu(e);let t=e.length,n=-1,r=0,o=-1,s=0,i;for(;t--;){const a=e.codePointAt(t);if(a===47){if(i){r=t+1;break}continue}n<0&&(i=!0,n=t+1),a===46?o<0?o=t:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||n<0||s===0||s===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function i8(...e){let t=-1,n;for(;++t<e.length;)hu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":a8(n)}function a8(e){hu(e);const t=e.codePointAt(0)===47;let n=l8(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function l8(e,t){let n="",r=0,o=-1,s=0,i=-1,a,l;for(;++i<=e.length;){if(i<e.length)a=e.codePointAt(i);else{if(a===47)break;a=47}if(a===47){if(!(o===i-1||s===1))if(o!==i-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=i,s=0;continue}}else if(n.length>0){n="",r=0,o=i,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,i):n=e.slice(o+1,i),r=i-o-1;o=i,s=0}else a===46&&s>-1?s++:s=-1}return n}function hu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const c8={cwd:u8};function u8(){return"/"}function cy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function d8(e){if(typeof e=="string")e=new URL(e);else if(!cy(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return f8(e)}function f8(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const sm=["history","path","basename","stem","extname","dirname"];class uT{constructor(t){let n;t?cy(t)?n={path:t}:typeof t=="string"||h8(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":c8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sm.length;){const s=sm[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let o;for(o in n)sm.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Hr.basename(this.path):void 0}set basename(t){am(t,"basename"),im(t,"basename"),this.path=Hr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Hr.dirname(this.path):void 0}set dirname(t){y1(this.basename,"dirname"),this.path=Hr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Hr.extname(this.path):void 0}set extname(t){if(im(t,"extname"),y1(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Hr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){cy(t)&&(t=d8(t)),am(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Hr.basename(this.path,this.extname):void 0}set stem(t){am(t,"stem"),im(t,"stem"),this.path=Hr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new mn(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function im(e,t){if(e&&e.includes(Hr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Hr.sep+"`")}function am(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function y1(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function h8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const p8=function(e){const r=this.constructor.prototype,o=r[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},m8={}.hasOwnProperty;class H0 extends p8{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=t8()}copy(){const t=new H0;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(om(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(um("data",this.frozen),this.namespace[t]=n,this):m8.call(this.namespace,t)&&this.namespace[t]||void 0:t?(um("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=od(t),r=this.parser||this.Parser;return lm("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),lm("process",this.parser||this.Parser),cm("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(s,i){const a=od(t),l=r.parse(a);r.run(l,a,function(d,f,p){if(d||!f||!p)return u(d);const h=f,y=r.stringify(h,p);v8(y)?p.value=y:p.result=y,u(d,p)});function u(d,f){d||!f?i(d):s?s(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),lm("processSync",this.parser||this.Parser),cm("processSync",this.compiler||this.Compiler),this.process(t,o),x1("processSync","process",n),r;function o(s,i){n=!0,u1(s),r=i}}run(t,n,r){v1(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(i,a){const l=od(n);o.run(t,l,u);function u(d,f,p){const h=f||t;d?a(d):i?i(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,s),x1("runSync","run",r),o;function s(i,a){u1(i),o=a,r=!0}}stringify(t,n){this.freeze();const r=od(n),o=this.compiler||this.Compiler;return cm("stringify",o),v1(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(um("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):i(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...f]=u;l(d,f)}else i(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function i(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(o.settings=om(!0,o.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const f=u[d];s(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,d){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===u){p=f;break}if(p===-1)r.push([u,...d]);else if(d.length>0){let[h,...y]=d;const m=r[p][1];ly(m)&&ly(h)&&(h=om(!0,m,h)),r[p]=[u,h,...y]}}}}const g8=new H0().freeze();function lm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function um(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function v1(e){if(!ly(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function x1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function od(e){return y8(e)?e:new uT(e)}function y8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function v8(e){return typeof e=="string"||x8(e)}function x8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const w8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",w1=[],b1={allowDangerousHtml:!0},b8=/^(https?|ircs?|mailto|xmpp)$/i,k8=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function _8(e){const t=S8(e),n=C8(e);return E8(t.runSync(t.parse(n),n),e)}function S8(e){const t=e.rehypePlugins||w1,n=e.remarkPlugins||w1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...b1}:b1;return g8().use(s6).use(n).use(X6,r).use(t)}function C8(e){const t=e.children||"",n=new uT;return typeof t=="string"&&(n.value=t),n}function E8(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,s=t.disallowedElements,i=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||N8;for(const d of k8)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+w8+d.id,void 0);return V0(e,u),q5(e,{Fragment:c.Fragment,components:o,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function u(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return i?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in tm)if(Object.hasOwn(tm,h)&&Object.hasOwn(d.properties,h)){const y=d.properties[h],m=tm[h];(m===null||m.includes(d.tagName))&&(d.properties[h]=l(String(y||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(d,f,p)),h&&p&&typeof f=="number")return a&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function N8(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||b8.test(e.slice(0,t))?e:""}function k1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function j8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function P8(e,t,n){const o=Bh((n||{}).ignore||[]),s=T8(t);let i=-1;for(;++i<s.length;)lT(e,"text",a);function a(u,d){let f=-1,p;for(;++f<d.length;){const h=d[f],y=p?p.children:void 0;if(o(h,y?y.indexOf(h):void 0,p))return;p=h}if(p)return l(u,d)}function l(u,d){const f=d[d.length-1],p=s[i][0],h=s[i][1];let y=0;const x=f.children.indexOf(u);let g=!1,v=[];p.lastIndex=0;let b=p.exec(u.value);for(;b;){const k=b.index,S={index:b.index,input:b.input,stack:[...d,u]};let E=h(...b,S);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=k+1:(y!==k&&v.push({type:"text",value:u.value.slice(y,k)}),Array.isArray(E)?v.push(...E):E&&v.push(E),y=k+b[0].length,g=!0),!p.global)break;b=p.exec(u.value)}return g?(y<u.value.length&&v.push({type:"text",value:u.value.slice(y)}),f.children.splice(x,1,...v)):v=[u],x+v.length}}function T8(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const o=n[r];t.push([$8(o[0]),R8(o[1])])}return t}function $8(e){return typeof e=="string"?new RegExp(j8(e),"g"):e}function R8(e){return typeof e=="function"?e:function(){return e}}const dm="phrasing",fm=["autolink","link","image","label"];function I8(){return{transforms:[F8],enter:{literalAutolink:O8,literalAutolinkEmail:hm,literalAutolinkHttp:hm,literalAutolinkWww:hm},exit:{literalAutolink:z8,literalAutolinkEmail:L8,literalAutolinkHttp:M8,literalAutolinkWww:D8}}}function A8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dm,notInConstruct:fm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dm,notInConstruct:fm},{character:":",before:"[ps]",after:"\\/",inConstruct:dm,notInConstruct:fm}]}}function O8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function hm(e){this.config.enter.autolinkProtocol.call(this,e)}function M8(e){this.config.exit.autolinkProtocol.call(this,e)}function D8(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function L8(e){this.config.exit.autolinkEmail.call(this,e)}function z8(e){this.exit(e)}function F8(e){P8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,U8],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),q8]],{ignore:["link","linkReference"]})}function U8(e,t,n,r,o){let s="";if(!dT(o)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!V8(n)))return!1;const i=H8(n+r);if(!i[0])return!1;const a={type:"link",title:null,url:s+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[a,{type:"text",value:i[1]}]:a}function q8(e,t,n,r){return!dT(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function V8(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function H8(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=k1(e,"(");let s=k1(e,")");for(;r!==-1&&o>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function dT(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||$i(n)||qh(n))&&(!t||n!==47)}fT.peek=X8;function B8(){this.buffer()}function W8(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function K8(){this.buffer()}function Z8(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Q8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ar(this.sliceSerialize(e)).toLowerCase(),n.label=t}function G8(e){this.exit(e)}function J8(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ar(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Y8(e){this.exit(e)}function X8(){return"["}function fT(e,t,n,r){const o=n.createTracker(r);let s=o.move("[^");const i=n.enter("footnoteReference"),a=n.enter("reference");return s+=o.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),i(),s+=o.move("]"),s}function eq(){return{enter:{gfmFootnoteCallString:B8,gfmFootnoteCall:W8,gfmFootnoteDefinitionLabelString:K8,gfmFootnoteDefinition:Z8},exit:{gfmFootnoteCallString:Q8,gfmFootnoteCall:G8,gfmFootnoteDefinitionLabelString:J8,gfmFootnoteDefinition:Y8}}}function tq(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:fT},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,s,i){const a=s.createTracker(i);let l=a.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),d(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
409
- `:" ")+s.indentLines(s.containerFlow(r,a.current()),t?hT:nq))),u(),l}}function nq(e,t,n){return t===0?e:hT(e,t,n)}function hT(e,t,n){return(n?"":" ")+e}const rq=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];pT.peek=lq;function oq(){return{canContainEols:["delete"],enter:{strikethrough:iq},exit:{strikethrough:aq}}}function sq(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rq}],handlers:{delete:pT}}}function iq(e){this.enter({type:"delete",children:[]},e)}function aq(e){this.exit(e)}function pT(e,t,n,r){const o=n.createTracker(r),s=n.enter("strikethrough");let i=o.move("~~");return i+=n.containerPhrasing(e,{...o.current(),before:i,after:"~"}),i+=o.move("~~"),s(),i}function lq(){return"~"}function cq(e){return e.length}function uq(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||cq,s=[],i=[],a=[],l=[];let u=0,d=-1;for(;++d<e.length;){const m=[],x=[];let g=-1;for(e[d].length>u&&(u=e[d].length);++g<e[d].length;){const v=dq(e[d][g]);if(n.alignDelimiters!==!1){const b=o(v);x[g]=b,(l[g]===void 0||b>l[g])&&(l[g]=b)}m.push(v)}i[d]=m,a[d]=x}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)s[f]=_1(r[f]);else{const m=_1(r);for(;++f<u;)s[f]=m}f=-1;const p=[],h=[];for(;++f<u;){const m=s[f];let x="",g="";m===99?(x=":",g=":"):m===108?x=":":m===114&&(g=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[f]-x.length-g.length);const b=x+"-".repeat(v)+g;n.alignDelimiters!==!1&&(v=x.length+v+g.length,v>l[f]&&(l[f]=v),h[f]=v),p[f]=b}i.splice(1,0,p),a.splice(1,0,h),d=-1;const y=[];for(;++d<i.length;){const m=i[d],x=a[d];f=-1;const g=[];for(;++f<u;){const v=m[f]||"";let b="",k="";if(n.alignDelimiters!==!1){const S=l[f]-(x[f]||0),E=s[f];E===114?b=" ".repeat(S):E===99?S%2?(b=" ".repeat(S/2+.5),k=" ".repeat(S/2-.5)):(b=" ".repeat(S/2),k=b):k=" ".repeat(S)}n.delimiterStart!==!1&&!f&&g.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||f)&&g.push(" "),n.alignDelimiters!==!1&&g.push(b),g.push(v),n.alignDelimiters!==!1&&g.push(k),n.padding!==!1&&g.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&g.push("|")}y.push(n.delimiterEnd===!1?g.join("").replace(/ +$/,""):g.join(""))}return y.join(`
410
- `)}function dq(e){return e==null?"":String(e)}function _1(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function fq(e,t,n,r){const o=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const i=n.indentLines(n.containerFlow(e,s.current()),hq);return o(),i}function hq(e,t,n){return">"+(n?"":" ")+e}function pq(e,t){return S1(e,t.inConstruct,!0)&&!S1(e,t.notInConstruct,!1)}function S1(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function C1(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
411
- `&&pq(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
412
- `}function mq(e,t){const n=String(e);let r=n.indexOf(t),o=r,s=0,i=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++s>i&&(i=s):s=1,o=r+t.length,r=n.indexOf(t,o);return i}function gq(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function yq(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function vq(e,t,n,r){const o=yq(n),s=e.value||"",i=o==="`"?"GraveAccent":"Tilde";if(gq(e,n)){const f=n.enter("codeIndented"),p=n.indentLines(s,xq);return f(),p}const a=n.createTracker(r),l=o.repeat(Math.max(mq(s,o)+1,3)),u=n.enter("codeFenced");let d=a.move(l);if(e.lang){const f=n.enter(`codeFencedLang${i}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${i}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
413
- `,encode:["`"],...a.current()})),f()}return d+=a.move(`
414
- `),s&&(d+=a.move(s+`
415
- `)),d+=a.move(l),u(),d}function xq(e,t,n){return(n?"":" ")+e}function B0(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function wq(e,t,n,r){const o=B0(n),s=o==='"'?"Quote":"Apostrophe",i=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
416
- `,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),u+=l.move(" "+o),u+=l.move(n.safe(e.title,{before:u,after:o,...l.current()})),u+=l.move(o),a()),i(),u}function bq(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function qc(e){return"&#x"+e.toString(16).toUpperCase()+";"}function zf(e,t,n){const r=rl(e),o=rl(t);return r===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}mT.peek=kq;function mT(e,t,n,r){const o=bq(n),s=n.enter("emphasis"),i=n.createTracker(r),a=i.move(o);let l=i.move(n.containerPhrasing(e,{after:o,before:a,...i.current()}));const u=l.charCodeAt(0),d=zf(r.before.charCodeAt(r.before.length-1),u,o);d.inside&&(l=qc(u)+l.slice(1));const f=l.charCodeAt(l.length-1),p=zf(r.after.charCodeAt(0),f,o);p.inside&&(l=l.slice(0,-1)+qc(f));const h=i.move(o);return s(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},a+l+h}function kq(e,t,n){return n.options.emphasis||"*"}function _q(e,t){let n=!1;return V0(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,iy}),!!((!e.depth||e.depth<3)&&M0(e)&&(t.options.setext||n))}function Sq(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(_q(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),p=n.containerPhrasing(e,{...s.current(),before:`
417
- `,after:`
418
- `});return f(),d(),p+`
419
- `+(o===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
420
- `))+1))}const i="#".repeat(o),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(i+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
421
- `,...s.current()});return/^[\t ]/.test(u)&&(u=qc(u.charCodeAt(0))+u.slice(1)),u=u?i+" "+u:i,n.options.closeAtx&&(u+=" "+i),l(),a(),u}gT.peek=Cq;function gT(e){return e.value||""}function Cq(){return"<"}yT.peek=Eq;function yT(e,t,n,r){const o=B0(n),s=o==='"'?"Quote":"Apostrophe",i=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),u+=l.move(" "+o),u+=l.move(n.safe(e.title,{before:u,after:o,...l.current()})),u+=l.move(o),a()),u+=l.move(")"),i(),u}function Eq(){return"!"}vT.peek=Nq;function vT(e,t,n,r){const o=e.referenceType,s=n.enter("imageReference");let i=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),i();const d=n.stack;n.stack=[],i=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return i(),n.stack=d,s(),o==="full"||!u||u!==f?l+=a.move(f+"]"):o==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Nq(){return"!"}xT.peek=jq;function xT(e,t,n){let r=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const i=n.unsafe[s],a=n.compilePattern(i);let l;if(i.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return o+r+o}function jq(){return"`"}function wT(e,t){const n=M0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}bT.peek=Pq;function bT(e,t,n,r){const o=B0(n),s=o==='"'?"Quote":"Apostrophe",i=n.createTracker(r);let a,l;if(wT(e,n)){const d=n.stack;n.stack=[],a=n.enter("autolink");let f=i.move("<");return f+=i.move(n.containerPhrasing(e,{before:f,after:">",...i.current()})),f+=i.move(">"),a(),n.stack=d,f}a=n.enter("link"),l=n.enter("label");let u=i.move("[");return u+=i.move(n.containerPhrasing(e,{before:u,after:"](",...i.current()})),u+=i.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=i.move("<"),u+=i.move(n.safe(e.url,{before:u,after:">",...i.current()})),u+=i.move(">")):(l=n.enter("destinationRaw"),u+=i.move(n.safe(e.url,{before:u,after:e.title?" ":")",...i.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=i.move(" "+o),u+=i.move(n.safe(e.title,{before:u,after:o,...i.current()})),u+=i.move(o),l()),u+=i.move(")"),a(),u}function Pq(e,t,n){return wT(e,n)?"<":"["}kT.peek=Tq;function kT(e,t,n,r){const o=e.referenceType,s=n.enter("linkReference");let i=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),i();const d=n.stack;n.stack=[],i=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return i(),n.stack=d,s(),o==="full"||!u||u!==f?l+=a.move(f+"]"):o==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function Tq(){return"["}function W0(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function $q(e){const t=W0(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Rq(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function _T(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Iq(e,t,n,r){const o=n.enter("list"),s=n.bulletCurrent;let i=e.ordered?Rq(n):W0(n);const a=e.ordered?i==="."?")":".":$q(n);let l=t&&n.bulletLastUsed?i===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((i==="*"||i==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),_T(n)===i&&d){let f=-1;for(;++f<e.children.length;){const p=e.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(i=a),n.bulletCurrent=i;const u=n.containerFlow(e,r);return n.bulletLastUsed=i,n.bulletCurrent=s,o(),u}function Aq(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Oq(e,t,n,r){const o=Aq(n);let s=n.bulletCurrent||W0(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let i=s.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(i=Math.ceil(i/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(i-s.length)),a.shift(i);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),d);return l(),u;function d(f,p,h){return p?(h?"":" ".repeat(i))+f:(h?s:s+" ".repeat(i-s.length))+f}}function Mq(e,t,n,r){const o=n.enter("paragraph"),s=n.enter("phrasing"),i=n.containerPhrasing(e,r);return s(),o(),i}const Dq=Bh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Lq(e,t,n,r){return(e.children.some(function(i){return Dq(i)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function zq(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ST.peek=Fq;function ST(e,t,n,r){const o=zq(n),s=n.enter("strong"),i=n.createTracker(r),a=i.move(o+o);let l=i.move(n.containerPhrasing(e,{after:o,before:a,...i.current()}));const u=l.charCodeAt(0),d=zf(r.before.charCodeAt(r.before.length-1),u,o);d.inside&&(l=qc(u)+l.slice(1));const f=l.charCodeAt(l.length-1),p=zf(r.after.charCodeAt(0),f,o);p.inside&&(l=l.slice(0,-1)+qc(f));const h=i.move(o+o);return s(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},a+l+h}function Fq(e,t,n){return n.options.strong||"*"}function Uq(e,t,n,r){return n.safe(e.value,r)}function qq(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Vq(e,t,n){const r=(_T(n)+(n.options.ruleSpaces?" ":"")).repeat(qq(n));return n.options.ruleSpaces?r.slice(0,-1):r}const CT={blockquote:fq,break:C1,code:vq,definition:wq,emphasis:mT,hardBreak:C1,heading:Sq,html:gT,image:yT,imageReference:vT,inlineCode:xT,link:bT,linkReference:kT,list:Iq,listItem:Oq,paragraph:Mq,root:Lq,strong:ST,text:Uq,thematicBreak:Vq};function Hq(){return{enter:{table:Bq,tableData:E1,tableHeader:E1,tableRow:Kq},exit:{codeText:Zq,table:Wq,tableData:pm,tableHeader:pm,tableRow:pm}}}function Bq(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Wq(e){this.exit(e),this.data.inTable=void 0}function Kq(e){this.enter({type:"tableRow",children:[]},e)}function pm(e){this.exit(e)}function E1(e){this.enter({type:"tableCell",children:[]},e)}function Zq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Qq));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Qq(e,t){return t==="|"?t:e}function Gq(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
422
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:i,tableCell:l,tableRow:a}};function i(h,y,m,x){return u(d(h,m,x),h.align)}function a(h,y,m,x){const g=f(h,m,x),v=u([g]);return v.slice(0,v.indexOf(`
423
- `))}function l(h,y,m,x){const g=m.enter("tableCell"),v=m.enter("phrasing"),b=m.containerPhrasing(h,{...x,before:s,after:s});return v(),g(),b}function u(h,y){return uq(h,{align:y,alignDelimiters:r,padding:n,stringLength:o})}function d(h,y,m){const x=h.children;let g=-1;const v=[],b=y.enter("table");for(;++g<x.length;)v[g]=f(x[g],y,m);return b(),v}function f(h,y,m){const x=h.children;let g=-1;const v=[],b=y.enter("tableRow");for(;++g<x.length;)v[g]=l(x[g],h,y,m);return b(),v}function p(h,y,m){let x=CT.inlineCode(h,y,m);return m.stack.includes("tableCell")&&(x=x.replace(/\|/g,"\\$&")),x}}function Jq(){return{exit:{taskListCheckValueChecked:N1,taskListCheckValueUnchecked:N1,paragraph:Xq}}}function Yq(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:eV}}}function N1(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Xq(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=t.children;let s=-1,i;for(;++s<o.length;){const a=o[s];if(a.type==="paragraph"){i=a;break}}i===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function eV(e,t,n,r){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(i);let l=CT.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+i}}function tV(){return[I8(),eq(),oq(),Hq(),Jq()]}function nV(e){return{extensions:[A8(),tq(e),sq(),Gq(e),Yq()]}}const rV={tokenize:cV,partial:!0},ET={tokenize:uV,partial:!0},NT={tokenize:dV,partial:!0},jT={tokenize:fV,partial:!0},oV={tokenize:hV,partial:!0},PT={name:"wwwAutolink",tokenize:aV,previous:$T},TT={name:"protocolAutolink",tokenize:lV,previous:RT},qo={name:"emailAutolink",tokenize:iV,previous:IT},io={};function sV(){return{text:io}}let Vs=48;for(;Vs<123;)io[Vs]=qo,Vs++,Vs===58?Vs=65:Vs===91&&(Vs=97);io[43]=qo;io[45]=qo;io[46]=qo;io[95]=qo;io[72]=[qo,TT];io[104]=[qo,TT];io[87]=[qo,PT];io[119]=[qo,PT];function iV(e,t,n){const r=this;let o,s;return i;function i(f){return!uy(f)||!IT.call(r,r.previous)||K0(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return uy(f)?(e.consume(f),a):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(oV,d,u)(f):f===45||f===95||hn(f)?(s=!0,e.consume(f),l):d(f)}function u(f){return e.consume(f),o=!0,l}function d(f){return s&&o&&_n(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function aV(e,t,n){const r=this;return o;function o(i){return i!==87&&i!==119||!$T.call(r,r.previous)||K0(r.events)?n(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(rV,e.attempt(ET,e.attempt(NT,s),n),n)(i))}function s(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(i)}}function lV(e,t,n){const r=this;let o="",s=!1;return i;function i(f){return(f===72||f===104)&&RT.call(r,r.previous)&&!K0(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(f),e.consume(f),a):n(f)}function a(f){if(_n(f)&&o.length<5)return o+=String.fromCodePoint(f),e.consume(f),a;if(f===58){const p=o.toLowerCase();if(p==="http"||p==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),s?u:(s=!0,l)):n(f)}function u(f){return f===null||Mf(f)||nt(f)||$i(f)||qh(f)?n(f):e.attempt(ET,e.attempt(NT,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function cV(e,t,n){let r=0;return o;function o(i){return(i===87||i===119)&&r<3?(r++,e.consume(i),o):i===46&&r===3?(e.consume(i),s):n(i)}function s(i){return i===null?n(i):t(i)}}function uV(e,t,n){let r,o,s;return i;function i(u){return u===46||u===95?e.check(jT,l,a)(u):u===null||nt(u)||$i(u)||u!==45&&qh(u)?l(u):(s=!0,e.consume(u),i)}function a(u){return u===95?r=!0:(o=r,r=void 0),e.consume(u),i}function l(u){return o||r||!s?n(u):t(u)}}function dV(e,t){let n=0,r=0;return o;function o(i){return i===40?(n++,e.consume(i),o):i===41&&r<n?s(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(jT,t,s)(i):i===null||nt(i)||$i(i)?t(i):(e.consume(i),o)}function s(i){return i===41&&r++,e.consume(i),o}}function fV(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),o):a===60||a===null||nt(a)||$i(a)?t(a):n(a)}function o(a){return a===null||a===40||a===91||nt(a)||$i(a)?t(a):r(a)}function s(a){return _n(a)?i(a):n(a)}function i(a){return a===59?(e.consume(a),r):_n(a)?(e.consume(a),i):n(a)}}function hV(e,t,n){return r;function r(s){return e.consume(s),o}function o(s){return hn(s)?n(s):t(s)}}function $T(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||nt(e)}function RT(e){return!_n(e)}function IT(e){return!(e===47||uy(e))}function uy(e){return e===43||e===45||e===46||e===95||hn(e)}function K0(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const pV={tokenize:kV,partial:!0};function mV(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xV,continuation:{tokenize:wV},exit:bV}},text:{91:{name:"gfmFootnoteCall",tokenize:vV},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:gV,resolveTo:yV}}}}function gV(e,t,n){const r=this;let o=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i;for(;o--;){const l=r.events[o][1];if(l.type==="labelImage"){i=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!i||!i._balanced)return n(l);const u=Ar(r.sliceSerialize({start:i.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function yV(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},i={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function vV(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,i;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(s>999||f===93&&!i||f===null||f===91||nt(f))return n(f);if(f===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return o.includes(Ar(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return nt(f)||(i=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function xV(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,i=0,a;return l;function l(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(y)}function d(y){if(i>999||y===93&&!a||y===null||y===91||nt(y))return n(y);if(y===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=Ar(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return nt(y)||(a=!0),i++,e.consume(y),y===92?f:d}function f(y){return y===91||y===92||y===93?(e.consume(y),i++,d):d(y)}function p(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),o.includes(s)||o.push(s),Ke(e,h,"gfmFootnoteDefinitionWhitespace")):n(y)}function h(y){return t(y)}}function wV(e,t,n){return e.check(fu,t,e.attempt(pV,t,n))}function bV(e){e.exit("gfmFootnoteDefinition")}function kV(e,t,n){const r=this;return Ke(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const i=r.events[r.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?t(s):n(s)}}function _V(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(i,a){let l=-1;for(;++l<i.length;)if(i[l][0]==="enter"&&i[l][1].type==="strikethroughSequenceTemporary"&&i[l][1]._close){let u=l;for(;u--;)if(i[u][0]==="exit"&&i[u][1].type==="strikethroughSequenceTemporary"&&i[u][1]._open&&i[l][1].end.offset-i[l][1].start.offset===i[u][1].end.offset-i[u][1].start.offset){i[l][1].type="strikethroughSequence",i[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},i[u][1].start),end:Object.assign({},i[l][1].end)},f={type:"strikethroughText",start:Object.assign({},i[u][1].end),end:Object.assign({},i[l][1].start)},p=[["enter",d,a],["enter",i[u][1],a],["exit",i[u][1],a],["enter",f,a]],h=a.parser.constructs.insideSpan.null;h&&Gn(p,p.length,0,Vh(h,i.slice(u+1,l),a)),Gn(p,p.length,0,[["exit",f,a],["enter",i[l][1],a],["exit",i[l][1],a],["exit",d,a]]),Gn(i,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<i.length;)i[l][1].type==="strikethroughSequenceTemporary"&&(i[l][1].type="data");return i}function s(i,a,l){const u=this.previous,d=this.events;let f=0;return p;function p(y){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(y):(i.enter("strikethroughSequenceTemporary"),h(y))}function h(y){const m=rl(u);if(y===126)return f>1?l(y):(i.consume(y),f++,h);if(f<2&&!n)return l(y);const x=i.exit("strikethroughSequenceTemporary"),g=rl(y);return x._open=!g||g===2&&!!m,x._close=!m||m===2&&!!g,a(y)}}}class SV{constructor(){this.map=[]}add(t,n,r){CV(this,t,n,r)}consume(t){if(this.map.sort(function(s,i){return s[0]-i[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(const s of o)t.push(s);o=r.pop()}this.map.length=0}}function CV(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function EV(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function NV(){return{flow:{null:{name:"table",tokenize:jV,resolveAll:PV}}}}function jV(e,t,n){const r=this;let o=0,s=0,i;return a;function a($){let j=r.events.length-1;for(;j>-1;){const L=r.events[j][1].type;if(L==="lineEnding"||L==="linePrefix")j--;else break}const I=j>-1?r.events[j][1].type:null,D=I==="tableHead"||I==="tableRow"?E:l;return D===E&&r.parser.lazy[r.now().line]?n($):D($)}function l($){return e.enter("tableHead"),e.enter("tableRow"),u($)}function u($){return $===124||(i=!0,s+=1),d($)}function d($){return $===null?n($):Ee($)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),h):n($):qe($)?Ke(e,d,"whitespace")($):(s+=1,i&&(i=!1,o+=1),$===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),i=!0,d):(e.enter("data"),f($)))}function f($){return $===null||$===124||nt($)?(e.exit("data"),d($)):(e.consume($),$===92?p:f)}function p($){return $===92||$===124?(e.consume($),f):f($)}function h($){return r.interrupt=!1,r.parser.lazy[r.now().line]?n($):(e.enter("tableDelimiterRow"),i=!1,qe($)?Ke(e,y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):y($))}function y($){return $===45||$===58?x($):$===124?(i=!0,e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),m):S($)}function m($){return qe($)?Ke(e,x,"whitespace")($):x($)}function x($){return $===58?(s+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),g):$===45?(s+=1,g($)):$===null||Ee($)?k($):S($)}function g($){return $===45?(e.enter("tableDelimiterFiller"),v($)):S($)}function v($){return $===45?(e.consume($),v):$===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b($))}function b($){return qe($)?Ke(e,k,"whitespace")($):k($)}function k($){return $===124?y($):$===null||Ee($)?!i||o!==s?S($):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t($)):S($)}function S($){return n($)}function E($){return e.enter("tableRow"),P($)}function P($){return $===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),P):$===null||Ee($)?(e.exit("tableRow"),t($)):qe($)?Ke(e,P,"whitespace")($):(e.enter("data"),O($))}function O($){return $===null||$===124||nt($)?(e.exit("data"),P($)):(e.consume($),$===92?R:O)}function R($){return $===92||$===124?(e.consume($),O):O($)}}function PV(e,t){let n=-1,r=!0,o=0,s=[0,0,0,0],i=[0,0,0,0],a=!1,l=0,u,d,f;const p=new SV;for(;++n<e.length;){const h=e[n],y=h[1];h[0]==="enter"?y.type==="tableHead"?(a=!1,l!==0&&(j1(p,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",u,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(r=!0,f=void 0,s=[0,0,0,0],i=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},p.add(n,0,[["enter",d,t]])),o=y.type==="tableDelimiterRow"?2:d?3:1):o&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(r=!1,i[2]===0&&(s[1]!==0&&(i[0]=i[1],f=sd(p,t,s,o,void 0,f),s=[0,0,0,0]),i[2]=n)):y.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(i[0]=i[1],f=sd(p,t,s,o,void 0,f)),s=i,i=[s[1],n,0,0])):y.type==="tableHead"?(a=!0,l=n):y.type==="tableRow"||y.type==="tableDelimiterRow"?(l=n,s[1]!==0?(i[0]=i[1],f=sd(p,t,s,o,n,f)):i[1]!==0&&(f=sd(p,t,i,o,n,f)),o=0):o&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(i[3]=n)}for(l!==0&&j1(p,t,l,u,d),p.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=EV(t.events,n))}return e}function sd(e,t,n,r,o,s){const i=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Ji(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Ji(t.events,n[1]);if(s={type:i,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Ji(t.events,n[2]),d=Ji(t.events,n[3]),f={type:a,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const y=n[2]+1,m=n[3]-n[2]-1;e.add(y,m,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return o!==void 0&&(s.end=Object.assign({},Ji(t.events,o)),e.add(o,0,[["exit",s,t]]),s=void 0),s}function j1(e,t,n,r,o){const s=[],i=Ji(t.events,n);o&&(o.end=Object.assign({},i),s.push(["exit",o,t])),r.end=Object.assign({},i),s.push(["exit",r,t]),e.add(n+1,0,s)}function Ji(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const TV={name:"tasklistCheck",tokenize:RV};function $V(){return{text:{91:TV}}}function RV(e,t,n){const r=this;return o;function o(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return nt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),i):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),i):n(l)}function i(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return Ee(l)?t(l):qe(l)?e.check({tokenize:IV},t,n)(l):n(l)}}function IV(e,t,n){return Ke(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function AV(e){return VP([sV(),mV(),_V(e),NV(),$V()])}const OV={};function MV(e){const t=this,n=e||OV,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),i=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(AV(n)),s.push(tV()),i.push(nV(n))}const Ff=180;function DV(e){return e.replace(/\*\*([^*]+)\*\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/^#+\s+/gm,"").replace(/\s+/g," ").trim()}function LV(e,t){var o;if(t!=null&&t.trim())return t.trim();const n=((o=e.split(/\n\n+/)[0])==null?void 0:o.replace(/\n/g," "))??e,r=DV(n);return r.length<=Ff?r:`${r.slice(0,Ff-1).trimEnd()}…`}function zV(e,t){return t!=null&&t.trim()&&e.length>Ff?!0:e.length>Ff||/\n/.test(e)}function FV({description:e,title:t,expanded:n,onToggle:r}){const o=LV(e,t),s=zV(e,t);return e?s?c.jsxs("div",{className:"space-y-1",children:[c.jsx("p",{className:"line-clamp-3 text-sm leading-relaxed",children:o}),c.jsxs("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1 text-xs text-[#92E4DD] hover:text-white",children:[c.jsx(Eh,{className:`h-3.5 w-3.5 transition-transform ${n?"rotate-180":""}`}),n?"Hide full description":"Show full description"]})]}):c.jsx("span",{children:o}):c.jsx("span",{className:"text-gray-500",children:"—"})}function UV({description:e}){return c.jsx("div",{className:"max-h-64 overflow-auto rounded border border-white/10 bg-[#0F0F0C] p-3",children:c.jsx("div",{className:"prose prose-sm prose-invert max-w-none prose-headings:text-gray-100 prose-p:text-gray-300 prose-li:text-gray-300 prose-strong:text-gray-100 prose-code:text-[#92E4DD] prose-code:before:content-none prose-code:after:content-none",children:c.jsx(_8,{remarkPlugins:[MV],children:e})})})}function qV(){const[e,t]=w.useState(null);return{expandedDescription:e,toggleDescription:r=>{t(o=>o===r?null:r)}}}function mm(e){return new Set(e.filter(t=>t.enabled===!1).map(t=>t.name))}function VV({serviceId:e,tools:t,isLoading:n}){const[r,o]=w.useState(""),[s,i]=w.useState(null),{expandedDescription:a,toggleDescription:l}=qV(),[u,d]=w.useState(()=>mm(t)),f=Kt(),{toast:p}=qt(),h=w.useMemo(()=>t.map(k=>`${k.name}:${k.enabled===!1?"0":"1"}`).sort().join("\0"),[t]);w.useEffect(()=>{d(mm(t))},[e,h]);const y=dt({mutationFn:async k=>{await Ce("PUT",`/api/services/${e}/tool-settings`,{disabledTools:k})},onSuccess:()=>{f.invalidateQueries({queryKey:["/api/services",e,"tools"]}),f.invalidateQueries({queryKey:["/api/services"]})},onError:k=>{p({title:"Could not save tool settings",description:k.message,variant:"destructive"}),d(mm(t))}}),m=k=>{d(k),y.mutate([...k])},x=(k,S)=>{const E=new Set(u);S?E.delete(k):E.add(k),m(E)},g=k=>{if(k){m(new Set);return}m(new Set(t.map(S=>S.name)))},v=w.useMemo(()=>{const k=r.trim().toLowerCase();return k?t.filter(S=>{var E;return S.name.toLowerCase().includes(k)||(((E=S.title)==null?void 0:E.toLowerCase().includes(k))??!1)||S.description.toLowerCase().includes(k)}):t},[t,r]),b=t.length-u.size;return n?c.jsx("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:c.jsx("p",{className:"text-sm text-gray-400",children:"Loading tools…"})}):t.length===0?null:c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("h3",{className:"text-lg font-semibold flex items-center",children:[c.jsx(t0,{className:"w-5 h-5 mr-2"}),"Tools",c.jsxs("span",{className:"ml-2 text-sm font-normal text-gray-400",children:[b," of ",t.length," enabled"]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(le,{type:"button",size:"sm",variant:"ghost",className:"h-8 text-xs text-[#A8C4C0] hover:text-white hover:bg-white/10",onClick:()=>g(!0),disabled:u.size===0||y.isPending,children:"Enable all"}),c.jsx(le,{type:"button",size:"sm",variant:"ghost",className:"h-8 text-xs text-[#A8C4C0] hover:text-white hover:bg-white/10",onClick:()=>g(!1),disabled:b===0||y.isPending,children:"Disable all"})]})]}),c.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."}),c.jsxs("div",{className:"relative mb-3",children:[c.jsx(fN,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500"}),c.jsx(Je,{value:r,onChange:k=>o(k.target.value),placeholder:"Search tools…",className:"border-white/15 bg-[#0F0F0C] pl-9 text-[#E8F6F4] placeholder:text-[#6B8581]"})]}),c.jsx("div",{className:"rounded-md border border-white/10 overflow-hidden",children:c.jsxs(EP,{children:[c.jsx(NP,{children:c.jsxs(Gi,{className:"border-white/10 hover:bg-transparent",children:[c.jsx(Ld,{className:"w-[72px] text-center text-[#A8C4C0]",children:"Enabled"}),c.jsx(Ld,{className:"w-[220px] text-[#A8C4C0]",children:"Tool"}),c.jsx(Ld,{className:"text-[#A8C4C0]",children:"Description"})]})}),c.jsx(jP,{children:v.length===0?c.jsx(Gi,{className:"border-white/10 hover:bg-transparent",children:c.jsx(Qs,{colSpan:3,className:"py-8 text-center text-sm text-gray-400",children:"No tools match your search."})}):v.map(k=>{const S=!u.has(k.name),E=s===k.name,P=a===k.name,O=k.inputSchema&&Object.keys(k.inputSchema).length>0;return c.jsxs(w.Fragment,{children:[c.jsxs(Gi,{className:`border-white/10 ${S?"hover:bg-white/5":"opacity-60 hover:bg-white/5"}`,children:[c.jsx(Qs,{className:"text-center",children:c.jsx("div",{className:"flex justify-center",children:c.jsx(Of,{checked:S,onCheckedChange:R=>x(k.name,R===!0),disabled:y.isPending,"aria-label":`${S?"Disable":"Enable"} ${k.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]"})})}),c.jsx(Qs,{children:O?c.jsxs("button",{type:"button",onClick:()=>i(E?null:k.name),className:"flex w-full items-center gap-1 text-left font-mono text-sm text-[#92E4DD] hover:text-white",children:[c.jsx(Eh,{className:`h-4 w-4 shrink-0 transition-transform ${E?"rotate-180":""}`}),k.name]}):c.jsx("span",{className:"font-mono text-sm text-[#92E4DD]",children:k.name})}),c.jsx(Qs,{className:"max-w-0 text-sm text-gray-300",children:c.jsx(FV,{description:k.description,title:k.title,expanded:P,onToggle:()=>l(k.name)})})]}),P&&c.jsx(Gi,{className:"border-white/10 bg-black/30 hover:bg-black/30",children:c.jsx(Qs,{colSpan:3,className:"py-3",children:c.jsx(UV,{description:k.description})})}),O&&E&&c.jsx(Gi,{className:"border-white/10 bg-black/30 hover:bg-black/30",children:c.jsx(Qs,{colSpan:3,className:"py-3",children:c.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(k.inputSchema,null,2)})})})]},k.name)})})]})})]})}function gm({items:e,className:t}){return e.length===0?null:c.jsx("ol",{className:`list-decimal list-inside space-y-1 text-xs ${t??""}`,children:e.map((n,r)=>c.jsx("li",{children:n},`${r}-${n.slice(0,24)}`))})}function P1({serviceId:e,onConnected:t}){const{toast:n}=qt(),[r,o]=w.useState(""),[s,i]=w.useState(""),[a,l]=w.useState(!1),[u,d]=w.useState(!1),[f,p]=w.useState(!1),{data:h,isLoading:y}=ut({queryKey:["/api/oauth",e,"setup"],queryFn:async()=>{const S=await Ce("GET",`/api/oauth/${e}/setup`),E=await S.json();if(!S.ok||!E.success)throw new Error(E.error||"Failed to load OAuth setup");return E.data},enabled:!!e}),m=h==null?void 0:h.guide,x=!!(h!=null&&h.hasSavedCredentials),g=()=>{if(!u||(m==null?void 0:m.setupMode)!=="manual")return;const S={};return r.trim()&&(S.clientId=r.trim()),s.trim()&&(S.clientSecret=s.trim()),S},v=async(S,E)=>{try{await navigator.clipboard.writeText(E),n({title:"Copied",description:`${S} copied to clipboard.`})}catch{n({title:"Copy failed",description:"Select and copy manually.",variant:"destructive"})}};w.useEffect(()=>{(m==null?void 0:m.setupMode)==="manual"?d(!0):d(!1),p(!x)},[m==null?void 0:m.setupMode,x]),w.useEffect(()=>{h!=null&&h.savedOAuthClientId&&!r&&o(h.savedOAuthClientId)},[h==null?void 0:h.savedOAuthClientId,r]);const b=async S=>{var E,P,O;l(!0);try{const R=await Ce("POST",`/api/oauth/${e}/connect`,S??{}),$=await R.json();if(!R.ok||!$.success){((E=$.data)!=null&&E.needsCredentials||((P=$.data)==null?void 0:P.setupMode)==="manual")&&d(!0),n({title:"OAuth setup",description:$.error||"Could not start OAuth flow.",variant:"destructive"});return}(O=$.data)!=null&&O.authorizationUrl&&(window.open($.data.authorizationUrl,"_blank"),n({title:"Continue in browser",description:"Complete sign-in in the new tab, then return here."}),t==null||t())}catch(R){n({title:"OAuth setup failed",description:R instanceof Error?R.message:"Unknown error",variant:"destructive"})}finally{l(!1)}};if(y)return c.jsx("p",{className:"text-sm text-orange-200",children:"Loading setup guide…"});if(!m)return null;if(m.setupMode==="unavailable")return c.jsxs("div",{className:"space-y-3 text-sm text-orange-100",children:[c.jsx("p",{children:m.unavailableReason}),m.docsUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(m.docsUrl,"_blank"),children:[c.jsx(Co,{className:"w-4 h-4 mr-1"}),"Provider docs"]})]});const k=m.setupMode==="dynamic"||m.setupMode==="managed"||m.setupMode==="manual";return c.jsxs("div",{className:"space-y-4 text-sm text-orange-100",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-orange-200",children:m.title}),m.summary&&c.jsx("p",{className:"mt-1 text-xs text-orange-100/90",children:m.summary}),k&&c.jsxs("p",{className:"mt-2 text-xs text-orange-100/80",children:["Redirect URI:"," ",c.jsx("code",{className:"text-orange-50",children:m.redirectUri})]}),m.easierAlternative&&c.jsx("p",{className:"mt-2 text-xs text-orange-100/70 border-l-2 border-orange-500/30 pl-2",children:m.easierAlternative})]}),x&&m.setupMode==="manual"&&c.jsxs("div",{className:"rounded-lg border border-green-500/30 bg-green-500/10 p-3 text-xs text-green-100",children:[c.jsx("p",{className:"font-medium text-green-200",children:"OAuth credentials saved"}),c.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."})]}),m.prerequisites&&m.prerequisites.length>0&&!x&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"Before you start"}),c.jsx("ul",{className:"list-disc list-inside space-y-1 text-xs text-orange-100/90",children:m.prerequisites.map(S=>c.jsx("li",{children:S},S))})]}),(m.manifestJson||m.createAppUrl||k)&&c.jsxs("div",{className:"flex flex-wrap gap-2",children:[m.manifestJson&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>void v("App manifest",m.manifestJson),children:[c.jsx(o4,{className:"w-4 h-4 mr-1"}),"Copy manifest"]}),k&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>void v("Redirect URI",m.redirectUri),children:[c.jsx(e0,{className:"w-4 h-4 mr-1"}),"Copy redirect URI"]}),m.createAppUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(m.createAppUrl,"_blank"),children:[c.jsx(Co,{className:"w-4 h-4 mr-1"}),m.createAppLabel??"Open app creator"]})]}),m.steps.length>0&&c.jsx("div",{children:x&&m.setupMode==="manual"?c.jsxs("details",{className:"rounded-lg border border-orange-500/20 bg-orange-500/5 p-3",children:[c.jsx("summary",{className:"cursor-pointer text-xs font-medium text-orange-200",children:"First-time Slack app setup"}),c.jsx("div",{className:"mt-2",children:c.jsx(gm,{items:m.steps})})]}):c.jsxs(c.Fragment,{children:[m.setupMode==="informational"?c.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"What to do"}):null,c.jsx(gm,{items:m.steps})]})}),m.tokenAlternative&&c.jsxs("p",{className:"text-xs text-orange-100/80 border-l-2 border-orange-500/30 pl-2",children:[c.jsx("span",{className:"font-medium text-orange-200",children:"Alternative: "}),m.tokenAlternative]}),u&&m.setupMode==="manual"&&c.jsxs("div",{className:"space-y-3 rounded-lg border border-orange-500/20 bg-orange-500/5 p-3",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx(Be,{htmlFor:`oauth-client-id-${e}`,className:"text-orange-200",children:"Client ID"}),c.jsx(Je,{id:`oauth-client-id-${e}`,value:r,onChange:S=>o(S.target.value),placeholder:"OAuth Client ID",className:"bg-black/20 border-orange-500/30"})]}),f?c.jsxs("div",{className:"space-y-1",children:[c.jsx(Be,{htmlFor:`oauth-client-secret-${e}`,className:"text-orange-200",children:"Client Secret"}),c.jsx(Je,{id:`oauth-client-secret-${e}`,type:"password",value:s,onChange:S=>i(S.target.value),placeholder:"OAuth Client Secret",className:"bg-black/20 border-orange-500/30"})]}):c.jsx("p",{className:"text-xs text-orange-200/80",children:"Client secret is saved locally for this service."}),x&&c.jsx(le,{type:"button",size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>p(S=>!S),children:f?"Hide client secret field":"Update client secret"}),(h==null?void 0:h.hasStoredClientSecret)&&f&&c.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."})]}),m.afterConnect&&m.afterConnect.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-orange-200 mb-1",children:"After connect"}),c.jsx(gm,{items:m.afterConnect,className:"text-orange-100/80"})]}),k&&c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(le,{size:"sm",className:"bg-orange-600 hover:bg-orange-700",disabled:a||u&&m.setupMode==="manual"&&!x&&(!r.trim()||!s.trim()),onClick:()=>b(g()),children:a?"Connecting…":x&&m.setupMode==="manual"?"Reconnect":m.setupMode==="dynamic"||m.setupMode==="managed"?"Connect":"Connect with credentials"}),m.docsUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(m.docsUrl,"_blank"),children:[c.jsx(Co,{className:"w-4 h-4 mr-1"}),"Docs"]})]}),m.setupMode==="informational"&&m.docsUrl&&c.jsxs(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-200",onClick:()=>window.open(m.docsUrl,"_blank"),children:[c.jsx(Co,{className:"w-4 h-4 mr-1"}),"Docs"]})]})}function fc(e,t){e.invalidateQueries({queryKey:["/api/services"]}),e.invalidateQueries({queryKey:["/api/collection/warnings"]}),t&&(e.invalidateQueries({queryKey:["/api/services",t]}),e.invalidateQueries({queryKey:["/api/services",t,"tools"]}))}const AT="agent-deck:oauth-complete";function HV(e){return typeof e=="object"&&e!==null&&e.type===AT}function ei(e){return!!(e&&typeof e=="object"&&Object.keys(e).length>0)}function T1(e){return ei(e)?JSON.stringify(e,null,2):`{
424
-
425
- }`}function BV(e){const t=e.trim();if(!t||t==="{}")return{ok:!0,headers:{}};try{const n=JSON.parse(t);if(typeof n!="object"||n===null||Array.isArray(n))return{ok:!1,error:'Headers must be a JSON object (e.g. {"Authorization": "Bearer token"})'};for(const[r,o]of Object.entries(n))if(typeof o!="string")return{ok:!1,error:`Header "${r}" must be a string value`};return{ok:!0,headers:n}}catch{return{ok:!1,error:"Invalid JSON — fix syntax before saving"}}}function WV(e){return/^bearer\s+/i.test(e)?"Bearer ••••":e.length>0?"••••":""}function id(e){return ei(e)?Object.entries(e).map(([t,n])=>({name:t,masked:WV(n)})):[]}function ad(e){return e==="not_required"||e==="authenticated"||e==="authenticated_refreshable"}function KV(e){if(!e)return"unknown";const t=new Date(e).getTime()-Date.now();if(t<=0)return"soon";const n=Math.round(t/6e4);if(n<60)return`in ${n} minute${n===1?"":"s"}`;const r=Math.round(n/60);if(r<48)return`in ${r} hour${r===1?"":"s"}`;const o=Math.round(r/24);return`in ${o} day${o===1?"":"s"}`}function ZV(e){if(!e||e.type!=="local-mcp")return!1;const t=[e.localCommand,...e.localArgs??[],e.url,e.name].filter(Boolean).join(" ").toLowerCase();return t.includes("google-drive")||t.includes("google_drive")}function QV({service:e,isOpen:t,onClose:n}){var Pe,We,Qt,nr,Nn,zr,Fr,Ot,rr,gn,lo,cp,fe,Vt,Us,qs,gw,yw,vw,xw,ww,bw;const[r,o]=w.useState(null),[s,i]=w.useState(!1),[a,l]=w.useState(!1),[u,d]=w.useState(""),[f,p]=w.useState(""),[h,y]=w.useState(!1),[m,x]=w.useState(!1),[g,v]=w.useState(!1),[b,k]=w.useState(`{
426
-
427
- }`),[S,E]=w.useState(null),[P,O]=w.useState(!1),[R,$]=w.useState(null),j=w.useRef(null),I=Kt(),{toast:D}=qt(),L=e&&(R==null?void 0:R.id)===e.id?R:e,T=L,Q=T!=null&&T.headers&&typeof T.headers=="object"?T.headers:null,X=!!(T&&T.id&&T.url),{data:M,isLoading:K,error:N,refetch:z}=ut({queryKey:["/api/mcp/discover",T==null?void 0:T.url],queryFn:async()=>{if(!T||T.type!=="mcp")return null;console.log(`🔍 Attempting MCP discovery for: ${T.url}`);try{const xe=await(await Ce("POST","/api/mcp/discover",{url:T.url})).json();return console.log(`✅ MCP discovery successful for ${T.url}:`,xe),xe}catch(ue){throw console.log(`❌ MCP discovery failed for ${T.url}:`,ue),ue}},enabled:X&&T.type==="mcp"&&t,staleTime:0,gcTime:2*60*1e3}),W=((We=(Pe=M==null?void 0:M.data)==null?void 0:Pe.oauth)==null?void 0:We.required)===!0,{data:_,refetch:C}=ut({queryKey:["/api/oauth",T==null?void 0:T.id,"status"],queryFn:async()=>{const ue=await Ce("GET",`/api/oauth/${T.id}/status`),xe=await ue.json();if(!ue.ok||!xe.success)throw new Error(xe.error||"Failed to load OAuth status");return xe.data},enabled:X&&T.type==="mcp"&&t&&W,refetchInterval:ue=>{const xe=ue.state.data;return xe!=null&&xe.authenticated||xe!=null&&xe.refreshFailed?!1:2e3}}),F=W?_!=null&&_.refreshFailed?{status:"refresh_failed",message:"OAuth renewal failed — please re-authenticate"}:_!=null&&_.authenticated?_.hasRefreshToken&&_.expiresAt?{status:"authenticated_refreshable",message:`Access expires ${KV(_.expiresAt)} · renews automatically`}:{status:"authenticated",message:null}:_!=null&&_.hasToken&&(_!=null&&_.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:T==null?void 0:T.id,apiServiceType:T==null?void 0:T.type,apiServiceUrl:T==null?void 0:T.url,isOpen:t,hasValidService:X,enabled:X&&T.type==="mcp"&&t,mcpDiscoveryLoading:K,mcpDiscoveryData:M?JSON.stringify(M,null,2):null,mcpDiscoveryDataKeys:M?Object.keys(M):null,oauthRequired:(nr=(Qt=M==null?void 0:M.data)==null?void 0:Qt.oauth)==null?void 0:nr.required,oauthData:(Nn=M==null?void 0:M.data)!=null&&Nn.oauth?JSON.stringify(M.data.oauth,null,2):null,toolsQueryEnabled:X&&T.type==="mcp"&&t&&!((Fr=(zr=M==null?void 0:M.data)==null?void 0:zr.oauth)!=null&&Fr.required)});const{data:Z,isLoading:Y,error:ae,refetch:de}=ut({queryKey:["/api/services",T==null?void 0:T.id,"tools"],queryFn:async()=>{if(!T||T.type!=="mcp"&&T.type!=="local-mcp")return{data:[]};console.log(`🔍 Attempting to discover tools for MCP service: ${T.id} at ${T.url}`);try{const xe=await(await Ce("GET",`/api/services/${T.id}/tools`)).json();return console.log(`✅ MCP tools discovery successful for ${T.id}:`,xe),xe}catch(ue){throw console.log(`❌ MCP tools discovery failed for ${T.id}:`,ue),ue}},enabled:X&&(T.type==="mcp"||T.type==="local-mcp")&&t&&(T.type==="local-mcp"||ad(F.status)),staleTime:0,gcTime:2*60*1e3});w.useEffect(()=>{if(!t||!(T!=null&&T.id)||T.type!=="mcp"&&T.type!=="local-mcp"||!(T.type==="local-mcp"||ad(F.status)||F.status==="not_required")||Y||ae)return;let xe=!1;return(async()=>{try{const yn=await(await Ce("GET",`/api/services/${T.id}`)).json();!xe&&(yn!=null&&yn.success)&&yn.data&&$(yn.data),I.invalidateQueries({queryKey:["/api/services"]})}catch{}})(),()=>{xe=!0}},[t,T==null?void 0:T.id,T==null?void 0:T.type,Y,ae,F.status,I]),w.useEffect(()=>{if(!t||!(T!=null&&T.id)||T.type!=="a2a")return;let ue=!1;return(async()=>{try{await Ce("GET",`/api/services/${T.id}/health`);const ln=await(await Ce("GET",`/api/services/${T.id}`)).json();!ue&&(ln!=null&&ln.success)&&ln.data&&$(ln.data),I.invalidateQueries({queryKey:["/api/services"]})}catch{}})(),()=>{ue=!0}},[t,T==null?void 0:T.id,T==null?void 0:T.type,I]),console.log("MCP Tools Query Debug:",{hasValidService:X,apiServiceType:T==null?void 0:T.type,isOpen:t,oauthRequired:(rr=(Ot=M==null?void 0:M.data)==null?void 0:Ot.oauth)==null?void 0:rr.required,oauthStatus:F.status,toolsQueryEnabled:X&&(T.type==="mcp"||T.type==="local-mcp")&&t&&(T.type==="local-mcp"||ad(F.status)),mcpToolsLoading:Y});const{data:U,isLoading:H,error:J}=ut({queryKey:["/api/proxy/a2a",T==null?void 0:T.id,"manifest"],queryFn:async()=>{if(!T||T.type!=="a2a")return null;const xe=await(await Ce("GET",`/api/proxy/a2a/${T.id}/manifest`)).text();return JSON.parse(xe)},enabled:X&&T.type==="a2a"&&t,staleTime:0,gcTime:2*60*1e3}),te=(Z==null?void 0:Z.data)||[],B=U,ne=Y||H;console.log("ServiceDetailsModal Debug:",{service:e==null?void 0:e.id,serviceType:e==null?void 0:e.type,isOpen:t,mcpDiscoveryLoading:K,mcpDiscoveryData:M,mcpDiscoveryError:N?String(N):null,mcpToolsLoading:Y,a2aManifestLoading:H,mcpToolsError:ae?String(ae):null,a2aManifestError:J?String(J):null,mcpToolsCount:te.length,mcpToolsData:Z,hasA2aManifest:!!B,isLoading:ne,oauthRequired:(lo=(gn=M==null?void 0:M.data)==null?void 0:gn.oauth)==null?void 0:lo.required,oauthStatus:F.status,oauthMessage:F.message,oauthAuthenticated:_==null?void 0:_.authenticated,expiresAt:_==null?void 0:_.expiresAt}),w.useEffect(()=>{if(!t){$(null),v(!1),E(null),Te.current=!1,re.current=!1;return}e&&($(e),d(e.name||""),p(e.description||""),v(!1),E(null))},[e,t]);const re=w.useRef(!1),Te=w.useRef(!1);w.useEffect(()=>{if(!t||!(T!=null&&T.id)){re.current=!1;return}if(!(_!=null&&_.authenticated)){re.current=!1;return}if(re.current)return;re.current=!0,Te.current=!0,(async()=>{D({title:"OAuth completed",description:"Authentication successful! Refreshing service status..."}),fc(I,T.id),I.invalidateQueries({queryKey:["/api/mcp/discover",T.url]});try{const xe=await Ce("GET",`/api/services/${T.id}`);if(xe.ok){const at=await xe.json();$(at.data??at)}}catch{}await z(),I.invalidateQueries({queryKey:["/api/services",T.id,"tools"]}),await de(),Te.current=!1})()},[_==null?void 0:_.authenticated,t,T==null?void 0:T.id]);const ce=()=>(e==null?void 0:e.type)==="mcp"?c.jsx(ek,{className:"w-6 h-6"}):c.jsx(Up,{className:"w-6 h-6"}),ke=()=>(e==null?void 0:e.type)==="mcp"?"text-blue-400":"text-purple-400",Ne=()=>(e==null?void 0:e.type)==="mcp"?"bg-blue-500/20":"bg-purple-500/20",rt=ue=>new Date(ue).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});w.useEffect(()=>{var ue,xe;s&&((ue=j.current)==null||ue.focus(),(xe=j.current)==null||xe.select())},[s]);const Tt=async()=>{const ue=(L==null?void 0:L.name)||"",xe=u.trim();if(!L||!xe||xe===ue){d(ue),i(!1);return}y(!0);try{await Ce("PUT",`/api/services/${L.id}`,{name:xe}),$({...L,name:xe}),I.invalidateQueries({queryKey:["/api/services"]}),I.invalidateQueries({queryKey:["/api/collection/warnings"]}),I.invalidateQueries({queryKey:["/api/decks"]}),i(!1)}catch(at){d(ue),i(!1),D({title:"Could not rename service",description:at instanceof Error?at.message:"Failed to update name",variant:"destructive"})}finally{y(!1)}},it=async()=>{if(e){x(!0);try{if((await Ce("PUT",`/api/services/${e.id}`,{description:f.trim()})).ok){if(R){const xe={...R,description:f.trim()};$(xe)}I.invalidateQueries({queryKey:["/api/services"]}),I.invalidateQueries({queryKey:["/api/collection/warnings"]}),I.invalidateQueries({queryKey:["/api/decks"]}),I.invalidateQueries({queryKey:["/api/decks"]}),D({title:"Description updated",description:"Service description has been updated successfully."}),l(!1)}else throw new Error("Failed to update description")}catch{D({title:"Update failed",description:"Failed to update service description. Please try again.",variant:"destructive"})}finally{x(!1)}}},qn=()=>{k(T1(Q)),E(null),v(!0)},G=()=>{v(!1),E(null),k(T1(Q))},ie=async()=>{if(!L)return;const ue=BV(b);if(!ue.ok){E(ue.error);return}O(!0);try{if(!(await Ce("PUT",`/api/services/${L.id}`,{headers:ue.headers})).ok)throw new Error("Failed to update headers");const at=Object.keys(ue.headers).length>0?ue.headers:void 0;$({...L,headers:at}),v(!1),E(null),fc(I,L.id),I.invalidateQueries({queryKey:["/api/decks"]}),D({title:"Headers updated",description:"Custom headers saved. Reconnecting with the new values."})}catch(xe){D({title:"Update failed",description:xe instanceof Error?xe.message:"Failed to update headers. Please try again.",variant:"destructive"})}finally{O(!1)}},_e=ue=>{ue||(Te.current&&(fc(I,(T==null?void 0:T.id)??(e==null?void 0:e.id)),Te.current=!1),re.current=!1,n())};return c.jsx(Ds,{open:t,onOpenChange:_e,children:c.jsxs(zo,{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:[c.jsx(Fo,{children:c.jsxs(Uo,{className:"text-2xl font-bold flex items-center",children:[ce(),c.jsx("div",{className:"ml-3 flex min-w-0 items-center",children:s?c.jsx("input",{ref:j,type:"text",value:u,disabled:h,onChange:ue=>d(ue.target.value),onBlur:()=>{Tt()},onKeyDown:ue=>{ue.key==="Enter"?(ue.preventDefault(),Tt()):ue.key==="Escape"&&(ue.preventDefault(),d((L==null?void 0:L.name)||""),i(!1))},className:"max-w-[16rem] rounded border border-white/20 bg-white/10 px-2 py-1 text-2xl font-bold text-white focus:border-white/40 focus:outline-none sm:max-w-[20rem]","aria-label":"Service name","data-testid":"input-service-name"}):c.jsx("button",{type:"button",className:"min-w-0 truncate text-left hover:underline",title:"Click to rename",onClick:()=>{d((L==null?void 0:L.name)||""),i(!0)},"data-testid":"button-rename-service",children:L==null?void 0:L.name})}),c.jsx(Yt,{className:`ml-3 ${Ne()} ${ke()}`,children:(cp=e==null?void 0:e.type)==null?void 0:cp.toUpperCase()})]})}),e&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsx("div",{className:"mb-3",children:c.jsxs("h3",{className:"text-lg font-semibold flex items-center",children:[c.jsx(t4,{className:"w-5 h-5 mr-2"}),"Service Overview"]})}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("p",{className:"text-gray-300 text-sm",children:"Description"}),!a&&c.jsx(le,{size:"sm",variant:"ghost",onClick:()=>l(!0),className:"h-6 w-6 p-0 opacity-0 hover:opacity-100 transition-opacity",title:"Edit description",children:c.jsx(t0,{className:"w-3 h-3"})})]}),a?c.jsxs("div",{className:"space-y-2",children:[c.jsx("textarea",{value:f,onChange:ue=>p(ue.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}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(le,{size:"sm",onClick:it,disabled:m,className:"h-6 px-2 text-xs",children:m?"Saving...":"Save"}),c.jsx(le,{size:"sm",variant:"outline",onClick:()=>{l(!1),p((L==null?void 0:L.description)||"")},className:"h-6 px-2 text-xs",children:"Cancel"})]})]}):c.jsx("p",{className:"text-white cursor-pointer hover:bg-white/10 px-2 py-1 rounded transition-colors",onClick:()=>l(!0),title:"Click to edit description",children:(L==null?void 0:L.description)||"No description"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Endpoint"}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(Yt,{variant:"outline",className:"border-blue-500/30 text-blue-300",children:T.type.toUpperCase()}),ei(Q)&&c.jsx(Yt,{variant:"outline",className:"border-green-500/30 text-green-300",children:"Custom Headers"})]}),c.jsx(le,{size:"sm",variant:"ghost",onClick:()=>window.open(T.url,"_blank"),className:"p-1 h-auto",children:c.jsx(Co,{className:"w-4 h-4"})})]}),c.jsx("div",{className:"text-xs text-gray-400 break-all bg-black/20 p-2 rounded border border-white/10",children:T.url||"No URL available"}),T.type==="mcp"?c.jsxs("div",{className:"text-xs text-gray-400 bg-black/20 p-2 rounded border border-white/10","data-testid":"custom-headers-section",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[c.jsx("p",{className:"font-semibold text-gray-300",children:"Custom Headers"}),!g&&c.jsx(le,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs text-teal-300 hover:text-teal-200",onClick:qn,"data-testid":"button-edit-headers",children:"Edit"})]}),g?c.jsxs("div",{className:"space-y-2",children:[c.jsx(ko,{value:b,onChange:ue=>{k(ue.target.value),S&&E(null)},rows:6,className:"bg-white/10 border-white/20 text-white placeholder-gray-400 resize-none font-mono text-xs","data-testid":"textarea-edit-headers",disabled:P}),S&&c.jsxs("p",{className:"text-red-400 text-xs flex items-center gap-1","data-testid":"headers-json-error",children:[c.jsx(cr,{className:"w-3 h-3 shrink-0"}),S]}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(le,{size:"sm",variant:"ghost",className:"h-7 px-2 text-xs",onClick:G,disabled:P,"data-testid":"button-cancel-headers",children:"Cancel"}),c.jsx(le,{size:"sm",className:"h-7 px-3 text-xs bg-teal-600 hover:bg-teal-500",onClick:ie,disabled:P,"data-testid":"button-save-headers",children:P?"Saving…":"Save"})]})]}):ei(Q)?c.jsx("ul",{className:"space-y-1 font-mono","data-testid":"headers-masked-list",children:id(Q).map(({name:ue,masked:xe})=>c.jsxs("li",{children:[c.jsx("span",{className:"text-gray-300",children:ue}),c.jsx("span",{className:"text-gray-500",children:": "}),c.jsx("span",{children:xe})]},ue))}):c.jsx("p",{className:"text-gray-500","data-testid":"headers-empty-state",children:"No custom headers. Add Bearer or API key headers to authenticate."})]}):ei(Q)&&c.jsxs("div",{className:"text-xs text-gray-400 bg-black/20 p-2 rounded border border-white/10",children:[c.jsx("p",{className:"font-semibold mb-1",children:"Custom Headers:"}),c.jsx("ul",{className:"space-y-1 font-mono",children:id(Q).map(({name:ue,masked:xe})=>c.jsxs("li",{children:[c.jsx("span",{className:"text-gray-300",children:ue}),c.jsx("span",{className:"text-gray-500",children:": "}),c.jsx("span",{children:xe})]},ue))})]})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Health Status"}),c.jsx(Yt,{className:T.health==="healthy"?"bg-green-500/20 text-green-300":T.health==="unhealthy"?"bg-red-500/20 text-red-300":"bg-amber-500/20 text-amber-200",children:T.health==="healthy"?"Healthy":T.health==="unhealthy"?"Unreachable":F.status==="required"||F.status==="expired"||F.status==="refresh_failed"?"Auth required":"Unknown"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Registered"}),c.jsx("p",{className:"text-white text-sm",children:rt(T.registeredAt)})]})]})]}),ne&&c.jsxs("div",{className:"text-center py-8",children:[c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white mx-auto mb-4"}),c.jsx("p",{className:"text-gray-400",children:"Fetching service details..."})]}),r&&c.jsx("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:c.jsx("p",{className:"text-red-300",children:r})}),(e.type==="mcp"||e.type==="local-mcp")&&c.jsxs(c.Fragment,{children:[e.type==="local-mcp"&&c.jsxs("div",{className:"bg-cyan-500/15 border border-cyan-500/30 rounded-lg p-4 mb-4",children:[c.jsx("h3",{className:"text-cyan-200 font-semibold mb-2",children:"Local MCP — auth happens outside Agent Deck"}),c.jsx("div",{className:"text-cyan-100/90 text-sm space-y-2",children:ZV(T)?c.jsxs(c.Fragment,{children:[c.jsxs("p",{children:["This card runs ",c.jsx("code",{className:"text-xs",children:"@piotr-agier/google-drive-mcp"})," on your machine. Agent Deck does ",c.jsx("strong",{children:"not"}),' handle Google OAuth for it. If Google shows "app not verified", that is ',c.jsx("strong",{children:"your Google Cloud project"}),", not Agent Deck."]}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-1",children:[c.jsxs("li",{children:["Create a GCP OAuth client type ",c.jsx("strong",{children:"Desktop app"})," (not Web)."]}),c.jsxs("li",{children:["Add yourself as a ",c.jsx("strong",{children:"Test user"})," on the consent screen."]}),c.jsxs("li",{children:["Run in terminal first:"," ",c.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"
428
- export GOOGLE_DRIVE_MCP_AUTH_PORT=3100
429
- npx @piotr-agier/google-drive-mcp auth`})]}),c.jsxs("li",{children:["Set ",c.jsx("code",{className:"text-xs",children:"GOOGLE_DRIVE_MCP_TOKEN_PATH"})," in the card env to the same token file (",c.jsx("code",{className:"text-xs",children:"~/.config/google-drive-mcp/tokens.json"}),")."]})]}),c.jsxs("p",{className:"text-xs text-cyan-200/80",children:["Full steps: ",c.jsx("code",{className:"text-xs",children:"docs/GOOGLE_DRIVE_WORKAROUND.md"})," in the repo."]})]}):c.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."})})]}),c.jsx(VV,{serviceId:T.id,tools:te,isLoading:Y})]}),e.type==="a2a"&&B&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[c.jsx(f4,{className:"w-5 h-5 mr-2"}),"Agent Overview"]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Agent Name"}),c.jsx("p",{className:"text-white font-semibold",children:B.name})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Version"}),c.jsx("p",{className:"text-white",children:B.version})]}),c.jsxs("div",{className:"md:col-span-2",children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Description"}),c.jsx("p",{className:"text-white",children:B.description})]}),B.provider&&c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Provider"}),c.jsx("p",{className:"text-white",children:B.provider.organization})]}),B.documentationUrl&&c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-1",children:"Documentation"}),c.jsxs(le,{size:"sm",variant:"ghost",onClick:()=>window.open(B.documentationUrl,"_blank"),className:"p-1 h-auto text-purple-300",children:[c.jsx(Co,{className:"w-4 h-4 mr-1"}),"View Docs"]})]})]})]}),B.capabilities&&c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[c.jsx(iN,{className:"w-5 h-5 mr-2"}),"Capabilities"]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[B.capabilities.streaming&&c.jsx(Yt,{className:"bg-green-500/20 text-green-300",children:"Streaming"}),B.capabilities.pushNotifications&&c.jsx(Yt,{className:"bg-blue-500/20 text-blue-300",children:"Push Notifications"}),B.capabilities.stateTransitionHistory&&c.jsx(Yt,{className:"bg-purple-500/20 text-purple-300",children:"State History"})]})]}),B.skills&&B.skills.length>0&&c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center",children:[c.jsx(Up,{className:"w-5 h-5 mr-2"}),"Skills (",B.skills.length,")"]}),c.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:B.skills.map((ue,xe)=>c.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:[c.jsx("div",{className:"absolute top-2 left-2 text-xs font-bold",children:c.jsx("div",{className:"text-purple-300 leading-none",children:"S"})}),c.jsx("div",{className:"absolute bottom-2 right-2 text-xs font-bold rotate-180",children:c.jsx("div",{className:"text-purple-300 leading-none",children:"S"})}),c.jsxs("div",{className:"absolute inset-x-3 top-8 bottom-8 flex flex-col items-center justify-center text-center",children:[c.jsx("div",{className:"text-purple-300 mb-2",children:c.jsx(Up,{className:"w-6 h-6"})}),c.jsx("h4",{className:"font-bold text-sm mb-2 line-clamp-2 text-white",children:ue.name}),c.jsx("p",{className:"text-gray-300 text-xs line-clamp-4 mb-2",children:ue.description}),ue.tags&&ue.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1 justify-center",children:ue.tags.slice(0,2).map((at,ln)=>c.jsx("span",{className:"text-purple-300 text-xs bg-purple-500/20 px-1 py-0.5 rounded",children:at},ln))})]}),c.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"})]},xe))})]}),(B.defaultInputModes||B.defaultOutputModes)&&c.jsxs("div",{className:"bg-black/20 rounded-lg p-4 border border-white/10",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-3 flex items-center",children:[c.jsx(ek,{className:"w-5 h-5 mr-2"}),"Data Modes"]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[B.defaultInputModes&&c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-2",children:"Input Modes"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:B.defaultInputModes.map((ue,xe)=>c.jsx(Yt,{className:"bg-blue-500/20 text-blue-300 text-xs",children:ue},xe))})]}),B.defaultOutputModes&&c.jsxs("div",{children:[c.jsx("p",{className:"text-gray-300 text-sm mb-2",children:"Output Modes"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:B.defaultOutputModes.map((ue,xe)=>c.jsx(Yt,{className:"bg-green-500/20 text-green-300 text-xs",children:ue},xe))})]})]})]})]}),(e==null?void 0:e.type)==="mcp"&&F.status==="not_required"&&(T==null?void 0:T.id)&&c.jsxs("div",{className:"bg-blue-500/20 border border-blue-500/30 rounded-lg p-4 mb-4",children:[c.jsx("h3",{className:"text-blue-300 font-semibold mb-2",children:"How to connect"}),c.jsx(P1,{serviceId:T.id})]}),(e==null?void 0:e.type)==="mcp"&&F.status==="authenticated_refreshable"&&c.jsxs("div",{className:"bg-green-500/15 border border-green-500/30 rounded-lg p-4 mb-4",children:[c.jsx("h3",{className:"text-green-300 font-semibold mb-2",children:"✓ OAuth connected"}),c.jsx("p",{className:"text-green-100 text-sm",children:F.message})]}),(e==null?void 0:e.type)==="mcp"&&!ad(F.status)&&F.status!=="not_required"&&c.jsxs("div",{className:`${F.status==="expired"||F.status==="refresh_failed"?"bg-red-500/20 border-red-500/30":"bg-orange-500/20 border-orange-500/30"} rounded-lg p-4 mb-4`,children:[c.jsx("h3",{className:`${F.status==="expired"||F.status==="refresh_failed"?"text-red-300":"text-orange-300"} font-semibold mb-2`,children:F.status==="expired"||F.status==="refresh_failed"?"⏰ Token Expired":"🔐 Authentication Required"}),c.jsxs("div",{className:`${F.status==="expired"||F.status==="refresh_failed"?"text-red-200":"text-orange-200"} text-sm space-y-2`,children:[c.jsx("p",{children:c.jsx("strong",{children:F.message})}),c.jsx("p",{children:F.status==="expired"||F.status==="refresh_failed"?"Your OAuth token has expired or could not be renewed. Please re-authenticate to continue using this service.":"This MCP server requires OAuth authentication to access its tools. Please authenticate to continue."}),(T==null?void 0:T.id)&&c.jsx(P1,{serviceId:T.id,onConnected:()=>void C()}),((Vt=(fe=M==null?void 0:M.data)==null?void 0:fe.oauth)==null?void 0:Vt.resourceName)&&c.jsx("div",{className:"mt-3 p-2 bg-orange-500/10 rounded border border-orange-500/20 text-xs text-orange-100",children:c.jsxs("p",{children:[c.jsx("strong",{children:"Resource:"})," ",M.data.oauth.resourceName]})})]})]}),(e==null?void 0:e.type)==="mcp"&&c.jsxs("div",{className:"bg-gray-800/50 border border-gray-600/30 rounded-lg p-4 mb-4",children:[c.jsx("h3",{className:"text-gray-300 font-semibold mb-2",children:"Connection Logs"}),c.jsxs("div",{className:"text-gray-200 text-sm space-y-2",children:[c.jsxs("div",{className:"bg-black/30 p-2 rounded text-xs",children:[c.jsx("p",{children:c.jsx("strong",{children:"🔍 Attempting to discover tools for MCP service:"})}),c.jsxs("p",{children:["Service ID: ",e==null?void 0:e.id]}),c.jsxs("p",{children:["Service URL: ",T==null?void 0:T.url]}),c.jsxs("p",{children:["Status: ",Y?"🔄 Loading...":ae?"❌ Failed":"✅ Complete"]})]}),Y&&c.jsxs("div",{className:"bg-yellow-500/20 p-2 rounded text-xs",children:[c.jsxs("p",{children:["🔄 Making HTTP request to: ",c.jsxs("code",{children:["GET /api/services/",e==null?void 0:e.id,"/tools"]})]}),c.jsxs("p",{children:["Target MCP server: ",c.jsx("code",{children:T==null?void 0:T.url})]})]}),ae&&c.jsxs("div",{className:"bg-red-500/20 p-2 rounded text-xs",children:[c.jsx("p",{children:"❌ Request failed:"}),c.jsx("pre",{className:"whitespace-pre-wrap overflow-x-auto",children:ae instanceof Error?ae.message:String(ae)}),c.jsxs("div",{className:"mt-2 p-2 bg-black/30 rounded",children:[c.jsx("p",{children:c.jsx("strong",{children:"🔍 What we tried:"})}),c.jsxs("p",{children:["• Service ID: ",e==null?void 0:e.id]}),c.jsxs("p",{children:["• Target URL: ",T==null?void 0:T.url]}),c.jsxs("p",{children:["• Request: GET /api/services/",e==null?void 0:e.id,"/tools"]}),ei(Q)&&c.jsxs("div",{children:[c.jsx("p",{children:c.jsx("strong",{children:"📋 Headers sent:"})}),c.jsx("ul",{className:"text-xs font-mono",children:id(Q).map(({name:ue,masked:xe})=>c.jsxs("li",{children:[ue,": ",xe]},ue))})]}),c.jsxs("div",{className:"mt-2",children:[c.jsx("p",{children:c.jsx("strong",{children:"💡 What this means:"})}),c.jsxs("p",{children:["• The MCP server at ",T==null?void 0:T.url," returned an error"]}),c.jsx("p",{children:"• This could be due to authentication issues, server being down, or invalid configuration"}),c.jsx("p",{children:"• Check the error message above for specific details from the MCP server"})]})]})]}),!Y&&!ae&&te.length>0&&c.jsx("div",{className:"bg-green-500/20 p-2 rounded text-xs",children:c.jsxs("p",{children:["✅ Successfully discovered ",te.length," tools from MCP server"]})}),!Y&&!ae&&te.length===0&&c.jsxs("div",{className:"bg-yellow-500/20 p-2 rounded text-xs",children:[c.jsx("p",{children:"⚠️ Connected to MCP server but no tools were found"}),c.jsx("p",{children:"This could mean the server has no tools or requires specific authentication"})]})]})]}),ae&&(e.type==="mcp"||e.type==="local-mcp")&&c.jsxs("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:[c.jsx("h3",{className:"text-red-300 font-semibold mb-2",children:"MCP Tool Discovery Failed"}),c.jsxs("div",{className:"text-red-200 text-sm space-y-2",children:[c.jsx("p",{children:c.jsx("strong",{children:"Raw Error:"})}),c.jsx("pre",{className:"bg-black/30 p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap",children:ae instanceof Error?ae.message:String(ae)}),c.jsxs("p",{children:[c.jsx("strong",{children:"Service URL:"})," ",T==null?void 0:T.url]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Service ID:"})," ",T==null?void 0:T.id]}),ei(Q)&&c.jsxs("div",{children:[c.jsx("p",{children:c.jsx("strong",{children:"Custom Headers:"})}),c.jsx("ul",{className:"bg-black/30 p-2 rounded text-xs font-mono",children:id(Q).map(({name:ue,masked:xe})=>c.jsxs("li",{children:[ue,": ",xe]},ue))})]})]})]}),J&&e.type==="a2a"&&c.jsxs("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4",children:[c.jsx("h3",{className:"text-red-300 font-semibold mb-2",children:"A2A Manifest Discovery Failed"}),c.jsxs("div",{className:"text-red-200 text-sm space-y-2",children:[c.jsx("p",{children:c.jsx("strong",{children:"Raw Error:"})}),c.jsx("pre",{className:"bg-black/30 p-2 rounded text-xs overflow-x-auto whitespace-pre-wrap",children:J instanceof Error?J.message:String(J)}),c.jsxs("p",{children:[c.jsx("strong",{children:"Service URL:"})," ",T==null?void 0:T.url]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Service ID:"})," ",T==null?void 0:T.id]})]})]}),!ne&&!ae&&!J&&(e.type==="mcp"||e.type==="local-mcp")&&te.length===0&&(e.type==="local-mcp"||!((qs=(Us=M==null?void 0:M.data)==null?void 0:Us.oauth)!=null&&qs.required))&&c.jsxs("div",{className:"bg-yellow-500/20 border border-yellow-500/30 rounded-lg p-4",children:[c.jsx("h3",{className:"text-yellow-300 font-semibold mb-2",children:"No Tools Available"}),c.jsxs("p",{className:"text-yellow-200 text-sm",children:["Successfully connected to MCP server at ",T==null?void 0:T.url,", but no tools were discovered."]}),c.jsxs("div",{className:"text-yellow-200 text-xs mt-2",children:[c.jsx("p",{children:c.jsx("strong",{children:"This could mean:"})}),c.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[c.jsx("li",{children:"The MCP server has no tools registered"}),c.jsx("li",{children:"Tools require specific authentication"}),c.jsx("li",{children:"Tools are only available after certain operations"})]})]})]}),(e.type==="mcp"||e.type==="local-mcp")&&c.jsxs("div",{className:"bg-blue-500/20 border border-blue-500/30 rounded-lg p-4",children:[c.jsx("h3",{className:"text-blue-300 font-semibold mb-2",children:"🔍 MCP Server Analysis"}),c.jsxs("div",{className:"text-blue-200 text-sm space-y-2",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Server URL:"})," ",T==null?void 0:T.url]}),K&&c.jsx("div",{className:"mt-3 p-3 bg-black/30 rounded",children:c.jsx("p",{children:"🔍 Analyzing MCP server configuration..."})}),M&&c.jsxs("div",{className:"mt-3 p-3 bg-black/30 rounded",children:[c.jsx("p",{children:c.jsx("strong",{children:"🔍 What we discovered:"})}),M.error&&M.analysis&&c.jsxs("div",{className:"text-yellow-200",children:[M.analysis.auth_type==="oauth2"&&c.jsxs("div",{children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"OAuth 2.0 Authentication Required"})]}),c.jsx("p",{children:"• This MCP server requires OAuth 2.0 Bearer token authentication"}),c.jsx("p",{children:"• You'll need to provide OAuth credentials (client ID, client secret, authorization URL, token URL)"}),c.jsx("p",{children:"• Check the service provider's documentation for OAuth setup instructions"})]}),M.analysis.protocol==="sse"&&c.jsxs("div",{children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"SSE Protocol Required"})]}),c.jsx("p",{children:"• This MCP server uses Server-Sent Events (SSE) protocol"}),c.jsx("p",{children:"• We'll need to connect using event streaming instead of HTTP"})]}),M.analysis.issue==="not_found"&&c.jsxs("div",{children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"Server Not Found"})]}),c.jsx("p",{children:"• The MCP server URL might be incorrect"}),c.jsx("p",{children:"• Check if the server is running and the URL is correct"})]}),M.analysis.issue==="server_error"&&c.jsxs("div",{children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"Server Error"})]}),c.jsx("p",{children:"• The MCP server is experiencing internal errors"}),c.jsx("p",{children:"• Try again later or contact the service provider"})]}),M.analysis.message&&c.jsxs("p",{children:["• ",c.jsx("strong",{children:"Analysis:"})," ",M.analysis.message]})]}),((yw=(gw=M==null?void 0:M.data)==null?void 0:gw.oauth)==null?void 0:yw.required)&&c.jsxs("div",{className:"text-yellow-200",children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"OAuth 2.0 Authentication Required"})]}),M.data.oauth.authorizationUrl&&c.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[c.jsx(le,{size:"sm",variant:"default",className:"h-7",onClick:async()=>{var ue,xe;if(T!=null&&T.id)try{D({title:"Setting up OAuth...",description:"Automatically registering OAuth application and starting authorization flow..."});const at=await Ce("POST",`/api/oauth/${T.id}/auto-setup`,{});if(!at.ok){const yn=await at.json();(ue=yn.data)!=null&&ue.registrationUrl?(window.open(yn.data.registrationUrl,"_blank"),D({title:"OAuth Registration Required",description:`${yn.error} I've opened the registration page for you. Please create an OAuth app and then come back to add your credentials.`,duration:15e3})):D({title:"OAuth Setup Failed",description:yn.error||"Failed to setup OAuth automatically. Please configure manually.",variant:"destructive"});return}const ln=await at.json();ln.success&&((xe=ln.data)!=null&&xe.authorizationUrl)?(window.open(ln.data.authorizationUrl,"_blank"),D({title:"OAuth Setup Successful",description:"OAuth application registered automatically! Please complete the authorization in the new window.",duration:1e4}),C()):D({title:"OAuth Setup Failed",description:"Failed to get authorization URL. Please try again.",variant:"destructive"})}catch(at){D({title:"OAuth Setup Failed",description:at instanceof Error?at.message:"Unknown error occurred",variant:"destructive"})}},children:"🔧 Auto-Setup OAuth"}),c.jsxs(le,{size:"sm",variant:"ghost",className:"p-1 h-auto text-blue-300",onClick:()=>window.open(M.data.oauth.authorizationUrl,"_blank"),children:[c.jsx(Co,{className:"w-4 h-4 mr-1"}),"Open Raw Authorization URL"]})]}),!M.data.oauth.authorizationUrl&&M.data.oauth.protectedResourceConfigUrl&&c.jsx("div",{className:"mt-2",children:c.jsxs(le,{size:"sm",variant:"ghost",className:"p-1 h-auto text-blue-300",onClick:()=>window.open(M.data.oauth.protectedResourceConfigUrl,"_blank"),children:[c.jsx(Co,{className:"w-4 h-4 mr-1"}),"View OAuth Configuration"]})}),M.data.oauth.authorizationServerMetadataUrl&&c.jsxs("div",{className:"mt-2 text-xs text-gray-300",children:[c.jsx("span",{className:"mr-1",children:"Auth Server Metadata:"}),c.jsx("button",{className:"underline text-blue-300",onClick:()=>window.open(M.data.oauth.authorizationServerMetadataUrl,"_blank"),children:M.data.oauth.authorizationServerMetadataUrl})]})]}),(M==null?void 0:M.success)&&!((xw=(vw=M==null?void 0:M.data)==null?void 0:vw.oauth)!=null&&xw.required)&&c.jsxs("div",{className:"text-green-200",children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"✅ Server Analysis Complete"})]}),c.jsx("p",{children:"• MCP server is accessible and responding"}),c.jsx("p",{children:"• No authentication issues detected"}),c.jsx("p",{children:"• Protocol compatibility confirmed"})]}),((bw=(ww=M==null?void 0:M.data)==null?void 0:ww.oauth)==null?void 0:bw.required)&&c.jsxs("div",{className:"text-orange-200",children:[c.jsxs("p",{children:["• ",c.jsx("strong",{children:"🔐 OAuth 2.0 Authentication Required"})]}),c.jsx("p",{children:"• This MCP server requires OAuth authentication"}),M.data.oauth.resourceName&&c.jsxs("p",{children:["• Service: ",M.data.oauth.resourceName]}),M.data.oauth.authorizationUrl&&c.jsxs("p",{children:["• Authorization URL: ",M.data.oauth.authorizationUrl]}),M.data.oauth.tokenUrl&&c.jsxs("p",{children:["• Token URL: ",M.data.oauth.tokenUrl]}),c.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[c.jsx(le,{size:"sm",variant:"default",className:"bg-orange-600 hover:bg-orange-700",onClick:async()=>{var ue,xe;if(T!=null&&T.id)try{D({title:"Setting up OAuth...",description:"Automatically registering OAuth application and starting authorization flow..."});const at=await Ce("POST",`/api/oauth/${T.id}/auto-setup`,{});if(!at.ok){const yn=await at.json();(ue=yn.data)!=null&&ue.registrationUrl?(window.open(yn.data.registrationUrl,"_blank"),D({title:"OAuth Registration Required",description:`${yn.error} I've opened the registration page for you. Please create an OAuth app and then come back to add your credentials.`,duration:15e3})):D({title:"OAuth Setup Failed",description:yn.error||"Failed to setup OAuth automatically. Please configure manually.",variant:"destructive"});return}const ln=await at.json();ln.success&&((xe=ln.data)!=null&&xe.authorizationUrl)?(window.open(ln.data.authorizationUrl,"_blank"),D({title:"OAuth Setup Successful",description:"OAuth application registered automatically! Please complete the authorization in the new window.",duration:1e4}),C()):D({title:"OAuth Setup Failed",description:"Failed to get authorization URL. Please try again.",variant:"destructive"})}catch(at){D({title:"OAuth Setup Failed",description:at instanceof Error?at.message:"Unknown error occurred",variant:"destructive"})}},children:"🔧 Auto-Setup OAuth"}),c.jsx(le,{size:"sm",variant:"outline",className:"border-orange-500/30 text-orange-300 hover:bg-orange-500/10",onClick:()=>{const ue=`OAuth Setup Instructions:
430
-
431
- 1. Go to the service provider's OAuth/Developer settings
432
- 2. Create a new OAuth application
433
- 3. Set Redirect URL: http://localhost:8000/api/oauth/${T==null?void 0:T.id}/callback
434
- 4. Copy the Client ID and Client Secret
435
- 5. Edit this service and add the credentials
436
-
437
- ${M.data.oauth.authorizationUrl?`Authorization URL: ${M.data.oauth.authorizationUrl}`:""}
438
- ${M.data.oauth.tokenUrl?`Token URL: ${M.data.oauth.tokenUrl}`:""}
439
- ${M.data.oauth.issuer?`Issuer: ${M.data.oauth.issuer}`:""}`;D({title:"OAuth Setup Instructions",description:ue,duration:1e4})},children:"📋 Setup Instructions"})]})]}),c.jsxs("div",{className:"mt-2 text-xs",children:[c.jsx("p",{children:c.jsx("strong",{children:"💡 Next Steps:"})}),c.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[c.jsx("li",{children:"For OAuth servers: Provide OAuth credentials in service settings"}),c.jsx("li",{children:"For SSE servers: We'll automatically use the correct protocol"}),c.jsx("li",{children:"For connection issues: Verify the server URL and status"})]})]})]}),N&&c.jsxs("div",{className:"mt-3 p-3 bg-red-500/20 rounded",children:[c.jsx("p",{children:c.jsx("strong",{children:"❌ Discovery Failed"})}),c.jsx("p",{children:"Could not analyze MCP server configuration"}),c.jsx("pre",{className:"text-xs overflow-x-auto",children:N instanceof Error?N.message:String(N)})]})]})]}),!ne&&!ae&&!J&&e.type==="a2a"&&!B&&c.jsxs("div",{className:"bg-yellow-500/20 border border-yellow-500/30 rounded-lg p-4",children:[c.jsx("h3",{className:"text-yellow-300 font-semibold mb-2",children:"Agent Details Not Available"}),c.jsxs("p",{className:"text-yellow-200 text-sm",children:["Successfully connected to A2A agent at ",T==null?void 0:T.url,", but no manifest was found."]}),c.jsxs("div",{className:"text-yellow-200 text-xs mt-2",children:[c.jsx("p",{children:c.jsx("strong",{children:"This could mean:"})}),c.jsxs("ul",{className:"list-disc list-inside ml-2 space-y-1",children:[c.jsx("li",{children:"The agent doesn't provide a manifest"}),c.jsx("li",{children:"Manifest endpoint is not implemented"}),c.jsx("li",{children:"Agent requires specific authentication"})]})]})]})]})]})})}function GV({open:e,onOpenChange:t}){const[n,r]=w.useState(null),[o,s]=w.useState(null),[i,a]=w.useState(null),[l,u]=w.useState(!1),d=Kt(),{toast:f}=qt(),p=()=>{r(null),s(null),a(null),u(!1)},h=dt({mutationFn:async()=>{if(!n)throw new Error("Choose a bundle file first");const m=await n.text();let x;try{x=JSON.parse(m)}catch{throw new Error("File is not valid JSON")}return XF(x)},onSuccess:m=>{a(m),d.invalidateQueries({queryKey:["/api/decks"]}),d.invalidateQueries({queryKey:["/api/services"]}),d.invalidateQueries({queryKey:["/api/playbooks"]}),d.invalidateQueries({queryKey:["/api/playbooks/collection"]}),d.invalidateQueries({queryKey:["/api/credentials/collection"]}),d.invalidateQueries({queryKey:["/api/collection/warnings"]}),f({title:"Import complete",description:jk(m)})},onError:m=>{f({title:"Import failed",description:m.message,variant:"destructive"})}}),y=async m=>{var x,g,v;if(r(m),a(null),!m){s(null);return}try{const b=await m.text(),k=JSON.parse(b);s(`${((x=k.services)==null?void 0:x.length)??0} services · ${((g=k.playbooks)==null?void 0:g.length)??0} playbooks · ${((v=k.decks)==null?void 0:v.length)??0} decks`)}catch{s("Invalid JSON")}};return c.jsx(Ds,{open:e,onOpenChange:m=>{m||p(),t(m)},children:c.jsxs(zo,{className:"sm:max-w-lg border-border bg-[#161612] text-[#E8F6F4]",children:[c.jsxs(Fo,{children:[c.jsx(Uo,{children:"Import bundle"}),c.jsx(zi,{asChild:!0,children:c.jsxs("div",{className:"space-y-2 text-left text-sm text-[#A8C4C0]",children:[c.jsx("p",{children:"Adds MCP, playbooks, and decks from a JSON file."}),c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-amber-200/90",children:"Notes"}),c.jsxs("ul",{className:"mt-1 list-disc space-y-0.5 pl-4",children:[c.jsx("li",{children:"Same name as an existing card or deck is skipped (linked only)."}),c.jsx("li",{children:"No credentials or secrets — re-enter keys and reconnect OAuth."})]})]})]})})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"bundle-file",children:"Bundle file"}),c.jsx(Je,{id:"bundle-file",type:"file",accept:".json,.agent-deck.json,application/json",className:"cursor-pointer bg-white/5 border-white/20",onChange:m=>{var x;return y(((x=m.target.files)==null?void 0:x[0])??null)},"data-testid":"input-import-bundle"}),o&&c.jsx("p",{className:"text-xs text-[#A8C4C0]","data-testid":"import-preview",children:o})]}),!i&&c.jsx(le,{onClick:()=>h.mutate(),disabled:!n||h.isPending||o==="Invalid JSON",className:"rounded-full border px-6 text-sm font-semibold hover:opacity-90",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},"data-testid":"button-import-apply",children:h.isPending?"Importing…":"Import"}),i&&c.jsxs("div",{className:"space-y-2 rounded-lg border border-white/10 bg-white/5 p-3 text-sm","data-testid":"import-report",children:[c.jsx("p",{className:"font-medium",children:jk(i)}),i.servicesNeedingOauth.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-amber-200",children:"Needs OAuth reconnect:"}),c.jsx("ul",{className:"list-disc pl-5 text-[#A8C4C0]",children:i.servicesNeedingOauth.map(m=>c.jsx("li",{children:m},m))})]}),i.warnings.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-amber-200",children:"Warnings:"}),c.jsx("ul",{className:"list-disc pl-5 text-[#A8C4C0]",children:i.warnings.map(m=>c.jsx("li",{children:m},m))})]}),c.jsx(le,{variant:"outline",size:"sm",className:"rounded-full border border-white/20 text-white hover:bg-white/10",onClick:()=>u(m=>!m),children:l?"Hide id map":"Show id map"}),l&&c.jsx("pre",{className:"max-h-40 overflow-auto rounded bg-black/40 p-2 text-xs",children:JSON.stringify(i.idMap,null,2)}),c.jsx(le,{className:"rounded-full border px-6 text-sm font-semibold hover:opacity-90",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},onClick:()=>{p(),t(!1)},children:"Done"})]})]})]})})}function JV(){const[e,t]=w.useState("connecting"),[n,r]=w.useState(null),o=w.useRef(null),s=w.useRef(null),i=Kt();return w.useEffect(()=>{const l=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws/events`,u=()=>{try{const f=new WebSocket(l);o.current=f,f.onopen=()=>{console.log("WebSocket connected"),t("connected")},f.onmessage=p=>{var h;try{const y=JSON.parse(p.data);r(y),y.type==="deck_update"?(console.log("Received deck update:",y),i.invalidateQueries({queryKey:["/api/decks"]})):y.type==="service_update"?(console.log("Received service update:",y),fc(i,typeof((h=y.data)==null?void 0:h.serviceId)=="string"?y.data.serviceId:void 0)):y.type==="connection_status"&&t(y.status==="connected"?"connected":"disconnected")}catch(y){console.error("Failed to parse WebSocket message:",y)}},f.onclose=()=>{console.log("WebSocket disconnected"),t("disconnected"),s.current=setTimeout(()=>{console.log("Attempting to reconnect WebSocket..."),t("connecting"),u()},3e3)},f.onerror=p=>{console.error("WebSocket error:",p),t("disconnected")}}catch(f){console.error("Failed to connect WebSocket:",f),t("disconnected")}};u();const d=f=>{f.origin===window.location.origin&&HV(f.data)&&fc(i,f.data.serviceId)};return window.addEventListener("message",d),()=>{window.removeEventListener("message",d),s.current&&clearTimeout(s.current),o.current&&o.current.readyState===WebSocket.OPEN&&o.current.close()}},[i]),{connectionStatus:e,lastMessage:n}}async function $1(e,t){const n=e==="credential"?`credentialId=${encodeURIComponent(t)}`:`serviceId=${encodeURIComponent(t)}`;return(await(await Ce("GET",`/api/playbooks/dependents/check?${n}`)).json()).data??[]}function YV(e){const[t,n]=w.useState(null),[r,o]=w.useState(null),[s,i]=w.useState(null),[a,l]=w.useState(!1),u=Kt(),{toast:d}=qt(),f=()=>{if(!e)throw new Error("Select a deck to edit first");return e},p=dt({mutationFn:async j=>{var X,M,K;const I=f(),T=(X=(await(await Ce("GET","/api/decks")).json()).data)==null?void 0:X.find(N=>N.id===I);if(!T)throw new Error("Selected deck not found");if((M=T.services)!=null&&M.some(N=>N.id===j))throw new Error("Service is already in the deck");const Q=((K=T.services)==null?void 0:K.length)??0;return Ce("POST",`/api/decks/${I}/services`,{serviceId:j,position:Q})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Service added to deck",description:`${(t==null?void 0:t.name)||"Service"} has been added to the deck.`})},onError:j=>{d({title:"Failed to add service",description:j.message,variant:"destructive"})}}),h=dt({mutationFn:async j=>{var Q,X;const I=f(),T=(Q=(await(await Ce("GET","/api/decks")).json()).data)==null?void 0:Q.find(M=>M.id===I);if((X=T==null?void 0:T.credentials)!=null&&X.some(M=>M.id===j))throw new Error("API key is already in the deck");return Ce("POST",`/api/decks/${I}/credentials`,{credentialId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"API key added to deck",description:`${(r==null?void 0:r.label)||"API key"} is scoped to this deck.`})},onError:j=>{d({title:"Failed to add API key",description:j.message,variant:"destructive"})}}),y=dt({mutationFn:async j=>{var Q,X;const I=f(),T=(Q=(await(await Ce("GET","/api/decks")).json()).data)==null?void 0:Q.find(M=>M.id===I);if((X=T==null?void 0:T.playbooks)!=null&&X.some(M=>M.id===j))throw new Error("Playbook is already in the deck");return Ce("POST",`/api/decks/${I}/playbooks`,{playbookId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Playbook added to deck",description:`${(s==null?void 0:s.title)||"Playbook"} is on this deck.`})},onError:j=>{d({title:"Failed to add playbook",description:j.message,variant:"destructive"})}}),m=dt({mutationFn:async j=>{const I=await $1("service",j);if(I.length>0){const L=I.map(Q=>Q.title).join(", ");if(!window.confirm(`Warning: ${I.length} playbook(s) depend on this MCP (${L}). Remove from deck anyway?`))throw new Error("Cancelled")}const D=f();return Ce("DELETE",`/api/decks/${D}/services`,{serviceId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Service removed from deck",description:`${(t==null?void 0:t.name)||"Service"} has been removed from the deck.`})},onError:j=>{j.message!=="Cancelled"&&d({title:"Failed to remove service",description:j.message,variant:"destructive"})}}),x=dt({mutationFn:async j=>{const I=await $1("credential",j);if(I.length>0){const L=I.map(Q=>Q.title).join(", ");if(!window.confirm(`Warning: ${I.length} playbook(s) depend on this API key (${L}). Remove from deck anyway?`))throw new Error("Cancelled")}const D=f();return Ce("DELETE",`/api/decks/${D}/credentials`,{credentialId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"API key removed from deck",description:`${(r==null?void 0:r.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=dt({mutationFn:async j=>{const I=f();return Ce("DELETE",`/api/decks/${I}/playbooks`,{playbookId:j})},onSuccess:()=>{u.invalidateQueries({queryKey:["/api/decks"]}),d({title:"Playbook removed from deck",description:`${(s==null?void 0:s.title)||"Playbook"} is no longer on this deck.`})},onError:j=>{d({title:"Failed to remove playbook",description:j.message,variant:"destructive"})}}),v=(j,I)=>{j.currentTarget instanceof HTMLElement&&(j.currentTarget.style.opacity=I)},b=(j,I)=>{j.dataTransfer.setData("text/plain",I.id),j.dataTransfer.setData("application/json",JSON.stringify(I)),j.dataTransfer.effectAllowed=I.fromDeck?"move":"copy"},k=(j,I,D=!1)=>{n(I),o(null),i(null),l(D),b(j,{kind:"service",id:I.id,fromDeck:D}),v(j,"0.5")},S=(j,I,D=!1)=>{o(I),n(null),i(null),l(D),b(j,{kind:"credential",id:I.id,fromDeck:D}),v(j,"0.5")},E=(j,I,D=!1)=>{i(I),n(null),o(null),l(D),b(j,{kind:"playbook",id:I.id,fromDeck:D}),v(j,"0.5")},P=j=>{n(null),o(null),i(null),v(j,"1")},O=j=>{if(j.kind==="service"){j.fromDeck?m.mutate(j.id):p.mutate(j.id);return}if(j.kind==="credential"){j.fromDeck?x.mutate(j.id):h.mutate(j.id);return}j.fromDeck?g.mutate(j.id):y.mutate(j.id)};return{draggedService:t,draggedCredential:r,draggedPlaybook:s,isDraggingFromDeck:a,handleDragStart:k,handleCredentialDragStart:S,handlePlaybookDragStart:E,handleDragEnd:P,handleDrop:j=>{j.preventDefault();const I=j.dataTransfer.getData("application/json");if(I){try{O(JSON.parse(I))}catch{const D=j.dataTransfer.getData("text/plain");D&&t&&p.mutate(D)}n(null),o(null),i(null),l(!1)}},handleGlobalDrop:j=>{j.preventDefault();const I=j.dataTransfer.getData("application/json");if(I){try{const D=JSON.parse(I);D.fromDeck&&O(D)}catch{}n(null),o(null),i(null),l(!1)}},isDropping:p.isPending||h.isPending||y.isPending||m.isPending||x.isPending||g.isPending}}const ym="agent-deck-editing-deck-id";function XV(e){const[t,n]=w.useState(()=>typeof window>"u"?null:localStorage.getItem(ym));w.useEffect(()=>{if(e.length===0)return;if(!(t&&e.some(i=>i.id===t))){const i=e[0].id;n(i),localStorage.setItem(ym,i)}},[e,t]);const r=s=>{n(s),localStorage.setItem(ym,s)};return{editingDeck:e.find(s=>s.id===t)??null,editingDeckId:t,setEditingDeckId:r}}function R1(e,[t,n]){return Math.min(n,Math.max(t,e))}function eH(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var tH=[" ","Enter","ArrowUp","ArrowDown"],nH=[" ","Enter"],Ri="Select",[Kh,Zh,rH]=Qv(Ri),[xl,ute]=Do(Ri,[rH,gl]),Qh=gl(),[oH,zs]=xl(Ri),[sH,iH]=xl(Ri),OT=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:y}=e,m=Qh(t),[x,g]=w.useState(null),[v,b]=w.useState(null),[k,S]=w.useState(!1),E=k0(u),[P,O]=ji({prop:r,defaultProp:o??!1,onChange:s,caller:Ri}),[R,$]=ji({prop:i,defaultProp:a,onChange:l,caller:Ri}),j=w.useRef(null),I=x?y||!!x.closest("form"):!0,[D,L]=w.useState(new Set),T=Array.from(D).map(Q=>Q.props.value).join(";");return c.jsx(HN,{...m,children:c.jsxs(oH,{required:h,scope:t,trigger:x,onTriggerChange:g,valueNode:v,onValueNodeChange:b,valueNodeHasChildren:k,onValueNodeHasChildrenChange:S,contentId:No(),value:R,onValueChange:$,open:P,onOpenChange:O,dir:E,triggerPointerDownPosRef:j,disabled:p,children:[c.jsx(Kh.Provider,{scope:t,children:c.jsx(sH,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(Q=>{L(X=>new Set(X).add(Q))},[]),onNativeOptionRemove:w.useCallback(Q=>{L(X=>{const M=new Set(X);return M.delete(Q),M})},[]),children:n})}),I?c.jsxs(s2,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:R,onChange:Q=>$(Q.target.value),disabled:p,form:y,children:[R===void 0?c.jsx("option",{value:""}):null,Array.from(D)]},T):null]})})};OT.displayName=Ri;var MT="SelectTrigger",DT=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=Qh(n),i=zs(MT,n),a=i.disabled||r,l=Xe(t,i.onTriggerChange),u=Zh(n),d=w.useRef("touch"),[f,p,h]=a2(m=>{const x=u().filter(b=>!b.disabled),g=x.find(b=>b.value===i.value),v=l2(x,m,g);v!==void 0&&i.onValueChange(v.value)}),y=m=>{a||(i.onOpenChange(!0),h()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx($h,{asChild:!0,...s,children:c.jsx(Ae.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":i2(i.value)?"":void 0,...o,ref:l,onClick:be(o.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&y(m)}),onPointerDown:be(o.onPointerDown,m=>{d.current=m.pointerType;const x=m.target;x.hasPointerCapture(m.pointerId)&&x.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:be(o.onKeyDown,m=>{const x=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(x&&m.key===" ")&&tH.includes(m.key)&&(y(),m.preventDefault())})})})});DT.displayName=MT;var LT="SelectValue",zT=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,l=zs(LT,n),{onValueNodeHasChildrenChange:u}=l,d=s!==void 0,f=Xe(t,l.onValueNodeChange);return on(()=>{u(d)},[u,d]),c.jsx(Ae.span,{...a,ref:f,style:{pointerEvents:"none"},children:i2(l.value)?c.jsx(c.Fragment,{children:i}):s})});zT.displayName=LT;var aH="SelectIcon",FT=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return c.jsx(Ae.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});FT.displayName=aH;var lH="SelectPortal",UT=e=>c.jsx(ou,{asChild:!0,...e});UT.displayName=lH;var Ii="SelectContent",qT=w.forwardRef((e,t)=>{const n=zs(Ii,e.__scopeSelect),[r,o]=w.useState();if(on(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Li.createPortal(c.jsx(VT,{scope:e.__scopeSelect,children:c.jsx(Kh.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),s):null}return c.jsx(HT,{...e,ref:t})});qT.displayName=Ii;var kr=10,[VT,Fs]=xl(Ii),cH="SelectContentImpl",uH=Ni("SelectContent.RemoveScroll"),HT=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:x,...g}=e,v=zs(Ii,n),[b,k]=w.useState(null),[S,E]=w.useState(null),P=Xe(t,Z=>k(Z)),[O,R]=w.useState(null),[$,j]=w.useState(null),I=Zh(n),[D,L]=w.useState(!1),T=w.useRef(!1);w.useEffect(()=>{if(b)return y0(b)},[b]),g0();const Q=w.useCallback(Z=>{const[Y,...ae]=I().map(H=>H.ref.current),[de]=ae.slice(-1),U=document.activeElement;for(const H of Z)if(H===U||(H==null||H.scrollIntoView({block:"nearest"}),H===Y&&S&&(S.scrollTop=0),H===de&&S&&(S.scrollTop=S.scrollHeight),H==null||H.focus(),document.activeElement!==U))return},[I,S]),X=w.useCallback(()=>Q([O,b]),[Q,O,b]);w.useEffect(()=>{D&&X()},[D,X]);const{onOpenChange:M,triggerPointerDownPosRef:K}=v;w.useEffect(()=>{if(b){let Z={x:0,y:0};const Y=de=>{var U,H;Z={x:Math.abs(Math.round(de.pageX)-(((U=K.current)==null?void 0:U.x)??0)),y:Math.abs(Math.round(de.pageY)-(((H=K.current)==null?void 0:H.y)??0))}},ae=de=>{Z.x<=10&&Z.y<=10?de.preventDefault():b.contains(de.target)||M(!1),document.removeEventListener("pointermove",Y),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",ae,{capture:!0})}}},[b,M,K]),w.useEffect(()=>{const Z=()=>M(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[M]);const[N,z]=a2(Z=>{const Y=I().filter(U=>!U.disabled),ae=Y.find(U=>U.ref.current===document.activeElement),de=l2(Y,Z,ae);de&&setTimeout(()=>de.ref.current.focus())}),W=w.useCallback((Z,Y,ae)=>{const de=!T.current&&!ae;(v.value!==void 0&&v.value===Y||de)&&(R(Z),de&&(T.current=!0))},[v.value]),_=w.useCallback(()=>b==null?void 0:b.focus(),[b]),C=w.useCallback((Z,Y,ae)=>{const de=!T.current&&!ae;(v.value!==void 0&&v.value===Y||de)&&j(Z)},[v.value]),A=r==="popper"?dy:BT,F=A===dy?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:m,avoidCollisions:x}:{};return c.jsx(VT,{scope:n,content:b,viewport:S,onViewportChange:E,itemRefCallback:W,selectedItem:O,onItemLeave:_,itemTextRefCallback:C,focusSelectedItem:X,selectedItemText:$,position:r,isPositioned:D,searchRef:N,children:c.jsx(Mh,{as:uH,allowPinchZoom:!0,children:c.jsx(Ah,{asChild:!0,trapped:v.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:be(o,Z=>{var Y;(Y=v.trigger)==null||Y.focus({preventScroll:!0}),Z.preventDefault()}),children:c.jsx(fl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:c.jsx(A,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Z=>Z.preventDefault(),...g,...F,onPlaced:()=>L(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:be(g.onKeyDown,Z=>{const Y=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!Y&&Z.key.length===1&&z(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let de=I().filter(U=>!U.disabled).map(U=>U.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const U=Z.target,H=de.indexOf(U);de=de.slice(H+1)}setTimeout(()=>Q(de)),Z.preventDefault()}})})})})})})});HT.displayName=cH;var dH="SelectItemAlignedPosition",BT=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=zs(Ii,n),i=Fs(Ii,n),[a,l]=w.useState(null),[u,d]=w.useState(null),f=Xe(t,P=>d(P)),p=Zh(n),h=w.useRef(!1),y=w.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:g,focusSelectedItem:v}=i,b=w.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&u&&m&&x&&g){const P=s.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),R=s.valueNode.getBoundingClientRect(),$=g.getBoundingClientRect();if(s.dir!=="rtl"){const U=$.left-O.left,H=R.left-U,J=P.left-H,te=P.width+J,B=Math.max(te,O.width),ne=window.innerWidth-kr,re=R1(H,[kr,Math.max(kr,ne-B)]);a.style.minWidth=te+"px",a.style.left=re+"px"}else{const U=O.right-$.right,H=window.innerWidth-R.right-U,J=window.innerWidth-P.right-H,te=P.width+J,B=Math.max(te,O.width),ne=window.innerWidth-kr,re=R1(H,[kr,Math.max(kr,ne-B)]);a.style.minWidth=te+"px",a.style.right=re+"px"}const j=p(),I=window.innerHeight-kr*2,D=m.scrollHeight,L=window.getComputedStyle(u),T=parseInt(L.borderTopWidth,10),Q=parseInt(L.paddingTop,10),X=parseInt(L.borderBottomWidth,10),M=parseInt(L.paddingBottom,10),K=T+Q+D+M+X,N=Math.min(x.offsetHeight*5,K),z=window.getComputedStyle(m),W=parseInt(z.paddingTop,10),_=parseInt(z.paddingBottom,10),C=P.top+P.height/2-kr,A=I-C,F=x.offsetHeight/2,Z=x.offsetTop+F,Y=T+Q+Z,ae=K-Y;if(Y<=C){const U=j.length>0&&x===j[j.length-1].ref.current;a.style.bottom="0px";const H=u.clientHeight-m.offsetTop-m.offsetHeight,J=Math.max(A,F+(U?_:0)+H+X),te=Y+J;a.style.height=te+"px"}else{const U=j.length>0&&x===j[0].ref.current;a.style.top="0px";const J=Math.max(C,T+m.offsetTop+(U?W:0)+F)+ae;a.style.height=J+"px",m.scrollTop=Y-C+m.offsetTop}a.style.margin=`${kr}px 0`,a.style.minHeight=N+"px",a.style.maxHeight=I+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,a,u,m,x,g,s.dir,r]);on(()=>b(),[b]);const[k,S]=w.useState();on(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const E=w.useCallback(P=>{P&&y.current===!0&&(b(),v==null||v(),y.current=!1)},[b,v]);return c.jsx(hH,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:c.jsx(Ae.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});BT.displayName=dH;var fH="SelectPopperPosition",dy=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=kr,...s}=e,i=Qh(n);return c.jsx(d0,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.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)"}})});dy.displayName=fH;var[hH,Z0]=xl(Ii,{}),fy="SelectViewport",WT=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=Fs(fy,n),i=Z0(fy,n),a=Xe(t,s.onViewportChange),l=w.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(Kh.Slot,{scope:n,children:c.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:be(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&f){const h=Math.abs(l.current-d.scrollTop);if(h>0){const y=window.innerHeight-kr*2,m=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),g=Math.max(m,x);if(g<y){const v=g+h,b=Math.min(y,v),k=v-b;f.style.height=b+"px",f.style.bottom==="0px"&&(d.scrollTop=k>0?k:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});WT.displayName=fy;var KT="SelectGroup",[pH,mH]=xl(KT),gH=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=No();return c.jsx(pH,{scope:n,id:o,children:c.jsx(Ae.div,{role:"group","aria-labelledby":o,...r,ref:t})})});gH.displayName=KT;var ZT="SelectLabel",QT=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=mH(ZT,n);return c.jsx(Ae.div,{id:o.id,...r,ref:t})});QT.displayName=ZT;var Uf="SelectItem",[yH,GT]=xl(Uf),JT=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=zs(Uf,n),l=Fs(Uf,n),u=a.value===r,[d,f]=w.useState(s??""),[p,h]=w.useState(!1),y=Xe(t,v=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,v,r,o)}),m=No(),x=w.useRef("touch"),g=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 c.jsx(yH,{scope:n,value:r,disabled:o,textId:m,isSelected:u,onItemTextChange:w.useCallback(v=>{f(b=>b||((v==null?void 0:v.textContent)??"").trim())},[]),children:c.jsx(Kh.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:c.jsx(Ae.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:y,onFocus:be(i.onFocus,()=>h(!0)),onBlur:be(i.onBlur,()=>h(!1)),onClick:be(i.onClick,()=>{x.current!=="mouse"&&g()}),onPointerUp:be(i.onPointerUp,()=>{x.current==="mouse"&&g()}),onPointerDown:be(i.onPointerDown,v=>{x.current=v.pointerType}),onPointerMove:be(i.onPointerMove,v=>{var b;x.current=v.pointerType,o?(b=l.onItemLeave)==null||b.call(l):x.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(i.onPointerLeave,v=>{var b;v.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:be(i.onKeyDown,v=>{var k;((k=l.searchRef)==null?void 0:k.current)!==""&&v.key===" "||(nH.includes(v.key)&&g(),v.key===" "&&v.preventDefault())})})})})});JT.displayName=Uf;var Wl="SelectItemText",YT=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=zs(Wl,n),a=Fs(Wl,n),l=GT(Wl,n),u=iH(Wl,n),[d,f]=w.useState(null),p=Xe(t,g=>f(g),l.onItemTextChange,g=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,g,l.value,l.disabled)}),h=d==null?void 0:d.textContent,y=w.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=u;return on(()=>(m(y),()=>x(y)),[m,x,y]),c.jsxs(c.Fragment,{children:[c.jsx(Ae.span,{id:l.textId,...s,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Li.createPortal(s.children,i.valueNode):null]})});YT.displayName=Wl;var XT="SelectItemIndicator",e2=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return GT(XT,n).isSelected?c.jsx(Ae.span,{"aria-hidden":!0,...r,ref:t}):null});e2.displayName=XT;var hy="SelectScrollUpButton",t2=w.forwardRef((e,t)=>{const n=Fs(hy,e.__scopeSelect),r=Z0(hy,e.__scopeSelect),[o,s]=w.useState(!1),i=Xe(t,r.onScrollButtonChange);return on(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?c.jsx(r2,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});t2.displayName=hy;var py="SelectScrollDownButton",n2=w.forwardRef((e,t)=>{const n=Fs(py,e.__scopeSelect),r=Z0(py,e.__scopeSelect),[o,s]=w.useState(!1),i=Xe(t,r.onScrollButtonChange);return on(()=>{if(n.viewport&&n.isPositioned){let a=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<u;s(d)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?c.jsx(r2,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});n2.displayName=py;var r2=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=Fs("SelectScrollButton",n),i=w.useRef(null),a=Zh(n),l=w.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),on(()=>{var d;const u=a().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),c.jsx(Ae.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:be(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:be(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:be(o.onPointerLeave,()=>{l()})})}),vH="SelectSeparator",o2=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ae.div,{"aria-hidden":!0,...r,ref:t})});o2.displayName=vH;var my="SelectArrow",xH=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qh(n),s=zs(my,n),i=Fs(my,n);return s.open&&i.position==="popper"?c.jsx(f0,{...o,...r,ref:t}):null});xH.displayName=my;var wH="SelectBubbleInput",s2=w.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=w.useRef(null),s=Xe(r,o),i=eH(t);return w.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&d){const f=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[i,t]),c.jsx(Ae.select,{...n,style:{...ME,...n.style},ref:s,defaultValue:t})});s2.displayName=wH;function i2(e){return e===""||e===void 0}function a2(e){const t=mr(e),n=w.useRef(""),r=w.useRef(0),o=w.useCallback(i=>{const a=n.current+i;t(a),function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),s=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function l2(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=bH(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const l=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function bH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kH=OT,c2=DT,_H=zT,SH=FT,CH=UT,u2=qT,EH=WT,d2=QT,f2=JT,NH=YT,jH=e2,h2=t2,p2=n2,m2=o2;const PH=kH,TH=_H,g2=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(c2,{ref:r,className:$e("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",e),...n,children:[t,c.jsx(SH,{asChild:!0,children:c.jsx(Eh,{className:"h-4 w-4 opacity-50"})})]}));g2.displayName=c2.displayName;const y2=w.forwardRef(({className:e,...t},n)=>c.jsx(h2,{ref:n,className:$e("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(r4,{className:"h-4 w-4"})}));y2.displayName=h2.displayName;const v2=w.forwardRef(({className:e,...t},n)=>c.jsx(p2,{ref:n,className:$e("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Eh,{className:"h-4 w-4"})}));v2.displayName=p2.displayName;const x2=w.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>c.jsx(CH,{children:c.jsxs(u2,{ref:o,className:$e("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]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[c.jsx(y2,{}),c.jsx(EH,{className:$e("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(v2,{})]})}));x2.displayName=u2.displayName;const $H=w.forwardRef(({className:e,...t},n)=>c.jsx(d2,{ref:n,className:$e("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));$H.displayName=d2.displayName;const Yi=w.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(f2,{ref:r,className:$e("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",e),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(jH,{children:c.jsx(aN,{className:"h-4 w-4"})})}),c.jsx(NH,{children:t})]}));Yi.displayName=f2.displayName;const RH=w.forwardRef(({className:e,...t},n)=>c.jsx(m2,{ref:n,className:$e("-mx-1 my-1 h-px bg-muted",e),...t}));RH.displayName=m2.displayName;const IH="/assets/AgentDeckLogo3-X5qCXS2A.png";function AH(){const[e,t]=w.useState(""),[n,r]=w.useState(""),[o,s]=w.useState(!1),[i,a]=w.useState(!1),[l,u]=w.useState(null),[d,f]=w.useState(!1),[p,h]=w.useState(!1),[y,m]=w.useState(null),[x,g]=w.useState(!1),[v,b]=w.useState(!1),[k,S]=w.useState(null),[E,P]=w.useState(!1),[O,R]=w.useState(!1),[$,j]=w.useState(!1),[I,D]=w.useState(null),{toast:L}=qt(),{data:T=[]}=ut({queryKey:["/api/playbook-patches","proposed"],queryFn:()=>Yg("proposed")}),{data:Q=0}=ut({queryKey:["/api/feedback-signals/count","available"],queryFn:()=>yP()}),X=async()=>{j(!0);try{const fe=await mP({scope:"collection"});gP(fe,"backup.agent-deck.json"),L({title:"Exported collection",description:`${fe.services.length} services, ${fe.playbooks.length} playbooks, ${fe.decks.length} decks`})}catch(fe){L({title:"Export failed",description:fe instanceof Error?fe.message:"Unknown error",variant:"destructive"})}finally{j(!1)}},{connectionStatus:M}=JV(),{data:K,isLoading:N,error:z}=ut({queryKey:["/api/decks"]}),W=(K==null?void 0:K.data)||[],{editingDeck:_,editingDeckId:C,setEditingDeckId:A}=XV(W),{handleDragStart:F,handleCredentialDragStart:Z,handlePlaybookDragStart:Y,handleDragEnd:ae,handleDrop:de,handleGlobalDrop:U,isDraggingFromDeck:H}=YV(C),{data:J,isLoading:te,error:B}=ut({queryKey:["/api/services"]}),{data:ne,isLoading:re}=ut({queryKey:["/api/credentials/vault"]}),{data:Te,isLoading:ce}=ut({queryKey:["/api/playbooks/vault"]}),{data:ke}=ut({queryKey:["/api/collection/warnings"],staleTime:6e4}),Ne=(J==null?void 0:J.data)||[],rt=(ne==null?void 0:ne.data)||[],Tt=(Te==null?void 0:Te.data)||[],it=w.useMemo(()=>ML(ke==null?void 0:ke.data),[ke==null?void 0:ke.data]),qn=(fe,Vt)=>o?fe==="service"?it.serviceWarnings.has(Vt):fe==="credential"?it.credentialWarnings.has(Vt):it.playbookWarnings.has(Vt):!0,G=Ne.filter(fe=>{var qs;if(!qn("service",fe.id)||n==="api-key"||n==="playbook")return!1;const Vt=fe.name.toLowerCase().includes(e.toLowerCase())||((qs=fe.description)==null?void 0:qs.toLowerCase().includes(e.toLowerCase())),Us=!n||n==="all"||fe.type===n;return Vt&&Us}),ie=rt.filter(fe=>!qn("credential",fe.id)||n&&n!=="all"&&n!=="api-key"?!1:fe.label.toLowerCase().includes(e.toLowerCase())),_e=Tt.filter(fe=>!qn("playbook",fe.id)||n&&n!=="all"&&n!=="playbook"?!1:fe.title.toLowerCase().includes(e.toLowerCase())||fe.body.toLowerCase().includes(e.toLowerCase())),Pe=G.length+ie.length+_e.length;B&&console.error("Services error:",B),z&&console.error("Decks error:",z);const We=()=>{t(""),r(""),s(!1)},Qt=!!(e||n||o),nr=new Set(((_==null?void 0:_.credentials)??[]).map(fe=>fe.id)),Nn=new Set(((_==null?void 0:_.playbooks)??[]).map(fe=>fe.id)),zr=(_==null?void 0:_.services)||[],Fr=(_==null?void 0:_.playbooks)||[],Ot=fe=>{u(fe),f(!0)},rr=fe=>{S(fe.id),P(!0)},gn=fe=>{m(fe.id),g(!0)},lo=fe=>{D(fe)};if(B||z){const fe=(z instanceof Error?z.message:null)??(B instanceof Error?B.message:null)??"There was an error loading the application data.";return c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-900",children:c.jsxs("div",{className:"text-center max-w-lg px-4",children:[c.jsx("h2",{className:"text-2xl font-bold text-red-400 mb-4",children:"Error Loading Data"}),c.jsx("p",{className:"text-gray-300 mb-2",children:"There was an error loading the application data."}),c.jsx("p",{className:"text-gray-400 text-sm mb-4",children:fe}),c.jsxs("p",{className:"text-gray-500 text-xs mb-6",children:["Is the API running? Try ",c.jsx("code",{className:"text-gray-300",children:"agent-deck stop && agent-deck start"})]}),c.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 te||N||re||ce?c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-900",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-yellow-400 mx-auto mb-4"}),c.jsx("p",{className:"text-gray-300",children:"Loading AgentDeck..."})]})}):c.jsxs("div",{className:"flex min-h-dvh flex-col overflow-x-hidden",onDrop:U,onDragOver:fe=>fe.preventDefault(),style:{position:"relative",...H&&{background:"linear-gradient(to bottom right, #1a1a2e, #16213e, #0f3460)"}},children:[c.jsx("header",{className:"relative z-20 shrink-0 bg-black/30 backdrop-blur-md border-b border-white/10",children:c.jsx("div",{className:"container mx-auto px-4 py-3 sm:py-4",children:c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[c.jsx("img",{src:IH,alt:"Agent Deck Logo",className:"h-12 w-12 shrink-0 object-contain sm:h-16 sm:w-16"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"text-xl font-bold bg-gradient-to-r from-yellow-400 to-yellow-600 bg-clip-text text-transparent sm:text-2xl",style:{background:"linear-gradient(to right, #C4B643, #D4C760)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},children:"AgentDeck"}),c.jsx("p",{className:"text-xs sm:text-sm",style:{color:"#92E4DD"},children:"Build tool deck for your agent"})]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-3 sm:gap-6",children:[c.jsxs("div",{className:`flex items-center space-x-2 px-3 py-1 rounded-full border ${M==="connected"?"bg-emerald-500/20 border-emerald-500/30":"bg-red-500/20 border-red-500/30"}`,children:[c.jsx("div",{className:`w-2 h-2 rounded-full animate-pulse ${M==="connected"?"bg-emerald-400":"bg-red-400"}`}),c.jsx("button",{className:`text-sm hover:underline cursor-pointer ${M==="connected"?"text-emerald-300":"text-red-300"}`,"data-testid":"button-copy-mcp-url",onClick:()=>{navigator.clipboard.writeText("http://localhost:3001/mcp").then(()=>{L({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"})]}),c.jsx(mF,{highlightDeckId:C??void 0}),c.jsx(Ya,{href:"/feedback-signals",children:c.jsxs(le,{variant:"outline",size:"sm",className:"relative border-white/20 bg-white/5 text-[#E8F6F4]",children:["Feedback",Q>0&&c.jsx("span",{className:"ml-2 rounded-full px-2 py-0.5 text-xs font-semibold",style:{background:"#C4B643",color:"#0A0A07"},title:"Open feedback available for curation",children:Q})]})}),c.jsx(Ya,{href:"/playbook-patches",children:c.jsxs(le,{variant:"outline",size:"sm",className:"relative border-white/20 bg-white/5 text-[#E8F6F4]",children:[c.jsx(i4,{className:"mr-2 h-4 w-4"}),"Review",T.length>0&&c.jsx("span",{className:"ml-2 rounded-full px-2 py-0.5 text-xs font-semibold",style:{background:"#C4B643",color:"#0A0A07"},title:"Proposed playbook patches",children:T.length})]})})]})]})})}),H&&c.jsx("div",{className:"fixed inset-0 pointer-events-none z-50 flex items-center justify-center",children:c.jsxs("div",{className:"bg-red-500/20 border-2 border-dashed border-red-500/50 rounded-lg p-8 text-center",children:[c.jsx("div",{className:"text-red-400 text-lg font-bold mb-2",children:"Drop to Remove"}),c.jsx("div",{className:"text-red-300 text-sm",children:"Release to remove card from deck"})]})}),c.jsx("main",{className:"container mx-auto flex min-h-0 flex-1 flex-col px-4 py-4 sm:py-6",children:c.jsxs("div",{className:"grid min-w-0 grid-cols-1 gap-4 sm:gap-6 xl:min-h-0 xl:flex-1 xl:grid-cols-4 xl:overflow-hidden",children:[c.jsxs("div",{className:"min-w-0 space-y-4 sm:space-y-6 xl:col-span-1 xl:min-h-0 xl:overflow-y-auto",children:[c.jsx("div",{className:"panel-surface h-64 overflow-hidden p-4 min-w-0 sm:h-72 xl:h-80",children:c.jsx(t3,{decks:W,editingDeckId:C,onSelectDeck:A,isLoading:N})}),c.jsxs("div",{className:"panel-surface p-4",children:[c.jsxs("h2",{className:"text-lg font-bold mb-3 flex items-center",children:[c.jsx(iN,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),c.jsx("span",{style:{color:"#92E4DD"},children:"Add Cards"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs(le,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${Gr}`,style:Jr(bn),onClick:()=>a(!0),"data-testid":"button-register-mcp",children:[c.jsx(Ef,{className:"w-3 h-3 mr-2"}),"Register MCP"]}),c.jsxs(le,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${Gr}`,style:Jr(Rn),onClick:()=>h(!0),"data-testid":"button-register-api-key",children:[c.jsx(Ug,{className:"w-3 h-3 mr-2"}),"Register API key"]}),c.jsxs(le,{variant:"ghost",className:`w-full border-2 text-sm py-2 hover:opacity-90 ${Gr}`,style:Jr(Cr),onClick:()=>b(!0),"data-testid":"button-register-playbook",children:[c.jsx(Xv,{className:"w-3 h-3 mr-2"}),"Register Playbook"]})]})]})]}),c.jsxs("div",{className:"flex min-w-0 flex-col gap-4 sm:gap-6 xl:col-span-3 xl:h-full xl:min-h-0",children:[c.jsx("div",{className:"panel-surface h-64 shrink-0 overflow-hidden p-4 min-w-0 sm:h-72 xl:h-80",children:_?c.jsx("div",{className:"h-full",children:c.jsx(tz,{deck:_,services:zr,credentials:_.credentials??[],playbooks:Fr,allServices:Ne,collectionWarnings:it,onDrop:de,onDragStart:F,onCredentialDragStart:Z,onPlaybookDragStart:Y,onDragEnd:ae,onCardClick:Ot,onPlaybookClick:rr,onCredentialClick:gn})}):c.jsxs("div",{className:"text-center h-full flex flex-col justify-center",children:[c.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:c.jsx(Cf,{className:"w-6 h-6 text-yellow-400"})}),c.jsx("h3",{className:"text-lg font-bold mb-2",style:{color:"#92E4DD"},children:"No deck selected"}),c.jsx("p",{className:"text-gray-300 mb-4 text-sm",children:"Create a deck or select one from the sidebar to edit its cards."}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs(le,{onClick:()=>{const fe=document.querySelector('[data-testid="create-deck-button"]');fe&&fe.click()},className:"border text-sm py-2",style:{background:"#C4B643",borderColor:"#C4B643",color:"black"},children:[c.jsx(ai,{className:"w-4 h-4 mr-2"}),"Create New Deck"]}),c.jsxs(le,{variant:"outline",className:"border-white/20 text-white hover:bg-white/10 text-sm py-2",onClick:()=>{const fe=document.querySelector('[data-testid="deck-management-panel"]');fe&&fe.scrollIntoView({behavior:"smooth"})},children:[c.jsx(Cf,{className:"w-4 h-4 mr-2"}),"Manage Decks"]})]})]})}),c.jsxs("div",{className:"panel-surface flex min-h-[20rem] flex-col overflow-hidden p-4 min-w-0 sm:min-h-[24rem] xl:min-h-0 xl:flex-1","data-testid":"collection-panel",children:[c.jsxs("div",{className:"mb-3 flex shrink-0 flex-wrap items-center justify-between gap-2",children:[c.jsxs("h2",{className:"text-lg font-bold flex items-center",children:[c.jsx(a4,{className:"w-4 h-4 mr-2",style:{color:"#92E4DD"}}),c.jsx("span",{style:{color:"#92E4DD"},children:"My Collection"}),c.jsxs("span",{className:"ml-3 text-sm font-normal text-gray-400",children:["(",Pe," cards)"]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsxs(le,{size:"sm",variant:"outline",className:"h-8 px-2 text-xs border-white/20 text-white hover:bg-white/10",onClick:X,disabled:$,title:"Export all MCP, playbooks, and decks","data-testid":"button-export-all",children:[c.jsx(dN,{className:"w-3 h-3 mr-1"}),$?"Exporting…":"Export all"]}),c.jsxs(le,{size:"sm",variant:"outline",className:"h-8 px-2 text-xs border-white/20 text-white hover:bg-white/10",onClick:()=>R(!0),title:"Import a bundle file","data-testid":"button-import-bundle",children:[c.jsx(d4,{className:"w-3 h-3 mr-1"}),"Import"]}),c.jsxs("div",{className:"relative",children:[c.jsx(fN,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),c.jsx(Je,{placeholder:"Search...",value:e,onChange:fe=>t(fe.target.value),className:"h-8 w-36 pl-8 text-sm bg-white/10 border-white/20 text-white placeholder-gray-400 sm:w-48","data-testid":"input-search"})]}),c.jsxs(PH,{value:n||"all",onValueChange:fe=>r(fe==="all"?"":fe),children:[c.jsxs(g2,{className:"w-[7.5rem] h-8 bg-white/10 border-white/20 text-white text-xs shrink-0","data-testid":"select-type",children:[c.jsx(s4,{className:"w-3 h-3 mr-1 shrink-0"}),c.jsx(TH,{placeholder:"Type"})]}),c.jsxs(x2,{children:[c.jsx(Yi,{value:"all",children:"All"}),c.jsx(Yi,{value:"mcp",children:"MCP"}),c.jsx(Yi,{value:"local-mcp",children:"Local MCP"}),c.jsx(Yi,{value:"api-key",children:"API Key"}),c.jsx(Yi,{value:"playbook",children:"Playbook"})]})]}),(e||n||o)&&c.jsx(le,{size:"sm",variant:"outline",className:"h-8 px-2 text-xs border-white/20 text-white hover:bg-white/10",onClick:We,title:"Clear all filters",children:"Clear"})]})]}),it.total>0&&c.jsx("button",{type:"button",onClick:()=>s(fe=>!fe),className:`mb-3 w-full shrink-0 rounded-lg border px-3 py-2 text-left text-sm transition-colors ${o?"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:c.jsxs("span",{className:"flex items-start gap-2",children:[c.jsx(cr,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-300"}),c.jsx("span",{children:o?c.jsxs(c.Fragment,{children:["Showing ",c.jsx("strong",{children:Pe})," card",Pe===1?"":"s"," needing attention.",c.jsx("span",{className:"text-amber-200/80",children:" Click to show all cards."})]}):c.jsxs(c.Fragment,{children:[c.jsx("strong",{children:it.total})," card",it.total===1?"":"s"," need attention",it.byKind.oauth_expired+it.byKind.oauth_required>0&&c.jsxs(c.Fragment,{children:[" ","(",it.byKind.oauth_expired+it.byKind.oauth_required," ","OAuth)"]}),". ",c.jsx("span",{className:"text-amber-200/80",children:"Click to filter."})]})})]})}),c.jsx("div",{className:"min-h-0 flex-1 overflow-x-hidden overflow-y-auto px-1 py-2",children:te||re||ce?c.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,5rem)] gap-y-2 pr-12",children:Array.from({length:10}).map((fe,Vt)=>c.jsx("div",{className:"animate-pulse",children:c.jsx("div",{className:"bg-white/10 rounded-lg w-32 h-48 aspect-[2/3]"})},Vt))}):Pe===0?c.jsxs("div",{className:"text-center py-12",children:[c.jsx("div",{className:"text-gray-400 mb-4",children:c.jsx("i",{className:"fas fa-layer-group text-4xl"})}),c.jsx("h3",{className:"text-lg font-semibold text-gray-300 mb-2",children:"No cards yet"}),c.jsx("p",{className:"text-gray-400 text-sm mb-4",children:Qt?o?"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"}),!Qt&&c.jsxs("div",{className:"flex gap-3 justify-center",children:[c.jsxs(le,{variant:"ghost",size:"sm",className:`border-2 hover:opacity-90 ${Gr}`,style:Jr(bn),onClick:()=>a(!0),"data-testid":"button-register-mcp-empty",children:[c.jsx(Ef,{className:"w-3 h-3 mr-1"}),"Register MCP"]}),c.jsxs(le,{variant:"ghost",size:"sm",className:`border-2 hover:opacity-90 ${Gr}`,style:Jr(Rn),onClick:()=>h(!0),"data-testid":"button-register-api-key-empty",children:[c.jsx(Ug,{className:"w-3 h-3 mr-1"}),"Register API key"]})]})]}):c.jsxs("div",{className:"relative isolate grid grid-cols-[repeat(auto-fill,5rem)] gap-y-2 pr-12",style:{isolation:"isolate"},"data-testid":"collection-card-grid",children:[_e.map((fe,Vt)=>c.jsx("div",{className:"relative group",style:{zIndex:I===fe.id?999999:Pe-Vt},children:c.jsx(BL,{playbook:fe,isInActiveDeck:Nn.has(fe.id),activeDeck:_??void 0,isInCollection:!0,onDragStart:Y,onDragEnd:ae,onCardClick:rr,onMouseEnter:()=>lo(fe.id),onMouseLeave:()=>lo(null),warnings:it.playbookWarnings.get(fe.id)})},fe.id)),ie.map((fe,Vt)=>c.jsx("div",{className:"relative group",style:{zIndex:I===fe.id?999999:Pe-_e.length-Vt},children:c.jsx(VL,{credential:fe,isInActiveDeck:nr.has(fe.id),activeDeck:_??void 0,isInCollection:!0,onDragStart:Z,onDragEnd:ae,onMouseEnter:()=>lo(fe.id),onMouseLeave:()=>lo(null),onCardClick:gn,warnings:it.credentialWarnings.get(fe.id)})},fe.id)),G.map((fe,Vt)=>{var Us;return c.jsx("div",{className:"relative group",style:{zIndex:I===fe.id?999999:Pe-_e.length-ie.length-Vt},children:c.jsx(FL,{service:fe,onDragStart:F,onDragEnd:ae,isInActiveDeck:((Us=_==null?void 0:_.services)==null?void 0:Us.some(qs=>qs.id===fe.id))||!1,onCardClick:Ot,isInCollection:!0,onMouseEnter:()=>lo(fe.id),onMouseLeave:()=>lo(null),activeDeck:_??void 0,warnings:it.serviceWarnings.get(fe.id)})},fe.id)})]})})]})]})]})}),c.jsxs("div",{className:"fixed inset-0 pointer-events-none z-0 overflow-hidden",children:[c.jsx("div",{className:"absolute top-20 left-20",children:c.jsx("div",{className:"h-96 w-96 rounded-full bg-cyan-500/10 blur-3xl animate-orb-drift-1"})}),c.jsx("div",{className:"absolute bottom-20 right-20",children:c.jsx("div",{className:"h-96 w-96 rounded-full bg-pink-500/10 blur-3xl animate-orb-drift-2"})}),c.jsx("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:c.jsx("div",{className:"h-96 w-96 rounded-full bg-purple-500/5 blur-3xl animate-orb-drift-3"})})]}),c.jsx(YF,{type:"mcp",open:i,onOpenChange:a}),c.jsx(QV,{service:l,isOpen:d,onClose:()=>f(!1)}),c.jsx(n3,{open:p,onOpenChange:h}),c.jsx(p3,{credentialId:y,open:x,onOpenChange:g}),c.jsx(r3,{open:v,onOpenChange:b}),c.jsx(h3,{playbookId:k,open:E,onOpenChange:P}),c.jsx(GV,{open:O,onOpenChange:R})]})}const Xo=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:$e("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Xo.displayName="Card";const Gs=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:$e("flex flex-col space-y-1.5 p-6",e),...t}));Gs.displayName="CardHeader";const Js=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:$e("text-2xl font-semibold leading-none tracking-tight",e),...t}));Js.displayName="CardTitle";const Ud=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:$e("text-sm text-muted-foreground",e),...t}));Ud.displayName="CardDescription";const es=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:$e("p-6 pt-0",e),...t}));es.displayName="CardContent";const OH=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:$e("flex items-center p-6 pt-0",e),...t}));OH.displayName="CardFooter";function MH(){return c.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:c.jsx(Xo,{className:"w-full max-w-md mx-4",children:c.jsxs(es,{className:"pt-6",children:[c.jsxs("div",{className:"flex mb-4 gap-2",children:[c.jsx(uN,{className:"h-8 w-8 text-red-500"}),c.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),c.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}function DH(){const[e]=gO(),[t,n]=w.useState("loading"),[r,o]=w.useState("Authenticating...");return w.useEffect(()=>{(async()=>{try{const i=new URL(window.location.href),a=i.searchParams.get("success"),l=i.searchParams.get("error"),u=i.searchParams.get("serviceId");a==="true"?(n("success"),o("Authentication successful! This window will close automatically."),window.opener&&!window.opener.closed&&window.opener.postMessage({type:AT,serviceId:u??void 0},window.location.origin),setTimeout(()=>{window.close()},2e3)):a==="false"?(n("error"),o(`OAuth Error: ${l||"Authentication failed"}`)):(n("error"),o("Invalid OAuth callback - please try again"))}catch(i){n("error"),o(i instanceof Error?i.message:"Authentication failed")}})()},[e]),c.jsx("div",{className:"flex items-center justify-center min-h-screen bg-background",children:c.jsxs("div",{className:"text-center space-y-4",children:[t==="loading"&&c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto"}),t==="success"&&c.jsx("div",{className:"text-green-500 text-4xl",children:"✓"}),t==="error"&&c.jsx("div",{className:"text-red-500 text-4xl",children:"✗"}),c.jsx("h1",{className:"text-xl font-semibold",children:r}),t==="error"&&c.jsx("button",{onClick:()=>window.close(),className:"px-4 py-2 bg-primary text-primary-foreground rounded hover:bg-primary/90",children:"Close Window"})]})})}function ma(e){const t=()=>{throw new Error(`Invalid url to pass to open(): ${e}`)};let n;try{n=new URL(e)}catch{t()}return n.protocol!=="https:"&&n.protocol!=="http:"&&t(),n.hostname!==encodeURIComponent(n.hostname)&&t(),n.username&&(n.username=encodeURIComponent(n.username)),n.password&&(n.password=encodeURIComponent(n.password)),n.pathname=n.pathname.slice(0,1)+encodeURIComponent(n.pathname.slice(1)).replace(/%2f/ig,"/"),n.search=n.search.slice(0,1)+Array.from(n.searchParams.entries()).map(LH).join("&"),n.hash=n.hash.slice(0,1)+encodeURIComponent(n.hash.slice(1)),n.href}function LH([e,t]){return`${encodeURIComponent(e)}${t.length>0?`=${encodeURIComponent(t)}`:""}`}var I1=class{constructor(e,t={}){co(this,"serverUrl");co(this,"storageKeyPrefix");co(this,"serverUrlHash");co(this,"clientName");co(this,"clientUri");co(this,"callbackUrl");co(this,"preventAutoAuth");co(this,"onPopupWindow");this.serverUrl=e,this.storageKeyPrefix=t.storageKeyPrefix||"mcp:auth",this.serverUrlHash=this.hashString(e),this.clientName=t.clientName||"MCP Browser Client",this.clientUri=t.clientUri||(typeof window<"u"?window.location.origin:""),this.callbackUrl=ma(t.callbackUrl||(typeof window<"u"?new URL("/oauth/callback",window.location.origin).toString():"/oauth/callback")),this.preventAutoAuth=t.preventAutoAuth,this.onPopupWindow=t.onPopupWindow}get redirectUrl(){return ma(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 e=this.getKey("client_info"),t=localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(n){console.warn(`[${this.storageKeyPrefix}] Failed to parse client information:`,n),localStorage.removeItem(e);return}}async saveClientInformation(e){const t=this.getKey("client_info");localStorage.setItem(t,JSON.stringify(e))}async tokens(){const e=this.getKey("tokens"),t=localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(n){console.warn(`[${this.storageKeyPrefix}] Failed to parse tokens:`,n),localStorage.removeItem(e);return}}async saveTokens(e){const t=this.getKey("tokens");localStorage.setItem(t,JSON.stringify(e)),localStorage.removeItem(this.getKey("code_verifier")),localStorage.removeItem(this.getKey("last_auth_url"))}async saveCodeVerifier(e){const t=this.getKey("code_verifier");localStorage.setItem(t,e)}async codeVerifier(){const e=this.getKey("code_verifier"),t=localStorage.getItem(e);if(!t)throw new Error(`[${this.storageKeyPrefix}] Code verifier not found in storage for key ${e}. Auth flow likely corrupted or timed out.`);return t}async prepareAuthorizationUrl(e){const t=crypto.randomUUID(),n=`${this.storageKeyPrefix}:state_${t}`,r={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(n,JSON.stringify(r)),e.searchParams.set("state",t);const o=e.toString(),s=ma(o);return localStorage.setItem(this.getKey("last_auth_url"),s),s}async redirectToAuthorization(e){if(this.preventAutoAuth)return;const t=await this.prepareAuthorizationUrl(e),n="width=600,height=700,resizable=yes,scrollbars=yes,status=yes";try{const r=window.open(t,`mcp_auth_${this.serverUrlHash}`,n);this.onPopupWindow&&this.onPopupWindow(t,n,r),!r||r.closed||typeof r.closed>"u"?console.warn(`[${this.storageKeyPrefix}] Popup likely blocked by browser. Manual navigation might be required using the stored URL.`):(r.focus(),console.info(`[${this.storageKeyPrefix}] Redirecting to authorization URL in popup.`))}catch(r){console.error(`[${this.storageKeyPrefix}] Error opening popup window:`,r)}}getLastAttemptedAuthUrl(){const e=localStorage.getItem(this.getKey("last_auth_url"));return e?ma(e):null}clearStorage(){const e=`${this.storageKeyPrefix}_${this.serverUrlHash}_`,t=`${this.storageKeyPrefix}:state_`,n=[];let r=0;for(let s=0;s<localStorage.length;s++){const i=localStorage.key(s);if(i){if(i.startsWith(e))n.push(i);else if(i.startsWith(t))try{const a=localStorage.getItem(i);a&&JSON.parse(a).serverUrlHash===this.serverUrlHash&&n.push(i)}catch(a){console.warn(`[${this.storageKeyPrefix}] Error parsing state key ${i} during clearStorage:`,a)}}}return[...new Set(n)].forEach(s=>{localStorage.removeItem(s),r++}),r}hashString(e){let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t=t&t}return Math.abs(t).toString(16)}getKey(e){return`${this.storageKeyPrefix}_${this.serverUrlHash}_${e}`}};const zH=Object.freeze({status:"aborted"});function ee(e,t,n){function r(a,l){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,l);for(const d in i.prototype)d in a||Object.defineProperty(a,d,{value:i.prototype[d].bind(a)});a._zod.constr=i,a._zod.def=l}const o=(n==null?void 0:n.Parent)??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var l;const u=n!=null&&n.Parent?new s:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>{var l,u;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(u=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class Vc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const w2={};function $s(e){return w2}function FH(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function UH(e,t){return typeof t=="bigint"?t.toString():t}function Q0(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function G0(e){return e==null}function J0(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function qH(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function mt(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Gh(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Dl(e){return JSON.stringify(e)}const b2=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function qf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const VH=Q0(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Vf(e){if(qf(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(qf(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const HH=new Set(["string","number","symbol"]);function pu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ui(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function ve(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function BH(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const WH={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function KH(e,t){const n={},r=e._zod.def;for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(n[o]=r.shape[o])}return Ui(e,{...e._zod.def,shape:n,checks:[]})}function ZH(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete n[o]}return Ui(e,{...e._zod.def,shape:n,checks:[]})}function QH(e,t){if(!Vf(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return Gh(this,"shape",r),r},checks:[]};return Ui(e,n)}function GH(e,t){return Ui(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Gh(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function JH(e,t,n){const r=t._zod.def.shape,o={...r};if(n)for(const s in n){if(!(s in r))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=e?new e({type:"optional",innerType:r[s]}):r[s])}else for(const s in r)o[s]=e?new e({type:"optional",innerType:r[s]}):r[s];return Ui(t,{...t._zod.def,shape:o,checks:[]})}function YH(e,t,n){const r=t._zod.def.shape,o={...r};if(n)for(const s in n){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=new e({type:"nonoptional",innerType:r[s]}))}else for(const s in r)o[s]=new e({type:"nonoptional",innerType:r[s]});return Ui(t,{...t._zod.def,shape:o,checks:[]})}function hc(e,t=0){var n;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function li(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ld(e){return typeof e=="string"?e:e==null?void 0:e.message}function Rs(e,t,n){var o,s,i,a,l,u;const r={...e,path:e.path??[]};if(!e.message){const d=ld((i=(s=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:s.error)==null?void 0:i.call(s,e))??ld((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??ld((l=n.customError)==null?void 0:l.call(n,e))??ld((u=n.localeError)==null?void 0:u.call(n,e))??"Invalid input";r.message=d}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Y0(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Hc(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const k2=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,UH,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},_2=ee("$ZodError",k2),S2=ee("$ZodError",k2,{Parent:Error});function XH(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function eB(e,t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){const u=i.path[l];l===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(i))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return o(e),r}const tB=e=>(t,n,r,o)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Vc;if(i.issues.length){const a=new((o==null?void 0:o.Err)??e)(i.issues.map(l=>Rs(l,s,$s())));throw b2(a,o==null?void 0:o.callee),a}return i.value},nB=e=>async(t,n,r,o)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new((o==null?void 0:o.Err)??e)(i.issues.map(l=>Rs(l,s,$s())));throw b2(a,o==null?void 0:o.callee),a}return i.value},C2=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Vc;return s.issues.length?{success:!1,error:new(e??_2)(s.issues.map(i=>Rs(i,o,$s())))}:{success:!0,data:s.value}},E2=C2(S2),N2=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>Rs(i,o,$s())))}:{success:!0,data:s.value}},rB=N2(S2),oB=/^[cC][^\s-]{8,}$/,sB=/^[0-9a-z]+$/,iB=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,aB=/^[0-9a-vA-V]{20}$/,lB=/^[A-Za-z0-9]{27}$/,cB=/^[a-zA-Z0-9_-]{21}$/,uB=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dB=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,A1=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,fB=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function pB(){return new RegExp(hB,"u")}const mB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gB=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,yB=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,vB=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,xB=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,j2=/^[A-Za-z0-9_-]*$/,wB=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,bB=/^\+(?:[0-9]){6,14}[0-9]$/,P2="(?:(?:\\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])))",kB=new RegExp(`^${P2}$`);function T2(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function _B(e){return new RegExp(`^${T2(e)}$`)}function SB(e){const t=T2({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${P2}T(?:${r})$`)}const CB=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},EB=/^\d+$/,NB=/^-?\d+(?:\.\d+)?/i,jB=/true|false/i,PB=/null/i,TB=/^[^A-Z]*$/,$B=/^[^a-z]*$/,Un=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),$2={number:"number",bigint:"bigint",object:"date"},R2=ee("$ZodCheckLessThan",(e,t)=>{Un.init(e,t);const n=$2[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),I2=ee("$ZodCheckGreaterThan",(e,t)=>{Un.init(e,t);const n=$2[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),RB=ee("$ZodCheckMultipleOf",(e,t)=>{Un.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):qH(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),IB=ee("$ZodCheckNumberFormat",(e,t)=>{var i;Un.init(e,t),t.format=t.format||"float64";const n=(i=t.format)==null?void 0:i.includes("int"),r=n?"int":"number",[o,s]=WH[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=EB)}),e._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}l<o&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>s&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inst:e})}}),AB=ee("$ZodCheckMaxLength",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!G0(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=Y0(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),OB=ee("$ZodCheckMinLength",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!G0(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=Y0(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),MB=ee("$ZodCheckLengthEquals",(e,t)=>{var n;Un.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!G0(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const i=Y0(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Jh=ee("$ZodCheckStringFormat",(e,t)=>{var n,r;Un.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),DB=ee("$ZodCheckRegex",(e,t)=>{Jh.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),LB=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=TB),Jh.init(e,t)}),zB=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$B),Jh.init(e,t)}),FB=ee("$ZodCheckIncludes",(e,t)=>{Un.init(e,t);const n=pu(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),UB=ee("$ZodCheckStartsWith",(e,t)=>{Un.init(e,t);const n=new RegExp(`^${pu(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),qB=ee("$ZodCheckEndsWith",(e,t)=>{Un.init(e,t);const n=new RegExp(`.*${pu(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),VB=ee("$ZodCheckOverwrite",(e,t)=>{Un.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class HB{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
440
- `).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...n,o.join(`
441
- `))}}const BB={major:4,minor:0,patch:0},st=ee("$ZodType",(e,t)=>{var o;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=BB;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const i of s._zod.onattach)i(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const s=(i,a,l)=>{let u=hc(i),d;for(const f of a){if(f._zod.def.when){if(!f._zod.def.when(i))continue}else if(u)continue;const p=i.issues.length,h=f._zod.check(i);if(h instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Vc;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,i.issues.length!==p&&(u||(u=hc(i,p)))});else{if(i.issues.length===p)continue;u||(u=hc(i,p))}}return d?d.then(()=>i):i};e._zod.run=(i,a)=>{const l=e._zod.parse(i,a);if(l instanceof Promise){if(a.async===!1)throw new Vc;return l.then(u=>s(u,r,a))}return s(l,r,a)}}e["~standard"]={validate:s=>{var i;try{const a=E2(e,s);return a.success?{value:a.data}:{issues:(i=a.error)==null?void 0:i.issues}}catch{return rB(e,s).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),X0=ee("$ZodString",(e,t)=>{var n;st.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??CB(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),xt=ee("$ZodStringFormat",(e,t)=>{Jh.init(e,t),X0.init(e,t)}),WB=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=dB),xt.init(e,t)}),KB=ee("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=A1(r))}else t.pattern??(t.pattern=A1());xt.init(e,t)}),ZB=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=fB),xt.init(e,t)}),QB=ee("$ZodURL",(e,t)=>{xt.init(e,t),e._zod.check=n=>{try{const r=n.value,o=new URL(r),s=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:wB.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&s.endsWith("/")?n.value=s.slice(0,-1):n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),GB=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=pB()),xt.init(e,t)}),JB=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=cB),xt.init(e,t)}),YB=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=oB),xt.init(e,t)}),XB=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=sB),xt.init(e,t)}),eW=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=iB),xt.init(e,t)}),tW=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=aB),xt.init(e,t)}),nW=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=lB),xt.init(e,t)}),rW=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=SB(t)),xt.init(e,t)}),oW=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=kB),xt.init(e,t)}),sW=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=_B(t)),xt.init(e,t)}),iW=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=uB),xt.init(e,t)}),aW=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=mB),xt.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),lW=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gB),xt.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),cW=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=yB),xt.init(e,t)}),uW=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vB),xt.init(e,t),e._zod.check=n=>{const[r,o]=n.value.split("/");try{if(!o)throw new Error;const s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function A2(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const dW=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=xB),xt.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{A2(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function fW(e){if(!j2.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return A2(n)}const hW=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=j2),xt.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{fW(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),pW=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=bB),xt.init(e,t)});function mW(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const gW=ee("$ZodJWT",(e,t)=>{xt.init(e,t),e._zod.check=n=>{mW(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),O2=ee("$ZodNumber",(e,t)=>{st.init(e,t),e._zod.pattern=e._zod.bag.pattern??NB,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),yW=ee("$ZodNumber",(e,t)=>{IB.init(e,t),O2.init(e,t)}),vW=ee("$ZodBoolean",(e,t)=>{st.init(e,t),e._zod.pattern=jB,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),xW=ee("$ZodNull",(e,t)=>{st.init(e,t),e._zod.pattern=PB,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const o=n.value;return o===null||n.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),n}}),wW=ee("$ZodAny",(e,t)=>{st.init(e,t),e._zod.parse=n=>n}),bW=ee("$ZodUnknown",(e,t)=>{st.init(e,t),e._zod.parse=n=>n}),kW=ee("$ZodNever",(e,t)=>{st.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function O1(e,t,n){e.issues.length&&t.issues.push(...li(n,e.issues)),t.value[n]=e.value}const _W=ee("$ZodArray",(e,t)=>{st.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?s.push(l.then(u=>O1(u,n,i))):O1(l,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function cd(e,t,n){e.issues.length&&t.issues.push(...li(n,e.issues)),t.value[n]=e.value}function M1(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...li(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const SW=ee("$ZodObject",(e,t)=>{st.init(e,t);const n=Q0(()=>{const f=Object.keys(t.shape);for(const h of f)if(!(t.shape[h]instanceof st))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);const p=BH(t.shape);return{shape:t.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(p)}});mt(e._zod,"propValues",()=>{const f=t.shape,p={};for(const h in f){const y=f[h]._zod;if(y.values){p[h]??(p[h]=new Set);for(const m of y.values)p[h].add(m)}}return p});const r=f=>{const p=new HB(["shape","payload","ctx"]),h=n.value,y=v=>{const b=Dl(v);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};p.write("const input = payload.value;");const m=Object.create(null);let x=0;for(const v of h.keys)m[v]=`key_${x++}`;p.write("const newResult = {}");for(const v of h.keys)if(h.optionalKeys.has(v)){const b=m[v];p.write(`const ${b} = ${y(v)};`);const k=Dl(v);p.write(`
442
- if (${b}.issues.length) {
443
- if (input[${k}] === undefined) {
444
- if (${k} in input) {
445
- newResult[${k}] = undefined;
446
- }
447
- } else {
448
- payload.issues = payload.issues.concat(
449
- ${b}.issues.map((iss) => ({
450
- ...iss,
451
- path: iss.path ? [${k}, ...iss.path] : [${k}],
452
- }))
453
- );
454
- }
455
- } else if (${b}.value === undefined) {
456
- if (${k} in input) newResult[${k}] = undefined;
457
- } else {
458
- newResult[${k}] = ${b}.value;
459
- }
460
- `)}else{const b=m[v];p.write(`const ${b} = ${y(v)};`),p.write(`
461
- if (${b}.issues.length) payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
462
- ...iss,
463
- path: iss.path ? [${Dl(v)}, ...iss.path] : [${Dl(v)}]
464
- })));`),p.write(`newResult[${Dl(v)}] = ${b}.value`)}p.write("payload.value = newResult;"),p.write("return payload;");const g=p.compile();return(v,b)=>g(f,v,b)};let o;const s=qf,i=!w2.jitless,l=i&&VH.value,u=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=n.value);const h=f.value;if(!s(h))return f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f;const y=[];if(i&&l&&(p==null?void 0:p.async)===!1&&p.jitless!==!0)o||(o=r(t.shape)),f=o(f,p);else{f.value={};const b=d.shape;for(const k of d.keys){const S=b[k],E=S._zod.run({value:h[k],issues:[]},p),P=S._zod.optin==="optional"&&S._zod.optout==="optional";E instanceof Promise?y.push(E.then(O=>P?M1(O,f,k,h):cd(O,f,k))):P?M1(E,f,k,h):cd(E,f,k)}}if(!u)return y.length?Promise.all(y).then(()=>f):f;const m=[],x=d.keySet,g=u._zod,v=g.def.type;for(const b of Object.keys(h)){if(x.has(b))continue;if(v==="never"){m.push(b);continue}const k=g.run({value:h[b],issues:[]},p);k instanceof Promise?y.push(k.then(S=>cd(S,f,b))):cd(k,f,b)}return m.length&&f.issues.push({code:"unrecognized_keys",keys:m,input:h,inst:e}),y.length?Promise.all(y).then(()=>f):f}});function D1(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(s=>Rs(s,r,$s())))}),t}const M2=ee("$ZodUnion",(e,t)=>{st.init(e,t),mt(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),mt(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),mt(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),mt(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>J0(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let o=!1;const s=[];for(const i of t.options){const a=i._zod.run({value:n.value,issues:[]},r);if(a instanceof Promise)s.push(a),o=!0;else{if(a.issues.length===0)return a;s.push(a)}}return o?Promise.all(s).then(i=>D1(i,n,e,r)):D1(s,n,e,r)}}),CW=ee("$ZodDiscriminatedUnion",(e,t)=>{M2.init(e,t);const n=e._zod.parse;mt(e._zod,"propValues",()=>{const o={};for(const s of t.options){const i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[a,l]of Object.entries(i)){o[a]||(o[a]=new Set);for(const u of l)o[a].add(u)}}return o});const r=Q0(()=>{const o=t.options,s=new Map;for(const i of o){const a=i._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const l of a){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,i)}}return s});e._zod.parse=(o,s)=>{const i=o.value;if(!qf(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),o;const a=r.value.get(i==null?void 0:i[t.discriminator]);return a?a._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:i,path:[t.discriminator],inst:e}),o)}}),EW=ee("$ZodIntersection",(e,t)=>{st.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([l,u])=>L1(n,l,u)):L1(n,s,i)}});function gy(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Vf(e)&&Vf(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const i=gy(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=gy(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function L1(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),hc(e))return e;const r=gy(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const NW=ee("$ZodRecord",(e,t)=>{st.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Vf(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;n.value={};for(const l of i)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:o[l],issues:[]},r);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&n.issues.push(...li(l,d.issues)),n.value[l]=d.value})):(u.issues.length&&n.issues.push(...li(l,u.issues)),n.value[l]=u.value)}let a;for(const l in o)i.has(l)||(a=a??[],a.push(l));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const i of Reflect.ownKeys(o)){if(i==="__proto__")continue;const a=t.keyType._zod.run({value:i,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>Rs(u,r,$s())),input:i,path:[i],inst:e}),n.value[a.value]=a.value;continue}const l=t.valueType._zod.run({value:o[i],issues:[]},r);l instanceof Promise?s.push(l.then(u=>{u.issues.length&&n.issues.push(...li(i,u.issues)),n.value[a.value]=u.value})):(l.issues.length&&n.issues.push(...li(i,l.issues)),n.value[a.value]=l.value)}}return s.length?Promise.all(s).then(()=>n):n}}),jW=ee("$ZodEnum",(e,t)=>{st.init(e,t);const n=FH(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>HH.has(typeof r)).map(r=>typeof r=="string"?pu(r):r.toString()).join("|")})$`),e._zod.parse=(r,o)=>{const s=r.value;return e._zod.values.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),PW=ee("$ZodLiteral",(e,t)=>{st.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?pu(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,r)=>{const o=n.value;return e._zod.values.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),TW=ee("$ZodTransform",(e,t)=>{st.init(e,t),e._zod.parse=(n,r)=>{const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n));if(o instanceof Promise)throw new Vc;return n.value=o,n}}),$W=ee("$ZodOptional",(e,t)=>{st.init(e,t),e._zod.optin="optional",e._zod.optout="optional",mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${J0(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,r):n.value===void 0?n:t.innerType._zod.run(n,r)}),RW=ee("$ZodNullable",(e,t)=>{st.init(e,t),mt(e._zod,"optin",()=>t.innerType._zod.optin),mt(e._zod,"optout",()=>t.innerType._zod.optout),mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${J0(n.source)}|null)$`):void 0}),mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),IW=ee("$ZodDefault",(e,t)=>{st.init(e,t),e._zod.optin="optional",mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>z1(s,t)):z1(o,t)}});function z1(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const AW=ee("$ZodPrefault",(e,t)=>{st.init(e,t),e._zod.optin="optional",mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),OW=ee("$ZodNonOptional",(e,t)=>{st.init(e,t),mt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>F1(s,e)):F1(o,e)}});function F1(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const MW=ee("$ZodCatch",(e,t)=>{st.init(e,t),e._zod.optin="optional",mt(e._zod,"optout",()=>t.innerType._zod.optout),mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>Rs(i,r,$s()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>Rs(s,r,$s()))},input:n.value}),n.issues=[]),n)}}),DW=ee("$ZodPipe",(e,t)=>{st.init(e,t),mt(e._zod,"values",()=>t.in._zod.values),mt(e._zod,"optin",()=>t.in._zod.optin),mt(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>U1(s,t,r)):U1(o,t,r)}});function U1(e,t,n){return hc(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const LW=ee("$ZodReadonly",(e,t)=>{st.init(e,t),mt(e._zod,"propValues",()=>t.innerType._zod.propValues),mt(e._zod,"values",()=>t.innerType._zod.values),mt(e._zod,"optin",()=>t.innerType._zod.optin),mt(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(q1):q1(o)}});function q1(e){return e.value=Object.freeze(e.value),e}const zW=ee("$ZodCustom",(e,t)=>{Un.init(e,t),st.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>V1(s,n,r,e));V1(o,n,r,e)}});function V1(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Hc(o))}}class FW{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function UW(){return new FW}const ud=UW();function qW(e,t){return new e({type:"string",...ve(t)})}function VW(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ve(t)})}function H1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ve(t)})}function HW(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ve(t)})}function BW(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ve(t)})}function WW(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ve(t)})}function KW(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ve(t)})}function D2(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ve(t)})}function ZW(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ve(t)})}function QW(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ve(t)})}function GW(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ve(t)})}function JW(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ve(t)})}function YW(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ve(t)})}function XW(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ve(t)})}function eK(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ve(t)})}function tK(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ve(t)})}function nK(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ve(t)})}function rK(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ve(t)})}function oK(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ve(t)})}function sK(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ve(t)})}function iK(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ve(t)})}function aK(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ve(t)})}function lK(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ve(t)})}function cK(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ve(t)})}function uK(e,t){return new e({type:"string",format:"date",check:"string_format",...ve(t)})}function dK(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ve(t)})}function fK(e,t){return new e({type:"string",format:"duration",check:"string_format",...ve(t)})}function hK(e,t){return new e({type:"number",checks:[],...ve(t)})}function pK(e,t){return new e({type:"number",coerce:!0,checks:[],...ve(t)})}function mK(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ve(t)})}function gK(e,t){return new e({type:"boolean",...ve(t)})}function yK(e,t){return new e({type:"null",...ve(t)})}function vK(e){return new e({type:"any"})}function xK(e){return new e({type:"unknown"})}function wK(e,t){return new e({type:"never",...ve(t)})}function B1(e,t){return new R2({check:"less_than",...ve(t),value:e,inclusive:!1})}function vm(e,t){return new R2({check:"less_than",...ve(t),value:e,inclusive:!0})}function W1(e,t){return new I2({check:"greater_than",...ve(t),value:e,inclusive:!1})}function xm(e,t){return new I2({check:"greater_than",...ve(t),value:e,inclusive:!0})}function K1(e,t){return new RB({check:"multiple_of",...ve(t),value:e})}function L2(e,t){return new AB({check:"max_length",...ve(t),maximum:e})}function Hf(e,t){return new OB({check:"min_length",...ve(t),minimum:e})}function z2(e,t){return new MB({check:"length_equals",...ve(t),length:e})}function bK(e,t){return new DB({check:"string_format",format:"regex",...ve(t),pattern:e})}function kK(e){return new LB({check:"string_format",format:"lowercase",...ve(e)})}function _K(e){return new zB({check:"string_format",format:"uppercase",...ve(e)})}function SK(e,t){return new FB({check:"string_format",format:"includes",...ve(t),includes:e})}function CK(e,t){return new UB({check:"string_format",format:"starts_with",...ve(t),prefix:e})}function EK(e,t){return new qB({check:"string_format",format:"ends_with",...ve(t),suffix:e})}function mu(e){return new VB({check:"overwrite",tx:e})}function NK(e){return mu(t=>t.normalize(e))}function jK(){return mu(e=>e.trim())}function PK(){return mu(e=>e.toLowerCase())}function TK(){return mu(e=>e.toUpperCase())}function $K(e,t,n){return new e({type:"array",element:t,...ve(n)})}function RK(e,t,n){const r=ve(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function IK(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ve(n)})}const AK=ee("ZodISODateTime",(e,t)=>{rW.init(e,t),Nt.init(e,t)});function F2(e){return cK(AK,e)}const OK=ee("ZodISODate",(e,t)=>{oW.init(e,t),Nt.init(e,t)});function MK(e){return uK(OK,e)}const DK=ee("ZodISOTime",(e,t)=>{sW.init(e,t),Nt.init(e,t)});function LK(e){return dK(DK,e)}const zK=ee("ZodISODuration",(e,t)=>{iW.init(e,t),Nt.init(e,t)});function FK(e){return fK(zK,e)}const UK=(e,t)=>{_2.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>eB(e,n)},flatten:{value:n=>XH(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},Yh=ee("ZodError",UK,{Parent:Error}),qK=tB(Yh),VK=nB(Yh),HK=C2(Yh),BK=N2(Yh),wt=ee("ZodType",(e,t)=>(st.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>Ui(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>qK(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>HK(e,n,r),e.parseAsync=async(n,r)=>VK(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>BK(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(L7(n,r)),e.superRefine=n=>e.check(z7(n)),e.overwrite=n=>e.check(mu(n)),e.optional=()=>_t(e),e.nullable=()=>G1(e),e.nullish=()=>_t(G1(e)),e.nonoptional=n=>T7(e,n),e.array=()=>he(e),e.or=n=>bt([e,n]),e.and=n=>tx(e,n),e.transform=n=>vy(e,W2(n)),e.default=n=>N7(e,n),e.prefault=n=>P7(e,n),e.catch=n=>R7(e,n),e.pipe=n=>vy(e,n),e.readonly=()=>O7(e),e.describe=n=>{const r=e.clone();return ud.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=ud.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ud.get(e);const r=e.clone();return ud.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),U2=ee("_ZodString",(e,t)=>{X0.init(e,t),wt.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(bK(...r)),e.includes=(...r)=>e.check(SK(...r)),e.startsWith=(...r)=>e.check(CK(...r)),e.endsWith=(...r)=>e.check(EK(...r)),e.min=(...r)=>e.check(Hf(...r)),e.max=(...r)=>e.check(L2(...r)),e.length=(...r)=>e.check(z2(...r)),e.nonempty=(...r)=>e.check(Hf(1,...r)),e.lowercase=r=>e.check(kK(r)),e.uppercase=r=>e.check(_K(r)),e.trim=()=>e.check(jK()),e.normalize=(...r)=>e.check(NK(...r)),e.toLowerCase=()=>e.check(PK()),e.toUpperCase=()=>e.check(TK())}),WK=ee("ZodString",(e,t)=>{X0.init(e,t),U2.init(e,t),e.email=n=>e.check(VW(KK,n)),e.url=n=>e.check(D2(q2,n)),e.jwt=n=>e.check(lK(c7,n)),e.emoji=n=>e.check(ZW(QK,n)),e.guid=n=>e.check(H1(Z1,n)),e.uuid=n=>e.check(HW(dd,n)),e.uuidv4=n=>e.check(BW(dd,n)),e.uuidv6=n=>e.check(WW(dd,n)),e.uuidv7=n=>e.check(KW(dd,n)),e.nanoid=n=>e.check(QW(GK,n)),e.guid=n=>e.check(H1(Z1,n)),e.cuid=n=>e.check(GW(JK,n)),e.cuid2=n=>e.check(JW(YK,n)),e.ulid=n=>e.check(YW(XK,n)),e.base64=n=>e.check(sK(i7,n)),e.base64url=n=>e.check(iK(a7,n)),e.xid=n=>e.check(XW(e7,n)),e.ksuid=n=>e.check(eK(t7,n)),e.ipv4=n=>e.check(tK(n7,n)),e.ipv6=n=>e.check(nK(r7,n)),e.cidrv4=n=>e.check(rK(o7,n)),e.cidrv6=n=>e.check(oK(s7,n)),e.e164=n=>e.check(aK(l7,n)),e.datetime=n=>e.check(F2(n)),e.date=n=>e.check(MK(n)),e.time=n=>e.check(LK(n)),e.duration=n=>e.check(FK(n))});function V(e){return qW(WK,e)}const Nt=ee("ZodStringFormat",(e,t)=>{xt.init(e,t),U2.init(e,t)}),KK=ee("ZodEmail",(e,t)=>{ZB.init(e,t),Nt.init(e,t)}),Z1=ee("ZodGUID",(e,t)=>{WB.init(e,t),Nt.init(e,t)}),dd=ee("ZodUUID",(e,t)=>{KB.init(e,t),Nt.init(e,t)}),q2=ee("ZodURL",(e,t)=>{QB.init(e,t),Nt.init(e,t)});function ZK(e){return D2(q2,e)}const QK=ee("ZodEmoji",(e,t)=>{GB.init(e,t),Nt.init(e,t)}),GK=ee("ZodNanoID",(e,t)=>{JB.init(e,t),Nt.init(e,t)}),JK=ee("ZodCUID",(e,t)=>{YB.init(e,t),Nt.init(e,t)}),YK=ee("ZodCUID2",(e,t)=>{XB.init(e,t),Nt.init(e,t)}),XK=ee("ZodULID",(e,t)=>{eW.init(e,t),Nt.init(e,t)}),e7=ee("ZodXID",(e,t)=>{tW.init(e,t),Nt.init(e,t)}),t7=ee("ZodKSUID",(e,t)=>{nW.init(e,t),Nt.init(e,t)}),n7=ee("ZodIPv4",(e,t)=>{aW.init(e,t),Nt.init(e,t)}),r7=ee("ZodIPv6",(e,t)=>{lW.init(e,t),Nt.init(e,t)}),o7=ee("ZodCIDRv4",(e,t)=>{cW.init(e,t),Nt.init(e,t)}),s7=ee("ZodCIDRv6",(e,t)=>{uW.init(e,t),Nt.init(e,t)}),i7=ee("ZodBase64",(e,t)=>{dW.init(e,t),Nt.init(e,t)}),a7=ee("ZodBase64URL",(e,t)=>{hW.init(e,t),Nt.init(e,t)}),l7=ee("ZodE164",(e,t)=>{pW.init(e,t),Nt.init(e,t)}),c7=ee("ZodJWT",(e,t)=>{gW.init(e,t),Nt.init(e,t)}),ex=ee("ZodNumber",(e,t)=>{O2.init(e,t),wt.init(e,t),e.gt=(r,o)=>e.check(W1(r,o)),e.gte=(r,o)=>e.check(xm(r,o)),e.min=(r,o)=>e.check(xm(r,o)),e.lt=(r,o)=>e.check(B1(r,o)),e.lte=(r,o)=>e.check(vm(r,o)),e.max=(r,o)=>e.check(vm(r,o)),e.int=r=>e.check(Q1(r)),e.safe=r=>e.check(Q1(r)),e.positive=r=>e.check(W1(0,r)),e.nonnegative=r=>e.check(xm(0,r)),e.negative=r=>e.check(B1(0,r)),e.nonpositive=r=>e.check(vm(0,r)),e.multipleOf=(r,o)=>e.check(K1(r,o)),e.step=(r,o)=>e.check(K1(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Qe(e){return hK(ex,e)}const u7=ee("ZodNumberFormat",(e,t)=>{yW.init(e,t),ex.init(e,t)});function Q1(e){return mK(u7,e)}const d7=ee("ZodBoolean",(e,t)=>{vW.init(e,t),wt.init(e,t)});function ht(e){return gK(d7,e)}const f7=ee("ZodNull",(e,t)=>{xW.init(e,t),wt.init(e,t)});function h7(e){return yK(f7,e)}const p7=ee("ZodAny",(e,t)=>{wW.init(e,t),wt.init(e,t)});function m7(){return vK(p7)}const g7=ee("ZodUnknown",(e,t)=>{bW.init(e,t),wt.init(e,t)});function Ct(){return xK(g7)}const y7=ee("ZodNever",(e,t)=>{kW.init(e,t),wt.init(e,t)});function v7(e){return wK(y7,e)}const x7=ee("ZodArray",(e,t)=>{_W.init(e,t),wt.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(Hf(n,r)),e.nonempty=n=>e.check(Hf(1,n)),e.max=(n,r)=>e.check(L2(n,r)),e.length=(n,r)=>e.check(z2(n,r)),e.unwrap=()=>e.element});function he(e,t){return $K(x7,e,t)}const V2=ee("ZodObject",(e,t)=>{SW.init(e,t),wt.init(e,t),mt(e,"shape",()=>t.shape),e.keyof=()=>er(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ct()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ct()}),e.strict=()=>e.clone({...e._zod.def,catchall:v7()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>QH(e,n),e.merge=n=>GH(e,n),e.pick=n=>KH(e,n),e.omit=n=>ZH(e,n),e.partial=(...n)=>JH(K2,e,n[0]),e.required=(...n)=>YH(Z2,e,n[0])});function pe(e,t){const n={type:"object",get shape(){return Gh(this,"shape",{...e}),this.shape},...ve(t)};return new V2(n)}function tn(e,t){return new V2({type:"object",get shape(){return Gh(this,"shape",{...e}),this.shape},catchall:Ct(),...ve(t)})}const H2=ee("ZodUnion",(e,t)=>{M2.init(e,t),wt.init(e,t),e.options=t.options});function bt(e,t){return new H2({type:"union",options:e,...ve(t)})}const w7=ee("ZodDiscriminatedUnion",(e,t)=>{H2.init(e,t),CW.init(e,t)});function B2(e,t,n){return new w7({type:"union",options:t,discriminator:e,...ve(n)})}const b7=ee("ZodIntersection",(e,t)=>{EW.init(e,t),wt.init(e,t)});function tx(e,t){return new b7({type:"intersection",left:e,right:t})}const k7=ee("ZodRecord",(e,t)=>{NW.init(e,t),wt.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function gt(e,t,n){return new k7({type:"record",keyType:e,valueType:t,...ve(n)})}const yy=ee("ZodEnum",(e,t)=>{jW.init(e,t),wt.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new yy({...t,checks:[],...ve(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new yy({...t,checks:[],...ve(o),entries:s})}});function er(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new yy({type:"enum",entries:n,...ve(t)})}const _7=ee("ZodLiteral",(e,t)=>{PW.init(e,t),wt.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function we(e,t){return new _7({type:"literal",values:Array.isArray(e)?e:[e],...ve(t)})}const S7=ee("ZodTransform",(e,t)=>{TW.init(e,t),wt.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=s=>{if(typeof s=="string")n.issues.push(Hc(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),i.continue??(i.continue=!0),n.issues.push(Hc(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function W2(e){return new S7({type:"transform",transform:e})}const K2=ee("ZodOptional",(e,t)=>{$W.init(e,t),wt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function _t(e){return new K2({type:"optional",innerType:e})}const C7=ee("ZodNullable",(e,t)=>{RW.init(e,t),wt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function G1(e){return new C7({type:"nullable",innerType:e})}const E7=ee("ZodDefault",(e,t)=>{IW.init(e,t),wt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function N7(e,t){return new E7({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const j7=ee("ZodPrefault",(e,t)=>{AW.init(e,t),wt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function P7(e,t){return new j7({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Z2=ee("ZodNonOptional",(e,t)=>{OW.init(e,t),wt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function T7(e,t){return new Z2({type:"nonoptional",innerType:e,...ve(t)})}const $7=ee("ZodCatch",(e,t)=>{MW.init(e,t),wt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function R7(e,t){return new $7({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const I7=ee("ZodPipe",(e,t)=>{DW.init(e,t),wt.init(e,t),e.in=t.in,e.out=t.out});function vy(e,t){return new I7({type:"pipe",in:e,out:t})}const A7=ee("ZodReadonly",(e,t)=>{LW.init(e,t),wt.init(e,t)});function O7(e){return new A7({type:"readonly",innerType:e})}const Q2=ee("ZodCustom",(e,t)=>{zW.init(e,t),wt.init(e,t)});function M7(e){const t=new Un({check:"custom"});return t._zod.check=e,t}function D7(e,t){return RK(Q2,e??(()=>!0),t)}function L7(e,t={}){return IK(Q2,e,t)}function z7(e){const t=M7(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Hc(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(Hc(o))}},e(n.value,n)));return t}function G2(e,t){return vy(W2(e),t)}const F7={custom:"custom"};function U7(e){return pK(ex,e)}const Xh="2025-11-25",q7=[Xh,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Ys="io.modelcontextprotocol/related-task",ep="2.0",Ut=D7(e=>e!==null&&(typeof e=="object"||typeof e=="function")),J2=bt([V(),Qe().int()]),Y2=V();tn({ttl:Qe().optional(),pollInterval:Qe().optional()});const V7=pe({ttl:Qe().optional()}),H7=pe({taskId:V()}),nx=tn({progressToken:J2.optional(),[Ys]:H7.optional()}),tr=pe({_meta:nx.optional()}),gu=tr.extend({task:V7.optional()}),B7=e=>gu.safeParse(e).success,sn=pe({method:V(),params:tr.loose().optional()}),gr=pe({_meta:nx.optional()}),yr=pe({method:V(),params:gr.loose().optional()}),an=tn({_meta:nx.optional()}),tp=bt([V(),Qe().int()]),X2=pe({jsonrpc:we(ep),id:tp,...sn.shape}).strict(),xy=e=>X2.safeParse(e).success,e$=pe({jsonrpc:we(ep),...yr.shape}).strict(),W7=e=>e$.safeParse(e).success,rx=pe({jsonrpc:we(ep),id:tp,result:an}).strict(),Kl=e=>rx.safeParse(e).success;var Ie;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Ie||(Ie={}));const ox=pe({jsonrpc:we(ep),id:tp.optional(),error:pe({code:Qe().int(),message:V(),data:Ct().optional()})}).strict(),K7=e=>ox.safeParse(e).success,qd=bt([X2,e$,rx,ox]);bt([rx,ox]);const ga=an.strict(),Z7=gr.extend({requestId:tp.optional(),reason:V().optional()}),sx=yr.extend({method:we("notifications/cancelled"),params:Z7}),Q7=pe({src:V(),mimeType:V().optional(),sizes:he(V()).optional(),theme:er(["light","dark"]).optional()}),yu=pe({icons:he(Q7).optional()}),ol=pe({name:V(),title:V().optional()}),t$=ol.extend({...ol.shape,...yu.shape,version:V(),websiteUrl:V().optional(),description:V().optional()}),G7=tx(pe({applyDefaults:ht().optional()}),gt(V(),Ct())),J7=G2(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,tx(pe({form:G7.optional(),url:Ut.optional()}),gt(V(),Ct()).optional())),Y7=tn({list:Ut.optional(),cancel:Ut.optional(),requests:tn({sampling:tn({createMessage:Ut.optional()}).optional(),elicitation:tn({create:Ut.optional()}).optional()}).optional()}),X7=tn({list:Ut.optional(),cancel:Ut.optional(),requests:tn({tools:tn({call:Ut.optional()}).optional()}).optional()}),eZ=pe({experimental:gt(V(),Ut).optional(),sampling:pe({context:Ut.optional(),tools:Ut.optional()}).optional(),elicitation:J7.optional(),roots:pe({listChanged:ht().optional()}).optional(),tasks:Y7.optional(),extensions:gt(V(),Ut).optional()}),tZ=tr.extend({protocolVersion:V(),capabilities:eZ,clientInfo:t$}),nZ=sn.extend({method:we("initialize"),params:tZ}),rZ=pe({experimental:gt(V(),Ut).optional(),logging:Ut.optional(),completions:Ut.optional(),prompts:pe({listChanged:ht().optional()}).optional(),resources:pe({subscribe:ht().optional(),listChanged:ht().optional()}).optional(),tools:pe({listChanged:ht().optional()}).optional(),tasks:X7.optional(),extensions:gt(V(),Ut).optional()}),n$=an.extend({protocolVersion:V(),capabilities:rZ,serverInfo:t$,instructions:V().optional()}),r$=yr.extend({method:we("notifications/initialized"),params:gr.optional()}),oZ=e=>r$.safeParse(e).success,ix=sn.extend({method:we("ping"),params:tr.optional()}),sZ=pe({progress:Qe(),total:_t(Qe()),message:_t(V())}),iZ=pe({...gr.shape,...sZ.shape,progressToken:J2}),ax=yr.extend({method:we("notifications/progress"),params:iZ}),aZ=tr.extend({cursor:Y2.optional()}),vu=sn.extend({params:aZ.optional()}),xu=an.extend({nextCursor:Y2.optional()}),lZ=er(["working","input_required","completed","failed","cancelled"]),wu=pe({taskId:V(),status:lZ,ttl:bt([Qe(),h7()]),createdAt:V(),lastUpdatedAt:V(),pollInterval:_t(Qe()),statusMessage:_t(V())}),Bc=an.extend({task:wu}),cZ=gr.merge(wu),Bf=yr.extend({method:we("notifications/tasks/status"),params:cZ}),lx=sn.extend({method:we("tasks/get"),params:tr.extend({taskId:V()})}),cx=an.merge(wu),ux=sn.extend({method:we("tasks/result"),params:tr.extend({taskId:V()})});an.loose();const dx=vu.extend({method:we("tasks/list")}),fx=xu.extend({tasks:he(wu)}),hx=sn.extend({method:we("tasks/cancel"),params:tr.extend({taskId:V()})}),uZ=an.merge(wu),o$=pe({uri:V(),mimeType:_t(V()),_meta:gt(V(),Ct()).optional()}),s$=o$.extend({text:V()}),px=V().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),i$=o$.extend({blob:px}),bu=er(["user","assistant"]),wl=pe({audience:he(bu).optional(),priority:Qe().min(0).max(1).optional(),lastModified:F2({offset:!0}).optional()}),a$=pe({...ol.shape,...yu.shape,uri:V(),description:_t(V()),mimeType:_t(V()),size:_t(Qe()),annotations:wl.optional(),_meta:_t(tn({}))}),dZ=pe({...ol.shape,...yu.shape,uriTemplate:V(),description:_t(V()),mimeType:_t(V()),annotations:wl.optional(),_meta:_t(tn({}))}),fZ=vu.extend({method:we("resources/list")}),Wf=xu.extend({resources:he(a$)}),hZ=vu.extend({method:we("resources/templates/list")}),l$=xu.extend({resourceTemplates:he(dZ)}),mx=tr.extend({uri:V()}),pZ=mx,mZ=sn.extend({method:we("resources/read"),params:pZ}),gx=an.extend({contents:he(bt([s$,i$]))}),c$=yr.extend({method:we("notifications/resources/list_changed"),params:gr.optional()}),gZ=mx,yZ=sn.extend({method:we("resources/subscribe"),params:gZ}),vZ=mx,xZ=sn.extend({method:we("resources/unsubscribe"),params:vZ}),wZ=gr.extend({uri:V()}),bZ=yr.extend({method:we("notifications/resources/updated"),params:wZ}),kZ=pe({name:V(),description:_t(V()),required:_t(ht())}),_Z=pe({...ol.shape,...yu.shape,description:_t(V()),arguments:_t(he(kZ)),_meta:_t(tn({}))}),SZ=vu.extend({method:we("prompts/list")}),Kf=xu.extend({prompts:he(_Z)}),CZ=tr.extend({name:V(),arguments:gt(V(),V()).optional()}),EZ=sn.extend({method:we("prompts/get"),params:CZ}),yx=pe({type:we("text"),text:V(),annotations:wl.optional(),_meta:gt(V(),Ct()).optional()}),vx=pe({type:we("image"),data:px,mimeType:V(),annotations:wl.optional(),_meta:gt(V(),Ct()).optional()}),xx=pe({type:we("audio"),data:px,mimeType:V(),annotations:wl.optional(),_meta:gt(V(),Ct()).optional()}),NZ=pe({type:we("tool_use"),name:V(),id:V(),input:gt(V(),Ct()),_meta:gt(V(),Ct()).optional()}),jZ=pe({type:we("resource"),resource:bt([s$,i$]),annotations:wl.optional(),_meta:gt(V(),Ct()).optional()}),PZ=a$.extend({type:we("resource_link")}),wx=bt([yx,vx,xx,PZ,jZ]),TZ=pe({role:bu,content:wx}),bx=an.extend({description:V().optional(),messages:he(TZ)}),u$=yr.extend({method:we("notifications/prompts/list_changed"),params:gr.optional()}),$Z=pe({title:V().optional(),readOnlyHint:ht().optional(),destructiveHint:ht().optional(),idempotentHint:ht().optional(),openWorldHint:ht().optional()}),RZ=pe({taskSupport:er(["required","optional","forbidden"]).optional()}),d$=pe({...ol.shape,...yu.shape,description:V().optional(),inputSchema:pe({type:we("object"),properties:gt(V(),Ut).optional(),required:he(V()).optional()}).catchall(Ct()),outputSchema:pe({type:we("object"),properties:gt(V(),Ut).optional(),required:he(V()).optional()}).catchall(Ct()).optional(),annotations:$Z.optional(),execution:RZ.optional(),_meta:gt(V(),Ct()).optional()}),IZ=vu.extend({method:we("tools/list")}),kx=xu.extend({tools:he(d$)}),ku=an.extend({content:he(wx).default([]),structuredContent:gt(V(),Ct()).optional(),isError:ht().optional()});ku.or(an.extend({toolResult:Ct()}));const AZ=gu.extend({name:V(),arguments:gt(V(),Ct()).optional()}),OZ=sn.extend({method:we("tools/call"),params:AZ}),f$=yr.extend({method:we("notifications/tools/list_changed"),params:gr.optional()}),MZ=pe({autoRefresh:ht().default(!0),debounceMs:Qe().int().nonnegative().default(300)}),h$=er(["debug","info","notice","warning","error","critical","alert","emergency"]),DZ=tr.extend({level:h$}),LZ=sn.extend({method:we("logging/setLevel"),params:DZ}),zZ=gr.extend({level:h$,logger:V().optional(),data:Ct()}),FZ=yr.extend({method:we("notifications/message"),params:zZ}),UZ=pe({name:V().optional()}),qZ=pe({hints:he(UZ).optional(),costPriority:Qe().min(0).max(1).optional(),speedPriority:Qe().min(0).max(1).optional(),intelligencePriority:Qe().min(0).max(1).optional()}),VZ=pe({mode:er(["auto","required","none"]).optional()}),HZ=pe({type:we("tool_result"),toolUseId:V().describe("The unique identifier for the corresponding tool call."),content:he(wx).default([]),structuredContent:pe({}).loose().optional(),isError:ht().optional(),_meta:gt(V(),Ct()).optional()}),BZ=B2("type",[yx,vx,xx]),Zf=B2("type",[yx,vx,xx,NZ,HZ]),WZ=pe({role:bu,content:bt([Zf,he(Zf)]),_meta:gt(V(),Ct()).optional()}),KZ=gu.extend({messages:he(WZ),modelPreferences:qZ.optional(),systemPrompt:V().optional(),includeContext:er(["none","thisServer","allServers"]).optional(),temperature:Qe().optional(),maxTokens:Qe().int(),stopSequences:he(V()).optional(),metadata:Ut.optional(),tools:he(d$).optional(),toolChoice:VZ.optional()}),p$=sn.extend({method:we("sampling/createMessage"),params:KZ}),m$=an.extend({model:V(),stopReason:_t(er(["endTurn","stopSequence","maxTokens"]).or(V())),role:bu,content:BZ}),g$=an.extend({model:V(),stopReason:_t(er(["endTurn","stopSequence","maxTokens","toolUse"]).or(V())),role:bu,content:bt([Zf,he(Zf)])}),ZZ=pe({type:we("boolean"),title:V().optional(),description:V().optional(),default:ht().optional()}),QZ=pe({type:we("string"),title:V().optional(),description:V().optional(),minLength:Qe().optional(),maxLength:Qe().optional(),format:er(["email","uri","date","date-time"]).optional(),default:V().optional()}),GZ=pe({type:er(["number","integer"]),title:V().optional(),description:V().optional(),minimum:Qe().optional(),maximum:Qe().optional(),default:Qe().optional()}),JZ=pe({type:we("string"),title:V().optional(),description:V().optional(),enum:he(V()),default:V().optional()}),YZ=pe({type:we("string"),title:V().optional(),description:V().optional(),oneOf:he(pe({const:V(),title:V()})),default:V().optional()}),XZ=pe({type:we("string"),title:V().optional(),description:V().optional(),enum:he(V()),enumNames:he(V()).optional(),default:V().optional()}),eQ=bt([JZ,YZ]),tQ=pe({type:we("array"),title:V().optional(),description:V().optional(),minItems:Qe().optional(),maxItems:Qe().optional(),items:pe({type:we("string"),enum:he(V())}),default:he(V()).optional()}),nQ=pe({type:we("array"),title:V().optional(),description:V().optional(),minItems:Qe().optional(),maxItems:Qe().optional(),items:pe({anyOf:he(pe({const:V(),title:V()}))}),default:he(V()).optional()}),rQ=bt([tQ,nQ]),oQ=bt([XZ,eQ,rQ]),sQ=bt([oQ,ZZ,QZ,GZ]),iQ=gu.extend({mode:we("form").optional(),message:V(),requestedSchema:pe({type:we("object"),properties:gt(V(),sQ),required:he(V()).optional()})}),aQ=gu.extend({mode:we("url"),message:V(),elicitationId:V(),url:V().url()}),lQ=bt([iQ,aQ]),y$=sn.extend({method:we("elicitation/create"),params:lQ}),cQ=gr.extend({elicitationId:V()}),uQ=yr.extend({method:we("notifications/elicitation/complete"),params:cQ}),v$=an.extend({action:er(["accept","decline","cancel"]),content:G2(e=>e===null?void 0:e,gt(V(),bt([V(),Qe(),ht(),he(V())])).optional())}),dQ=pe({type:we("ref/resource"),uri:V()}),fQ=pe({type:we("ref/prompt"),name:V()}),hQ=tr.extend({ref:bt([fQ,dQ]),argument:pe({name:V(),value:V()}),context:pe({arguments:gt(V(),V()).optional()}).optional()}),pQ=sn.extend({method:we("completion/complete"),params:hQ}),x$=an.extend({completion:tn({values:he(V()).max(100),total:_t(Qe().int()),hasMore:_t(ht())})}),mQ=pe({uri:V().startsWith("file://"),name:V().optional(),_meta:gt(V(),Ct()).optional()}),gQ=sn.extend({method:we("roots/list"),params:tr.optional()}),yQ=an.extend({roots:he(mQ)}),vQ=yr.extend({method:we("notifications/roots/list_changed"),params:gr.optional()});bt([ix,nZ,pQ,LZ,EZ,SZ,fZ,hZ,mZ,yZ,xZ,OZ,IZ,lx,ux,dx,hx]);bt([sx,ax,r$,vQ,Bf]);bt([ga,m$,g$,v$,yQ,cx,fx,Bc]);bt([ix,p$,y$,gQ,lx,ux,dx,hx]);bt([sx,ax,FZ,bZ,c$,f$,u$,Bf,uQ]);bt([ga,n$,x$,bx,Kf,Wf,l$,gx,ku,kx,cx,fx,Bc]);class je extends Error{constructor(t,n,r){super(`MCP error ${t}: ${n}`),this.code=t,this.data=r,this.name="McpError"}static fromError(t,n,r){if(t===Ie.UrlElicitationRequired&&r){const o=r;if(o.elicitations)return new xQ(o.elicitations,n)}return new je(t,n,r)}}class xQ extends je{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(Ie.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){var t;return((t=this.data)==null?void 0:t.elicitations)??[]}}class J1 extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}function wm(e){}function w$(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=wm,onError:n=wm,onRetry:r=wm,onComment:o}=e;let s="",i=!0,a,l="",u="";function d(m){const x=i?m.replace(/^\xEF\xBB\xBF/,""):m,[g,v]=wQ(`${s}${x}`);for(const b of g)f(b);s=v,i=!1}function f(m){if(m===""){h();return}if(m.startsWith(":")){o&&o(m.slice(m.startsWith(": ")?2:1));return}const x=m.indexOf(":");if(x!==-1){const g=m.slice(0,x),v=m[x+1]===" "?2:1,b=m.slice(x+v);p(g,b,m);return}p(m,"",m)}function p(m,x,g){switch(m){case"event":u=x;break;case"data":l=`${l}${x}
465
- `;break;case"id":a=x.includes("\0")?void 0:x;break;case"retry":/^\d+$/.test(x)?r(parseInt(x,10)):n(new J1(`Invalid \`retry\` value: "${x}"`,{type:"invalid-retry",value:x,line:g}));break;default:n(new J1(`Unknown field "${m.length>20?`${m.slice(0,20)}…`:m}"`,{type:"unknown-field",field:m,value:x,line:g}));break}}function h(){l.length>0&&t({id:a,event:u||void 0,data:l.endsWith(`
466
- `)?l.slice(0,-1):l}),a=void 0,l="",u=""}function y(m={}){s&&m.consume&&f(s),i=!0,a=void 0,l="",u="",s=""}return{feed:d,reset:y}}function wQ(e){const t=[];let n="",r=0;for(;r<e.length;){const o=e.indexOf("\r",r),s=e.indexOf(`
467
- `,r);let i=-1;if(o!==-1&&s!==-1?i=Math.min(o,s):o!==-1?o===e.length-1?i=-1:i=o:s!==-1&&(i=s),i===-1){n=e.slice(r);break}else{const a=e.slice(r,i);t.push(a),r=i+1,e[r-1]==="\r"&&e[r]===`
468
- `&&r++}}return[t,n]}class Y1 extends Event{constructor(t,n){var r,o;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(o=n==null?void 0:n.message)!=null?o:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(X1(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(X1(this),n)}}function bQ(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function wy(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(wy).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${wy(e.cause)}`:e.message:`${e}`}function X1(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var b$=e=>{throw TypeError(e)},_x=(e,t,n)=>t.has(e)||b$("Cannot "+n),Ue=(e,t,n)=>(_x(e,t,"read from private field"),n?n.call(e):t.get(e)),Mt=(e,t,n)=>t.has(e)?b$("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),yt=(e,t,n,r)=>(_x(e,t,"write to private field"),t.set(e,n),n),go=(e,t,n)=>(_x(e,t,"access private method"),n),In,ti,Xi,Vd,Qf,pc,ya,mc,os,ea,ja,ta,Zl,_r,by,ky,_y,e_,Sy,Cy,Ql,Ey,Ny;class Hd extends EventTarget{constructor(t,n){var r,o;super(),Mt(this,_r),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Mt(this,In),Mt(this,ti),Mt(this,Xi),Mt(this,Vd),Mt(this,Qf),Mt(this,pc),Mt(this,ya),Mt(this,mc,null),Mt(this,os),Mt(this,ea),Mt(this,ja,null),Mt(this,ta,null),Mt(this,Zl,null),Mt(this,ky,async s=>{var i;Ue(this,ea).reset();const{body:a,redirected:l,status:u,headers:d}=s;if(u===204){go(this,_r,Ql).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?yt(this,Xi,new URL(s.url)):yt(this,Xi,void 0),u!==200){go(this,_r,Ql).call(this,`Non-200 status code (${u})`,u);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){go(this,_r,Ql).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(Ue(this,In)===this.CLOSED)return;yt(this,In,this.OPEN);const f=new Event("open");if((i=Ue(this,Zl))==null||i.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){go(this,_r,Ql).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const p=new TextDecoder,h=a.getReader();let y=!0;do{const{done:m,value:x}=await h.read();x&&Ue(this,ea).feed(p.decode(x,{stream:!m})),m&&(y=!1,Ue(this,ea).reset(),go(this,_r,Ey).call(this))}while(y)}),Mt(this,_y,s=>{yt(this,os,void 0),!(s.name==="AbortError"||s.type==="aborted")&&go(this,_r,Ey).call(this,wy(s))}),Mt(this,Sy,s=>{typeof s.id=="string"&&yt(this,mc,s.id);const i=new MessageEvent(s.event||"message",{data:s.data,origin:Ue(this,Xi)?Ue(this,Xi).origin:Ue(this,ti).origin,lastEventId:s.id||""});Ue(this,ta)&&(!s.event||s.event==="message")&&Ue(this,ta).call(this,i),this.dispatchEvent(i)}),Mt(this,Cy,s=>{yt(this,pc,s)}),Mt(this,Ny,()=>{yt(this,ya,void 0),Ue(this,In)===this.CONNECTING&&go(this,_r,by).call(this)});try{if(t instanceof URL)yt(this,ti,t);else if(typeof t=="string")yt(this,ti,new URL(t,kQ()));else throw new Error("Invalid URL")}catch{throw bQ("An invalid or illegal string was specified")}yt(this,ea,w$({onEvent:Ue(this,Sy),onRetry:Ue(this,Cy)})),yt(this,In,this.CONNECTING),yt(this,pc,3e3),yt(this,Qf,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),yt(this,Vd,(o=n==null?void 0:n.withCredentials)!=null?o:!1),go(this,_r,by).call(this)}get readyState(){return Ue(this,In)}get url(){return Ue(this,ti).href}get withCredentials(){return Ue(this,Vd)}get onerror(){return Ue(this,ja)}set onerror(t){yt(this,ja,t)}get onmessage(){return Ue(this,ta)}set onmessage(t){yt(this,ta,t)}get onopen(){return Ue(this,Zl)}set onopen(t){yt(this,Zl,t)}addEventListener(t,n,r){const o=n;super.addEventListener(t,o,r)}removeEventListener(t,n,r){const o=n;super.removeEventListener(t,o,r)}close(){Ue(this,ya)&&clearTimeout(Ue(this,ya)),Ue(this,In)!==this.CLOSED&&(Ue(this,os)&&Ue(this,os).abort(),yt(this,In,this.CLOSED),yt(this,os,void 0))}}In=new WeakMap,ti=new WeakMap,Xi=new WeakMap,Vd=new WeakMap,Qf=new WeakMap,pc=new WeakMap,ya=new WeakMap,mc=new WeakMap,os=new WeakMap,ea=new WeakMap,ja=new WeakMap,ta=new WeakMap,Zl=new WeakMap,_r=new WeakSet,by=function(){yt(this,In,this.CONNECTING),yt(this,os,new AbortController),Ue(this,Qf)(Ue(this,ti),go(this,_r,e_).call(this)).then(Ue(this,ky)).catch(Ue(this,_y))},ky=new WeakMap,_y=new WeakMap,e_=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...Ue(this,mc)?{"Last-Event-ID":Ue(this,mc)}:void 0},cache:"no-store",signal:(e=Ue(this,os))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},Sy=new WeakMap,Cy=new WeakMap,Ql=function(e,t){var n;Ue(this,In)!==this.CLOSED&&yt(this,In,this.CLOSED);const r=new Y1("error",{code:t,message:e});(n=Ue(this,ja))==null||n.call(this,r),this.dispatchEvent(r)},Ey=function(e,t){var n;if(Ue(this,In)===this.CLOSED)return;yt(this,In,this.CONNECTING);const r=new Y1("error",{code:t,message:e});(n=Ue(this,ja))==null||n.call(this,r),this.dispatchEvent(r),yt(this,ya,setTimeout(Ue(this,Ny),Ue(this,pc)))},Ny=new WeakMap,Hd.CONNECTING=0,Hd.OPEN=1,Hd.CLOSED=2;function kQ(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}function Gf(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function k$(e=fetch,t){return t?async(n,r)=>{const o={...t,...r,headers:r!=null&&r.headers?{...Gf(t.headers),...Gf(r.headers)}:t.headers};return e(n,o)}:e}let Sx;Sx=globalThis.crypto;async function _Q(e){return(await Sx).getRandomValues(new Uint8Array(e))}async function SQ(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~";let n="";const r=await _Q(e);for(let o=0;o<e;o++){const s=r[o]%t.length;n+=t[s]}return n}async function CQ(e){return await SQ(e)}async function EQ(e){const t=await(await Sx).subtle.digest("SHA-256",new TextEncoder().encode(e));return btoa(String.fromCharCode(...new Uint8Array(t))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function NQ(e){if(e||(e=43),e<43||e>128)throw`Expected a length between 43 and 128. Received ${e}.`;const t=await CQ(e),n=await EQ(t);return{code_verifier:t,code_challenge:n}}const Xt=ZK().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:F7.custom,message:"URL must be parseable",fatal:!0}),zH}).refine(e=>{const t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),jQ=tn({resource:V().url(),authorization_servers:he(Xt).optional(),jwks_uri:V().url().optional(),scopes_supported:he(V()).optional(),bearer_methods_supported:he(V()).optional(),resource_signing_alg_values_supported:he(V()).optional(),resource_name:V().optional(),resource_documentation:V().optional(),resource_policy_uri:V().url().optional(),resource_tos_uri:V().url().optional(),tls_client_certificate_bound_access_tokens:ht().optional(),authorization_details_types_supported:he(V()).optional(),dpop_signing_alg_values_supported:he(V()).optional(),dpop_bound_access_tokens_required:ht().optional()}),_$=tn({issuer:V(),authorization_endpoint:Xt,token_endpoint:Xt,registration_endpoint:Xt.optional(),scopes_supported:he(V()).optional(),response_types_supported:he(V()),response_modes_supported:he(V()).optional(),grant_types_supported:he(V()).optional(),token_endpoint_auth_methods_supported:he(V()).optional(),token_endpoint_auth_signing_alg_values_supported:he(V()).optional(),service_documentation:Xt.optional(),revocation_endpoint:Xt.optional(),revocation_endpoint_auth_methods_supported:he(V()).optional(),revocation_endpoint_auth_signing_alg_values_supported:he(V()).optional(),introspection_endpoint:V().optional(),introspection_endpoint_auth_methods_supported:he(V()).optional(),introspection_endpoint_auth_signing_alg_values_supported:he(V()).optional(),code_challenge_methods_supported:he(V()).optional(),client_id_metadata_document_supported:ht().optional()}),PQ=tn({issuer:V(),authorization_endpoint:Xt,token_endpoint:Xt,userinfo_endpoint:Xt.optional(),jwks_uri:Xt,registration_endpoint:Xt.optional(),scopes_supported:he(V()).optional(),response_types_supported:he(V()),response_modes_supported:he(V()).optional(),grant_types_supported:he(V()).optional(),acr_values_supported:he(V()).optional(),subject_types_supported:he(V()),id_token_signing_alg_values_supported:he(V()),id_token_encryption_alg_values_supported:he(V()).optional(),id_token_encryption_enc_values_supported:he(V()).optional(),userinfo_signing_alg_values_supported:he(V()).optional(),userinfo_encryption_alg_values_supported:he(V()).optional(),userinfo_encryption_enc_values_supported:he(V()).optional(),request_object_signing_alg_values_supported:he(V()).optional(),request_object_encryption_alg_values_supported:he(V()).optional(),request_object_encryption_enc_values_supported:he(V()).optional(),token_endpoint_auth_methods_supported:he(V()).optional(),token_endpoint_auth_signing_alg_values_supported:he(V()).optional(),display_values_supported:he(V()).optional(),claim_types_supported:he(V()).optional(),claims_supported:he(V()).optional(),service_documentation:V().optional(),claims_locales_supported:he(V()).optional(),ui_locales_supported:he(V()).optional(),claims_parameter_supported:ht().optional(),request_parameter_supported:ht().optional(),request_uri_parameter_supported:ht().optional(),require_request_uri_registration:ht().optional(),op_policy_uri:Xt.optional(),op_tos_uri:Xt.optional(),client_id_metadata_document_supported:ht().optional()}),TQ=pe({...PQ.shape,..._$.pick({code_challenge_methods_supported:!0}).shape}),$Q=pe({access_token:V(),id_token:V().optional(),token_type:V(),expires_in:U7().optional(),scope:V().optional(),refresh_token:V().optional()}).strip(),RQ=pe({error:V(),error_description:V().optional(),error_uri:V().optional()}),t_=Xt.optional().or(we("").transform(()=>{})),IQ=pe({redirect_uris:he(Xt),token_endpoint_auth_method:V().optional(),grant_types:he(V()).optional(),response_types:he(V()).optional(),client_name:V().optional(),client_uri:Xt.optional(),logo_uri:t_,scope:V().optional(),contacts:he(V()).optional(),tos_uri:t_,policy_uri:V().optional(),jwks_uri:Xt.optional(),jwks:m7().optional(),software_id:V().optional(),software_version:V().optional(),software_statement:V().optional()}).strip(),AQ=pe({client_id:V(),client_secret:V().optional(),client_id_issued_at:Qe().optional(),client_secret_expires_at:Qe().optional()}).strip(),OQ=IQ.merge(AQ);pe({error:V(),error_description:V().optional()}).strip();pe({token:V(),token_type_hint:V().optional()}).strip();function MQ(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function DQ({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const o=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",s=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return o.startsWith(s)}class Zt extends Error{constructor(t,n){super(t),this.errorUri=n,this.name=this.constructor.name}toResponseObject(){const t={error:this.errorCode,error_description:this.message};return this.errorUri&&(t.error_uri=this.errorUri),t}get errorCode(){return this.constructor.errorCode}}class jy extends Zt{}jy.errorCode="invalid_request";class Jf extends Zt{}Jf.errorCode="invalid_client";class Yf extends Zt{}Yf.errorCode="invalid_grant";class Xf extends Zt{}Xf.errorCode="unauthorized_client";class Py extends Zt{}Py.errorCode="unsupported_grant_type";class Ty extends Zt{}Ty.errorCode="invalid_scope";class $y extends Zt{}$y.errorCode="access_denied";class sl extends Zt{}sl.errorCode="server_error";class Ry extends Zt{}Ry.errorCode="temporarily_unavailable";class Iy extends Zt{}Iy.errorCode="unsupported_response_type";class Ay extends Zt{}Ay.errorCode="unsupported_token_type";class Oy extends Zt{}Oy.errorCode="invalid_token";class My extends Zt{}My.errorCode="method_not_allowed";class Dy extends Zt{}Dy.errorCode="too_many_requests";class eh extends Zt{}eh.errorCode="invalid_client_metadata";class Ly extends Zt{}Ly.errorCode="insufficient_scope";class zy extends Zt{}zy.errorCode="invalid_target";const LQ={[jy.errorCode]:jy,[Jf.errorCode]:Jf,[Yf.errorCode]:Yf,[Xf.errorCode]:Xf,[Py.errorCode]:Py,[Ty.errorCode]:Ty,[$y.errorCode]:$y,[sl.errorCode]:sl,[Ry.errorCode]:Ry,[Iy.errorCode]:Iy,[Ay.errorCode]:Ay,[Oy.errorCode]:Oy,[My.errorCode]:My,[Dy.errorCode]:Dy,[eh.errorCode]:eh,[Ly.errorCode]:Ly,[zy.errorCode]:zy};class Wn extends Error{constructor(t){super(t??"Unauthorized")}}function zQ(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const bm="code",km="S256";function FQ(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&zQ(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function UQ(e,t,n,r){const{client_id:o,client_secret:s}=t;switch(e){case"client_secret_basic":qQ(o,s,n);return;case"client_secret_post":VQ(o,s,r);return;case"none":HQ(o,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function qQ(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function VQ(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function HQ(e,t){t.set("client_id",e)}async function S$(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=RQ.parse(JSON.parse(n)),{error:o,error_description:s,error_uri:i}=r,a=LQ[o]||sl;return new a(s||"",i)}catch(r){const o=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new sl(o)}}async function $r(e,t){var n,r;try{return await _m(e,t)}catch(o){if(o instanceof Jf||o instanceof Xf)return await((n=e.invalidateCredentials)==null?void 0:n.call(e,"all")),await _m(e,t);if(o instanceof Yf)return await((r=e.invalidateCredentials)==null?void 0:r.call(e,"tokens")),await _m(e,t);throw o}}async function _m(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:o,fetchFn:s}){var b,k,S,E,P;const i=await((b=e.discoveryState)==null?void 0:b.call(e));let a,l,u,d=o;if(!d&&(i!=null&&i.resourceMetadataUrl)&&(d=new URL(i.resourceMetadataUrl)),i!=null&&i.authorizationServerUrl){if(l=i.authorizationServerUrl,a=i.resourceMetadata,u=i.authorizationServerMetadata??await E$(l,{fetchFn:s}),!a)try{a=await C$(t,{resourceMetadataUrl:d},s)}catch{}(u!==i.authorizationServerMetadata||a!==i.resourceMetadata)&&await((k=e.saveDiscoveryState)==null?void 0:k.call(e,{authorizationServerUrl:String(l),resourceMetadataUrl:d==null?void 0:d.toString(),resourceMetadata:a,authorizationServerMetadata:u}))}else{const O=await JQ(t,{resourceMetadataUrl:d,fetchFn:s});l=O.authorizationServerUrl,u=O.authorizationServerMetadata,a=O.resourceMetadata,await((S=e.saveDiscoveryState)==null?void 0:S.call(e,{authorizationServerUrl:String(l),resourceMetadataUrl:d==null?void 0:d.toString(),resourceMetadata:a,authorizationServerMetadata:u}))}const f=await WQ(t,e,a),p=r||((E=a==null?void 0:a.scopes_supported)==null?void 0:E.join(" "))||e.clientMetadata.scope;let h=await Promise.resolve(e.clientInformation());if(!h){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const O=(u==null?void 0:u.client_id_metadata_document_supported)===!0,R=e.clientMetadataUrl;if(R&&!BQ(R))throw new eh(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${R}`);if(O&&R)h={client_id:R},await((P=e.saveClientInformation)==null?void 0:P.call(e,h));else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const j=await nG(l,{metadata:u,clientMetadata:e.clientMetadata,scope:p,fetchFn:s});await e.saveClientInformation(j),h=j}}const y=!e.redirectUrl;if(n!==void 0||y){const O=await tG(e,l,{metadata:u,resource:f,authorizationCode:n,fetchFn:s});return await e.saveTokens(O),"AUTHORIZED"}const m=await e.tokens();if(m!=null&&m.refresh_token)try{const O=await eG(l,{metadata:u,clientInformation:h,refreshToken:m.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:s});return await e.saveTokens(O),"AUTHORIZED"}catch(O){if(!(!(O instanceof Zt)||O instanceof sl))throw O}const x=e.state?await e.state():void 0,{authorizationUrl:g,codeVerifier:v}=await YQ(l,{metadata:u,clientInformation:h,state:x,redirectUrl:e.redirectUrl,scope:p,resource:f});return await e.saveCodeVerifier(v),await e.redirectToAuthorization(g),"REDIRECT"}function BQ(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function WQ(e,t,n){const r=MQ(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n==null?void 0:n.resource);if(n){if(!DQ({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function th(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const o=Sm(e,"resource_metadata")||void 0;let s;if(o)try{s=new URL(o)}catch{}const i=Sm(e,"scope")||void 0,a=Sm(e,"error")||void 0;return{resourceMetadataUrl:s,scope:i,error:a}}function Sm(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),o=n.match(r);return o?o[1]||o[2]:null}async function C$(e,t,n=fetch){var o,s;const r=await QQ(e,"oauth-protected-resource",n,{protocolVersion:t==null?void 0:t.protocolVersion,metadataUrl:t==null?void 0:t.resourceMetadataUrl});if(!r||r.status===404)throw await((o=r==null?void 0:r.body)==null?void 0:o.cancel()),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await((s=r.body)==null?void 0:s.cancel()),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return jQ.parse(await r.json())}async function Cx(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?Cx(e,void 0,n):void 0;throw r}}function KQ(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function n_(e,t,n=fetch){return await Cx(e,{"MCP-Protocol-Version":t},n)}function ZQ(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function QQ(e,t,n,r){const o=new URL(e),s=(r==null?void 0:r.protocolVersion)??Xh;let i;if(r!=null&&r.metadataUrl)i=new URL(r.metadataUrl);else{const l=KQ(t,o.pathname);i=new URL(l,(r==null?void 0:r.metadataServerUrl)??o),i.search=o.search}let a=await n_(i,s,n);if(!(r!=null&&r.metadataUrl)&&ZQ(a,o.pathname)){const l=new URL(`/.well-known/${t}`,o);a=await n_(l,s,n)}return a}function GQ(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let o=t.pathname;return o.endsWith("/")&&(o=o.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${o}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${o}`,t.origin),type:"oidc"}),r.push({url:new URL(`${o}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function E$(e,{fetchFn:t=fetch,protocolVersion:n=Xh}={}){var s;const r={"MCP-Protocol-Version":n,Accept:"application/json"},o=GQ(e);for(const{url:i,type:a}of o){const l=await Cx(i,r,t);if(l){if(!l.ok){if(await((s=l.body)==null?void 0:s.cancel()),l.status>=400&&l.status<500)continue;throw new Error(`HTTP ${l.status} trying to load ${a==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return a==="oauth"?_$.parse(await l.json()):TQ.parse(await l.json())}}}async function JQ(e,t){let n,r;try{n=await C$(e,{resourceMetadataUrl:t==null?void 0:t.resourceMetadataUrl},t==null?void 0:t.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const o=await E$(r,{fetchFn:t==null?void 0:t.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:o,resourceMetadata:n}}async function YQ(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:o,state:s,resource:i}){let a;if(t){if(a=new URL(t.authorization_endpoint),!t.response_types_supported.includes(bm))throw new Error(`Incompatible auth server: does not support response type ${bm}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(km))throw new Error(`Incompatible auth server: does not support code challenge method ${km}`)}else a=new URL("/authorize",e);const l=await NQ(),u=l.code_verifier,d=l.code_challenge;return a.searchParams.set("response_type",bm),a.searchParams.set("client_id",n.client_id),a.searchParams.set("code_challenge",d),a.searchParams.set("code_challenge_method",km),a.searchParams.set("redirect_uri",String(r)),s&&a.searchParams.set("state",s),o&&a.searchParams.set("scope",o),o!=null&&o.includes("offline_access")&&a.searchParams.append("prompt","consent"),i&&a.searchParams.set("resource",i.href),{authorizationUrl:a,codeVerifier:u}}function XQ(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function N$(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:o,resource:s,fetchFn:i}){const a=t!=null&&t.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),l=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(s&&n.set("resource",s.href),o)await o(l,n,a,t);else if(r){const d=(t==null?void 0:t.token_endpoint_auth_methods_supported)??[],f=FQ(r,d);UQ(f,r,l,n)}const u=await(i??fetch)(a,{method:"POST",headers:l,body:n});if(!u.ok)throw await S$(u);return $Q.parse(await u.json())}async function eG(e,{metadata:t,clientInformation:n,refreshToken:r,resource:o,addClientAuthentication:s,fetchFn:i}){const a=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),l=await N$(e,{metadata:t,tokenRequestParams:a,clientInformation:n,addClientAuthentication:s,resource:o,fetchFn:i});return{refresh_token:r,...l}}async function tG(e,t,{metadata:n,resource:r,authorizationCode:o,fetchFn:s}={}){const i=e.clientMetadata.scope;let a;if(e.prepareTokenRequest&&(a=await e.prepareTokenRequest(i)),!a){if(!o)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();a=XQ(o,u,e.redirectUrl)}const l=await e.clientInformation();return N$(t,{metadata:n,tokenRequestParams:a,clientInformation:l??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:s})}async function nG(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:o}){let s;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");s=new URL(t.registration_endpoint)}else s=new URL("/register",e);const i=await(o??fetch)(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!i.ok)throw await S$(i);return OQ.parse(await i.json())}class rG extends Error{constructor(t,n,r){super(`SSE error: ${n}`),this.code=t,this.event=r}}class oG{constructor(t,n){this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._eventSourceInit=n==null?void 0:n.eventSourceInit,this._requestInit=n==null?void 0:n.requestInit,this._authProvider=n==null?void 0:n.authProvider,this._fetch=n==null?void 0:n.fetch,this._fetchWithInit=k$(n==null?void 0:n.fetch,n==null?void 0:n.requestInit)}async _authThenStart(){var n;if(!this._authProvider)throw new Wn("No auth provider");let t;try{t=await $r(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw(n=this.onerror)==null||n.call(this,r),r}if(t!=="AUTHORIZED")throw new Wn;return await this._startOrAuth()}async _commonHeaders(){var r;const t={};if(this._authProvider){const o=await this._authProvider.tokens();o&&(t.Authorization=`Bearer ${o.access_token}`)}this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=Gf((r=this._requestInit)==null?void 0:r.headers);return new Headers({...t,...n})}_startOrAuth(){var n;const t=((n=this==null?void 0:this._eventSourceInit)==null?void 0:n.fetch)??this._fetch??fetch;return new Promise((r,o)=>{this._eventSource=new Hd(this._url.href,{...this._eventSourceInit,fetch:async(s,i)=>{const a=await this._commonHeaders();a.set("Accept","text/event-stream");const l=await t(s,{...i,headers:a});if(l.status===401&&l.headers.has("www-authenticate")){const{resourceMetadataUrl:u,scope:d}=th(l);this._resourceMetadataUrl=u,this._scope=d}return l}}),this._abortController=new AbortController,this._eventSource.onerror=s=>{var a;if(s.code===401&&this._authProvider){this._authThenStart().then(r,o);return}const i=new rG(s.code,s.message,s);o(i),(a=this.onerror)==null||a.call(this,i)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",s=>{var a;const i=s;try{if(this._endpoint=new URL(i.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(l){o(l),(a=this.onerror)==null||a.call(this,l),this.close();return}r()}),this._eventSource.onmessage=s=>{var l,u;const i=s;let a;try{a=qd.parse(JSON.parse(i.data))}catch(d){(l=this.onerror)==null||l.call(this,d);return}(u=this.onmessage)==null||u.call(this,a)}})}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(t){if(!this._authProvider)throw new Wn("No auth provider");if(await $r(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Wn("Failed to authorize")}async close(){var t,n,r;(t=this._abortController)==null||t.abort(),(n=this._eventSource)==null||n.close(),(r=this.onclose)==null||r.call(this)}async send(t){var n,r,o;if(!this._endpoint)throw new Error("Not connected");try{const s=await this._commonHeaders();s.set("content-type","application/json");const i={...this._requestInit,method:"POST",headers:s,body:JSON.stringify(t),signal:(n=this._abortController)==null?void 0:n.signal},a=await(this._fetch??fetch)(this._endpoint,i);if(!a.ok){const l=await a.text().catch(()=>null);if(a.status===401&&this._authProvider){const{resourceMetadataUrl:u,scope:d}=th(a);if(this._resourceMetadataUrl=u,this._scope=d,await $r(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Wn;return this.send(t)}throw new Error(`Error POSTing to endpoint (HTTP ${a.status}): ${l}`)}await((r=a.body)==null?void 0:r.cancel())}catch(s){throw(o=this.onerror)==null||o.call(this,s),s}}setProtocolVersion(t){this._protocolVersion=t}}class sG extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let o;super({start(s){o=w$({onEvent:i=>{s.enqueue(i)},onError(i){t==="terminate"?s.error(i):typeof t=="function"&&t(i)},onRetry:n,onComment:r})},transform(s){o.feed(s)}})}}const iG={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2};class Zi extends Error{constructor(t,n){super(`Streamable HTTP error: ${n}`),this.code=t}}class aG{constructor(t,n){this._hasCompletedAuthFlow=!1,this._url=t,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=n==null?void 0:n.requestInit,this._authProvider=n==null?void 0:n.authProvider,this._fetch=n==null?void 0:n.fetch,this._fetchWithInit=k$(n==null?void 0:n.fetch,n==null?void 0:n.requestInit),this._sessionId=n==null?void 0:n.sessionId,this._reconnectionOptions=(n==null?void 0:n.reconnectionOptions)??iG}async _authThenStart(){var n;if(!this._authProvider)throw new Wn("No auth provider");let t;try{t=await $r(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(r){throw(n=this.onerror)==null||n.call(this,r),r}if(t!=="AUTHORIZED")throw new Wn;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){var r;const t={};if(this._authProvider){const o=await this._authProvider.tokens();o&&(t.Authorization=`Bearer ${o.access_token}`)}this._sessionId&&(t["mcp-session-id"]=this._sessionId),this._protocolVersion&&(t["mcp-protocol-version"]=this._protocolVersion);const n=Gf((r=this._requestInit)==null?void 0:r.headers);return new Headers({...t,...n})}async _startOrAuthSse(t){var r,o,s;const{resumptionToken:n}=t;try{const i=await this._commonHeaders();i.set("Accept","text/event-stream"),n&&i.set("last-event-id",n);const a=await(this._fetch??fetch)(this._url,{method:"GET",headers:i,signal:(r=this._abortController)==null?void 0:r.signal});if(!a.ok){if(await((o=a.body)==null?void 0:o.cancel()),a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new Zi(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,t,!0)}catch(i){throw(s=this.onerror)==null||s.call(this,i),i}}_getNextReconnectionDelay(t){if(this._serverRetryMs!==void 0)return this._serverRetryMs;const n=this._reconnectionOptions.initialReconnectionDelay,r=this._reconnectionOptions.reconnectionDelayGrowFactor,o=this._reconnectionOptions.maxReconnectionDelay;return Math.min(n*Math.pow(r,t),o)}_scheduleReconnection(t,n=0){var s;const r=this._reconnectionOptions.maxRetries;if(n>=r){(s=this.onerror)==null||s.call(this,new Error(`Maximum reconnection attempts (${r}) exceeded.`));return}const o=this._getNextReconnectionDelay(n);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(t).catch(i=>{var a;(a=this.onerror)==null||a.call(this,new Error(`Failed to reconnect SSE stream: ${i instanceof Error?i.message:String(i)}`)),this._scheduleReconnection(t,n+1)})},o)}_handleSseStream(t,n,r){if(!t)return;const{onresumptiontoken:o,replayMessageId:s}=n;let i,a=!1,l=!1;(async()=>{var d,f,p,h;try{const y=t.pipeThrough(new TextDecoderStream).pipeThrough(new sG({onRetry:g=>{this._serverRetryMs=g}})).getReader();for(;;){const{value:g,done:v}=await y.read();if(v)break;if(g.id&&(i=g.id,a=!0,o==null||o(g.id)),!!g.data&&(!g.event||g.event==="message"))try{const b=qd.parse(JSON.parse(g.data));Kl(b)&&(l=!0,s!==void 0&&(b.id=s)),(d=this.onmessage)==null||d.call(this,b)}catch(b){(f=this.onerror)==null||f.call(this,b)}}(r||a)&&!l&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:i,onresumptiontoken:o,replayMessageId:s},0)}catch(y){if((p=this.onerror)==null||p.call(this,new Error(`SSE stream disconnected: ${y}`)),(r||a)&&!l&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:i,onresumptiontoken:o,replayMessageId:s},0)}catch(g){(h=this.onerror)==null||h.call(this,new Error(`Failed to reconnect: ${g instanceof Error?g.message:String(g)}`))}}})()}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(t){if(!this._authProvider)throw new Wn("No auth provider");if(await $r(this._authProvider,{serverUrl:this._url,authorizationCode:t,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Wn("Failed to authorize")}async close(){var t,n;this._reconnectionTimeout&&(clearTimeout(this._reconnectionTimeout),this._reconnectionTimeout=void 0),(t=this._abortController)==null||t.abort(),(n=this.onclose)==null||n.call(this)}async send(t,n){var r,o,s,i,a,l;try{const{resumptionToken:u,onresumptiontoken:d}=n||{};if(u){this._startOrAuthSse({resumptionToken:u,replayMessageId:xy(t)?t.id:void 0}).catch(v=>{var b;return(b=this.onerror)==null?void 0:b.call(this,v)});return}const f=await this._commonHeaders();f.set("content-type","application/json"),f.set("accept","application/json, text/event-stream");const p={...this._requestInit,method:"POST",headers:f,body:JSON.stringify(t),signal:(r=this._abortController)==null?void 0:r.signal},h=await(this._fetch??fetch)(this._url,p),y=h.headers.get("mcp-session-id");if(y&&(this._sessionId=y),!h.ok){const v=await h.text().catch(()=>null);if(h.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Zi(401,"Server returned 401 after successful authentication");const{resourceMetadataUrl:b,scope:k}=th(h);if(this._resourceMetadataUrl=b,this._scope=k,await $r(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!=="AUTHORIZED")throw new Wn;return this._hasCompletedAuthFlow=!0,this.send(t)}if(h.status===403&&this._authProvider){const{resourceMetadataUrl:b,scope:k,error:S}=th(h);if(S==="insufficient_scope"){const E=h.headers.get("WWW-Authenticate");if(this._lastUpscopingHeader===E)throw new Zi(403,"Server returned 403 after trying upscoping");if(k&&(this._scope=k),b&&(this._resourceMetadataUrl=b),this._lastUpscopingHeader=E??void 0,await $r(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!=="AUTHORIZED")throw new Wn;return this.send(t)}}throw new Zi(h.status,`Error POSTing to endpoint: ${v}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,h.status===202){await((o=h.body)==null?void 0:o.cancel()),oZ(t)&&this._startOrAuthSse({resumptionToken:void 0}).catch(v=>{var b;return(b=this.onerror)==null?void 0:b.call(this,v)});return}const x=(Array.isArray(t)?t:[t]).filter(v=>"method"in v&&"id"in v&&v.id!==void 0).length>0,g=h.headers.get("content-type");if(x)if(g!=null&&g.includes("text/event-stream"))this._handleSseStream(h.body,{onresumptiontoken:d},!1);else if(g!=null&&g.includes("application/json")){const v=await h.json(),b=Array.isArray(v)?v.map(k=>qd.parse(k)):[qd.parse(v)];for(const k of b)(s=this.onmessage)==null||s.call(this,k)}else throw await((i=h.body)==null?void 0:i.cancel()),new Zi(-1,`Unexpected content type: ${g}`);else await((a=h.body)==null?void 0:a.cancel())}catch(u){throw(l=this.onerror)==null||l.call(this,u),u}}get sessionId(){return this._sessionId}async terminateSession(){var t,n,r;if(this._sessionId)try{const o=await this._commonHeaders(),s={...this._requestInit,method:"DELETE",headers:o,signal:(t=this._abortController)==null?void 0:t.signal},i=await(this._fetch??fetch)(this._url,s);if(await((n=i.body)==null?void 0:n.cancel()),!i.ok&&i.status!==405)throw new Zi(i.status,`Failed to terminate session: ${i.statusText}`);this._sessionId=void 0}catch(o){throw(r=this.onerror)==null||r.call(this,o),o}}setProtocolVersion(t){this._protocolVersion=t}get protocolVersion(){return this._protocolVersion}async resumeStream(t,n){await this._startOrAuthSse({resumptionToken:t,onresumptiontoken:n==null?void 0:n.onresumptiontoken})}}function np(e){return!!e._zod}function ts(e,t){return np(e)?E2(e,t):e.safeParse(t)}function j$(e){var n,r;if(!e)return;let t;if(np(e)?t=(r=(n=e._zod)==null?void 0:n.def)==null?void 0:r.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function lG(e){var o;if(np(e)){const i=(o=e._zod)==null?void 0:o.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}const n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}const r=e.value;if(r!==void 0)return r}function Hs(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function r_(e){const t=j$(e),n=t==null?void 0:t.method;if(!n)throw new Error("Schema is missing a method literal");const r=lG(n);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function o_(e,t){const n=ts(e,t);if(!n.success)throw n.error;return n.data}const cG=6e4;class uG{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(sx,n=>{this._oncancel(n)}),this.setNotificationHandler(ax,n=>{this._onprogress(n)}),this.setRequestHandler(ix,n=>({})),this._taskStore=t==null?void 0:t.taskStore,this._taskMessageQueue=t==null?void 0:t.taskMessageQueue,this._taskStore&&(this.setRequestHandler(lx,async(n,r)=>{const o=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!o)throw new je(Ie.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(ux,async(n,r)=>{const o=async()=>{var a;const s=n.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(s,r.sessionId);){if(l.type==="response"||l.type==="error"){const u=l.message,d=u.id,f=this._requestResolvers.get(d);if(f)if(this._requestResolvers.delete(d),l.type==="response")f(u);else{const p=u,h=new je(p.error.code,p.error.message,p.error.data);f(h)}else{const p=l.type==="response"?"Response":"Error";this._onerror(new Error(`${p} handler missing for request ${d}`))}continue}await((a=this._transport)==null?void 0:a.send(l.message,{relatedRequestId:r.requestId}))}}const i=await this._taskStore.getTask(s,r.sessionId);if(!i)throw new je(Ie.InvalidParams,`Task not found: ${s}`);if(!Hs(i.status))return await this._waitForTaskUpdate(s,r.signal),await o();if(Hs(i.status)){const l=await this._taskStore.getTaskResult(s,r.sessionId);return this._clearTaskQueue(s),{...l,_meta:{...l._meta,[Ys]:{taskId:s}}}}return await o()};return await o()}),this.setRequestHandler(dx,async(n,r)=>{var o;try{const{tasks:s,nextCursor:i}=await this._taskStore.listTasks((o=n.params)==null?void 0:o.cursor,r.sessionId);return{tasks:s,nextCursor:i,_meta:{}}}catch(s){throw new je(Ie.InvalidParams,`Failed to list tasks: ${s instanceof Error?s.message:String(s)}`)}}),this.setRequestHandler(hx,async(n,r)=>{try{const o=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!o)throw new je(Ie.InvalidParams,`Task not found: ${n.params.taskId}`);if(Hs(o.status))throw new je(Ie.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(n.params.taskId);const s=await this._taskStore.getTask(n.params.taskId,r.sessionId);if(!s)throw new je(Ie.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof je?o:new je(Ie.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;const n=this._requestHandlerAbortControllers.get(t.params.requestId);n==null||n.abort(t.params.reason)}_setupTimeout(t,n,r,o,s=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(o,n),startTime:Date.now(),timeout:n,maxTotalTimeout:r,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(t){const n=this._timeoutInfo.get(t);if(!n)return!1;const r=Date.now()-n.startTime;if(n.maxTotalTimeout&&r>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),je.fromError(Ie.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:r});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){const n=this._timeoutInfo.get(t);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(t))}async connect(t){var s,i,a;if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;const n=(s=this.transport)==null?void 0:s.onclose;this._transport.onclose=()=>{n==null||n(),this._onclose()};const r=(i=this.transport)==null?void 0:i.onerror;this._transport.onerror=l=>{r==null||r(l),this._onerror(l)};const o=(a=this._transport)==null?void 0:a.onmessage;this._transport.onmessage=(l,u)=>{o==null||o(l,u),Kl(l)||K7(l)?this._onresponse(l):xy(l)?this._onrequest(l,u):W7(l)?this._onnotification(l):this._onerror(new Error(`Unknown message type: ${JSON.stringify(l)}`))},await this._transport.start()}_onclose(){var r;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(const o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();const n=je.fromError(Ie.ConnectionClosed,"Connection closed");this._transport=void 0,(r=this.onclose)==null||r.call(this);for(const o of t.values())o(n)}_onerror(t){var n;(n=this.onerror)==null||n.call(this,t)}_onnotification(t){const n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(t,n){var d,f,p,h;const r=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,o=this._transport,s=(p=(f=(d=t.params)==null?void 0:d._meta)==null?void 0:f[Ys])==null?void 0:p.taskId;if(r===void 0){const y={jsonrpc:"2.0",id:t.id,error:{code:Ie.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:y,timestamp:Date.now()},o==null?void 0:o.sessionId).catch(m=>this._onerror(new Error(`Failed to enqueue error response: ${m}`))):o==null||o.send(y).catch(m=>this._onerror(new Error(`Failed to send an error response: ${m}`)));return}const i=new AbortController;this._requestHandlerAbortControllers.set(t.id,i);const a=B7(t.params)?t.params.task:void 0,l=this._taskStore?this.requestTaskStore(t,o==null?void 0:o.sessionId):void 0,u={signal:i.signal,sessionId:o==null?void 0:o.sessionId,_meta:(h=t.params)==null?void 0:h._meta,sendNotification:async y=>{if(i.signal.aborted)return;const m={relatedRequestId:t.id};s&&(m.relatedTask={taskId:s}),await this.notification(y,m)},sendRequest:async(y,m,x)=>{var b;if(i.signal.aborted)throw new je(Ie.ConnectionClosed,"Request was cancelled");const g={...x,relatedRequestId:t.id};s&&!g.relatedTask&&(g.relatedTask={taskId:s});const v=((b=g.relatedTask)==null?void 0:b.taskId)??s;return v&&l&&await l.updateTaskStatus(v,"input_required"),await this.request(y,m,g)},authInfo:n==null?void 0:n.authInfo,requestId:t.id,requestInfo:n==null?void 0:n.requestInfo,taskId:s,taskStore:l,taskRequestedTtl:a==null?void 0:a.ttl,closeSSEStream:n==null?void 0:n.closeSSEStream,closeStandaloneSSEStream:n==null?void 0:n.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>r(t,u)).then(async y=>{if(i.signal.aborted)return;const m={result:y,jsonrpc:"2.0",id:t.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:m,timestamp:Date.now()},o==null?void 0:o.sessionId):await(o==null?void 0:o.send(m))},async y=>{if(i.signal.aborted)return;const m={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(y.code)?y.code:Ie.InternalError,message:y.message??"Internal error",...y.data!==void 0&&{data:y.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:m,timestamp:Date.now()},o==null?void 0:o.sessionId):await(o==null?void 0:o.send(m))}).catch(y=>this._onerror(new Error(`Failed to send response: ${y}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===i&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:n,...r}=t.params,o=Number(n),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const i=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(l){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(l);return}s(r)}_onresponse(t){const n=Number(t.id),r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),Kl(t))r(t);else{const i=new je(t.error.code,t.error.message,t.error.data);r(i)}return}const o=this._responseHandlers.get(n);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let s=!1;if(Kl(t)&&t.result&&typeof t.result=="object"){const i=t.result;if(i.task&&typeof i.task=="object"){const a=i.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,n))}}if(s||this._progressHandlers.delete(n),Kl(t))o(t);else{const i=je.fromError(t.error.code,t.error.message,t.error.data);o(i)}}get transport(){return this._transport}async close(){var t;await((t=this._transport)==null?void 0:t.close())}async*requestStream(t,n,r){var i,a;const{task:o}=r??{};if(!o){try{yield{type:"result",result:await this.request(t,n,r)}}catch(l){yield{type:"error",error:l instanceof je?l:new je(Ie.InternalError,String(l))}}return}let s;try{const l=await this.request(t,Bc,r);if(l.task)s=l.task.taskId,yield{type:"taskCreated",task:l.task};else throw new je(Ie.InternalError,"Task creation did not return a task");for(;;){const u=await this.getTask({taskId:s},r);if(yield{type:"taskStatus",task:u},Hs(u.status)){u.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},n,r)}:u.status==="failed"?yield{type:"error",error:new je(Ie.InternalError,`Task ${s} failed`)}:u.status==="cancelled"&&(yield{type:"error",error:new je(Ie.InternalError,`Task ${s} was cancelled`)});return}if(u.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},n,r)};return}const d=u.pollInterval??((i=this._options)==null?void 0:i.defaultTaskPollInterval)??1e3;await new Promise(f=>setTimeout(f,d)),(a=r==null?void 0:r.signal)==null||a.throwIfAborted()}}catch(l){yield{type:"error",error:l instanceof je?l:new je(Ie.InternalError,String(l))}}}request(t,n,r){const{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:l}=r??{};return new Promise((u,d)=>{var v,b,k,S,E;const f=P=>{d(P)};if(!this._transport){f(new Error("Not connected"));return}if(((v=this._options)==null?void 0:v.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(P){f(P);return}(b=r==null?void 0:r.signal)==null||b.throwIfAborted();const p=this._requestMessageId++,h={...t,jsonrpc:"2.0",id:p};r!=null&&r.onprogress&&(this._progressHandlers.set(p,r.onprogress),h.params={...t.params,_meta:{...((k=t.params)==null?void 0:k._meta)||{},progressToken:p}}),a&&(h.params={...h.params,task:a}),l&&(h.params={...h.params,_meta:{...((S=h.params)==null?void 0:S._meta)||{},[Ys]:l}});const y=P=>{var R;this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),(R=this._transport)==null||R.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(P)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch($=>this._onerror(new Error(`Failed to send cancellation: ${$}`)));const O=P instanceof je?P:new je(Ie.RequestTimeout,String(P));d(O)};this._responseHandlers.set(p,P=>{var O;if(!((O=r==null?void 0:r.signal)!=null&&O.aborted)){if(P instanceof Error)return d(P);try{const R=ts(n,P.result);R.success?u(R.data):d(R.error)}catch(R){d(R)}}}),(E=r==null?void 0:r.signal)==null||E.addEventListener("abort",()=>{var P;y((P=r==null?void 0:r.signal)==null?void 0:P.reason)});const m=(r==null?void 0:r.timeout)??cG,x=()=>y(je.fromError(Ie.RequestTimeout,"Request timed out",{timeout:m}));this._setupTimeout(p,m,r==null?void 0:r.maxTotalTimeout,x,(r==null?void 0:r.resetTimeoutOnProgress)??!1);const g=l==null?void 0:l.taskId;if(g){const P=O=>{const R=this._responseHandlers.get(p);R?R(O):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,P),this._enqueueTaskMessage(g,{type:"request",message:h,timestamp:Date.now()}).catch(O=>{this._cleanupTimeout(p),d(O)})}else this._transport.send(h,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(P=>{this._cleanupTimeout(p),d(P)})})}async getTask(t,n){return this.request({method:"tasks/get",params:t},cx,n)}async getTaskResult(t,n,r){return this.request({method:"tasks/result",params:t},n,r)}async listTasks(t,n){return this.request({method:"tasks/list",params:t},fx,n)}async cancelTask(t,n){return this.request({method:"tasks/cancel",params:t},uZ,n)}async notification(t,n){var a,l,u,d;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const r=(a=n==null?void 0:n.relatedTask)==null?void 0:a.taskId;if(r){const f={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...((l=t.params)==null?void 0:l._meta)||{},[Ys]:n.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:f,timestamp:Date.now()});return}if((((u=this._options)==null?void 0:u.debouncedNotificationMethods)??[]).includes(t.method)&&!t.params&&!(n!=null&&n.relatedRequestId)&&!(n!=null&&n.relatedTask)){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{var p,h;if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let f={...t,jsonrpc:"2.0"};n!=null&&n.relatedTask&&(f={...f,params:{...f.params,_meta:{...((p=f.params)==null?void 0:p._meta)||{},[Ys]:n.relatedTask}}}),(h=this._transport)==null||h.send(f,n).catch(y=>this._onerror(y))});return}let i={...t,jsonrpc:"2.0"};n!=null&&n.relatedTask&&(i={...i,params:{...i.params,_meta:{...((d=i.params)==null?void 0:d._meta)||{},[Ys]:n.relatedTask}}}),await this._transport.send(i,n)}setRequestHandler(t,n){const r=r_(t);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(o,s)=>{const i=o_(t,o);return Promise.resolve(n(i,s))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,n){const r=r_(t);this._notificationHandlers.set(r,o=>{const s=o_(t,o);return Promise.resolve(n(s))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,n,r){var s;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const o=(s=this._options)==null?void 0:s.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,n,r,o)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(t,n);for(const o of r)if(o.type==="request"&&xy(o.message)){const s=o.message.id,i=this._requestResolvers.get(s);i?(i(new je(Ie.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,n){var o,s;let r=((o=this._options)==null?void 0:o.defaultTaskPollInterval)??1e3;try{const i=await((s=this._taskStore)==null?void 0:s.getTask(t));i!=null&&i.pollInterval&&(r=i.pollInterval)}catch{}return new Promise((i,a)=>{if(n.aborted){a(new je(Ie.InvalidRequest,"Request cancelled"));return}const l=setTimeout(i,r);n.addEventListener("abort",()=>{clearTimeout(l),a(new je(Ie.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,n){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async o=>{if(!t)throw new Error("No request provided");return await r.createTask(o,t.id,{method:t.method,params:t.params},n)},getTask:async o=>{const s=await r.getTask(o,n);if(!s)throw new je(Ie.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(o,s,i)=>{await r.storeTaskResult(o,s,i,n);const a=await r.getTask(o,n);if(a){const l=Bf.parse({method:"notifications/tasks/status",params:a});await this.notification(l),Hs(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>r.getTaskResult(o,n),updateTaskStatus:async(o,s,i)=>{const a=await r.getTask(o,n);if(!a)throw new je(Ie.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(Hs(a.status))throw new je(Ie.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(o,s,i,n);const l=await r.getTask(o,n);if(l){const u=Bf.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Hs(l.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>r.listTasks(o,n)}}}function s_(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function dG(e,t){const n={...e};for(const r in t){const o=r,s=t[o];if(s===void 0)continue;const i=n[o];s_(i)&&s_(s)?n[o]={...i,...s}:n[o]=s}return n}var Fy={exports:{}},P$={},fo={},Bs={},_u={},Le={},Wc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(v){if(super(),!e.IDENTIFIER.test(v))throw new Error("CodeGen: name must be a valid identifier");this.str=v}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(v){super(),this._items=typeof v=="string"?[v]:v}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const v=this._items[0];return v===""||v==='""'}get str(){var v;return(v=this._str)!==null&&v!==void 0?v:this._str=this._items.reduce((b,k)=>`${b}${k}`,"")}get names(){var v;return(v=this._names)!==null&&v!==void 0?v:this._names=this._items.reduce((b,k)=>(k instanceof n&&(b[k.str]=(b[k.str]||0)+1),b),{})}}e._Code=r,e.nil=new r("");function o(g,...v){const b=[g[0]];let k=0;for(;k<v.length;)a(b,v[k]),b.push(g[++k]);return new r(b)}e._=o;const s=new r("+");function i(g,...v){const b=[h(g[0])];let k=0;for(;k<v.length;)b.push(s),a(b,v[k]),b.push(s,h(g[++k]));return l(b),new r(b)}e.str=i;function a(g,v){v instanceof r?g.push(...v._items):v instanceof n?g.push(v):g.push(f(v))}e.addCodeArg=a;function l(g){let v=1;for(;v<g.length-1;){if(g[v]===s){const b=u(g[v-1],g[v+1]);if(b!==void 0){g.splice(v-1,3,b);continue}g[v++]="+"}v++}}function u(g,v){if(v==='""')return g;if(g==='""')return v;if(typeof g=="string")return v instanceof n||g[g.length-1]!=='"'?void 0:typeof v!="string"?`${g.slice(0,-1)}${v}"`:v[0]==='"'?g.slice(0,-1)+v.slice(1):void 0;if(typeof v=="string"&&v[0]==='"'&&!(g instanceof n))return`"${g}${v.slice(1)}`}function d(g,v){return v.emptyStr()?g:g.emptyStr()?v:i`${g}${v}`}e.strConcat=d;function f(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:h(Array.isArray(g)?g.join(","):g)}function p(g){return new r(h(g))}e.stringify=p;function h(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function y(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new r(`.${g}`):o`[${g}]`}e.getProperty=y;function m(g){if(typeof g=="string"&&e.IDENTIFIER.test(g))return new r(`${g}`);throw new Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}e.getEsmExportName=m;function x(g){return new r(g.toString())}e.regexpCode=x})(Wc);var Uy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Wc;class n extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var r;(function(l){l[l.Started=0]="Started",l[l.Completed=1]="Completed"})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:u,parent:d}={}){this._names={},this._prefixes=u,this._parent=d}toName(u){return u instanceof t.Name?u:this.name(u)}name(u){return new t.Name(this._newName(u))}_newName(u){const d=this._names[u]||this._nameGroup(u);return`${u}${d.index++}`}_nameGroup(u){var d,f;if(!((f=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||f===void 0)&&f.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}e.Scope=o;class s extends t.Name{constructor(u,d){super(d),this.prefix=u}setValue(u,{property:d,itemIndex:f}){this.value=u,this.scopePath=(0,t._)`.${new t.Name(d)}[${f}]`}}e.ValueScopeName=s;const i=(0,t._)`\n`;class a extends o{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?i:t.nil}}get(){return this._scope}name(u){return new s(u,this._newName(u))}value(u,d){var f;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const p=this.toName(u),{prefix:h}=p,y=(f=d.key)!==null&&f!==void 0?f:d.ref;let m=this._values[h];if(m){const v=m.get(y);if(v)return v}else m=this._values[h]=new Map;m.set(y,p);const x=this._scope[h]||(this._scope[h]=[]),g=x.length;return x[g]=d.ref,p.setValue(d,{property:h,itemIndex:g}),p}getValue(u,d){const f=this._values[u];if(f)return f.get(d)}scopeRefs(u,d=this._values){return this._reduceValues(d,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,t._)`${u}${f.scopePath}`})}scopeCode(u=this._values,d,f){return this._reduceValues(u,p=>{if(p.value===void 0)throw new Error(`CodeGen: name "${p}" has no value`);return p.value.code},d,f)}_reduceValues(u,d,f={},p){let h=t.nil;for(const y in u){const m=u[y];if(!m)continue;const x=f[y]=f[y]||new Map;m.forEach(g=>{if(x.has(g))return;x.set(g,r.Started);let v=d(g);if(v){const b=this.opts.es5?e.varKinds.var:e.varKinds.const;h=(0,t._)`${h}${b} ${g} = ${v};${this.opts._n}`}else if(v=p==null?void 0:p(g))h=(0,t._)`${h}${v}${this.opts._n}`;else throw new n(g);x.set(g,r.Completed)})}return h}}e.ValueScope=a})(Uy);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Wc,n=Uy;var r=Wc;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var o=Uy;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return o.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return o.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return o.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return o.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(C,A){return this}}class i extends s{constructor(C,A,F){super(),this.varKind=C,this.name=A,this.rhs=F}render({es5:C,_n:A}){const F=C?n.varKinds.var:this.varKind,Z=this.rhs===void 0?"":` = ${this.rhs}`;return`${F} ${this.name}${Z};`+A}optimizeNames(C,A){if(C[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,C,A)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends s{constructor(C,A,F){super(),this.lhs=C,this.rhs=A,this.sideEffects=F}render({_n:C}){return`${this.lhs} = ${this.rhs};`+C}optimizeNames(C,A){if(!(this.lhs instanceof t.Name&&!C[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,C,A),this}get names(){const C=this.lhs instanceof t.Name?{}:{...this.lhs.names};return D(C,this.rhs)}}class l extends a{constructor(C,A,F,Z){super(C,F,Z),this.op=A}render({_n:C}){return`${this.lhs} ${this.op}= ${this.rhs};`+C}}class u extends s{constructor(C){super(),this.label=C,this.names={}}render({_n:C}){return`${this.label}:`+C}}class d extends s{constructor(C){super(),this.label=C,this.names={}}render({_n:C}){return`break${this.label?` ${this.label}`:""};`+C}}class f extends s{constructor(C){super(),this.error=C}render({_n:C}){return`throw ${this.error};`+C}get names(){return this.error.names}}class p extends s{constructor(C){super(),this.code=C}render({_n:C}){return`${this.code};`+C}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(C,A){return this.code=L(this.code,C,A),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends s{constructor(C=[]){super(),this.nodes=C}render(C){return this.nodes.reduce((A,F)=>A+F.render(C),"")}optimizeNodes(){const{nodes:C}=this;let A=C.length;for(;A--;){const F=C[A].optimizeNodes();Array.isArray(F)?C.splice(A,1,...F):F?C[A]=F:C.splice(A,1)}return C.length>0?this:void 0}optimizeNames(C,A){const{nodes:F}=this;let Z=F.length;for(;Z--;){const Y=F[Z];Y.optimizeNames(C,A)||(T(C,Y.names),F.splice(Z,1))}return F.length>0?this:void 0}get names(){return this.nodes.reduce((C,A)=>I(C,A.names),{})}}class y extends h{render(C){return"{"+C._n+super.render(C)+"}"+C._n}}class m extends h{}class x extends y{}x.kind="else";class g extends y{constructor(C,A){super(A),this.condition=C}render(C){let A=`if(${this.condition})`+super.render(C);return this.else&&(A+="else "+this.else.render(C)),A}optimizeNodes(){super.optimizeNodes();const C=this.condition;if(C===!0)return this.nodes;let A=this.else;if(A){const F=A.optimizeNodes();A=this.else=Array.isArray(F)?new x(F):F}if(A)return C===!1?A instanceof g?A:A.nodes:this.nodes.length?this:new g(Q(C),A instanceof g?[A]:A.nodes);if(!(C===!1||!this.nodes.length))return this}optimizeNames(C,A){var F;if(this.else=(F=this.else)===null||F===void 0?void 0:F.optimizeNames(C,A),!!(super.optimizeNames(C,A)||this.else))return this.condition=L(this.condition,C,A),this}get names(){const C=super.names;return D(C,this.condition),this.else&&I(C,this.else.names),C}}g.kind="if";class v extends y{}v.kind="for";class b extends v{constructor(C){super(),this.iteration=C}render(C){return`for(${this.iteration})`+super.render(C)}optimizeNames(C,A){if(super.optimizeNames(C,A))return this.iteration=L(this.iteration,C,A),this}get names(){return I(super.names,this.iteration.names)}}class k extends v{constructor(C,A,F,Z){super(),this.varKind=C,this.name=A,this.from=F,this.to=Z}render(C){const A=C.es5?n.varKinds.var:this.varKind,{name:F,from:Z,to:Y}=this;return`for(${A} ${F}=${Z}; ${F}<${Y}; ${F}++)`+super.render(C)}get names(){const C=D(super.names,this.from);return D(C,this.to)}}class S extends v{constructor(C,A,F,Z){super(),this.loop=C,this.varKind=A,this.name=F,this.iterable=Z}render(C){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(C)}optimizeNames(C,A){if(super.optimizeNames(C,A))return this.iterable=L(this.iterable,C,A),this}get names(){return I(super.names,this.iterable.names)}}class E extends y{constructor(C,A,F){super(),this.name=C,this.args=A,this.async=F}render(C){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(C)}}E.kind="func";class P extends h{render(C){return"return "+super.render(C)}}P.kind="return";class O extends y{render(C){let A="try"+super.render(C);return this.catch&&(A+=this.catch.render(C)),this.finally&&(A+=this.finally.render(C)),A}optimizeNodes(){var C,A;return super.optimizeNodes(),(C=this.catch)===null||C===void 0||C.optimizeNodes(),(A=this.finally)===null||A===void 0||A.optimizeNodes(),this}optimizeNames(C,A){var F,Z;return super.optimizeNames(C,A),(F=this.catch)===null||F===void 0||F.optimizeNames(C,A),(Z=this.finally)===null||Z===void 0||Z.optimizeNames(C,A),this}get names(){const C=super.names;return this.catch&&I(C,this.catch.names),this.finally&&I(C,this.finally.names),C}}class R extends y{constructor(C){super(),this.error=C}render(C){return`catch(${this.error})`+super.render(C)}}R.kind="catch";class $ extends y{render(C){return"finally"+super.render(C)}}$.kind="finally";class j{constructor(C,A={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...A,_n:A.lines?`
469
- `:""},this._extScope=C,this._scope=new n.Scope({parent:C}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(C){return this._scope.name(C)}scopeName(C){return this._extScope.name(C)}scopeValue(C,A){const F=this._extScope.value(C,A);return(this._values[F.prefix]||(this._values[F.prefix]=new Set)).add(F),F}getScopeValue(C,A){return this._extScope.getValue(C,A)}scopeRefs(C){return this._extScope.scopeRefs(C,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(C,A,F,Z){const Y=this._scope.toName(A);return F!==void 0&&Z&&(this._constants[Y.str]=F),this._leafNode(new i(C,Y,F)),Y}const(C,A,F){return this._def(n.varKinds.const,C,A,F)}let(C,A,F){return this._def(n.varKinds.let,C,A,F)}var(C,A,F){return this._def(n.varKinds.var,C,A,F)}assign(C,A,F){return this._leafNode(new a(C,A,F))}add(C,A){return this._leafNode(new l(C,e.operators.ADD,A))}code(C){return typeof C=="function"?C():C!==t.nil&&this._leafNode(new p(C)),this}object(...C){const A=["{"];for(const[F,Z]of C)A.length>1&&A.push(","),A.push(F),(F!==Z||this.opts.es5)&&(A.push(":"),(0,t.addCodeArg)(A,Z));return A.push("}"),new t._Code(A)}if(C,A,F){if(this._blockNode(new g(C)),A&&F)this.code(A).else().code(F).endIf();else if(A)this.code(A).endIf();else if(F)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(C){return this._elseNode(new g(C))}else(){return this._elseNode(new x)}endIf(){return this._endBlockNode(g,x)}_for(C,A){return this._blockNode(C),A&&this.code(A).endFor(),this}for(C,A){return this._for(new b(C),A)}forRange(C,A,F,Z,Y=this.opts.es5?n.varKinds.var:n.varKinds.let){const ae=this._scope.toName(C);return this._for(new k(Y,ae,A,F),()=>Z(ae))}forOf(C,A,F,Z=n.varKinds.const){const Y=this._scope.toName(C);if(this.opts.es5){const ae=A instanceof t.Name?A:this.var("_arr",A);return this.forRange("_i",0,(0,t._)`${ae}.length`,de=>{this.var(Y,(0,t._)`${ae}[${de}]`),F(Y)})}return this._for(new S("of",Z,Y,A),()=>F(Y))}forIn(C,A,F,Z=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(C,(0,t._)`Object.keys(${A})`,F);const Y=this._scope.toName(C);return this._for(new S("in",Z,Y,A),()=>F(Y))}endFor(){return this._endBlockNode(v)}label(C){return this._leafNode(new u(C))}break(C){return this._leafNode(new d(C))}return(C){const A=new P;if(this._blockNode(A),this.code(C),A.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(C,A,F){if(!A&&!F)throw new Error('CodeGen: "try" without "catch" and "finally"');const Z=new O;if(this._blockNode(Z),this.code(C),A){const Y=this.name("e");this._currNode=Z.catch=new R(Y),A(Y)}return F&&(this._currNode=Z.finally=new $,this.code(F)),this._endBlockNode(R,$)}throw(C){return this._leafNode(new f(C))}block(C,A){return this._blockStarts.push(this._nodes.length),C&&this.code(C).endBlock(A),this}endBlock(C){const A=this._blockStarts.pop();if(A===void 0)throw new Error("CodeGen: not in self-balancing block");const F=this._nodes.length-A;if(F<0||C!==void 0&&F!==C)throw new Error(`CodeGen: wrong number of nodes: ${F} vs ${C} expected`);return this._nodes.length=A,this}func(C,A=t.nil,F,Z){return this._blockNode(new E(C,A,F)),Z&&this.code(Z).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(C=1){for(;C-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(C){return this._currNode.nodes.push(C),this}_blockNode(C){this._currNode.nodes.push(C),this._nodes.push(C)}_endBlockNode(C,A){const F=this._currNode;if(F instanceof C||A&&F instanceof A)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${A?`${C.kind}/${A.kind}`:C.kind}"`)}_elseNode(C){const A=this._currNode;if(!(A instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=A.else=C,this}get _root(){return this._nodes[0]}get _currNode(){const C=this._nodes;return C[C.length-1]}set _currNode(C){const A=this._nodes;A[A.length-1]=C}}e.CodeGen=j;function I(_,C){for(const A in C)_[A]=(_[A]||0)+(C[A]||0);return _}function D(_,C){return C instanceof t._CodeOrName?I(_,C.names):_}function L(_,C,A){if(_ instanceof t.Name)return F(_);if(!Z(_))return _;return new t._Code(_._items.reduce((Y,ae)=>(ae instanceof t.Name&&(ae=F(ae)),ae instanceof t._Code?Y.push(...ae._items):Y.push(ae),Y),[]));function F(Y){const ae=A[Y.str];return ae===void 0||C[Y.str]!==1?Y:(delete C[Y.str],ae)}function Z(Y){return Y instanceof t._Code&&Y._items.some(ae=>ae instanceof t.Name&&C[ae.str]===1&&A[ae.str]!==void 0)}}function T(_,C){for(const A in C)_[A]=(_[A]||0)-(C[A]||0)}function Q(_){return typeof _=="boolean"||typeof _=="number"||_===null?!_:(0,t._)`!${W(_)}`}e.not=Q;const X=z(e.operators.AND);function M(..._){return _.reduce(X)}e.and=M;const K=z(e.operators.OR);function N(..._){return _.reduce(K)}e.or=N;function z(_){return(C,A)=>C===t.nil?A:A===t.nil?C:(0,t._)`${W(C)} ${_} ${W(A)}`}function W(_){return _ instanceof t.Name?_:(0,t._)`(${_})`}})(Le);var ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.checkStrictMode=ge.getErrorPath=ge.Type=ge.useFunc=ge.setEvaluated=ge.evaluatedPropsToName=ge.mergeEvaluated=ge.eachItem=ge.unescapeJsonPointer=ge.escapeJsonPointer=ge.escapeFragment=ge.unescapeFragment=ge.schemaRefOrVal=ge.schemaHasRulesButRef=ge.schemaHasRules=ge.checkUnknownRules=ge.alwaysValidSchema=ge.toHash=void 0;const tt=Le,fG=Wc;function hG(e){const t={};for(const n of e)t[n]=!0;return t}ge.toHash=hG;function pG(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(T$(e,t),!$$(t,e.self.RULES.all))}ge.alwaysValidSchema=pG;function T$(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema||typeof t=="boolean")return;const o=r.RULES.keywords;for(const s in t)o[s]||A$(e,`unknown keyword: "${s}"`)}ge.checkUnknownRules=T$;function $$(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(t[n])return!0;return!1}ge.schemaHasRules=$$;function mG(e,t){if(typeof e=="boolean")return!e;for(const n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}ge.schemaHasRulesButRef=mG;function gG({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,tt._)`${n}`}return(0,tt._)`${e}${t}${(0,tt.getProperty)(r)}`}ge.schemaRefOrVal=gG;function yG(e){return R$(decodeURIComponent(e))}ge.unescapeFragment=yG;function vG(e){return encodeURIComponent(Ex(e))}ge.escapeFragment=vG;function Ex(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}ge.escapeJsonPointer=Ex;function R$(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}ge.unescapeJsonPointer=R$;function xG(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}ge.eachItem=xG;function i_({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,s,i,a)=>{const l=i===void 0?s:i instanceof tt.Name?(s instanceof tt.Name?e(o,s,i):t(o,s,i),i):s instanceof tt.Name?(t(o,i,s),s):n(s,i);return a===tt.Name&&!(l instanceof tt.Name)?r(o,l):l}}ge.mergeEvaluated={props:i_({mergeNames:(e,t,n)=>e.if((0,tt._)`${n} !== true && ${t} !== undefined`,()=>{e.if((0,tt._)`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,(0,tt._)`${n} || {}`).code((0,tt._)`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if((0,tt._)`${n} !== true`,()=>{t===!0?e.assign(n,!0):(e.assign(n,(0,tt._)`${n} || {}`),Nx(e,n,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:I$}),items:i_({mergeNames:(e,t,n)=>e.if((0,tt._)`${n} !== true && ${t} !== undefined`,()=>e.assign(n,(0,tt._)`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if((0,tt._)`${n} !== true`,()=>e.assign(n,t===!0?!0:(0,tt._)`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function I$(e,t){if(t===!0)return e.var("props",!0);const n=e.var("props",(0,tt._)`{}`);return t!==void 0&&Nx(e,n,t),n}ge.evaluatedPropsToName=I$;function Nx(e,t,n){Object.keys(n).forEach(r=>e.assign((0,tt._)`${t}${(0,tt.getProperty)(r)}`,!0))}ge.setEvaluated=Nx;const a_={};function wG(e,t){return e.scopeValue("func",{ref:t,code:a_[t.code]||(a_[t.code]=new fG._Code(t.code))})}ge.useFunc=wG;var qy;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(qy||(ge.Type=qy={}));function bG(e,t,n){if(e instanceof tt.Name){const r=t===qy.Num;return n?r?(0,tt._)`"[" + ${e} + "]"`:(0,tt._)`"['" + ${e} + "']"`:r?(0,tt._)`"/" + ${e}`:(0,tt._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,tt.getProperty)(e).toString():"/"+Ex(e)}ge.getErrorPath=bG;function A$(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw new Error(t);e.self.logger.warn(t)}}ge.checkStrictMode=A$;var ao={};Object.defineProperty(ao,"__esModule",{value:!0});const dn=Le,kG={data:new dn.Name("data"),valCxt:new dn.Name("valCxt"),instancePath:new dn.Name("instancePath"),parentData:new dn.Name("parentData"),parentDataProperty:new dn.Name("parentDataProperty"),rootData:new dn.Name("rootData"),dynamicAnchors:new dn.Name("dynamicAnchors"),vErrors:new dn.Name("vErrors"),errors:new dn.Name("errors"),this:new dn.Name("this"),self:new dn.Name("self"),scope:new dn.Name("scope"),json:new dn.Name("json"),jsonPos:new dn.Name("jsonPos"),jsonLen:new dn.Name("jsonLen"),jsonPart:new dn.Name("jsonPart")};ao.default=kG;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Le,n=ge,r=ao;e.keywordError={message:({keyword:x})=>(0,t.str)`must pass "${x}" keyword validation`},e.keyword$DataError={message:({keyword:x,schemaType:g})=>g?(0,t.str)`"${x}" keyword must be ${g} ($data)`:(0,t.str)`"${x}" keyword is invalid ($data)`};function o(x,g=e.keywordError,v,b){const{it:k}=x,{gen:S,compositeRule:E,allErrors:P}=k,O=f(x,g,v);b??(E||P)?l(S,O):u(k,(0,t._)`[${O}]`)}e.reportError=o;function s(x,g=e.keywordError,v){const{it:b}=x,{gen:k,compositeRule:S,allErrors:E}=b,P=f(x,g,v);l(k,P),S||E||u(b,r.default.vErrors)}e.reportExtraError=s;function i(x,g){x.assign(r.default.errors,g),x.if((0,t._)`${r.default.vErrors} !== null`,()=>x.if(g,()=>x.assign((0,t._)`${r.default.vErrors}.length`,g),()=>x.assign(r.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:x,keyword:g,schemaValue:v,data:b,errsCount:k,it:S}){if(k===void 0)throw new Error("ajv implementation error");const E=x.name("err");x.forRange("i",k,r.default.errors,P=>{x.const(E,(0,t._)`${r.default.vErrors}[${P}]`),x.if((0,t._)`${E}.instancePath === undefined`,()=>x.assign((0,t._)`${E}.instancePath`,(0,t.strConcat)(r.default.instancePath,S.errorPath))),x.assign((0,t._)`${E}.schemaPath`,(0,t.str)`${S.errSchemaPath}/${g}`),S.opts.verbose&&(x.assign((0,t._)`${E}.schema`,v),x.assign((0,t._)`${E}.data`,b))})}e.extendErrors=a;function l(x,g){const v=x.const("err",g);x.if((0,t._)`${r.default.vErrors} === null`,()=>x.assign(r.default.vErrors,(0,t._)`[${v}]`),(0,t._)`${r.default.vErrors}.push(${v})`),x.code((0,t._)`${r.default.errors}++`)}function u(x,g){const{gen:v,validateName:b,schemaEnv:k}=x;k.$async?v.throw((0,t._)`new ${x.ValidationError}(${g})`):(v.assign((0,t._)`${b}.errors`,g),v.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function f(x,g,v){const{createErrors:b}=x.it;return b===!1?(0,t._)`{}`:p(x,g,v)}function p(x,g,v={}){const{gen:b,it:k}=x,S=[h(k,v),y(x,v)];return m(x,g,S),b.object(...S)}function h({errorPath:x},{instancePath:g}){const v=g?(0,t.str)`${x}${(0,n.getErrorPath)(g,n.Type.Str)}`:x;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,v)]}function y({keyword:x,it:{errSchemaPath:g}},{schemaPath:v,parentSchema:b}){let k=b?g:(0,t.str)`${g}/${x}`;return v&&(k=(0,t.str)`${k}${(0,n.getErrorPath)(v,n.Type.Str)}`),[d.schemaPath,k]}function m(x,{params:g,message:v},b){const{keyword:k,data:S,schemaValue:E,it:P}=x,{opts:O,propertyName:R,topSchemaRef:$,schemaPath:j}=P;b.push([d.keyword,k],[d.params,typeof g=="function"?g(x):g||(0,t._)`{}`]),O.messages&&b.push([d.message,typeof v=="function"?v(x):v]),O.verbose&&b.push([d.schema,E],[d.parentSchema,(0,t._)`${$}${j}`],[r.default.data,S]),R&&b.push([d.propertyName,R])}})(_u);var l_;function _G(){if(l_)return Bs;l_=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.boolOrEmptySchema=Bs.topBoolOrEmptySchema=void 0;const e=_u,t=Le,n=ao,r={message:"boolean schema is false"};function o(a){const{gen:l,schema:u,validateName:d}=a;u===!1?i(a,!1):typeof u=="object"&&u.$async===!0?l.return(n.default.data):(l.assign((0,t._)`${d}.errors`,null),l.return(!0))}Bs.topBoolOrEmptySchema=o;function s(a,l){const{gen:u,schema:d}=a;d===!1?(u.var(l,!1),i(a)):u.var(l,!0)}Bs.boolOrEmptySchema=s;function i(a,l){const{gen:u,data:d}=a,f={gen:u,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(f,r,void 0,l)}return Bs}var Lt={},Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.getRules=Ai.isJSONType=void 0;const SG=["string","number","integer","boolean","null","object","array"],CG=new Set(SG);function EG(e){return typeof e=="string"&&CG.has(e)}Ai.isJSONType=EG;function NG(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Ai.getRules=NG;var ho={},c_;function O$(){if(c_)return ho;c_=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.shouldUseRule=ho.shouldUseGroup=ho.schemaHasRulesForType=void 0;function e({schema:r,self:o},s){const i=o.RULES.types[s];return i&&i!==!0&&t(r,i)}ho.schemaHasRulesForType=e;function t(r,o){return o.rules.some(s=>n(r,s))}ho.shouldUseGroup=t;function n(r,o){var s;return r[o.keyword]!==void 0||((s=o.definition.implements)===null||s===void 0?void 0:s.some(i=>r[i]!==void 0))}return ho.shouldUseRule=n,ho}Object.defineProperty(Lt,"__esModule",{value:!0});Lt.reportTypeError=Lt.checkDataTypes=Lt.checkDataType=Lt.coerceAndCheckDataType=Lt.getJSONTypes=Lt.getSchemaTypes=Lt.DataType=void 0;const jG=Ai,PG=O$(),TG=_u,Me=Le,M$=ge;var Pa;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Pa||(Lt.DataType=Pa={}));function $G(e){const t=D$(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Lt.getSchemaTypes=$G;function D$(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(jG.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Lt.getJSONTypes=D$;function RG(e,t){const{gen:n,data:r,opts:o}=e,s=IG(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&(0,PG.schemaHasRulesForType)(e,t[0]));if(i){const a=jx(t,r,o.strictNumbers,Pa.Wrong);n.if(a,()=>{s.length?AG(e,t,s):Px(e)})}return i}Lt.coerceAndCheckDataType=RG;const L$=new Set(["string","number","integer","boolean","null"]);function IG(e,t){return t?e.filter(n=>L$.has(n)||t==="array"&&n==="array"):[]}function AG(e,t,n){const{gen:r,data:o,opts:s}=e,i=r.let("dataType",(0,Me._)`typeof ${o}`),a=r.let("coerced",(0,Me._)`undefined`);s.coerceTypes==="array"&&r.if((0,Me._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,(0,Me._)`${o}[0]`).assign(i,(0,Me._)`typeof ${o}`).if(jx(t,o,s.strictNumbers),()=>r.assign(a,o))),r.if((0,Me._)`${a} !== undefined`);for(const u of n)(L$.has(u)||u==="array"&&s.coerceTypes==="array")&&l(u);r.else(),Px(e),r.endIf(),r.if((0,Me._)`${a} !== undefined`,()=>{r.assign(o,a),OG(e,a)});function l(u){switch(u){case"string":r.elseIf((0,Me._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,Me._)`"" + ${o}`).elseIf((0,Me._)`${o} === null`).assign(a,(0,Me._)`""`);return;case"number":r.elseIf((0,Me._)`${i} == "boolean" || ${o} === null
470
- || (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,Me._)`+${o}`);return;case"integer":r.elseIf((0,Me._)`${i} === "boolean" || ${o} === null
471
- || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,Me._)`+${o}`);return;case"boolean":r.elseIf((0,Me._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,Me._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":r.elseIf((0,Me._)`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(a,null);return;case"array":r.elseIf((0,Me._)`${i} === "string" || ${i} === "number"
472
- || ${i} === "boolean" || ${o} === null`).assign(a,(0,Me._)`[${o}]`)}}}function OG({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,Me._)`${t} !== undefined`,()=>e.assign((0,Me._)`${t}[${n}]`,r))}function Vy(e,t,n,r=Pa.Correct){const o=r===Pa.Correct?Me.operators.EQ:Me.operators.NEQ;let s;switch(e){case"null":return(0,Me._)`${t} ${o} null`;case"array":s=(0,Me._)`Array.isArray(${t})`;break;case"object":s=(0,Me._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=i((0,Me._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=i();break;default:return(0,Me._)`typeof ${t} ${o} ${e}`}return r===Pa.Correct?s:(0,Me.not)(s);function i(a=Me.nil){return(0,Me.and)((0,Me._)`typeof ${t} == "number"`,a,n?(0,Me._)`isFinite(${t})`:Me.nil)}}Lt.checkDataType=Vy;function jx(e,t,n,r){if(e.length===1)return Vy(e[0],t,n,r);let o;const s=(0,M$.toHash)(e);if(s.array&&s.object){const i=(0,Me._)`typeof ${t} != "object"`;o=s.null?i:(0,Me._)`!${t} || ${i}`,delete s.null,delete s.array,delete s.object}else o=Me.nil;s.number&&delete s.integer;for(const i in s)o=(0,Me.and)(o,Vy(i,t,n,r));return o}Lt.checkDataTypes=jx;const MG={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?(0,Me._)`{type: ${e}}`:(0,Me._)`{type: ${t}}`};function Px(e){const t=DG(e);(0,TG.reportError)(t,MG)}Lt.reportTypeError=Px;function DG(e){const{gen:t,data:n,schema:r}=e,o=(0,M$.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}var Ll={},u_;function LG(){if(u_)return Ll;u_=1,Object.defineProperty(Ll,"__esModule",{value:!0}),Ll.assignDefaults=void 0;const e=Le,t=ge;function n(o,s){const{properties:i,items:a}=o.schema;if(s==="object"&&i)for(const l in i)r(o,l,i[l].default);else s==="array"&&Array.isArray(a)&&a.forEach((l,u)=>r(o,u,l.default))}Ll.assignDefaults=n;function r(o,s,i){const{gen:a,compositeRule:l,data:u,opts:d}=o;if(i===void 0)return;const f=(0,e._)`${u}${(0,e.getProperty)(s)}`;if(l){(0,t.checkStrictMode)(o,`default is ignored for: ${f}`);return}let p=(0,e._)`${f} === undefined`;d.useDefaults==="empty"&&(p=(0,e._)`${p} || ${f} === null || ${f} === ""`),a.if(p,(0,e._)`${f} = ${(0,e.stringify)(i)}`)}return Ll}var xr={},ze={};Object.defineProperty(ze,"__esModule",{value:!0});ze.validateUnion=ze.validateArray=ze.usePattern=ze.callValidateCode=ze.schemaProperties=ze.allSchemaProperties=ze.noPropertyInData=ze.propertyInData=ze.isOwnProperty=ze.hasPropFunc=ze.reportMissingProp=ze.checkMissingProp=ze.checkReportMissingProp=void 0;const ft=Le,Tx=ge,Ko=ao,zG=ge;function FG(e,t){const{gen:n,data:r,it:o}=e;n.if(Rx(n,r,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,ft._)`${t}`},!0),e.error()})}ze.checkReportMissingProp=FG;function UG({gen:e,data:t,it:{opts:n}},r,o){return(0,ft.or)(...r.map(s=>(0,ft.and)(Rx(e,t,s,n.ownProperties),(0,ft._)`${o} = ${s}`)))}ze.checkMissingProp=UG;function qG(e,t){e.setParams({missingProperty:t},!0),e.error()}ze.reportMissingProp=qG;function z$(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ft._)`Object.prototype.hasOwnProperty`})}ze.hasPropFunc=z$;function $x(e,t,n){return(0,ft._)`${z$(e)}.call(${t}, ${n})`}ze.isOwnProperty=$x;function VG(e,t,n,r){const o=(0,ft._)`${t}${(0,ft.getProperty)(n)} !== undefined`;return r?(0,ft._)`${o} && ${$x(e,t,n)}`:o}ze.propertyInData=VG;function Rx(e,t,n,r){const o=(0,ft._)`${t}${(0,ft.getProperty)(n)} === undefined`;return r?(0,ft.or)(o,(0,ft.not)($x(e,t,n))):o}ze.noPropertyInData=Rx;function F$(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ze.allSchemaProperties=F$;function HG(e,t){return F$(t).filter(n=>!(0,Tx.alwaysValidSchema)(e,t[n]))}ze.schemaProperties=HG;function BG({schemaCode:e,data:t,it:{gen:n,topSchemaRef:r,schemaPath:o,errorPath:s},it:i},a,l,u){const d=u?(0,ft._)`${e}, ${t}, ${r}${o}`:t,f=[[Ko.default.instancePath,(0,ft.strConcat)(Ko.default.instancePath,s)],[Ko.default.parentData,i.parentData],[Ko.default.parentDataProperty,i.parentDataProperty],[Ko.default.rootData,Ko.default.rootData]];i.opts.dynamicRef&&f.push([Ko.default.dynamicAnchors,Ko.default.dynamicAnchors]);const p=(0,ft._)`${d}, ${n.object(...f)}`;return l!==ft.nil?(0,ft._)`${a}.call(${l}, ${p})`:(0,ft._)`${a}(${p})`}ze.callValidateCode=BG;const WG=(0,ft._)`new RegExp`;function KG({gen:e,it:{opts:t}},n){const r=t.unicodeRegExp?"u":"",{regExp:o}=t.code,s=o(n,r);return e.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,ft._)`${o.code==="new RegExp"?WG:(0,zG.useFunc)(e,o)}(${n}, ${r})`})}ze.usePattern=KG;function ZG(e){const{gen:t,data:n,keyword:r,it:o}=e,s=t.name("valid");if(o.allErrors){const a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(s,!0),i(()=>t.break()),s;function i(a){const l=t.const("len",(0,ft._)`${n}.length`);t.forRange("i",0,l,u=>{e.subschema({keyword:r,dataProp:u,dataPropType:Tx.Type.Num},s),t.if((0,ft.not)(s),a)})}}ze.validateArray=ZG;function QG(e){const{gen:t,schema:n,keyword:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(l=>(0,Tx.alwaysValidSchema)(o,l))&&!o.opts.unevaluated)return;const i=t.let("valid",!1),a=t.name("_valid");t.block(()=>n.forEach((l,u)=>{const d=e.subschema({keyword:r,schemaProp:u,compositeRule:!0},a);t.assign(i,(0,ft._)`${i} || ${a}`),e.mergeValidEvaluated(d,a)||t.if((0,ft.not)(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}ze.validateUnion=QG;var d_;function GG(){if(d_)return xr;d_=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.validateKeywordUsage=xr.validSchemaType=xr.funcKeywordCode=xr.macroKeywordCode=void 0;const e=Le,t=ao,n=ze,r=_u;function o(p,h){const{gen:y,keyword:m,schema:x,parentSchema:g,it:v}=p,b=h.macro.call(v.self,x,g,v),k=u(y,m,b);v.opts.validateSchema!==!1&&v.self.validateSchema(b,!0);const S=y.name("valid");p.subschema({schema:b,schemaPath:e.nil,errSchemaPath:`${v.errSchemaPath}/${m}`,topSchemaRef:k,compositeRule:!0},S),p.pass(S,()=>p.error(!0))}xr.macroKeywordCode=o;function s(p,h){var y;const{gen:m,keyword:x,schema:g,parentSchema:v,$data:b,it:k}=p;l(k,h);const S=!b&&h.compile?h.compile.call(k.self,g,v,k):h.validate,E=u(m,x,S),P=m.let("valid");p.block$data(P,O),p.ok((y=h.valid)!==null&&y!==void 0?y:P);function O(){if(h.errors===!1)j(),h.modifying&&i(p),I(()=>p.error());else{const D=h.async?R():$();h.modifying&&i(p),I(()=>a(p,D))}}function R(){const D=m.let("ruleErrs",null);return m.try(()=>j((0,e._)`await `),L=>m.assign(P,!1).if((0,e._)`${L} instanceof ${k.ValidationError}`,()=>m.assign(D,(0,e._)`${L}.errors`),()=>m.throw(L))),D}function $(){const D=(0,e._)`${E}.errors`;return m.assign(D,null),j(e.nil),D}function j(D=h.async?(0,e._)`await `:e.nil){const L=k.opts.passContext?t.default.this:t.default.self,T=!("compile"in h&&!b||h.schema===!1);m.assign(P,(0,e._)`${D}${(0,n.callValidateCode)(p,E,L,T)}`,h.modifying)}function I(D){var L;m.if((0,e.not)((L=h.valid)!==null&&L!==void 0?L:P),D)}}xr.funcKeywordCode=s;function i(p){const{gen:h,data:y,it:m}=p;h.if(m.parentData,()=>h.assign(y,(0,e._)`${m.parentData}[${m.parentDataProperty}]`))}function a(p,h){const{gen:y}=p;y.if((0,e._)`Array.isArray(${h})`,()=>{y.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${h} : ${t.default.vErrors}.concat(${h})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,r.extendErrors)(p)},()=>p.error())}function l({schemaEnv:p},h){if(h.async&&!p.$async)throw new Error("async keyword in sync schema")}function u(p,h,y){if(y===void 0)throw new Error(`keyword "${h}" failed to compile`);return p.scopeValue("keyword",typeof y=="function"?{ref:y}:{ref:y,code:(0,e.stringify)(y)})}function d(p,h,y=!1){return!h.length||h.some(m=>m==="array"?Array.isArray(p):m==="object"?p&&typeof p=="object"&&!Array.isArray(p):typeof p==m||y&&typeof p>"u")}xr.validSchemaType=d;function f({schema:p,opts:h,self:y,errSchemaPath:m},x,g){if(Array.isArray(x.keyword)?!x.keyword.includes(g):x.keyword!==g)throw new Error("ajv implementation error");const v=x.dependencies;if(v!=null&&v.some(b=>!Object.prototype.hasOwnProperty.call(p,b)))throw new Error(`parent schema must have dependencies of ${g}: ${v.join(",")}`);if(x.validateSchema&&!x.validateSchema(p[g])){const k=`keyword "${g}" value is invalid at path "${m}": `+y.errorsText(x.validateSchema.errors);if(h.validateSchema==="log")y.logger.error(k);else throw new Error(k)}}return xr.validateKeywordUsage=f,xr}var po={},f_;function JG(){if(f_)return po;f_=1,Object.defineProperty(po,"__esModule",{value:!0}),po.extendSubschemaMode=po.extendSubschemaData=po.getSubschema=void 0;const e=Le,t=ge;function n(s,{keyword:i,schemaProp:a,schema:l,schemaPath:u,errSchemaPath:d,topSchemaRef:f}){if(i!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){const p=s.schema[i];return a===void 0?{schema:p,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(i)}`,errSchemaPath:`${s.errSchemaPath}/${i}`}:{schema:p[a],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(i)}${(0,e.getProperty)(a)}`,errSchemaPath:`${s.errSchemaPath}/${i}/${(0,t.escapeFragment)(a)}`}}if(l!==void 0){if(u===void 0||d===void 0||f===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:u,topSchemaRef:f,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}po.getSubschema=n;function r(s,i,{dataProp:a,dataPropType:l,data:u,dataTypes:d,propertyName:f}){if(u!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:p}=i;if(a!==void 0){const{errorPath:y,dataPathArr:m,opts:x}=i,g=p.let("data",(0,e._)`${i.data}${(0,e.getProperty)(a)}`,!0);h(g),s.errorPath=(0,e.str)`${y}${(0,t.getErrorPath)(a,l,x.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${a}`,s.dataPathArr=[...m,s.parentDataProperty]}if(u!==void 0){const y=u instanceof e.Name?u:p.let("data",u,!0);h(y),f!==void 0&&(s.propertyName=f)}d&&(s.dataTypes=d);function h(y){s.data=y,s.dataLevel=i.dataLevel+1,s.dataTypes=[],i.definedProperties=new Set,s.parentData=i.data,s.dataNames=[...i.dataNames,y]}}po.extendSubschemaData=r;function o(s,{jtdDiscriminator:i,jtdMetadata:a,compositeRule:l,createErrors:u,allErrors:d}){l!==void 0&&(s.compositeRule=l),u!==void 0&&(s.createErrors=u),d!==void 0&&(s.allErrors=d),s.jtdDiscriminator=i,s.jtdMetadata=a}return po.extendSubschemaMode=o,po}var en={},U$=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n},q$={exports:{}},gs=q$.exports=function(e,t,n){typeof t=="function"&&(n=t,t={}),n=t.cb||n;var r=typeof n=="function"?n:n.pre||function(){},o=n.post||function(){};Bd(t,r,o,e,"",e)};gs.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};gs.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};gs.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};gs.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 Bd(e,t,n,r,o,s,i,a,l,u){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,o,s,i,a,l,u);for(var d in r){var f=r[d];if(Array.isArray(f)){if(d in gs.arrayKeywords)for(var p=0;p<f.length;p++)Bd(e,t,n,f[p],o+"/"+d+"/"+p,s,o,d,r,p)}else if(d in gs.propsKeywords){if(f&&typeof f=="object")for(var h in f)Bd(e,t,n,f[h],o+"/"+d+"/"+YG(h),s,o,d,r,h)}else(d in gs.keywords||e.allKeys&&!(d in gs.skipKeywords))&&Bd(e,t,n,f,o+"/"+d,s,o,d,r)}n(r,o,s,i,a,l,u)}}function YG(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var XG=q$.exports;Object.defineProperty(en,"__esModule",{value:!0});en.getSchemaRefs=en.resolveUrl=en.normalizeId=en._getFullPath=en.getFullPath=en.inlineRef=void 0;const eJ=ge,tJ=U$,nJ=XG,rJ=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function oJ(e,t=!0){return typeof e=="boolean"?!0:t===!0?!Hy(e):t?V$(e)<=t:!1}en.inlineRef=oJ;const sJ=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Hy(e){for(const t in e){if(sJ.has(t))return!0;const n=e[t];if(Array.isArray(n)&&n.some(Hy)||typeof n=="object"&&Hy(n))return!0}return!1}function V$(e){let t=0;for(const n in e){if(n==="$ref")return 1/0;if(t++,!rJ.has(n)&&(typeof e[n]=="object"&&(0,eJ.eachItem)(e[n],r=>t+=V$(r)),t===1/0))return 1/0}return t}function H$(e,t="",n){n!==!1&&(t=Ta(t));const r=e.parse(t);return B$(e,r)}en.getFullPath=H$;function B$(e,t){return e.serialize(t).split("#")[0]+"#"}en._getFullPath=B$;const iJ=/#\/?$/;function Ta(e){return e?e.replace(iJ,""):""}en.normalizeId=Ta;function aJ(e,t,n){return n=Ta(n),e.resolve(t,n)}en.resolveUrl=aJ;const lJ=/^[a-z_][-a-z0-9._]*$/i;function cJ(e,t){if(typeof e=="boolean")return{};const{schemaId:n,uriResolver:r}=this.opts,o=Ta(e[n]||t),s={"":o},i=H$(r,o,!1),a={},l=new Set;return nJ(e,{allKeys:!0},(f,p,h,y)=>{if(y===void 0)return;const m=i+p;let x=s[y];typeof f[n]=="string"&&(x=g.call(this,f[n])),v.call(this,f.$anchor),v.call(this,f.$dynamicAnchor),s[p]=x;function g(b){const k=this.opts.uriResolver.resolve;if(b=Ta(x?k(x,b):b),l.has(b))throw d(b);l.add(b);let S=this.refs[b];return typeof S=="string"&&(S=this.refs[S]),typeof S=="object"?u(f,S.schema,b):b!==Ta(m)&&(b[0]==="#"?(u(f,a[b],b),a[b]=f):this.refs[b]=m),b}function v(b){if(typeof b=="string"){if(!lJ.test(b))throw new Error(`invalid anchor "${b}"`);g.call(this,`#${b}`)}}}),a;function u(f,p,h){if(p!==void 0&&!tJ(f,p))throw d(h)}function d(f){return new Error(`reference "${f}" resolves to more than one schema`)}}en.getSchemaRefs=cJ;var h_;function rp(){if(h_)return fo;h_=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.getData=fo.KeywordCxt=fo.validateFunctionCode=void 0;const e=_G(),t=Lt,n=O$(),r=Lt,o=LG(),s=GG(),i=JG(),a=Le,l=ao,u=en,d=ge,f=_u;function p(U){if(S(U)&&(P(U),k(U))){x(U);return}h(U,()=>(0,e.topBoolOrEmptySchema)(U))}fo.validateFunctionCode=p;function h({gen:U,validateName:H,schema:J,schemaEnv:te,opts:B},ne){B.code.es5?U.func(H,(0,a._)`${l.default.data}, ${l.default.valCxt}`,te.$async,()=>{U.code((0,a._)`"use strict"; ${v(J,B)}`),m(U,B),U.code(ne)}):U.func(H,(0,a._)`${l.default.data}, ${y(B)}`,te.$async,()=>U.code(v(J,B)).code(ne))}function y(U){return(0,a._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${U.dynamicRef?(0,a._)`, ${l.default.dynamicAnchors}={}`:a.nil}}={}`}function m(U,H){U.if(l.default.valCxt,()=>{U.var(l.default.instancePath,(0,a._)`${l.default.valCxt}.${l.default.instancePath}`),U.var(l.default.parentData,(0,a._)`${l.default.valCxt}.${l.default.parentData}`),U.var(l.default.parentDataProperty,(0,a._)`${l.default.valCxt}.${l.default.parentDataProperty}`),U.var(l.default.rootData,(0,a._)`${l.default.valCxt}.${l.default.rootData}`),H.dynamicRef&&U.var(l.default.dynamicAnchors,(0,a._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{U.var(l.default.instancePath,(0,a._)`""`),U.var(l.default.parentData,(0,a._)`undefined`),U.var(l.default.parentDataProperty,(0,a._)`undefined`),U.var(l.default.rootData,l.default.data),H.dynamicRef&&U.var(l.default.dynamicAnchors,(0,a._)`{}`)})}function x(U){const{schema:H,opts:J,gen:te}=U;h(U,()=>{J.$comment&&H.$comment&&D(U),$(U),te.let(l.default.vErrors,null),te.let(l.default.errors,0),J.unevaluated&&g(U),O(U),L(U)})}function g(U){const{gen:H,validateName:J}=U;U.evaluated=H.const("evaluated",(0,a._)`${J}.evaluated`),H.if((0,a._)`${U.evaluated}.dynamicProps`,()=>H.assign((0,a._)`${U.evaluated}.props`,(0,a._)`undefined`)),H.if((0,a._)`${U.evaluated}.dynamicItems`,()=>H.assign((0,a._)`${U.evaluated}.items`,(0,a._)`undefined`))}function v(U,H){const J=typeof U=="object"&&U[H.schemaId];return J&&(H.code.source||H.code.process)?(0,a._)`/*# sourceURL=${J} */`:a.nil}function b(U,H){if(S(U)&&(P(U),k(U))){E(U,H);return}(0,e.boolOrEmptySchema)(U,H)}function k({schema:U,self:H}){if(typeof U=="boolean")return!U;for(const J in U)if(H.RULES.all[J])return!0;return!1}function S(U){return typeof U.schema!="boolean"}function E(U,H){const{schema:J,gen:te,opts:B}=U;B.$comment&&J.$comment&&D(U),j(U),I(U);const ne=te.const("_errs",l.default.errors);O(U,ne),te.var(H,(0,a._)`${ne} === ${l.default.errors}`)}function P(U){(0,d.checkUnknownRules)(U),R(U)}function O(U,H){if(U.opts.jtd)return Q(U,[],!1,H);const J=(0,t.getSchemaTypes)(U.schema),te=(0,t.coerceAndCheckDataType)(U,J);Q(U,J,!te,H)}function R(U){const{schema:H,errSchemaPath:J,opts:te,self:B}=U;H.$ref&&te.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(H,B.RULES)&&B.logger.warn(`$ref: keywords ignored in schema at path "${J}"`)}function $(U){const{schema:H,opts:J}=U;H.default!==void 0&&J.useDefaults&&J.strictSchema&&(0,d.checkStrictMode)(U,"default is ignored in the schema root")}function j(U){const H=U.schema[U.opts.schemaId];H&&(U.baseId=(0,u.resolveUrl)(U.opts.uriResolver,U.baseId,H))}function I(U){if(U.schema.$async&&!U.schemaEnv.$async)throw new Error("async schema in sync schema")}function D({gen:U,schemaEnv:H,schema:J,errSchemaPath:te,opts:B}){const ne=J.$comment;if(B.$comment===!0)U.code((0,a._)`${l.default.self}.logger.log(${ne})`);else if(typeof B.$comment=="function"){const re=(0,a.str)`${te}/$comment`,Te=U.scopeValue("root",{ref:H.root});U.code((0,a._)`${l.default.self}.opts.$comment(${ne}, ${re}, ${Te}.schema)`)}}function L(U){const{gen:H,schemaEnv:J,validateName:te,ValidationError:B,opts:ne}=U;J.$async?H.if((0,a._)`${l.default.errors} === 0`,()=>H.return(l.default.data),()=>H.throw((0,a._)`new ${B}(${l.default.vErrors})`)):(H.assign((0,a._)`${te}.errors`,l.default.vErrors),ne.unevaluated&&T(U),H.return((0,a._)`${l.default.errors} === 0`))}function T({gen:U,evaluated:H,props:J,items:te}){J instanceof a.Name&&U.assign((0,a._)`${H}.props`,J),te instanceof a.Name&&U.assign((0,a._)`${H}.items`,te)}function Q(U,H,J,te){const{gen:B,schema:ne,data:re,allErrors:Te,opts:ce,self:ke}=U,{RULES:Ne}=ke;if(ne.$ref&&(ce.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(ne,Ne))){B.block(()=>Z(U,"$ref",Ne.all.$ref.definition));return}ce.jtd||M(U,H),B.block(()=>{for(const Tt of Ne.rules)rt(Tt);rt(Ne.post)});function rt(Tt){(0,n.shouldUseGroup)(ne,Tt)&&(Tt.type?(B.if((0,r.checkDataType)(Tt.type,re,ce.strictNumbers)),X(U,Tt),H.length===1&&H[0]===Tt.type&&J&&(B.else(),(0,r.reportTypeError)(U)),B.endIf()):X(U,Tt),Te||B.if((0,a._)`${l.default.errors} === ${te||0}`))}}function X(U,H){const{gen:J,schema:te,opts:{useDefaults:B}}=U;B&&(0,o.assignDefaults)(U,H.type),J.block(()=>{for(const ne of H.rules)(0,n.shouldUseRule)(te,ne)&&Z(U,ne.keyword,ne.definition,H.type)})}function M(U,H){U.schemaEnv.meta||!U.opts.strictTypes||(K(U,H),U.opts.allowUnionTypes||N(U,H),z(U,U.dataTypes))}function K(U,H){if(H.length){if(!U.dataTypes.length){U.dataTypes=H;return}H.forEach(J=>{_(U.dataTypes,J)||A(U,`type "${J}" not allowed by context "${U.dataTypes.join(",")}"`)}),C(U,H)}}function N(U,H){H.length>1&&!(H.length===2&&H.includes("null"))&&A(U,"use allowUnionTypes to allow union type keyword")}function z(U,H){const J=U.self.RULES.all;for(const te in J){const B=J[te];if(typeof B=="object"&&(0,n.shouldUseRule)(U.schema,B)){const{type:ne}=B.definition;ne.length&&!ne.some(re=>W(H,re))&&A(U,`missing type "${ne.join(",")}" for keyword "${te}"`)}}}function W(U,H){return U.includes(H)||H==="number"&&U.includes("integer")}function _(U,H){return U.includes(H)||H==="integer"&&U.includes("number")}function C(U,H){const J=[];for(const te of U.dataTypes)_(H,te)?J.push(te):H.includes("integer")&&te==="number"&&J.push("integer");U.dataTypes=J}function A(U,H){const J=U.schemaEnv.baseId+U.errSchemaPath;H+=` at "${J}" (strictTypes)`,(0,d.checkStrictMode)(U,H,U.opts.strictTypes)}class F{constructor(H,J,te){if((0,s.validateKeywordUsage)(H,J,te),this.gen=H.gen,this.allErrors=H.allErrors,this.keyword=te,this.data=H.data,this.schema=H.schema[te],this.$data=J.$data&&H.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(H,this.schema,te,this.$data),this.schemaType=J.schemaType,this.parentSchema=H.schema,this.params={},this.it=H,this.def=J,this.$data)this.schemaCode=H.gen.const("vSchema",de(this.$data,H));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,J.schemaType,J.allowUndefined))throw new Error(`${te} value must be ${JSON.stringify(J.schemaType)}`);("code"in J?J.trackErrors:J.errors!==!1)&&(this.errsCount=H.gen.const("_errs",l.default.errors))}result(H,J,te){this.failResult((0,a.not)(H),J,te)}failResult(H,J,te){this.gen.if(H),te?te():this.error(),J?(this.gen.else(),J(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(H,J){this.failResult((0,a.not)(H),void 0,J)}fail(H){if(H===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(H),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(H){if(!this.$data)return this.fail(H);const{schemaCode:J}=this;this.fail((0,a._)`${J} !== undefined && (${(0,a.or)(this.invalid$data(),H)})`)}error(H,J,te){if(J){this.setParams(J),this._error(H,te),this.setParams({});return}this._error(H,te)}_error(H,J){(H?f.reportExtraError:f.reportError)(this,this.def.error,J)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(H){this.allErrors||this.gen.if(H)}setParams(H,J){J?Object.assign(this.params,H):this.params=H}block$data(H,J,te=a.nil){this.gen.block(()=>{this.check$data(H,te),J()})}check$data(H=a.nil,J=a.nil){if(!this.$data)return;const{gen:te,schemaCode:B,schemaType:ne,def:re}=this;te.if((0,a.or)((0,a._)`${B} === undefined`,J)),H!==a.nil&&te.assign(H,!0),(ne.length||re.validateSchema)&&(te.elseIf(this.invalid$data()),this.$dataError(),H!==a.nil&&te.assign(H,!1)),te.else()}invalid$data(){const{gen:H,schemaCode:J,schemaType:te,def:B,it:ne}=this;return(0,a.or)(re(),Te());function re(){if(te.length){if(!(J instanceof a.Name))throw new Error("ajv implementation error");const ce=Array.isArray(te)?te:[te];return(0,a._)`${(0,r.checkDataTypes)(ce,J,ne.opts.strictNumbers,r.DataType.Wrong)}`}return a.nil}function Te(){if(B.validateSchema){const ce=H.scopeValue("validate$data",{ref:B.validateSchema});return(0,a._)`!${ce}(${J})`}return a.nil}}subschema(H,J){const te=(0,i.getSubschema)(this.it,H);(0,i.extendSubschemaData)(te,this.it,H),(0,i.extendSubschemaMode)(te,H);const B={...this.it,...te,items:void 0,props:void 0};return b(B,J),B}mergeEvaluated(H,J){const{it:te,gen:B}=this;te.opts.unevaluated&&(te.props!==!0&&H.props!==void 0&&(te.props=d.mergeEvaluated.props(B,H.props,te.props,J)),te.items!==!0&&H.items!==void 0&&(te.items=d.mergeEvaluated.items(B,H.items,te.items,J)))}mergeValidEvaluated(H,J){const{it:te,gen:B}=this;if(te.opts.unevaluated&&(te.props!==!0||te.items!==!0))return B.if(J,()=>this.mergeEvaluated(H,a.Name)),!0}}fo.KeywordCxt=F;function Z(U,H,J,te){const B=new F(U,J,H);"code"in J?J.code(B,te):B.$data&&J.validate?(0,s.funcKeywordCode)(B,J):"macro"in J?(0,s.macroKeywordCode)(B,J):(J.compile||J.validate)&&(0,s.funcKeywordCode)(B,J)}const Y=/^\/(?:[^~]|~0|~1)*$/,ae=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function de(U,{dataLevel:H,dataNames:J,dataPathArr:te}){let B,ne;if(U==="")return l.default.rootData;if(U[0]==="/"){if(!Y.test(U))throw new Error(`Invalid JSON-pointer: ${U}`);B=U,ne=l.default.rootData}else{const ke=ae.exec(U);if(!ke)throw new Error(`Invalid JSON-pointer: ${U}`);const Ne=+ke[1];if(B=ke[2],B==="#"){if(Ne>=H)throw new Error(ce("property/index",Ne));return te[H-Ne]}if(Ne>H)throw new Error(ce("data",Ne));if(ne=J[H-Ne],!B)return ne}let re=ne;const Te=B.split("/");for(const ke of Te)ke&&(ne=(0,a._)`${ne}${(0,a.getProperty)((0,d.unescapeJsonPointer)(ke))}`,re=(0,a._)`${re} && ${ne}`);return re;function ce(ke,Ne){return`Cannot access ${ke} ${Ne} levels up, current level is ${H}`}}return fo.getData=de,fo}var Su={};Object.defineProperty(Su,"__esModule",{value:!0});class uJ extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}Su.default=uJ;var bl={};Object.defineProperty(bl,"__esModule",{value:!0});const Cm=en;class dJ extends Error{constructor(t,n,r,o){super(o||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,Cm.resolveUrl)(t,n,r),this.missingSchema=(0,Cm.normalizeId)((0,Cm.getFullPath)(t,this.missingRef))}}bl.default=dJ;var On={};Object.defineProperty(On,"__esModule",{value:!0});On.resolveSchema=On.getCompilingSchema=On.resolveRef=On.compileSchema=On.SchemaEnv=void 0;const wr=Le,fJ=Su,Ws=ao,Tr=en,p_=ge,hJ=rp();class op{constructor(t){var n;this.refs={},this.dynamicAnchors={};let r;typeof t.schema=="object"&&(r=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(n=t.baseId)!==null&&n!==void 0?n:(0,Tr.normalizeId)(r==null?void 0:r[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=r==null?void 0:r.$async,this.refs={}}}On.SchemaEnv=op;function Ix(e){const t=W$.call(this,e);if(t)return t;const n=(0,Tr.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:r,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new wr.CodeGen(this.scope,{es5:r,lines:o,ownProperties:s});let a;e.$async&&(a=i.scopeValue("Error",{ref:fJ.default,code:(0,wr._)`require("ajv/dist/runtime/validation_error").default`}));const l=i.scopeName("validate");e.validateName=l;const u={gen:i,allErrors:this.opts.allErrors,data:Ws.default.data,parentData:Ws.default.parentData,parentDataProperty:Ws.default.parentDataProperty,dataNames:[Ws.default.data],dataPathArr:[wr.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,wr.stringify)(e.schema)}:{ref:e.schema}),validateName:l,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:n,baseId:e.baseId||n,schemaPath:wr.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,wr._)`""`,opts:this.opts,self:this};let d;try{this._compilations.add(e),(0,hJ.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);const f=i.toString();d=`${i.scopeRefs(Ws.default.scope)}return ${f}`,this.opts.code.process&&(d=this.opts.code.process(d,e));const h=new Function(`${Ws.default.self}`,`${Ws.default.scope}`,d)(this,this.scope.get());if(this.scope.value(l,{ref:h}),h.errors=null,h.schema=e.schema,h.schemaEnv=e,e.$async&&(h.$async=!0),this.opts.code.source===!0&&(h.source={validateName:l,validateCode:f,scopeValues:i._values}),this.opts.unevaluated){const{props:y,items:m}=u;h.evaluated={props:y instanceof wr.Name?void 0:y,items:m instanceof wr.Name?void 0:m,dynamicProps:y instanceof wr.Name,dynamicItems:m instanceof wr.Name},h.source&&(h.source.evaluated=(0,wr.stringify)(h.evaluated))}return e.validate=h,e}catch(f){throw delete e.validate,delete e.validateName,d&&this.logger.error("Error compiling schema, function code:",d),f}finally{this._compilations.delete(e)}}On.compileSchema=Ix;function pJ(e,t,n){var r;n=(0,Tr.resolveUrl)(this.opts.uriResolver,t,n);const o=e.refs[n];if(o)return o;let s=yJ.call(this,e,n);if(s===void 0){const i=(r=e.localRefs)===null||r===void 0?void 0:r[n],{schemaId:a}=this.opts;i&&(s=new op({schema:i,schemaId:a,root:e,baseId:t}))}if(s!==void 0)return e.refs[n]=mJ.call(this,s)}On.resolveRef=pJ;function mJ(e){return(0,Tr.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Ix.call(this,e)}function W$(e){for(const t of this._compilations)if(gJ(t,e))return t}On.getCompilingSchema=W$;function gJ(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function yJ(e,t){let n;for(;typeof(n=this.refs[t])=="string";)t=n;return n||this.schemas[t]||sp.call(this,e,t)}function sp(e,t){const n=this.opts.uriResolver.parse(t),r=(0,Tr._getFullPath)(this.opts.uriResolver,n);let o=(0,Tr.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===o)return Em.call(this,n,e);const s=(0,Tr.normalizeId)(r),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){const a=sp.call(this,e,i);return typeof(a==null?void 0:a.schema)!="object"?void 0:Em.call(this,n,a)}if(typeof(i==null?void 0:i.schema)=="object"){if(i.validate||Ix.call(this,i),s===(0,Tr.normalizeId)(t)){const{schema:a}=i,{schemaId:l}=this.opts,u=a[l];return u&&(o=(0,Tr.resolveUrl)(this.opts.uriResolver,o,u)),new op({schema:a,schemaId:l,root:e,baseId:o})}return Em.call(this,n,i)}}On.resolveSchema=sp;const vJ=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Em(e,{baseId:t,schema:n,root:r}){var o;if(((o=e.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(const a of e.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const l=n[(0,p_.unescapeFragment)(a)];if(l===void 0)return;n=l;const u=typeof n=="object"&&n[this.opts.schemaId];!vJ.has(a)&&u&&(t=(0,Tr.resolveUrl)(this.opts.uriResolver,t,u))}let s;if(typeof n!="boolean"&&n.$ref&&!(0,p_.schemaHasRulesButRef)(n,this.RULES)){const a=(0,Tr.resolveUrl)(this.opts.uriResolver,t,n.$ref);s=sp.call(this,r,a)}const{schemaId:i}=this.opts;if(s=s||new op({schema:n,schemaId:i,root:r,baseId:t}),s.schema!==s.root.schema)return s}const xJ="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",wJ="Meta-schema for $data reference (JSON AnySchema extension proposal)",bJ="object",kJ=["$data"],_J={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},SJ=!1,CJ={$id:xJ,description:wJ,type:bJ,required:kJ,properties:_J,additionalProperties:SJ};var Ax={},ip={exports:{}};const EJ={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};var NJ={HEX:EJ};const{HEX:jJ}=NJ,PJ=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function K$(e){if(Q$(e,".")<3)return{host:e,isIPV4:!1};const t=e.match(PJ)||[],[n]=t;return n?{host:$J(n,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function m_(e,t=!1){let n="",r=!0;for(const o of e){if(jJ[o]===void 0)return;o!=="0"&&r===!0&&(r=!1),r||(n+=o)}return t&&n.length===0&&(n="0"),n}function TJ(e){let t=0;const n={error:!1,address:"",zone:""},r=[],o=[];let s=!1,i=!1,a=!1;function l(){if(o.length){if(s===!1){const u=m_(o);if(u!==void 0)r.push(u);else return n.error=!0,!1}o.length=0}return!0}for(let u=0;u<e.length;u++){const d=e[u];if(!(d==="["||d==="]"))if(d===":"){if(i===!0&&(a=!0),!l())break;if(t++,r.push(":"),t>7){n.error=!0;break}u-1>=0&&e[u-1]===":"&&(i=!0);continue}else if(d==="%"){if(!l())break;s=!0}else{o.push(d);continue}}return o.length&&(s?n.zone=o.join(""):a?r.push(o.join("")):r.push(m_(o))),n.address=r.join(""),n}function Z$(e){if(Q$(e,":")<2)return{host:e,isIPV6:!1};const t=TJ(e);if(t.error)return{host:e,isIPV6:!1};{let n=t.address,r=t.address;return t.zone&&(n+="%"+t.zone,r+="%25"+t.zone),{host:n,escapedHost:r,isIPV6:!0}}}function $J(e,t){let n="",r=!0;const o=e.length;for(let s=0;s<o;s++){const i=e[s];i==="0"&&r?(s+1<=o&&e[s+1]===t||s+1===o)&&(n+=i,r=!1):(i===t?r=!0:r=!1,n+=i)}return n}function Q$(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}const g_=/^\.\.?\//u,y_=/^\/\.(?:\/|$)/u,v_=/^\/\.\.(?:\/|$)/u,RJ=/^\/?(?:.|\n)*?(?=\/|$)/u;function IJ(e){const t=[];for(;e.length;)if(e.match(g_))e=e.replace(g_,"");else if(e.match(y_))e=e.replace(y_,"/");else if(e.match(v_))e=e.replace(v_,"/"),t.pop();else if(e==="."||e==="..")e="";else{const n=e.match(RJ);if(n){const r=n[0];e=e.slice(r.length),t.push(r)}else throw new Error("Unexpected dot segment condition")}return t.join("")}function AJ(e,t){const n=t!==!0?escape:unescape;return e.scheme!==void 0&&(e.scheme=n(e.scheme)),e.userinfo!==void 0&&(e.userinfo=n(e.userinfo)),e.host!==void 0&&(e.host=n(e.host)),e.path!==void 0&&(e.path=n(e.path)),e.query!==void 0&&(e.query=n(e.query)),e.fragment!==void 0&&(e.fragment=n(e.fragment)),e}function OJ(e){const t=[];if(e.userinfo!==void 0&&(t.push(e.userinfo),t.push("@")),e.host!==void 0){let n=unescape(e.host);const r=K$(n);if(r.isIPV4)n=r.host;else{const o=Z$(r.host);o.isIPV6===!0?n=`[${o.escapedHost}]`:n=e.host}t.push(n)}return(typeof e.port=="number"||typeof e.port=="string")&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}var MJ={recomposeAuthority:OJ,normalizeComponentEncoding:AJ,removeDotSegments:IJ,normalizeIPv4:K$,normalizeIPv6:Z$};const DJ=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,LJ=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function G$(e){return typeof e.secure=="boolean"?e.secure:String(e.scheme).toLowerCase()==="wss"}function J$(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Y$(e){const t=String(e.scheme).toLowerCase()==="https";return(e.port===(t?443:80)||e.port==="")&&(e.port=void 0),e.path||(e.path="/"),e}function zJ(e){return e.secure=G$(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function FJ(e){if((e.port===(G$(e)?443:80)||e.port==="")&&(e.port=void 0),typeof e.secure=="boolean"&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function UJ(e,t){if(!e.path)return e.error="URN can not be parsed",e;const n=e.path.match(LJ);if(n){const r=t.scheme||e.scheme||"urn";e.nid=n[1].toLowerCase(),e.nss=n[2];const o=`${r}:${t.nid||e.nid}`,s=Ox[o];e.path=void 0,s&&(e=s.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function qJ(e,t){const n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),o=`${n}:${t.nid||r}`,s=Ox[o];s&&(e=s.serialize(e,t));const i=e,a=e.nss;return i.path=`${r||t.nid}:${a}`,t.skipEscape=!0,i}function VJ(e,t){const n=e;return n.uuid=n.nss,n.nss=void 0,!t.tolerant&&(!n.uuid||!DJ.test(n.uuid))&&(n.error=n.error||"UUID is not valid."),n}function HJ(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t}const X$={scheme:"http",domainHost:!0,parse:J$,serialize:Y$},BJ={scheme:"https",domainHost:X$.domainHost,parse:J$,serialize:Y$},Wd={scheme:"ws",domainHost:!0,parse:zJ,serialize:FJ},WJ={scheme:"wss",domainHost:Wd.domainHost,parse:Wd.parse,serialize:Wd.serialize},KJ={scheme:"urn",parse:UJ,serialize:qJ,skipNormalize:!0},ZJ={scheme:"urn:uuid",parse:VJ,serialize:HJ,skipNormalize:!0},Ox={http:X$,https:BJ,ws:Wd,wss:WJ,urn:KJ,"urn:uuid":ZJ};var QJ=Ox;const{normalizeIPv6:GJ,normalizeIPv4:JJ,removeDotSegments:Gl,recomposeAuthority:YJ,normalizeComponentEncoding:fd}=MJ,Mx=QJ;function XJ(e,t){return typeof e=="string"?e=eo(Oo(e,t),t):typeof e=="object"&&(e=Oo(eo(e,t),t)),e}function eY(e,t,n){const r=Object.assign({scheme:"null"},n),o=eR(Oo(e,r),Oo(t,r),r,!0);return eo(o,{...r,skipEscape:!0})}function eR(e,t,n,r){const o={};return r||(e=Oo(eo(e,n),n),t=Oo(eo(t,n),n)),n=n||{},!n.tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Gl(t.path||""),o.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=Gl(t.path||""),o.query=t.query):(t.path?(t.path.charAt(0)==="/"?o.path=Gl(t.path):((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?o.path="/"+t.path:e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path,o.path=Gl(o.path)),o.query=t.query):(o.path=e.path,t.query!==void 0?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function tY(e,t,n){return typeof e=="string"?(e=unescape(e),e=eo(fd(Oo(e,n),!0),{...n,skipEscape:!0})):typeof e=="object"&&(e=eo(fd(e,!0),{...n,skipEscape:!0})),typeof t=="string"?(t=unescape(t),t=eo(fd(Oo(t,n),!0),{...n,skipEscape:!0})):typeof t=="object"&&(t=eo(fd(t,!0),{...n,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()}function eo(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),o=[],s=Mx[(r.scheme||n.scheme||"").toLowerCase()];s&&s.serialize&&s.serialize(n,r),n.path!==void 0&&(r.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),r.reference!=="suffix"&&n.scheme&&o.push(n.scheme,":");const i=YJ(n);if(i!==void 0&&(r.reference!=="suffix"&&o.push("//"),o.push(i),n.path&&n.path.charAt(0)!=="/"&&o.push("/")),n.path!==void 0){let a=n.path;!r.absolutePath&&(!s||!s.absolutePath)&&(a=Gl(a)),i===void 0&&(a=a.replace(/^\/\//u,"/%2F")),o.push(a)}return n.query!==void 0&&o.push("?",n.query),n.fragment!==void 0&&o.push("#",n.fragment),o.join("")}const nY=Array.from({length:127},(e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)));function rY(e){let t=0;for(let n=0,r=e.length;n<r;++n)if(t=e.charCodeAt(n),t>126||nY[t])return!0;return!1}const oY=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Oo(e,t){const n=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=e.indexOf("%")!==-1;let s=!1;n.reference==="suffix"&&(e=(n.scheme?n.scheme+":":"")+"//"+e);const i=e.match(oY);if(i){if(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5]),r.host){const l=JJ(r.host);if(l.isIPV4===!1){const u=GJ(l.host);r.host=u.host.toLowerCase(),s=u.isIPV6}else r.host=l.host,s=!0}r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path?r.reference="same-document":r.scheme===void 0?r.reference="relative":r.fragment===void 0?r.reference="absolute":r.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==r.reference&&(r.error=r.error||"URI is not a "+n.reference+" reference.");const a=Mx[(n.scheme||r.scheme||"").toLowerCase()];if(!n.unicodeSupport&&(!a||!a.unicodeSupport)&&r.host&&(n.domainHost||a&&a.domainHost)&&s===!1&&rY(r.host))try{r.host=URL.domainToASCII(r.host.toLowerCase())}catch(l){r.error=r.error||"Host's domain name can not be converted to ASCII: "+l}(!a||a&&!a.skipNormalize)&&(o&&r.scheme!==void 0&&(r.scheme=unescape(r.scheme)),o&&r.host!==void 0&&(r.host=unescape(r.host)),r.path&&(r.path=escape(unescape(r.path))),r.fragment&&(r.fragment=encodeURI(decodeURIComponent(r.fragment)))),a&&a.parse&&a.parse(r,n)}else r.error=r.error||"URI can not be parsed.";return r}const Dx={SCHEMES:Mx,normalize:XJ,resolve:eY,resolveComponents:eR,equal:tY,serialize:eo,parse:Oo};ip.exports=Dx;ip.exports.default=Dx;ip.exports.fastUri=Dx;var sY=ip.exports;Object.defineProperty(Ax,"__esModule",{value:!0});const tR=sY;tR.code='require("ajv/dist/runtime/uri").default';Ax.default=tR;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=rp();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=Le;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=Su,o=bl,s=Ai,i=On,a=Le,l=en,u=Lt,d=ge,f=CJ,p=Ax,h=(N,z)=>new RegExp(N,z);h.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),x={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function b(N){var z,W,_,C,A,F,Z,Y,ae,de,U,H,J,te,B,ne,re,Te,ce,ke,Ne,rt,Tt,it,qn;const G=N.strict,ie=(z=N.code)===null||z===void 0?void 0:z.optimize,_e=ie===!0||ie===void 0?1:ie||0,Pe=(_=(W=N.code)===null||W===void 0?void 0:W.regExp)!==null&&_!==void 0?_:h,We=(C=N.uriResolver)!==null&&C!==void 0?C:p.default;return{strictSchema:(F=(A=N.strictSchema)!==null&&A!==void 0?A:G)!==null&&F!==void 0?F:!0,strictNumbers:(Y=(Z=N.strictNumbers)!==null&&Z!==void 0?Z:G)!==null&&Y!==void 0?Y:!0,strictTypes:(de=(ae=N.strictTypes)!==null&&ae!==void 0?ae:G)!==null&&de!==void 0?de:"log",strictTuples:(H=(U=N.strictTuples)!==null&&U!==void 0?U:G)!==null&&H!==void 0?H:"log",strictRequired:(te=(J=N.strictRequired)!==null&&J!==void 0?J:G)!==null&&te!==void 0?te:!1,code:N.code?{...N.code,optimize:_e,regExp:Pe}:{optimize:_e,regExp:Pe},loopRequired:(B=N.loopRequired)!==null&&B!==void 0?B:v,loopEnum:(ne=N.loopEnum)!==null&&ne!==void 0?ne:v,meta:(re=N.meta)!==null&&re!==void 0?re:!0,messages:(Te=N.messages)!==null&&Te!==void 0?Te:!0,inlineRefs:(ce=N.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(ke=N.schemaId)!==null&&ke!==void 0?ke:"$id",addUsedSchema:(Ne=N.addUsedSchema)!==null&&Ne!==void 0?Ne:!0,validateSchema:(rt=N.validateSchema)!==null&&rt!==void 0?rt:!0,validateFormats:(Tt=N.validateFormats)!==null&&Tt!==void 0?Tt:!0,unicodeRegExp:(it=N.unicodeRegExp)!==null&&it!==void 0?it:!0,int32range:(qn=N.int32range)!==null&&qn!==void 0?qn:!0,uriResolver:We}}class k{constructor(z={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,z=this.opts={...z,...b(z)};const{es5:W,lines:_}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:m,es5:W,lines:_}),this.logger=I(z.logger);const C=z.validateFormats;z.validateFormats=!1,this.RULES=(0,s.getRules)(),S.call(this,x,z,"NOT SUPPORTED"),S.call(this,g,z,"DEPRECATED","warn"),this._metaOpts=$.call(this),z.formats&&O.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),z.keywords&&R.call(this,z.keywords),typeof z.meta=="object"&&this.addMetaSchema(z.meta),P.call(this),z.validateFormats=C}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:z,meta:W,schemaId:_}=this.opts;let C=f;_==="id"&&(C={...f},C.id=C.$id,delete C.$id),W&&z&&this.addMetaSchema(C,C[_],!1)}defaultMeta(){const{meta:z,schemaId:W}=this.opts;return this.opts.defaultMeta=typeof z=="object"?z[W]||z:void 0}validate(z,W){let _;if(typeof z=="string"){if(_=this.getSchema(z),!_)throw new Error(`no schema with key or ref "${z}"`)}else _=this.compile(z);const C=_(W);return"$async"in _||(this.errors=_.errors),C}compile(z,W){const _=this._addSchema(z,W);return _.validate||this._compileSchemaEnv(_)}compileAsync(z,W){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:_}=this.opts;return C.call(this,z,W);async function C(de,U){await A.call(this,de.$schema);const H=this._addSchema(de,U);return H.validate||F.call(this,H)}async function A(de){de&&!this.getSchema(de)&&await C.call(this,{$ref:de},!0)}async function F(de){try{return this._compileSchemaEnv(de)}catch(U){if(!(U instanceof o.default))throw U;return Z.call(this,U),await Y.call(this,U.missingSchema),F.call(this,de)}}function Z({missingSchema:de,missingRef:U}){if(this.refs[de])throw new Error(`AnySchema ${de} is loaded but ${U} cannot be resolved`)}async function Y(de){const U=await ae.call(this,de);this.refs[de]||await A.call(this,U.$schema),this.refs[de]||this.addSchema(U,de,W)}async function ae(de){const U=this._loading[de];if(U)return U;try{return await(this._loading[de]=_(de))}finally{delete this._loading[de]}}}addSchema(z,W,_,C=this.opts.validateSchema){if(Array.isArray(z)){for(const F of z)this.addSchema(F,void 0,_,C);return this}let A;if(typeof z=="object"){const{schemaId:F}=this.opts;if(A=z[F],A!==void 0&&typeof A!="string")throw new Error(`schema ${F} must be string`)}return W=(0,l.normalizeId)(W||A),this._checkUnique(W),this.schemas[W]=this._addSchema(z,_,W,C,!0),this}addMetaSchema(z,W,_=this.opts.validateSchema){return this.addSchema(z,W,!0,_),this}validateSchema(z,W){if(typeof z=="boolean")return!0;let _;if(_=z.$schema,_!==void 0&&typeof _!="string")throw new Error("$schema must be a string");if(_=_||this.opts.defaultMeta||this.defaultMeta(),!_)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const C=this.validate(_,z);if(!C&&W){const A="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(A);else throw new Error(A)}return C}getSchema(z){let W;for(;typeof(W=E.call(this,z))=="string";)z=W;if(W===void 0){const{schemaId:_}=this.opts,C=new i.SchemaEnv({schema:{},schemaId:_});if(W=i.resolveSchema.call(this,C,z),!W)return;this.refs[z]=W}return W.validate||this._compileSchemaEnv(W)}removeSchema(z){if(z instanceof RegExp)return this._removeAllSchemas(this.schemas,z),this._removeAllSchemas(this.refs,z),this;switch(typeof z){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const W=E.call(this,z);return typeof W=="object"&&this._cache.delete(W.schema),delete this.schemas[z],delete this.refs[z],this}case"object":{const W=z;this._cache.delete(W);let _=z[this.opts.schemaId];return _&&(_=(0,l.normalizeId)(_),delete this.schemas[_],delete this.refs[_]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(z){for(const W of z)this.addKeyword(W);return this}addKeyword(z,W){let _;if(typeof z=="string")_=z,typeof W=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),W.keyword=_);else if(typeof z=="object"&&W===void 0){if(W=z,_=W.keyword,Array.isArray(_)&&!_.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,_,W),!W)return(0,d.eachItem)(_,A=>T.call(this,A)),this;X.call(this,W);const C={...W,type:(0,u.getJSONTypes)(W.type),schemaType:(0,u.getJSONTypes)(W.schemaType)};return(0,d.eachItem)(_,C.type.length===0?A=>T.call(this,A,C):A=>C.type.forEach(F=>T.call(this,A,C,F))),this}getKeyword(z){const W=this.RULES.all[z];return typeof W=="object"?W.definition:!!W}removeKeyword(z){const{RULES:W}=this;delete W.keywords[z],delete W.all[z];for(const _ of W.rules){const C=_.rules.findIndex(A=>A.keyword===z);C>=0&&_.rules.splice(C,1)}return this}addFormat(z,W){return typeof W=="string"&&(W=new RegExp(W)),this.formats[z]=W,this}errorsText(z=this.errors,{separator:W=", ",dataVar:_="data"}={}){return!z||z.length===0?"No errors":z.map(C=>`${_}${C.instancePath} ${C.message}`).reduce((C,A)=>C+W+A)}$dataMetaSchema(z,W){const _=this.RULES.all;z=JSON.parse(JSON.stringify(z));for(const C of W){const A=C.split("/").slice(1);let F=z;for(const Z of A)F=F[Z];for(const Z in _){const Y=_[Z];if(typeof Y!="object")continue;const{$data:ae}=Y.definition,de=F[Z];ae&&de&&(F[Z]=K(de))}}return z}_removeAllSchemas(z,W){for(const _ in z){const C=z[_];(!W||W.test(_))&&(typeof C=="string"?delete z[_]:C&&!C.meta&&(this._cache.delete(C.schema),delete z[_]))}}_addSchema(z,W,_,C=this.opts.validateSchema,A=this.opts.addUsedSchema){let F;const{schemaId:Z}=this.opts;if(typeof z=="object")F=z[Z];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof z!="boolean")throw new Error("schema must be object or boolean")}let Y=this._cache.get(z);if(Y!==void 0)return Y;_=(0,l.normalizeId)(F||_);const ae=l.getSchemaRefs.call(this,z,_);return Y=new i.SchemaEnv({schema:z,schemaId:Z,meta:W,baseId:_,localRefs:ae}),this._cache.set(Y.schema,Y),A&&!_.startsWith("#")&&(_&&this._checkUnique(_),this.refs[_]=Y),C&&this.validateSchema(z,!0),Y}_checkUnique(z){if(this.schemas[z]||this.refs[z])throw new Error(`schema with key or id "${z}" already exists`)}_compileSchemaEnv(z){if(z.meta?this._compileMetaSchema(z):i.compileSchema.call(this,z),!z.validate)throw new Error("ajv implementation error");return z.validate}_compileMetaSchema(z){const W=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,z)}finally{this.opts=W}}}k.ValidationError=r.default,k.MissingRefError=o.default,e.default=k;function S(N,z,W,_="error"){for(const C in N){const A=C;A in z&&this.logger[_](`${W}: option ${C}. ${N[A]}`)}}function E(N){return N=(0,l.normalizeId)(N),this.schemas[N]||this.refs[N]}function P(){const N=this.opts.schemas;if(N)if(Array.isArray(N))this.addSchema(N);else for(const z in N)this.addSchema(N[z],z)}function O(){for(const N in this.opts.formats){const z=this.opts.formats[N];z&&this.addFormat(N,z)}}function R(N){if(Array.isArray(N)){this.addVocabulary(N);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const z in N){const W=N[z];W.keyword||(W.keyword=z),this.addKeyword(W)}}function $(){const N={...this.opts};for(const z of y)delete N[z];return N}const j={log(){},warn(){},error(){}};function I(N){if(N===!1)return j;if(N===void 0)return console;if(N.log&&N.warn&&N.error)return N;throw new Error("logger must implement log, warn and error methods")}const D=/^[a-z_$][a-z0-9_$:-]*$/i;function L(N,z){const{RULES:W}=this;if((0,d.eachItem)(N,_=>{if(W.keywords[_])throw new Error(`Keyword ${_} is already defined`);if(!D.test(_))throw new Error(`Keyword ${_} has invalid name`)}),!!z&&z.$data&&!("code"in z||"validate"in z))throw new Error('$data keyword must have "code" or "validate" function')}function T(N,z,W){var _;const C=z==null?void 0:z.post;if(W&&C)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:A}=this;let F=C?A.post:A.rules.find(({type:Y})=>Y===W);if(F||(F={type:W,rules:[]},A.rules.push(F)),A.keywords[N]=!0,!z)return;const Z={keyword:N,definition:{...z,type:(0,u.getJSONTypes)(z.type),schemaType:(0,u.getJSONTypes)(z.schemaType)}};z.before?Q.call(this,F,Z,z.before):F.rules.push(Z),A.all[N]=Z,(_=z.implements)===null||_===void 0||_.forEach(Y=>this.addKeyword(Y))}function Q(N,z,W){const _=N.rules.findIndex(C=>C.keyword===W);_>=0?N.rules.splice(_,0,z):(N.rules.push(z),this.logger.warn(`rule ${W} is not defined`))}function X(N){let{metaSchema:z}=N;z!==void 0&&(N.$data&&this.opts.$data&&(z=K(z)),N.validateSchema=this.compile(z,!0))}const M={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function K(N){return{anyOf:[N,M]}}})(P$);var Lx={},zx={},Fx={};Object.defineProperty(Fx,"__esModule",{value:!0});const iY={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Fx.default=iY;var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.callRef=Oi.getValidate=void 0;const aY=bl,x_=ze,$n=Le,Qi=ao,w_=On,hd=ge,lY={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:r}=e,{baseId:o,schemaEnv:s,validateName:i,opts:a,self:l}=r,{root:u}=s;if((n==="#"||n==="#/")&&o===u.baseId)return f();const d=w_.resolveRef.call(l,u,o,n);if(d===void 0)throw new aY.default(r.opts.uriResolver,o,n);if(d instanceof w_.SchemaEnv)return p(d);return h(d);function f(){if(s===u)return Kd(e,i,s,s.$async);const y=t.scopeValue("root",{ref:u});return Kd(e,(0,$n._)`${y}.validate`,u,u.$async)}function p(y){const m=nR(e,y);Kd(e,m,y,y.$async)}function h(y){const m=t.scopeValue("schema",a.code.source===!0?{ref:y,code:(0,$n.stringify)(y)}:{ref:y}),x=t.name("valid"),g=e.subschema({schema:y,dataTypes:[],schemaPath:$n.nil,topSchemaRef:m,errSchemaPath:n},x);e.mergeEvaluated(g),e.ok(x)}}};function nR(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):(0,$n._)`${n.scopeValue("wrapper",{ref:t})}.validate`}Oi.getValidate=nR;function Kd(e,t,n,r){const{gen:o,it:s}=e,{allErrors:i,schemaEnv:a,opts:l}=s,u=l.passContext?Qi.default.this:$n.nil;r?d():f();function d(){if(!a.$async)throw new Error("async schema referenced by sync schema");const y=o.let("valid");o.try(()=>{o.code((0,$n._)`await ${(0,x_.callValidateCode)(e,t,u)}`),h(t),i||o.assign(y,!0)},m=>{o.if((0,$n._)`!(${m} instanceof ${s.ValidationError})`,()=>o.throw(m)),p(m),i||o.assign(y,!1)}),e.ok(y)}function f(){e.result((0,x_.callValidateCode)(e,t,u),()=>h(t),()=>p(t))}function p(y){const m=(0,$n._)`${y}.errors`;o.assign(Qi.default.vErrors,(0,$n._)`${Qi.default.vErrors} === null ? ${m} : ${Qi.default.vErrors}.concat(${m})`),o.assign(Qi.default.errors,(0,$n._)`${Qi.default.vErrors}.length`)}function h(y){var m;if(!s.opts.unevaluated)return;const x=(m=n==null?void 0:n.validate)===null||m===void 0?void 0:m.evaluated;if(s.props!==!0)if(x&&!x.dynamicProps)x.props!==void 0&&(s.props=hd.mergeEvaluated.props(o,x.props,s.props));else{const g=o.var("props",(0,$n._)`${y}.evaluated.props`);s.props=hd.mergeEvaluated.props(o,g,s.props,$n.Name)}if(s.items!==!0)if(x&&!x.dynamicItems)x.items!==void 0&&(s.items=hd.mergeEvaluated.items(o,x.items,s.items));else{const g=o.var("items",(0,$n._)`${y}.evaluated.items`);s.items=hd.mergeEvaluated.items(o,g,s.items,$n.Name)}}}Oi.callRef=Kd;Oi.default=lY;Object.defineProperty(zx,"__esModule",{value:!0});const cY=Fx,uY=Oi,dY=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",cY.default,uY.default];zx.default=dY;var Ux={},qx={};Object.defineProperty(qx,"__esModule",{value:!0});const nh=Le,Zo=nh.operators,rh={maximum:{okStr:"<=",ok:Zo.LTE,fail:Zo.GT},minimum:{okStr:">=",ok:Zo.GTE,fail:Zo.LT},exclusiveMaximum:{okStr:"<",ok:Zo.LT,fail:Zo.GTE},exclusiveMinimum:{okStr:">",ok:Zo.GT,fail:Zo.LTE}},fY={message:({keyword:e,schemaCode:t})=>(0,nh.str)`must be ${rh[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,nh._)`{comparison: ${rh[e].okStr}, limit: ${t}}`},hY={keyword:Object.keys(rh),type:"number",schemaType:"number",$data:!0,error:fY,code(e){const{keyword:t,data:n,schemaCode:r}=e;e.fail$data((0,nh._)`${n} ${rh[t].fail} ${r} || isNaN(${n})`)}};qx.default=hY;var Vx={};Object.defineProperty(Vx,"__esModule",{value:!0});const gc=Le,pY={message:({schemaCode:e})=>(0,gc.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,gc._)`{multipleOf: ${e}}`},mY={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:pY,code(e){const{gen:t,data:n,schemaCode:r,it:o}=e,s=o.opts.multipleOfPrecision,i=t.let("res"),a=s?(0,gc._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,gc._)`${i} !== parseInt(${i})`;e.fail$data((0,gc._)`(${r} === 0 || (${i} = ${n}/${r}, ${a}))`)}};Vx.default=mY;var Hx={},Bx={};Object.defineProperty(Bx,"__esModule",{value:!0});function rR(e){const t=e.length;let n=0,r=0,o;for(;r<t;)n++,o=e.charCodeAt(r++),o>=55296&&o<=56319&&r<t&&(o=e.charCodeAt(r),(o&64512)===56320&&r++);return n}Bx.default=rR;rR.code='require("ajv/dist/runtime/ucs2length").default';Object.defineProperty(Hx,"__esModule",{value:!0});const ni=Le,gY=ge,yY=Bx,vY={message({keyword:e,schemaCode:t}){const n=e==="maxLength"?"more":"fewer";return(0,ni.str)`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>(0,ni._)`{limit: ${e}}`},xY={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:vY,code(e){const{keyword:t,data:n,schemaCode:r,it:o}=e,s=t==="maxLength"?ni.operators.GT:ni.operators.LT,i=o.opts.unicode===!1?(0,ni._)`${n}.length`:(0,ni._)`${(0,gY.useFunc)(e.gen,yY.default)}(${n})`;e.fail$data((0,ni._)`${i} ${s} ${r}`)}};Hx.default=xY;var Wx={};Object.defineProperty(Wx,"__esModule",{value:!0});const wY=ze,oh=Le,bY={message:({schemaCode:e})=>(0,oh.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,oh._)`{pattern: ${e}}`},kY={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:bY,code(e){const{data:t,$data:n,schema:r,schemaCode:o,it:s}=e,i=s.opts.unicodeRegExp?"u":"",a=n?(0,oh._)`(new RegExp(${o}, ${i}))`:(0,wY.usePattern)(e,r);e.fail$data((0,oh._)`!${a}.test(${t})`)}};Wx.default=kY;var Kx={};Object.defineProperty(Kx,"__esModule",{value:!0});const yc=Le,_Y={message({keyword:e,schemaCode:t}){const n=e==="maxProperties"?"more":"fewer";return(0,yc.str)`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>(0,yc._)`{limit: ${e}}`},SY={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:_Y,code(e){const{keyword:t,data:n,schemaCode:r}=e,o=t==="maxProperties"?yc.operators.GT:yc.operators.LT;e.fail$data((0,yc._)`Object.keys(${n}).length ${o} ${r}`)}};Kx.default=SY;var Zx={};Object.defineProperty(Zx,"__esModule",{value:!0});const zl=ze,vc=Le,CY=ge,EY={message:({params:{missingProperty:e}})=>(0,vc.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,vc._)`{missingProperty: ${e}}`},NY={keyword:"required",type:"object",schemaType:"array",$data:!0,error:EY,code(e){const{gen:t,schema:n,schemaCode:r,data:o,$data:s,it:i}=e,{opts:a}=i;if(!s&&n.length===0)return;const l=n.length>=a.loopRequired;if(i.allErrors?u():d(),a.strictRequired){const h=e.parentSchema.properties,{definedProperties:y}=e.it;for(const m of n)if((h==null?void 0:h[m])===void 0&&!y.has(m)){const x=i.schemaEnv.baseId+i.errSchemaPath,g=`required property "${m}" is not defined at "${x}" (strictRequired)`;(0,CY.checkStrictMode)(i,g,i.opts.strictRequired)}}function u(){if(l||s)e.block$data(vc.nil,f);else for(const h of n)(0,zl.checkReportMissingProp)(e,h)}function d(){const h=t.let("missing");if(l||s){const y=t.let("valid",!0);e.block$data(y,()=>p(h,y)),e.ok(y)}else t.if((0,zl.checkMissingProp)(e,n,h)),(0,zl.reportMissingProp)(e,h),t.else()}function f(){t.forOf("prop",r,h=>{e.setParams({missingProperty:h}),t.if((0,zl.noPropertyInData)(t,o,h,a.ownProperties),()=>e.error())})}function p(h,y){e.setParams({missingProperty:h}),t.forOf(h,r,()=>{t.assign(y,(0,zl.propertyInData)(t,o,h,a.ownProperties)),t.if((0,vc.not)(y),()=>{e.error(),t.break()})},vc.nil)}}};Zx.default=NY;var Qx={};Object.defineProperty(Qx,"__esModule",{value:!0});const xc=Le,jY={message({keyword:e,schemaCode:t}){const n=e==="maxItems"?"more":"fewer";return(0,xc.str)`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>(0,xc._)`{limit: ${e}}`},PY={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:jY,code(e){const{keyword:t,data:n,schemaCode:r}=e,o=t==="maxItems"?xc.operators.GT:xc.operators.LT;e.fail$data((0,xc._)`${n}.length ${o} ${r}`)}};Qx.default=PY;var Gx={},Cu={};Object.defineProperty(Cu,"__esModule",{value:!0});const oR=U$;oR.code='require("ajv/dist/runtime/equal").default';Cu.default=oR;Object.defineProperty(Gx,"__esModule",{value:!0});const Nm=Lt,Gt=Le,TY=ge,$Y=Cu,RY={message:({params:{i:e,j:t}})=>(0,Gt.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,Gt._)`{i: ${e}, j: ${t}}`},IY={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:RY,code(e){const{gen:t,data:n,$data:r,schema:o,parentSchema:s,schemaCode:i,it:a}=e;if(!r&&!o)return;const l=t.let("valid"),u=s.items?(0,Nm.getSchemaTypes)(s.items):[];e.block$data(l,d,(0,Gt._)`${i} === false`),e.ok(l);function d(){const y=t.let("i",(0,Gt._)`${n}.length`),m=t.let("j");e.setParams({i:y,j:m}),t.assign(l,!0),t.if((0,Gt._)`${y} > 1`,()=>(f()?p:h)(y,m))}function f(){return u.length>0&&!u.some(y=>y==="object"||y==="array")}function p(y,m){const x=t.name("item"),g=(0,Nm.checkDataTypes)(u,x,a.opts.strictNumbers,Nm.DataType.Wrong),v=t.const("indices",(0,Gt._)`{}`);t.for((0,Gt._)`;${y}--;`,()=>{t.let(x,(0,Gt._)`${n}[${y}]`),t.if(g,(0,Gt._)`continue`),u.length>1&&t.if((0,Gt._)`typeof ${x} == "string"`,(0,Gt._)`${x} += "_"`),t.if((0,Gt._)`typeof ${v}[${x}] == "number"`,()=>{t.assign(m,(0,Gt._)`${v}[${x}]`),e.error(),t.assign(l,!1).break()}).code((0,Gt._)`${v}[${x}] = ${y}`)})}function h(y,m){const x=(0,TY.useFunc)(t,$Y.default),g=t.name("outer");t.label(g).for((0,Gt._)`;${y}--;`,()=>t.for((0,Gt._)`${m} = ${y}; ${m}--;`,()=>t.if((0,Gt._)`${x}(${n}[${y}], ${n}[${m}])`,()=>{e.error(),t.assign(l,!1).break(g)})))}}};Gx.default=IY;var Jx={};Object.defineProperty(Jx,"__esModule",{value:!0});const By=Le,AY=ge,OY=Cu,MY={message:"must be equal to constant",params:({schemaCode:e})=>(0,By._)`{allowedValue: ${e}}`},DY={keyword:"const",$data:!0,error:MY,code(e){const{gen:t,data:n,$data:r,schemaCode:o,schema:s}=e;r||s&&typeof s=="object"?e.fail$data((0,By._)`!${(0,AY.useFunc)(t,OY.default)}(${n}, ${o})`):e.fail((0,By._)`${s} !== ${n}`)}};Jx.default=DY;var Yx={};Object.defineProperty(Yx,"__esModule",{value:!0});const Jl=Le,LY=ge,zY=Cu,FY={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,Jl._)`{allowedValues: ${e}}`},UY={keyword:"enum",schemaType:"array",$data:!0,error:FY,code(e){const{gen:t,data:n,$data:r,schema:o,schemaCode:s,it:i}=e;if(!r&&o.length===0)throw new Error("enum must have non-empty array");const a=o.length>=i.opts.loopEnum;let l;const u=()=>l??(l=(0,LY.useFunc)(t,zY.default));let d;if(a||r)d=t.let("valid"),e.block$data(d,f);else{if(!Array.isArray(o))throw new Error("ajv implementation error");const h=t.const("vSchema",s);d=(0,Jl.or)(...o.map((y,m)=>p(h,m)))}e.pass(d);function f(){t.assign(d,!1),t.forOf("v",s,h=>t.if((0,Jl._)`${u()}(${n}, ${h})`,()=>t.assign(d,!0).break()))}function p(h,y){const m=o[y];return typeof m=="object"&&m!==null?(0,Jl._)`${u()}(${n}, ${h}[${y}])`:(0,Jl._)`${n} === ${m}`}}};Yx.default=UY;Object.defineProperty(Ux,"__esModule",{value:!0});const qY=qx,VY=Vx,HY=Hx,BY=Wx,WY=Kx,KY=Zx,ZY=Qx,QY=Gx,GY=Jx,JY=Yx,YY=[qY.default,VY.default,HY.default,BY.default,WY.default,KY.default,ZY.default,QY.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},GY.default,JY.default];Ux.default=YY;var Xx={},kl={};Object.defineProperty(kl,"__esModule",{value:!0});kl.validateAdditionalItems=void 0;const ri=Le,Wy=ge,XY={message:({params:{len:e}})=>(0,ri.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,ri._)`{limit: ${e}}`},eX={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:XY,code(e){const{parentSchema:t,it:n}=e,{items:r}=t;if(!Array.isArray(r)){(0,Wy.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas');return}sR(e,r)}};function sR(e,t){const{gen:n,schema:r,data:o,keyword:s,it:i}=e;i.items=!0;const a=n.const("len",(0,ri._)`${o}.length`);if(r===!1)e.setParams({len:t.length}),e.pass((0,ri._)`${a} <= ${t.length}`);else if(typeof r=="object"&&!(0,Wy.alwaysValidSchema)(i,r)){const u=n.var("valid",(0,ri._)`${a} <= ${t.length}`);n.if((0,ri.not)(u),()=>l(u)),e.ok(u)}function l(u){n.forRange("i",t.length,a,d=>{e.subschema({keyword:s,dataProp:d,dataPropType:Wy.Type.Num},u),i.allErrors||n.if((0,ri.not)(u),()=>n.break())})}}kl.validateAdditionalItems=sR;kl.default=eX;var ew={},_l={};Object.defineProperty(_l,"__esModule",{value:!0});_l.validateTuple=void 0;const b_=Le,Zd=ge,tX=ze,nX={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return iR(e,"additionalItems",t);n.items=!0,!(0,Zd.alwaysValidSchema)(n,t)&&e.ok((0,tX.validateArray)(e))}};function iR(e,t,n=e.schema){const{gen:r,parentSchema:o,data:s,keyword:i,it:a}=e;d(o),a.opts.unevaluated&&n.length&&a.items!==!0&&(a.items=Zd.mergeEvaluated.items(r,n.length,a.items));const l=r.name("valid"),u=r.const("len",(0,b_._)`${s}.length`);n.forEach((f,p)=>{(0,Zd.alwaysValidSchema)(a,f)||(r.if((0,b_._)`${u} > ${p}`,()=>e.subschema({keyword:i,schemaProp:p,dataProp:p},l)),e.ok(l))});function d(f){const{opts:p,errSchemaPath:h}=a,y=n.length,m=y===f.minItems&&(y===f.maxItems||f[t]===!1);if(p.strictTuples&&!m){const x=`"${i}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${h}"`;(0,Zd.checkStrictMode)(a,x,p.strictTuples)}}}_l.validateTuple=iR;_l.default=nX;Object.defineProperty(ew,"__esModule",{value:!0});const rX=_l,oX={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,rX.validateTuple)(e,"items")};ew.default=oX;var tw={};Object.defineProperty(tw,"__esModule",{value:!0});const k_=Le,sX=ge,iX=ze,aX=kl,lX={message:({params:{len:e}})=>(0,k_.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,k_._)`{limit: ${e}}`},cX={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:lX,code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:o}=n;r.items=!0,!(0,sX.alwaysValidSchema)(r,t)&&(o?(0,aX.validateAdditionalItems)(e,o):e.ok((0,iX.validateArray)(e)))}};tw.default=cX;var nw={};Object.defineProperty(nw,"__esModule",{value:!0});const sr=Le,pd=ge,uX={message:({params:{min:e,max:t}})=>t===void 0?(0,sr.str)`must contain at least ${e} valid item(s)`:(0,sr.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?(0,sr._)`{minContains: ${e}}`:(0,sr._)`{minContains: ${e}, maxContains: ${t}}`},dX={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:uX,code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:s}=e;let i,a;const{minContains:l,maxContains:u}=r;s.opts.next?(i=l===void 0?1:l,a=u):i=1;const d=t.const("len",(0,sr._)`${o}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){(0,pd.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,pd.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,pd.alwaysValidSchema)(s,n)){let m=(0,sr._)`${d} >= ${i}`;a!==void 0&&(m=(0,sr._)`${m} && ${d} <= ${a}`),e.pass(m);return}s.items=!0;const f=t.name("valid");a===void 0&&i===1?h(f,()=>t.if(f,()=>t.break())):i===0?(t.let(f,!0),a!==void 0&&t.if((0,sr._)`${o}.length > 0`,p)):(t.let(f,!1),p()),e.result(f,()=>e.reset());function p(){const m=t.name("_valid"),x=t.let("count",0);h(m,()=>t.if(m,()=>y(x)))}function h(m,x){t.forRange("i",0,d,g=>{e.subschema({keyword:"contains",dataProp:g,dataPropType:pd.Type.Num,compositeRule:!0},m),x()})}function y(m){t.code((0,sr._)`${m}++`),a===void 0?t.if((0,sr._)`${m} >= ${i}`,()=>t.assign(f,!0).break()):(t.if((0,sr._)`${m} > ${a}`,()=>t.assign(f,!1).break()),i===1?t.assign(f,!0):t.if((0,sr._)`${m} >= ${i}`,()=>t.assign(f,!0)))}}};nw.default=dX;var aR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Le,n=ge,r=ze;e.error={message:({params:{property:l,depsCount:u,deps:d}})=>{const f=u===1?"property":"properties";return(0,t.str)`must have ${f} ${d} when property ${l} is present`},params:({params:{property:l,depsCount:u,deps:d,missingProperty:f}})=>(0,t._)`{property: ${l},
473
- missingProperty: ${f},
474
- depsCount: ${u},
475
- deps: ${d}}`};const o={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(l){const[u,d]=s(l);i(l,u),a(l,d)}};function s({schema:l}){const u={},d={};for(const f in l){if(f==="__proto__")continue;const p=Array.isArray(l[f])?u:d;p[f]=l[f]}return[u,d]}function i(l,u=l.schema){const{gen:d,data:f,it:p}=l;if(Object.keys(u).length===0)return;const h=d.let("missing");for(const y in u){const m=u[y];if(m.length===0)continue;const x=(0,r.propertyInData)(d,f,y,p.opts.ownProperties);l.setParams({property:y,depsCount:m.length,deps:m.join(", ")}),p.allErrors?d.if(x,()=>{for(const g of m)(0,r.checkReportMissingProp)(l,g)}):(d.if((0,t._)`${x} && (${(0,r.checkMissingProp)(l,m,h)})`),(0,r.reportMissingProp)(l,h),d.else())}}e.validatePropertyDeps=i;function a(l,u=l.schema){const{gen:d,data:f,keyword:p,it:h}=l,y=d.name("valid");for(const m in u)(0,n.alwaysValidSchema)(h,u[m])||(d.if((0,r.propertyInData)(d,f,m,h.opts.ownProperties),()=>{const x=l.subschema({keyword:p,schemaProp:m},y);l.mergeValidEvaluated(x,y)},()=>d.var(y,!0)),l.ok(y))}e.validateSchemaDeps=a,e.default=o})(aR);var rw={};Object.defineProperty(rw,"__esModule",{value:!0});const lR=Le,fX=ge,hX={message:"property name must be valid",params:({params:e})=>(0,lR._)`{propertyName: ${e.propertyName}}`},pX={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:hX,code(e){const{gen:t,schema:n,data:r,it:o}=e;if((0,fX.alwaysValidSchema)(o,n))return;const s=t.name("valid");t.forIn("key",r,i=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),t.if((0,lR.not)(s),()=>{e.error(!0),o.allErrors||t.break()})}),e.ok(s)}};rw.default=pX;var ap={};Object.defineProperty(ap,"__esModule",{value:!0});const md=ze,br=Le,mX=ao,gd=ge,gX={message:"must NOT have additional properties",params:({params:e})=>(0,br._)`{additionalProperty: ${e.additionalProperty}}`},yX={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:gX,code(e){const{gen:t,schema:n,parentSchema:r,data:o,errsCount:s,it:i}=e;if(!s)throw new Error("ajv implementation error");const{allErrors:a,opts:l}=i;if(i.props=!0,l.removeAdditional!=="all"&&(0,gd.alwaysValidSchema)(i,n))return;const u=(0,md.allSchemaProperties)(r.properties),d=(0,md.allSchemaProperties)(r.patternProperties);f(),e.ok((0,br._)`${s} === ${mX.default.errors}`);function f(){t.forIn("key",o,x=>{!u.length&&!d.length?y(x):t.if(p(x),()=>y(x))})}function p(x){let g;if(u.length>8){const v=(0,gd.schemaRefOrVal)(i,r.properties,"properties");g=(0,md.isOwnProperty)(t,v,x)}else u.length?g=(0,br.or)(...u.map(v=>(0,br._)`${x} === ${v}`)):g=br.nil;return d.length&&(g=(0,br.or)(g,...d.map(v=>(0,br._)`${(0,md.usePattern)(e,v)}.test(${x})`))),(0,br.not)(g)}function h(x){t.code((0,br._)`delete ${o}[${x}]`)}function y(x){if(l.removeAdditional==="all"||l.removeAdditional&&n===!1){h(x);return}if(n===!1){e.setParams({additionalProperty:x}),e.error(),a||t.break();return}if(typeof n=="object"&&!(0,gd.alwaysValidSchema)(i,n)){const g=t.name("valid");l.removeAdditional==="failing"?(m(x,g,!1),t.if((0,br.not)(g),()=>{e.reset(),h(x)})):(m(x,g),a||t.if((0,br.not)(g),()=>t.break()))}}function m(x,g,v){const b={keyword:"additionalProperties",dataProp:x,dataPropType:gd.Type.Str};v===!1&&Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(b,g)}}};ap.default=yX;var ow={};Object.defineProperty(ow,"__esModule",{value:!0});const vX=rp(),__=ze,jm=ge,S_=ap,xX={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:r,data:o,it:s}=e;s.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&S_.default.code(new vX.KeywordCxt(s,S_.default,"additionalProperties"));const i=(0,__.allSchemaProperties)(n);for(const f of i)s.definedProperties.add(f);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=jm.mergeEvaluated.props(t,(0,jm.toHash)(i),s.props));const a=i.filter(f=>!(0,jm.alwaysValidSchema)(s,n[f]));if(a.length===0)return;const l=t.name("valid");for(const f of a)u(f)?d(f):(t.if((0,__.propertyInData)(t,o,f,s.opts.ownProperties)),d(f),s.allErrors||t.else().var(l,!0),t.endIf()),e.it.definedProperties.add(f),e.ok(l);function u(f){return s.opts.useDefaults&&!s.compositeRule&&n[f].default!==void 0}function d(f){e.subschema({keyword:"properties",schemaProp:f,dataProp:f},l)}}};ow.default=xX;var sw={};Object.defineProperty(sw,"__esModule",{value:!0});const C_=ze,yd=Le,E_=ge,N_=ge,wX={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:r,parentSchema:o,it:s}=e,{opts:i}=s,a=(0,C_.allSchemaProperties)(n),l=a.filter(m=>(0,E_.alwaysValidSchema)(s,n[m]));if(a.length===0||l.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;const u=i.strictSchema&&!i.allowMatchingProperties&&o.properties,d=t.name("valid");s.props!==!0&&!(s.props instanceof yd.Name)&&(s.props=(0,N_.evaluatedPropsToName)(t,s.props));const{props:f}=s;p();function p(){for(const m of a)u&&h(m),s.allErrors?y(m):(t.var(d,!0),y(m),t.if(d))}function h(m){for(const x in u)new RegExp(m).test(x)&&(0,E_.checkStrictMode)(s,`property ${x} matches pattern ${m} (use allowMatchingProperties)`)}function y(m){t.forIn("key",r,x=>{t.if((0,yd._)`${(0,C_.usePattern)(e,m)}.test(${x})`,()=>{const g=l.includes(m);g||e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:x,dataPropType:N_.Type.Str},d),s.opts.unevaluated&&f!==!0?t.assign((0,yd._)`${f}[${x}]`,!0):!g&&!s.allErrors&&t.if((0,yd.not)(d),()=>t.break())})})}}};sw.default=wX;var iw={};Object.defineProperty(iw,"__esModule",{value:!0});const bX=ge,kX={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:r}=e;if((0,bX.alwaysValidSchema)(r,n)){e.fail();return}const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};iw.default=kX;var aw={};Object.defineProperty(aw,"__esModule",{value:!0});const _X=ze,SX={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:_X.validateUnion,error:{message:"must match a schema in anyOf"}};aw.default=SX;var lw={};Object.defineProperty(lw,"__esModule",{value:!0});const Qd=Le,CX=ge,EX={message:"must match exactly one schema in oneOf",params:({params:e})=>(0,Qd._)`{passingSchemas: ${e.passing}}`},NX={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:EX,code(e){const{gen:t,schema:n,parentSchema:r,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(o.opts.discriminator&&r.discriminator)return;const s=n,i=t.let("valid",!1),a=t.let("passing",null),l=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(i,()=>e.reset(),()=>e.error(!0));function u(){s.forEach((d,f)=>{let p;(0,CX.alwaysValidSchema)(o,d)?t.var(l,!0):p=e.subschema({keyword:"oneOf",schemaProp:f,compositeRule:!0},l),f>0&&t.if((0,Qd._)`${l} && ${i}`).assign(i,!1).assign(a,(0,Qd._)`[${a}, ${f}]`).else(),t.if(l,()=>{t.assign(i,!0),t.assign(a,f),p&&e.mergeEvaluated(p,Qd.Name)})})}}};lw.default=NX;var cw={};Object.defineProperty(cw,"__esModule",{value:!0});const jX=ge,PX={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:r}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const o=t.name("valid");n.forEach((s,i)=>{if((0,jX.alwaysValidSchema)(r,s))return;const a=e.subschema({keyword:"allOf",schemaProp:i},o);e.ok(o),e.mergeEvaluated(a)})}};cw.default=PX;var uw={};Object.defineProperty(uw,"__esModule",{value:!0});const sh=Le,cR=ge,TX={message:({params:e})=>(0,sh.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,sh._)`{failingKeyword: ${e.ifClause}}`},$X={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:TX,code(e){const{gen:t,parentSchema:n,it:r}=e;n.then===void 0&&n.else===void 0&&(0,cR.checkStrictMode)(r,'"if" without "then" and "else" is ignored');const o=j_(r,"then"),s=j_(r,"else");if(!o&&!s)return;const i=t.let("valid",!0),a=t.name("_valid");if(l(),e.reset(),o&&s){const d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else o?t.if(a,u("then")):t.if((0,sh.not)(a),u("else"));e.pass(i,()=>e.error(!0));function l(){const d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,f){return()=>{const p=e.subschema({keyword:d},a);t.assign(i,a),e.mergeValidEvaluated(p,i),f?t.assign(f,(0,sh._)`${d}`):e.setParams({ifClause:d})}}}};function j_(e,t){const n=e.schema[t];return n!==void 0&&!(0,cR.alwaysValidSchema)(e,n)}uw.default=$X;var dw={};Object.defineProperty(dw,"__esModule",{value:!0});const RX=ge,IX={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){t.if===void 0&&(0,RX.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};dw.default=IX;Object.defineProperty(Xx,"__esModule",{value:!0});const AX=kl,OX=ew,MX=_l,DX=tw,LX=nw,zX=aR,FX=rw,UX=ap,qX=ow,VX=sw,HX=iw,BX=aw,WX=lw,KX=cw,ZX=uw,QX=dw;function GX(e=!1){const t=[HX.default,BX.default,WX.default,KX.default,ZX.default,QX.default,FX.default,UX.default,zX.default,qX.default,VX.default];return e?t.push(OX.default,DX.default):t.push(AX.default,MX.default),t.push(LX.default),t}Xx.default=GX;var fw={},hw={};Object.defineProperty(hw,"__esModule",{value:!0});const $t=Le,JX={message:({schemaCode:e})=>(0,$t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,$t._)`{format: ${e}}`},YX={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:JX,code(e,t){const{gen:n,data:r,$data:o,schema:s,schemaCode:i,it:a}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=a;if(!l.validateFormats)return;o?p():h();function p(){const y=n.scopeValue("formats",{ref:f.formats,code:l.code.formats}),m=n.const("fDef",(0,$t._)`${y}[${i}]`),x=n.let("fType"),g=n.let("format");n.if((0,$t._)`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>n.assign(x,(0,$t._)`${m}.type || "string"`).assign(g,(0,$t._)`${m}.validate`),()=>n.assign(x,(0,$t._)`"string"`).assign(g,m)),e.fail$data((0,$t.or)(v(),b()));function v(){return l.strictSchema===!1?$t.nil:(0,$t._)`${i} && !${g}`}function b(){const k=d.$async?(0,$t._)`(${m}.async ? await ${g}(${r}) : ${g}(${r}))`:(0,$t._)`${g}(${r})`,S=(0,$t._)`(typeof ${g} == "function" ? ${k} : ${g}.test(${r}))`;return(0,$t._)`${g} && ${g} !== true && ${x} === ${t} && !${S}`}}function h(){const y=f.formats[s];if(!y){v();return}if(y===!0)return;const[m,x,g]=b(y);m===t&&e.pass(k());function v(){if(l.strictSchema===!1){f.logger.warn(S());return}throw new Error(S());function S(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function b(S){const E=S instanceof RegExp?(0,$t.regexpCode)(S):l.code.formats?(0,$t._)`${l.code.formats}${(0,$t.getProperty)(s)}`:void 0,P=n.scopeValue("formats",{key:s,ref:S,code:E});return typeof S=="object"&&!(S instanceof RegExp)?[S.type||"string",S.validate,(0,$t._)`${P}.validate`]:["string",S,P]}function k(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!d.$async)throw new Error("async format in sync schema");return(0,$t._)`await ${g}(${r})`}return typeof x=="function"?(0,$t._)`${g}(${r})`:(0,$t._)`${g}.test(${r})`}}}};hw.default=YX;Object.defineProperty(fw,"__esModule",{value:!0});const XX=hw,eee=[XX.default];fw.default=eee;var il={};Object.defineProperty(il,"__esModule",{value:!0});il.contentVocabulary=il.metadataVocabulary=void 0;il.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];il.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];Object.defineProperty(Lx,"__esModule",{value:!0});const tee=zx,nee=Ux,ree=Xx,oee=fw,P_=il,see=[tee.default,nee.default,(0,ree.default)(),oee.default,P_.metadataVocabulary,P_.contentVocabulary];Lx.default=see;var pw={},lp={};Object.defineProperty(lp,"__esModule",{value:!0});lp.DiscrError=void 0;var T_;(function(e){e.Tag="tag",e.Mapping="mapping"})(T_||(lp.DiscrError=T_={}));Object.defineProperty(pw,"__esModule",{value:!0});const na=Le,Ky=lp,$_=On,iee=bl,aee=ge,lee={message:({params:{discrError:e,tagName:t}})=>e===Ky.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>(0,na._)`{error: ${e}, tag: ${n}, tagValue: ${t}}`},cee={keyword:"discriminator",type:"object",schemaType:"object",error:lee,code(e){const{gen:t,data:n,schema:r,parentSchema:o,it:s}=e,{oneOf:i}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=r.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(r.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");const l=t.let("valid",!1),u=t.const("tag",(0,na._)`${n}${(0,na.getProperty)(a)}`);t.if((0,na._)`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:Ky.DiscrError.Tag,tag:u,tagName:a})),e.ok(l);function d(){const h=p();t.if(!1);for(const y in h)t.elseIf((0,na._)`${u} === ${y}`),t.assign(l,f(h[y]));t.else(),e.error(!1,{discrError:Ky.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function f(h){const y=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:h},y);return e.mergeEvaluated(m,na.Name),y}function p(){var h;const y={},m=g(o);let x=!0;for(let k=0;k<i.length;k++){let S=i[k];if(S!=null&&S.$ref&&!(0,aee.schemaHasRulesButRef)(S,s.self.RULES)){const P=S.$ref;if(S=$_.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,P),S instanceof $_.SchemaEnv&&(S=S.schema),S===void 0)throw new iee.default(s.opts.uriResolver,s.baseId,P)}const E=(h=S==null?void 0:S.properties)===null||h===void 0?void 0:h[a];if(typeof E!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);x=x&&(m||g(S)),v(E,k)}if(!x)throw new Error(`discriminator: "${a}" must be required`);return y;function g({required:k}){return Array.isArray(k)&&k.includes(a)}function v(k,S){if(k.const)b(k.const,S);else if(k.enum)for(const E of k.enum)b(E,S);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function b(k,S){if(typeof k!="string"||k in y)throw new Error(`discriminator: "${a}" values must be unique strings`);y[k]=S}}}};pw.default=cee;const uee="http://json-schema.org/draft-07/schema#",dee="http://json-schema.org/draft-07/schema#",fee="Core schema meta-schema",hee={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:[]}},pee=["object","boolean"],mee={$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:"#"}},gee={$schema:uee,$id:dee,title:fee,definitions:hee,type:pee,properties:mee,default:!0};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=P$,r=Lx,o=pw,s=gee,i=["/properties"],a="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(y=>this.addVocabulary(y)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const y=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(y,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=rp();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=Le;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=Su;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=bl;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})(Fy,Fy.exports);var uR=Fy.exports;const yee=al(uR);var Zy={exports:{}},dR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,I){return{validate:j,compare:I}}e.fullFormats={date:t(s,i),time:t(l(!0),u),"date-time":t(p(!0),h),"iso-time":t(l(),d),"iso-date-time":t(p(),y),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:g,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:$,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:b,int32:{type:"number",validate:E},int64:{type:"number",validate:P},float:{type:"number",validate:O},double:{type:"number",validate:O},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,y),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(j){return j%4===0&&(j%100!==0||j%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(j){const I=r.exec(j);if(!I)return!1;const D=+I[1],L=+I[2],T=+I[3];return L>=1&&L<=12&&T>=1&&T<=(L===2&&n(D)?29:o[L])}function i(j,I){if(j&&I)return j>I?1:j<I?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function l(j){return function(D){const L=a.exec(D);if(!L)return!1;const T=+L[1],Q=+L[2],X=+L[3],M=L[4],K=L[5]==="-"?-1:1,N=+(L[6]||0),z=+(L[7]||0);if(N>23||z>59||j&&!M)return!1;if(T<=23&&Q<=59&&X<60)return!0;const W=Q-z*K,_=T-N*K-(W<0?1:0);return(_===23||_===-1)&&(W===59||W===-1)&&X<61}}function u(j,I){if(!(j&&I))return;const D=new Date("2020-01-01T"+j).valueOf(),L=new Date("2020-01-01T"+I).valueOf();if(D&&L)return D-L}function d(j,I){if(!(j&&I))return;const D=a.exec(j),L=a.exec(I);if(D&&L)return j=D[1]+D[2]+D[3],I=L[1]+L[2]+L[3],j>I?1:j<I?-1:0}const f=/t|\s/i;function p(j){const I=l(j);return function(L){const T=L.split(f);return T.length===2&&s(T[0])&&I(T[1])}}function h(j,I){if(!(j&&I))return;const D=new Date(j).valueOf(),L=new Date(I).valueOf();if(D&&L)return D-L}function y(j,I){if(!(j&&I))return;const[D,L]=j.split(f),[T,Q]=I.split(f),X=i(D,T);if(X!==void 0)return X||u(L,Q)}const m=/\/|:/,x=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function g(j){return m.test(j)&&x.test(j)}const v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function b(j){return v.lastIndex=0,v.test(j)}const k=-2147483648,S=2**31-1;function E(j){return Number.isInteger(j)&&j<=S&&j>=k}function P(j){return Number.isInteger(j)}function O(){return!0}const R=/[^\\]\\Z/;function $(j){if(R.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(dR);var fR={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=uR,n=Le,r=n.operators,o={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:a,schemaCode:l})=>(0,n.str)`should be ${o[a].okStr} ${l}`,params:({keyword:a,schemaCode:l})=>(0,n._)`{comparison: ${o[a].okStr}, limit: ${l}}`};e.formatLimitDefinition={keyword:Object.keys(o),type:"string",schemaType:"string",$data:!0,error:s,code(a){const{gen:l,data:u,schemaCode:d,keyword:f,it:p}=a,{opts:h,self:y}=p;if(!h.validateFormats)return;const m=new t.KeywordCxt(p,y.RULES.all.format.definition,"format");m.$data?x():g();function x(){const b=l.scopeValue("formats",{ref:y.formats,code:h.code.formats}),k=l.const("fmt",(0,n._)`${b}[${m.schemaCode}]`);a.fail$data((0,n.or)((0,n._)`typeof ${k} != "object"`,(0,n._)`${k} instanceof RegExp`,(0,n._)`typeof ${k}.compare != "function"`,v(k)))}function g(){const b=m.schema,k=y.formats[b];if(!k||k===!0)return;if(typeof k!="object"||k instanceof RegExp||typeof k.compare!="function")throw new Error(`"${f}": format "${b}" does not define "compare" function`);const S=l.scopeValue("formats",{key:b,ref:k,code:h.code.formats?(0,n._)`${h.code.formats}${(0,n.getProperty)(b)}`:void 0});a.fail$data(v(S))}function v(b){return(0,n._)`${b}.compare(${u}, ${d}) ${o[f].fail} 0`}},dependencies:["format"]};const i=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i})(fR);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=dR,r=fR,o=Le,s=new o.Name("fullFormats"),i=new o.Name("fastFormats"),a=(u,d={keywords:!0})=>{if(Array.isArray(d))return l(u,d,n.fullFormats,s),u;const[f,p]=d.mode==="fast"?[n.fastFormats,i]:[n.fullFormats,s],h=d.formats||n.formatNames;return l(u,h,f,p),d.keywords&&(0,r.default)(u),u};a.get=(u,d="full")=>{const p=(d==="fast"?n.fastFormats:n.fullFormats)[u];if(!p)throw new Error(`Unknown format "${u}"`);return p};function l(u,d,f,p){var h,y;(h=(y=u.opts.code).formats)!==null&&h!==void 0||(y.formats=(0,o._)`require("ajv-formats/dist/formats").${p}`);for(const m of d)u.addFormat(m,f[m])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(Zy,Zy.exports);var vee=Zy.exports;const xee=al(vee);function wee(){const e=new yee({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return xee(e),e}class bee{constructor(t){this._ajv=t??wee()}getValidator(t){const n="$id"in t&&typeof t.$id=="string"?this._ajv.getSchema(t.$id)??this._ajv.compile(t):this._ajv.compile(t);return r=>n(r)?{valid:!0,data:r,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(n.errors)}}}class kee{constructor(t){this._client=t}async*callToolStream(t,n=ku,r){const o=this._client,s={...r,task:(r==null?void 0:r.task)??(o.isToolTask(t.name)?{}:void 0)},i=o.requestStream({method:"tools/call",params:t},n,s),a=o.getToolOutputValidator(t.name);for await(const l of i){if(l.type==="result"&&a){const u=l.result;if(!u.structuredContent&&!u.isError){yield{type:"error",error:new je(Ie.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`)};return}if(u.structuredContent)try{const d=a(u.structuredContent);if(!d.valid){yield{type:"error",error:new je(Ie.InvalidParams,`Structured content does not match the tool's output schema: ${d.errorMessage}`)};return}}catch(d){if(d instanceof je){yield{type:"error",error:d};return}yield{type:"error",error:new je(Ie.InvalidParams,`Failed to validate structured content: ${d instanceof Error?d.message:String(d)}`)};return}}yield l}}async getTask(t,n){return this._client.getTask({taskId:t},n)}async getTaskResult(t,n,r){return this._client.getTaskResult({taskId:t},n,r)}async listTasks(t,n){return this._client.listTasks(t?{cursor:t}:void 0,n)}async cancelTask(t,n){return this._client.cancelTask({taskId:t},n)}requestStream(t,n,r){return this._client.requestStream(t,n,r)}}function _ee(e,t,n){var r;if(!e)throw new Error(`${n} does not support task creation (required for ${t})`);switch(t){case"tools/call":if(!((r=e.tools)!=null&&r.call))throw new Error(`${n} does not support task creation for tools/call (required for ${t})`);break}}function See(e,t,n){var r,o;if(!e)throw new Error(`${n} does not support task creation (required for ${t})`);switch(t){case"sampling/createMessage":if(!((r=e.sampling)!=null&&r.createMessage))throw new Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case"elicitation/create":if(!((o=e.elicitation)!=null&&o.create))throw new Error(`${n} does not support task creation for elicitation/create (required for ${t})`);break}}function Gd(e,t){if(!(!e||t===null||typeof t!="object")){if(e.type==="object"&&e.properties&&typeof e.properties=="object"){const n=t,r=e.properties;for(const o of Object.keys(r)){const s=r[o];n[o]===void 0&&Object.prototype.hasOwnProperty.call(s,"default")&&(n[o]=s.default),n[o]!==void 0&&Gd(s,n[o])}}if(Array.isArray(e.anyOf))for(const n of e.anyOf)typeof n!="boolean"&&Gd(n,t);if(Array.isArray(e.oneOf))for(const n of e.oneOf)typeof n!="boolean"&&Gd(n,t)}}function Cee(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};const t=e.form!==void 0,n=e.url!==void 0;return{supportsFormMode:t||!t&&!n,supportsUrlMode:n}}class Eee extends uG{constructor(t,n){super(n),this._clientInfo=t,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=(n==null?void 0:n.capabilities)??{},this._jsonSchemaValidator=(n==null?void 0:n.jsonSchemaValidator)??new bee,n!=null&&n.listChanged&&(this._pendingListChangedConfig=n.listChanged)}_setupListChangedHandlers(t){var n,r,o,s,i,a;t.tools&&((r=(n=this._serverCapabilities)==null?void 0:n.tools)!=null&&r.listChanged)&&this._setupListChangedHandler("tools",f$,t.tools,async()=>(await this.listTools()).tools),t.prompts&&((s=(o=this._serverCapabilities)==null?void 0:o.prompts)!=null&&s.listChanged)&&this._setupListChangedHandler("prompts",u$,t.prompts,async()=>(await this.listPrompts()).prompts),t.resources&&((a=(i=this._serverCapabilities)==null?void 0:i.resources)!=null&&a.listChanged)&&this._setupListChangedHandler("resources",c$,t.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new kee(this)}),this._experimental}registerCapabilities(t){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=dG(this._capabilities,t)}setRequestHandler(t,n){var a;const r=j$(t),o=r==null?void 0:r.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(np(o)){const l=o,u=(a=l._zod)==null?void 0:a.def;s=(u==null?void 0:u.value)??l.value}else{const l=o,u=l._def;s=(u==null?void 0:u.value)??l.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");const i=s;if(i==="elicitation/create"){const l=async(u,d)=>{var b,k;const f=ts(y$,u);if(!f.success){const S=f.error instanceof Error?f.error.message:String(f.error);throw new je(Ie.InvalidParams,`Invalid elicitation request: ${S}`)}const{params:p}=f.data;p.mode=p.mode??"form";const{supportsFormMode:h,supportsUrlMode:y}=Cee(this._capabilities.elicitation);if(p.mode==="form"&&!h)throw new je(Ie.InvalidParams,"Client does not support form-mode elicitation requests");if(p.mode==="url"&&!y)throw new je(Ie.InvalidParams,"Client does not support URL-mode elicitation requests");const m=await Promise.resolve(n(u,d));if(p.task){const S=ts(Bc,m);if(!S.success){const E=S.error instanceof Error?S.error.message:String(S.error);throw new je(Ie.InvalidParams,`Invalid task creation result: ${E}`)}return S.data}const x=ts(v$,m);if(!x.success){const S=x.error instanceof Error?x.error.message:String(x.error);throw new je(Ie.InvalidParams,`Invalid elicitation result: ${S}`)}const g=x.data,v=p.mode==="form"?p.requestedSchema:void 0;if(p.mode==="form"&&g.action==="accept"&&g.content&&v&&(k=(b=this._capabilities.elicitation)==null?void 0:b.form)!=null&&k.applyDefaults)try{Gd(v,g.content)}catch{}return g};return super.setRequestHandler(t,l)}if(i==="sampling/createMessage"){const l=async(u,d)=>{const f=ts(p$,u);if(!f.success){const g=f.error instanceof Error?f.error.message:String(f.error);throw new je(Ie.InvalidParams,`Invalid sampling request: ${g}`)}const{params:p}=f.data,h=await Promise.resolve(n(u,d));if(p.task){const g=ts(Bc,h);if(!g.success){const v=g.error instanceof Error?g.error.message:String(g.error);throw new je(Ie.InvalidParams,`Invalid task creation result: ${v}`)}return g.data}const m=p.tools||p.toolChoice?g$:m$,x=ts(m,h);if(!x.success){const g=x.error instanceof Error?x.error.message:String(x.error);throw new je(Ie.InvalidParams,`Invalid sampling result: ${g}`)}return x.data};return super.setRequestHandler(t,l)}return super.setRequestHandler(t,n)}assertCapability(t,n){var r;if(!((r=this._serverCapabilities)!=null&&r[t]))throw new Error(`Server does not support ${t} (required for ${n})`)}async connect(t,n){if(await super.connect(t),t.sessionId===void 0)try{const r=await this.request({method:"initialize",params:{protocolVersion:Xh,capabilities:this._capabilities,clientInfo:this._clientInfo}},n$,n);if(r===void 0)throw new Error(`Server sent invalid initialize result: ${r}`);if(!q7.includes(r.protocolVersion))throw new Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,t.setProtocolVersion&&t.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(r){throw this.close(),r}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(t){var n,r,o,s,i;switch(t){case"logging/setLevel":if(!((n=this._serverCapabilities)!=null&&n.logging))throw new Error(`Server does not support logging (required for ${t})`);break;case"prompts/get":case"prompts/list":if(!((r=this._serverCapabilities)!=null&&r.prompts))throw new Error(`Server does not support prompts (required for ${t})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!((o=this._serverCapabilities)!=null&&o.resources))throw new Error(`Server does not support resources (required for ${t})`);if(t==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${t})`);break;case"tools/call":case"tools/list":if(!((s=this._serverCapabilities)!=null&&s.tools))throw new Error(`Server does not support tools (required for ${t})`);break;case"completion/complete":if(!((i=this._serverCapabilities)!=null&&i.completions))throw new Error(`Server does not support completions (required for ${t})`);break}}assertNotificationCapability(t){var n;switch(t){case"notifications/roots/list_changed":if(!((n=this._capabilities.roots)!=null&&n.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${t})`);break}}assertRequestHandlerCapability(t){if(this._capabilities)switch(t){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${t})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${t})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${t})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${t})`);break}}assertTaskCapability(t){var n,r;_ee((r=(n=this._serverCapabilities)==null?void 0:n.tasks)==null?void 0:r.requests,t,"Server")}assertTaskHandlerCapability(t){var n;this._capabilities&&See((n=this._capabilities.tasks)==null?void 0:n.requests,t,"Client")}async ping(t){return this.request({method:"ping"},ga,t)}async complete(t,n){return this.request({method:"completion/complete",params:t},x$,n)}async setLoggingLevel(t,n){return this.request({method:"logging/setLevel",params:{level:t}},ga,n)}async getPrompt(t,n){return this.request({method:"prompts/get",params:t},bx,n)}async listPrompts(t,n){return this.request({method:"prompts/list",params:t},Kf,n)}async listResources(t,n){return this.request({method:"resources/list",params:t},Wf,n)}async listResourceTemplates(t,n){return this.request({method:"resources/templates/list",params:t},l$,n)}async readResource(t,n){return this.request({method:"resources/read",params:t},gx,n)}async subscribeResource(t,n){return this.request({method:"resources/subscribe",params:t},ga,n)}async unsubscribeResource(t,n){return this.request({method:"resources/unsubscribe",params:t},ga,n)}async callTool(t,n=ku,r){if(this.isToolTaskRequired(t.name))throw new je(Ie.InvalidRequest,`Tool "${t.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const o=await this.request({method:"tools/call",params:t},n,r),s=this.getToolOutputValidator(t.name);if(s){if(!o.structuredContent&&!o.isError)throw new je(Ie.InvalidRequest,`Tool ${t.name} has an output schema but did not return structured content`);if(o.structuredContent)try{const i=s(o.structuredContent);if(!i.valid)throw new je(Ie.InvalidParams,`Structured content does not match the tool's output schema: ${i.errorMessage}`)}catch(i){throw i instanceof je?i:new je(Ie.InvalidParams,`Failed to validate structured content: ${i instanceof Error?i.message:String(i)}`)}}return o}isToolTask(t){var n,r,o,s;return(s=(o=(r=(n=this._serverCapabilities)==null?void 0:n.tasks)==null?void 0:r.requests)==null?void 0:o.tools)!=null&&s.call?this._cachedKnownTaskTools.has(t):!1}isToolTaskRequired(t){return this._cachedRequiredTaskTools.has(t)}cacheToolMetadata(t){var n;this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const r of t){if(r.outputSchema){const s=this._jsonSchemaValidator.getValidator(r.outputSchema);this._cachedToolOutputValidators.set(r.name,s)}const o=(n=r.execution)==null?void 0:n.taskSupport;(o==="required"||o==="optional")&&this._cachedKnownTaskTools.add(r.name),o==="required"&&this._cachedRequiredTaskTools.add(r.name)}}getToolOutputValidator(t){return this._cachedToolOutputValidators.get(t)}async listTools(t,n){const r=await this.request({method:"tools/list",params:t},kx,n);return this.cacheToolMetadata(r.tools),r}_setupListChangedHandler(t,n,r,o){const s=MZ.safeParse(r);if(!s.success)throw new Error(`Invalid ${t} listChanged options: ${s.error.message}`);if(typeof r.onChanged!="function")throw new Error(`Invalid ${t} listChanged options: onChanged must be a function`);const{autoRefresh:i,debounceMs:a}=s.data,{onChanged:l}=r,u=async()=>{if(!i){l(null,null);return}try{const f=await o();l(null,f)}catch(f){const p=f instanceof Error?f:new Error(String(f));l(p,null)}},d=()=>{if(a){const f=this._listChangedDebounceTimers.get(t);f&&clearTimeout(f);const p=setTimeout(u,a);this._listChangedDebounceTimers.set(t,p)}else u()};this.setNotificationHandler(n,d)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}function Fl(e,t){if(!e)throw new Error(t)}var R_=3e3,Nee=5e3,Pm=5*60*1e3;function jee(e){const{url:t,clientName:n,clientUri:r,callbackUrl:o=typeof window<"u"?ma(new URL("/oauth/callback",window.location.origin).toString()):"/oauth/callback",storageKeyPrefix:s="mcp:auth",clientConfig:i={},customHeaders:a={},autoRetry:l=!1,autoReconnect:u=R_,transportType:d="auto",preventAutoAuth:f=!1,onPopupWindow:p}=e,[h,y]=w.useState("discovering"),[m,x]=w.useState([]),[g,v]=w.useState([]),[b,k]=w.useState([]),[S,E]=w.useState([]),[P,O]=w.useState(void 0),[R,$]=w.useState([]),[j,I]=w.useState(void 0),D=w.useRef(null),L=w.useRef(null),T=w.useRef(null),Q=w.useRef(!1),X=w.useRef(!0),M=w.useRef(0),K=w.useRef(null),N=w.useRef(h),z=w.useRef(u),W=w.useRef(null);w.useEffect(()=>{N.current=h,z.current=u},[h,u]);const _=w.useCallback((B,ne,...re)=>{const Te=re.length>0?`${ne} ${re.map(ce=>JSON.stringify(ce)).join(" ")}`:ne;console[B](`[useMcp] ${Te}`),X.current&&$(ce=>[...ce.slice(-100),{level:B,message:Te,timestamp:Date.now()}])},[]),C=w.useCallback(async(B=!1)=>{B||_("info","Disconnecting..."),Q.current=!1,K.current&&clearTimeout(K.current),K.current=null;const ne=L.current;if(D.current=null,L.current=null,X.current&&!B&&(y("discovering"),x([]),v([]),k([]),E([]),O(void 0),I(void 0)),ne)try{await ne.close(),B||_("debug","Transport closed")}catch(re){B||_("warn","Error closing transport:",re)}},[_]),A=w.useCallback((B,ne)=>{var re;if(_("error",B,ne??""),X.current){y("failed"),O(B);const Te=(re=T.current)==null?void 0:re.getLastAttemptedAuthUrl();Te&&(I(Te),_("info","Manual authentication URL may be available.",Te))}Q.current=!1},[_]),F=w.useCallback(async()=>{if(Q.current){_("debug","Connection attempt already in progress.");return}if(!X.current){_("debug","Connect called after unmount, aborting.");return}Q.current=!0,M.current+=1,O(void 0),I(void 0),W.current=null,y("discovering"),_("info",`Connecting attempt #${M.current} to ${t}...`),T.current||(T.current=new I1(t,{storageKeyPrefix:s,clientName:n,clientUri:r,callbackUrl:o,preventAutoAuth:f,onPopupWindow:p}),_("debug","BrowserOAuthClientProvider initialized in connect.")),D.current||(D.current=new Eee({name:i.name||"use-mcp-react-client",version:i.version||"0.1.0"},{capabilities:{}}),_("debug","MCP Client initialized in connect."));const B=async re=>{_("info",`Attempting connection with ${re.toUpperCase()} transport...`),N.current!=="authenticating"&&y("connecting");let Te;try{Fl(T.current,"Auth Provider must be initialized"),Fl(D.current,"Client must be initialized"),L.current&&(await L.current.close().catch(rt=>_("warn",`Error closing previous transport: ${rt.message}`)),L.current=null);const ce={authProvider:T.current,requestInit:{headers:{Accept:"application/json, text/event-stream",...a}}},ke=ma(t),Ne=new URL(ke);_("debug",`Creating ${re.toUpperCase()} transport for URL: ${Ne.toString()}`),_("debug","Transport options:",{authProvider:!!T.current,headers:a,url:Ne.toString()}),re==="http"?(_("debug","Creating StreamableHTTPClientTransport..."),Te=new aG(Ne,ce),_("debug","StreamableHTTPClientTransport created successfully")):(_("debug","Creating SSEClientTransport..."),Te=new oG(Ne,ce),_("debug","SSEClientTransport created successfully")),L.current=Te,_("debug",`${re.toUpperCase()} transport created and assigned to ref.`)}catch(ce){return A(`Failed to create ${re.toUpperCase()} transport: ${ce instanceof Error?ce.message:String(ce)}`,ce instanceof Error?ce:void 0),"failed"}Te.onmessage=ce=>{var ke,Ne;_("debug",`[Transport] Received: ${JSON.stringify(ce)}`),(Ne=(ke=D.current)==null?void 0:ke.handleMessage)==null||Ne.call(ke,ce)},Te.onerror=ce=>{_("warn",`Transport error event (${re.toUpperCase()}):`,ce),_("debug","Error details:",{message:ce.message,stack:ce.stack,name:ce.name,cause:ce.cause}),A(`Transport error (${re.toUpperCase()}): ${ce.message}`,ce)},Te.onclose=()=>{if(!X.current||Q.current)return;_("info",`Transport connection closed (${W.current||"unknown"} type).`);const ce=N.current,ke=z.current;if(ce==="ready"&&ke){const Ne=typeof ke=="number"?ke:R_;_("info",`Attempting to reconnect in ${Ne}ms...`),y("connecting"),setTimeout(()=>{X.current&&F()},Ne)}else ce!=="failed"&&ce!=="authenticating"&&A("Connection closed unexpectedly.")};try{_("info",`Connecting client via ${re.toUpperCase()}...`),_("debug","About to call client.connect() with transport instance"),_("debug",`Transport instance type: ${Te.constructor.name}`),await D.current.connect(Te),_("info",`Client connected via ${re.toUpperCase()}. Loading tools, resources, and prompts...`),W.current=re,y("loading");const ce=await D.current.request({method:"tools/list"},kx);let ke={resources:[],resourceTemplates:[]};try{ke=await D.current.request({method:"resources/list"},Wf)}catch(rt){_("debug","Server does not support resources/list method",rt)}let Ne={prompts:[]};try{Ne=await D.current.request({method:"prompts/list"},Kf)}catch(rt){_("debug","Server does not support prompts/list method",rt)}if(X.current){x(ce.tools),v(ke.resources),k(Array.isArray(ke.resourceTemplates)?ke.resourceTemplates:[]),E(Ne.prompts);const rt=[`Loaded ${ce.tools.length} tools`];return(ke.resources.length>0||ke.resourceTemplates&&ke.resourceTemplates.length>0)&&(rt.push(`${ke.resources.length} resources`),Array.isArray(ke.resourceTemplates)&&ke.resourceTemplates.length>0&&rt.push(`${ke.resourceTemplates.length} resource templates`)),Ne.prompts.length>0&&rt.push(`${Ne.prompts.length} prompts`),_("info",rt.join(", ")+"."),y("ready"),M.current=0,"success"}else return"failed"}catch(ce){_("debug",`Client connect error via ${re.toUpperCase()}:`,ce),_("debug","Connect error details:",{message:ce instanceof Error?ce.message:String(ce),stack:ce instanceof Error?ce.stack:"N/A",name:ce instanceof Error?ce.name:"Unknown",cause:ce instanceof Error?ce.cause:void 0});const ke=ce instanceof Error?ce:new Error(String(ce)),Ne=ke.message,rt=Ne.includes("404")||Ne.includes("Not Found"),Tt=Ne.includes("405")||Ne.includes("Method Not Allowed"),it=Ne==="Failed to fetch"||Ne==="NetworkError when attempting to fetch resource."||Ne==="Load failed";if(re==="http"&&(rt||Tt||it))return _("warn",`HTTP transport failed (${it?"CORS":rt?"404":"405"}).`),"fallback";if(ke instanceof Wn||Ne.includes("Unauthorized")||Ne.includes("401")){_("info","Authentication required."),Fl(T.current,"Auth Provider not available for auth flow");const qn=await T.current.tokens();if(f&&!qn)return _("info","Authentication required but auto-auth prevented. User action needed."),y("pending_auth"),"auth_redirect";N.current!=="authenticating"&&N.current!=="pending_auth"&&(y("authenticating"),K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{},Pm));try{const G=await $r(T.current,{serverUrl:t});if(!X.current)return"failed";if(G==="AUTHORIZED")return _("info","Authentication successful via existing token or refresh. Re-attempting connection..."),K.current&&clearTimeout(K.current),Q.current=!1,F(),"failed";if(G==="REDIRECT")return _("info","Redirecting for authentication. Waiting for callback..."),"auth_redirect"}catch(G){return X.current&&(K.current&&clearTimeout(K.current),A(`Failed to initiate authentication: ${G instanceof Error?G.message:String(G)}`,G instanceof Error?G:void 0)),"failed"}}return A(`Failed to connect via ${re.toUpperCase()}: ${Ne}`,ke),"failed"}};let ne="failed";if(console.log({transportType:d}),d==="sse")_("debug","Using SSE-only transport mode"),ne=await B("sse");else if(d==="http")_("debug","Using HTTP-only transport mode"),ne=await B("http");else{_("debug","Using auto transport mode (HTTP with SSE fallback)");const re=await B("http");if(re==="fallback"&&X.current&&N.current!=="authenticating"){_("info","HTTP failed, attempting SSE fallback...");const Te=await B("sse");ne=Te,Te==="failed"&&X.current}else ne=re}(ne==="success"||ne==="failed")&&(Q.current=!1),_("debug",`Connection sequence finished with status: ${ne}`)},[_,A,C,$r,t,s,n,r,o,i.name,i.version]),Z=w.useCallback(async(B,ne)=>{if(N.current!=="ready"||!D.current)throw new Error(`MCP client is not ready (current state: ${h}). Cannot call tool "${B}".`);_("info",`Calling tool: ${B}`,ne);try{const re=await D.current.request({method:"tools/call",params:{name:B,arguments:ne}},ku);return _("info",`Tool "${B}" call successful:`,re),re}catch(re){_("error",`Error calling tool "${B}": ${re instanceof Error?re.message:String(re)}`,re);const Te=re instanceof Error?re:new Error(String(re));if(Te instanceof Wn||Te.message.includes("Unauthorized")||Te.message.includes("401")){_("warn","Tool call unauthorized, attempting re-authentication..."),y("authenticating"),K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{},Pm);try{Fl(T.current,"Auth Provider not available for tool re-auth");const ce=await $r(T.current,{serverUrl:t});if(!X.current)return;ce==="AUTHORIZED"?(_("info","Re-authentication successful. Retrying tool call is recommended, or reconnecting."),K.current&&clearTimeout(K.current),Q.current=!1,F()):ce==="REDIRECT"&&_("info","Redirecting for re-authentication for tool call.")}catch(ce){if(!X.current)return;K.current&&clearTimeout(K.current),A(`Re-authentication failed: ${ce instanceof Error?ce.message:String(ce)}`,ce instanceof Error?ce:void 0)}}if(N.current!=="authenticating")throw re;return}},[h,t,_,A,F]),Y=w.useCallback(()=>{N.current==="failed"?(_("info","Retry requested..."),F()):_("warn",`Retry called but state is not 'failed' (state: ${N.current}). Ignoring.`)},[_,F]),ae=w.useCallback(async()=>{var ne;_("info","Manual authentication requested...");const B=N.current;if(B==="failed")_("info","Attempting to reconnect and authenticate via retry..."),Y();else if(B==="pending_auth"){_("info","Proceeding with authentication from pending state..."),y("authenticating"),K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{},Pm);try{Fl(T.current,"Auth Provider not available for manual auth");const re=await $r(T.current,{serverUrl:t});if(!X.current)return;re==="AUTHORIZED"?(_("info","Manual authentication successful. Re-attempting connection..."),K.current&&clearTimeout(K.current),Q.current=!1,F()):re==="REDIRECT"&&_("info","Redirecting for manual authentication. Waiting for callback...")}catch(re){if(!X.current)return;K.current&&clearTimeout(K.current),A(`Manual authentication failed: ${re instanceof Error?re.message:String(re)}`,re instanceof Error?re:void 0)}}else if(B==="authenticating"){_("warn","Already attempting authentication. Check for blocked popups or wait for timeout.");const re=(ne=T.current)==null?void 0:ne.getLastAttemptedAuthUrl();re&&!j&&(I(re),_("info","Manual authentication URL retrieved:",re))}else _("info",`Client not in a state requiring manual authentication trigger (state: ${B}). If needed, try disconnecting and reconnecting.`)},[_,Y,j,t,A,F]),de=w.useCallback(()=>{if(T.current){const B=T.current.clearStorage();_("info",`Cleared ${B} item(s) from localStorage for ${t}.`),I(void 0),C()}else _("warn","Auth provider not initialized, cannot clear storage.")},[t,_,C]),U=w.useCallback(async()=>{if(N.current!=="ready"||!D.current)throw new Error(`MCP client is not ready (current state: ${h}). Cannot list resources.`);_("info","Listing resources...");try{const B=await D.current.request({method:"resources/list"},Wf);X.current&&(v(B.resources),k(Array.isArray(B.resourceTemplates)?B.resourceTemplates:[]),_("info",`Listed ${B.resources.length} resources, ${Array.isArray(B.resourceTemplates)?B.resourceTemplates.length:0} resource templates.`))}catch(B){throw _("error",`Error listing resources: ${B instanceof Error?B.message:String(B)}`,B),B}},[h,_]),H=w.useCallback(async B=>{if(N.current!=="ready"||!D.current)throw new Error(`MCP client is not ready (current state: ${h}). Cannot read resource "${B}".`);_("info",`Reading resource: ${B}`);try{const ne=await D.current.request({method:"resources/read",params:{uri:B}},gx);return _("info",`Resource "${B}" read successfully`),ne}catch(ne){throw _("error",`Error reading resource "${B}": ${ne instanceof Error?ne.message:String(ne)}`,ne),ne}},[h,_]),J=w.useCallback(async()=>{if(N.current!=="ready"||!D.current)throw new Error(`MCP client is not ready (current state: ${h}). Cannot list prompts.`);_("info","Listing prompts...");try{const B=await D.current.request({method:"prompts/list"},Kf);X.current&&(E(B.prompts),_("info",`Listed ${B.prompts.length} prompts.`))}catch(B){throw _("error",`Error listing prompts: ${B instanceof Error?B.message:String(B)}`,B),B}},[h,_]),te=w.useCallback(async(B,ne)=>{if(N.current!=="ready"||!D.current)throw new Error(`MCP client is not ready (current state: ${h}). Cannot get prompt "${B}".`);_("info",`Getting prompt: ${B}`,ne);try{const re=await D.current.request({method:"prompts/get",params:{name:B,arguments:ne}},bx);return _("info",`Prompt "${B}" retrieved successfully`),re}catch(re){throw _("error",`Error getting prompt "${B}": ${re instanceof Error?re.message:String(re)}`,re),re}},[h,_]);return w.useEffect(()=>{const B=ne=>{var re;ne.origin===window.location.origin&&((re=ne.data)==null?void 0:re.type)==="mcp_auth_callback"&&(_("info","Received auth callback message.",ne.data),K.current&&clearTimeout(K.current),ne.data.success?(_("info","Authentication successful via popup. Reconnecting client..."),Q.current=!1,F()):A(`Authentication failed in callback: ${ne.data.error||"Unknown reason."}`))};return window.addEventListener("message",B),_("debug","Auth callback message listener added."),()=>{window.removeEventListener("message",B),_("debug","Auth callback message listener removed."),K.current&&clearTimeout(K.current)}},[_,A,F]),w.useEffect(()=>(X.current=!0,_("debug","useMcp mounted, initiating connection."),M.current=0,(!T.current||T.current.serverUrl!==t)&&(T.current=new I1(t,{storageKeyPrefix:s,clientName:n,clientUri:r,callbackUrl:o,preventAutoAuth:f,onPopupWindow:p}),_("debug","BrowserOAuthClientProvider initialized/updated on mount/option change.")),F(),()=>{X.current=!1,_("debug","useMcp unmounting, disconnecting."),C(!0)}),[t,s,o,n,r,i.name,i.version,F,C]),w.useEffect(()=>{let B=null;if(h==="failed"&&l&&M.current>0){const ne=typeof l=="number"?l:Nee;_("info",`Connection failed, auto-retrying in ${ne}ms...`),B=setTimeout(()=>{X.current&&N.current==="failed"&&Y()},ne)}return()=>{B&&clearTimeout(B)}},[h,l,Y,_]),{state:h,tools:m,resources:g,resourceTemplates:b,prompts:S,error:P,log:R,authUrl:j,callTool:Z,listResources:U,readResource:H,listPrompts:J,getPrompt:te,retry:Y,disconnect:C,authenticate:ae,clearStorage:de}}function Pee({service:e,autoConnect:t=!1,onConnected:n,onError:r}){const{toast:o}=qt(),{state:s,tools:i,resources:a,prompts:l,error:u,authUrl:d,callTool:f,readResource:p,listResources:h,getPrompt:y,listPrompts:m,retry:x,disconnect:g,authenticate:v,clearStorage:b}=jee({url:e.url,clientName:"AgentDeck",clientUri:window.location.origin,callbackUrl:`${window.location.origin}/oauth/callback`,storageKeyPrefix:`mcp:auth:${e.id}`,autoRetry:3,autoReconnect:5e3,transportType:"auto",preventAutoAuth:!t}),k=s==="ready",S=s==="connecting"||s==="loading",E=s==="authenticating"||s==="pending_auth",P=s==="failed";return Br.useEffect(()=>{k&&n&&(n(),o({title:"Connected to MCP service",description:`Successfully connected to ${e.name}`}))},[k,n,e.name,o]),Br.useEffect(()=>{P&&u&&r&&(r(u),o({title:"MCP connection failed",description:u,variant:"destructive"}))},[P,u,r,o]),{isConnected:k,isConnecting:S,isAuthenticating:E,hasError:P,error:u,tools:i,resources:a,prompts:l,connect:()=>{x()},disconnect:g,retry:x,authenticate:v,callTool:async(D,L)=>{try{return await f(D,L)}catch(T){const Q=T instanceof Error?T.message:"Unknown error";throw o({title:"Tool call failed",description:Q,variant:"destructive"}),T}},readResource:async D=>{try{return await p(D)}catch(L){const T=L instanceof Error?L.message:"Unknown error";throw o({title:"Resource read failed",description:T,variant:"destructive"}),L}},listResources:async()=>{try{await h()}catch(D){const L=D instanceof Error?D.message:"Unknown error";throw o({title:"Resource listing failed",description:L,variant:"destructive"}),D}},getPrompt:async(D,L)=>{try{return await y(D,L)}catch(T){const Q=T instanceof Error?T.message:"Unknown error";throw o({title:"Prompt retrieval failed",description:Q,variant:"destructive"}),T}},listPrompts:async()=>{try{await m()}catch(D){const L=D instanceof Error?D.message:"Unknown error";throw o({title:"Prompt listing failed",description:L,variant:"destructive"}),D}},authUrl:d,clearStorage:b}}function Tee(){const[e,t]=w.useState("https://api.githubcopilot.com/mcp"),[n,r]=w.useState("get_me"),[o,s]=w.useState("{}"),[i,a]=w.useState(""),l={id:"test-mcp-service",name:"Test MCP Service",url:e,registeredAt:new Date().toISOString(),updatedAt:new Date().toISOString()},{isConnected:u,isConnecting:d,isAuthenticating:f,hasError:p,error:h,tools:y,resources:m,prompts:x,connect:g,disconnect:v,retry:b,authenticate:k,callTool:S,authUrl:E,clearStorage:P}=Pee({service:l,autoConnect:!1,onConnected:()=>{console.log("Connected to test MCP service")},onError:j=>{console.error("Test MCP service error:",j)}}),R=d?{status:"connecting",icon:tk,color:"text-yellow-500"}:f?{status:"authenticating",icon:Ku,color:"text-blue-500"}:u?{status:"connected",icon:Fg,color:"text-green-500"}:p?{status:"error",icon:Xb,color:"text-red-500"}:{status:"disconnected",icon:Xb,color:"text-gray-500"},$=async()=>{try{let j={};o.trim()&&(j=JSON.parse(o));const I=await S(n,j);a(JSON.stringify(I,null,2))}catch(j){a(`Error: ${j instanceof Error?j.message:"Unknown error"}`)}};return c.jsxs("div",{className:"container mx-auto p-6 space-y-6",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"text-3xl font-bold mb-2",children:"use-mcp Integration Test"}),c.jsx("p",{className:"text-muted-foreground",children:"Testing the new use-mcp library integration with OAuth support"})]}),c.jsxs(Xo,{children:[c.jsxs(Gs,{children:[c.jsxs(Js,{className:"flex items-center gap-2",children:[c.jsx(R.icon,{className:`w-5 h-5 ${R.color}`}),"Connection Status: ",R.status]}),c.jsx(Ud,{children:"Current connection state and available actions"})]}),c.jsxs(es,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx(Be,{children:"Service URL"}),c.jsx(Je,{value:e,onChange:j=>t(j.target.value),placeholder:"Enter MCP service URL"})]}),c.jsxs("div",{className:"flex gap-2",children:[!u&&!d&&c.jsx(le,{onClick:g,children:"Connect"}),u&&c.jsx(le,{onClick:v,variant:"outline",children:"Disconnect"}),p&&c.jsxs(le,{onClick:b,variant:"outline",children:[c.jsx(tk,{className:"w-4 h-4 mr-1"}),"Retry"]}),E&&!u&&c.jsxs(le,{onClick:k,variant:"outline",children:[c.jsx(Ku,{className:"w-4 h-4 mr-1"}),"Authenticate"]})]})]}),h&&c.jsxs("div",{className:"flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-md",children:[c.jsx(uN,{className:"w-4 h-4 text-destructive"}),c.jsx("span",{className:"text-sm text-destructive",children:h})]})]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[c.jsxs(Xo,{children:[c.jsx(Gs,{children:c.jsxs(Js,{className:"flex items-center gap-2",children:[c.jsx(t0,{className:"w-4 h-4"}),"Tools (",y.length,")"]})}),c.jsx(es,{children:y.length===0?c.jsx("p",{className:"text-sm text-muted-foreground",children:u?"No tools available":"Connect to see tools"}):c.jsxs("div",{className:"space-y-2",children:[y.slice(0,5).map((j,I)=>c.jsx("div",{className:"text-sm",children:c.jsx(Yt,{variant:"outline",className:"text-xs",children:j.name})},I)),y.length>5&&c.jsxs("p",{className:"text-xs text-muted-foreground",children:["+",y.length-5," more tools"]})]})})]}),c.jsxs(Xo,{children:[c.jsx(Gs,{children:c.jsxs(Js,{children:["Resources (",m.length,")"]})}),c.jsx(es,{children:c.jsx("p",{className:"text-sm text-muted-foreground",children:u?`${m.length} resources available`:"Connect to see resources"})})]}),c.jsxs(Xo,{children:[c.jsx(Gs,{children:c.jsxs(Js,{children:["Prompts (",x.length,")"]})}),c.jsx(es,{children:c.jsx("p",{className:"text-sm text-muted-foreground",children:u?`${x.length} prompts available`:"Connect to see prompts"})})]})]}),u&&c.jsxs(Xo,{children:[c.jsxs(Gs,{children:[c.jsx(Js,{children:"Test Tool Call"}),c.jsx(Ud,{children:"Test calling a tool on the connected MCP service"})]}),c.jsxs(es,{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"toolName",children:"Tool Name"}),c.jsx(Je,{id:"toolName",value:n,onChange:j=>r(j.target.value),placeholder:"e.g., get_me"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{htmlFor:"toolArgs",children:"Arguments (JSON)"}),c.jsx(Je,{id:"toolArgs",value:o,onChange:j=>s(j.target.value),placeholder:'{"key": "value"}'})]})]}),c.jsxs(le,{onClick:$,disabled:!u,children:[c.jsx(l4,{className:"w-4 h-4 mr-1"}),"Call Tool"]}),i&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(Be,{children:"Result"}),c.jsx(ko,{value:i,readOnly:!0,rows:10,className:"font-mono text-sm"})]})]})]}),E&&c.jsxs(Xo,{children:[c.jsxs(Gs,{children:[c.jsxs(Js,{className:"flex items-center gap-2",children:[c.jsx(Ku,{className:"w-4 h-4"}),"OAuth Authentication"]}),c.jsx(Ud,{children:"This service requires OAuth authentication"})]}),c.jsxs(es,{className:"space-y-4",children:[c.jsx("div",{className:"p-3 bg-blue-50 border border-blue-200 rounded-md",children:c.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.'})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(le,{onClick:k,variant:"outline",children:[c.jsx(Ku,{className:"w-4 h-4 mr-1"}),"Start OAuth Flow"]}),c.jsx(le,{onClick:P,variant:"outline",children:"Clear OAuth Data"})]})]})]})]})}function hR(e){return e.before.title!==e.after.title||e.before.body!==e.after.body||e.before.triggers.join(`
476
- `)!==e.after.triggers.join(`
477
- `)}class $ee{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);const s=this.castInput(t,r),i=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),l=this.removeEmpty(this.tokenize(i,r));return this.diffWithOptionsObj(a,l,r,o)}diffWithOptionsObj(t,n,r,o){var s;const i=v=>{if(v=this.postProcess(v,r),o){setTimeout(function(){o(v)},0);return}else return v},a=n.length,l=t.length;let u=1,d=a+l;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const f=(s=r.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}];let y=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=l&&y+1>=a)return i(this.buildValues(h[0].lastComponent,n,t));let m=-1/0,x=1/0;const g=()=>{for(let v=Math.max(m,-u);v<=Math.min(x,u);v+=2){let b;const k=h[v-1],S=h[v+1];k&&(h[v-1]=void 0);let E=!1;if(S){const O=S.oldPos-v;E=S&&0<=O&&O<a}const P=k&&k.oldPos+1<l;if(!E&&!P){h[v]=void 0;continue}if(!P||E&&k.oldPos<S.oldPos?b=this.addToPath(S,!0,!1,0,r):b=this.addToPath(k,!1,!0,1,r),y=this.extractCommon(b,n,t,v,r),b.oldPos+1>=l&&y+1>=a)return i(this.buildValues(b.lastComponent,n,t))||!0;h[v]=b,b.oldPos+1>=l&&(x=Math.min(x,v-1)),y+1>=a&&(m=Math.max(m,v+1))}u++};if(o)(function v(){setTimeout(function(){if(u>d||Date.now()>p)return o(void 0);g()||v()},0)})();else for(;u<=d&&Date.now()<=p;){const v=g();if(v)return v}}addToPath(t,n,r,o,s){const i=t.lastComponent;return i&&!s.oneChangePerToken&&i.added===n&&i.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:i.count+1,added:n,removed:r,previousComponent:i.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:i}}}extractCommon(t,n,r,o,s){const i=n.length,a=r.length;let l=t.oldPos,u=l-o,d=0;for(;u+1<i&&l+1<a&&this.equals(r[l+1],n[u+1],s);)u++,l++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const o=[];let s;for(;t;)o.push(t),s=t.previousComponent,delete t.previousComponent,t=s;o.reverse();const i=o.length;let a=0,l=0,u=0;for(;a<i;a++){const d=o[a];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(l,l+d.count);f=f.map(function(p,h){const y=r[u+h];return y.length>p.length?y:p}),d.value=this.join(f)}else d.value=this.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}}return o}}class Ree extends $ee{constructor(){super(...arguments),this.tokenize=Oee}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
478
- `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
479
- `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
480
- `)&&(t=t.slice(0,-1)),n.endsWith(`
481
- `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const Iee=new Ree;function Aee(e,t,n){return Iee.diff(e,t,n)}function Oee(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
482
- `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let o=0;o<r.length;o++){const s=r[o];o%2&&!t.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}const Tm=3,Mee=10;function Dee(e){return e===""?[]:e.replace(/\n$/,"").split(`
483
- `)}function Lee(e,t){const n=Aee(e,t),r=[];let o=1,s=1;for(const i of n){const a=Dee(i.value);if(!i.added&&!i.removed&&a.length>=Mee){const u=a.slice(0,Tm),d=a.slice(-Tm),f=a.length-Tm*2;for(const p of u)r.push({kind:"unchanged",text:p,oldLine:o++,newLine:s++});f>0&&(r.push({kind:"ellipsis",text:`${f} unchanged lines`}),o+=f,s+=f);for(const p of d)r.push({kind:"unchanged",text:p,oldLine:o++,newLine:s++});continue}for(const u of a)i.added?r.push({kind:"added",text:u,newLine:s++}):i.removed?r.push({kind:"removed",text:u,oldLine:o++}):r.push({kind:"unchanged",text:u,oldLine:o++,newLine:s++})}return r}function zee(e){return e.some(t=>t.kind==="added"||t.kind==="removed")}const mw="max-w-full overflow-x-auto rounded-md border border-gray-800 bg-gray-950 font-mono text-xs leading-5";function Fee(e){switch(e){case"added":return"bg-emerald-950/70 text-emerald-100";case"removed":return"bg-rose-950/70 text-rose-100";case"ellipsis":return"bg-gray-900 text-gray-500 italic";default:return"bg-gray-950 text-gray-300"}}function Uee(e){switch(e){case"added":return"+";case"removed":return"-";case"ellipsis":return"…";default:return" "}}function qee({rows:e,emptyLabel:t}){return e.length===0?c.jsx("p",{className:"text-sm text-gray-500",children:t}):c.jsx("div",{className:mw,children:e.map((n,r)=>c.jsxs("div",{className:`grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] gap-0 ${Fee(n.kind)}`,children:[c.jsx("span",{className:"select-none border-r border-gray-800/80 px-2 py-0.5 text-right text-gray-600",children:n.oldLine??""}),c.jsx("span",{className:"select-none border-r border-gray-800/80 px-2 py-0.5 text-right text-gray-600",children:n.newLine??""}),c.jsxs("div",{className:"flex min-w-0 gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 select-none text-gray-500",children:Uee(n.kind)}),c.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-words",children:n.text||" "})]})]},`${n.kind}-${r}-${n.oldLine??""}-${n.newLine??""}`))})}function Vee({before:e,after:t}){const n=e.filter(o=>!t.includes(o)),r=t.filter(o=>!e.includes(o));return n.length===0&&r.length===0?null:c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium text-gray-400",children:"Triggers"}),c.jsxs("div",{className:`${mw} p-0`,children:[n.map(o=>c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-rose-950/70 text-rose-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"-"}),c.jsx("span",{children:o})]})]},`removed-${o}`)),r.map(o=>c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-emerald-950/70 text-emerald-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"+"}),c.jsx("span",{children:o})]})]},`added-${o}`))]})]})}function Hee({preview:e}){const t=hR(e),n=Lee(e.before.body,e.after.body),r=e.before.body.trim()!==e.after.body.trim()&&e.after.body.length>0&&!e.after.body.includes(e.before.body.slice(0,40))&&zee(n),o=e.before.title!==e.after.title,s=e.before.triggers.join(`
484
- `)!==e.after.triggers.join(`
485
- `);return c.jsxs("div",{className:"min-w-0 space-y-4",children:[!t&&c.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 text-sm text-amber-100",children:["No change detected — ops did not alter the playbook body or triggers. Reject this proposal and re-propose with a matching list anchor or ",c.jsx("code",{children:"rewrite_body"}),"."]}),r&&c.jsx("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 text-sm text-amber-100",children:"Full-body rewrite proposed — review carefully."}),o&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium text-gray-400",children:"Title"}),c.jsxs("div",{className:`${mw} p-0`,children:[e.before.title&&c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-rose-950/70 text-rose-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"-"}),c.jsx("span",{children:e.before.title})]})]}),e.after.title&&c.jsxs("div",{className:"grid min-w-0 grid-cols-[3rem_3rem_minmax(0,1fr)] bg-emerald-950/70 text-emerald-100",children:[c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsx("span",{className:"border-r border-gray-800/80 px-2 py-0.5"}),c.jsxs("div",{className:"flex gap-2 px-2 py-0.5",children:[c.jsx("span",{className:"w-3 shrink-0 text-gray-500",children:"+"}),c.jsx("span",{children:e.after.title})]})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-sm font-medium text-gray-400",children:"Body"}),c.jsx(qee,{rows:n,emptyLabel:"No body changes."})]}),s&&c.jsx(Vee,{before:e.before.triggers,after:e.after.triggers})]})}function Bee(e){if(!e)return[];try{return JSON.parse(e)}catch{return[]}}function Wee({conflicts:e,title:t="Trigger overlap warnings"}){return e.length===0?null:c.jsxs("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/10 p-4 text-sm text-amber-50",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-amber-200/90",children:t}),c.jsx("p",{className:"mt-2 text-amber-100/90",children:"These triggers overlap with other playbooks on the deck. Accept is still allowed — disambiguate triggers or propose a merge if the wrong playbook keeps firing."}),c.jsx("ul",{className:"mt-3 space-y-2",children:e.map(n=>c.jsxs("li",{className:"rounded border border-amber-500/20 bg-gray-950/60 p-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Yt,{variant:"outline",className:"border-amber-400/40 text-amber-100",children:n.level}),c.jsx("span",{className:"font-medium text-amber-50",children:n.otherPlaybookTitle}),c.jsx("span",{className:"font-mono text-xs text-amber-200/70",children:n.otherPlaybookId})]}),c.jsxs("p",{className:"mt-2 text-amber-100/90",children:[c.jsx("span",{className:"text-amber-200/80",children:"Candidate:"})," ",n.trigger]}),c.jsxs("p",{className:"text-amber-100/80",children:[c.jsx("span",{className:"text-amber-200/80",children:"Other:"})," ",n.otherTrigger]})]},`${n.trigger}-${n.otherPlaybookId}-${n.level}`))})]})}const vd=8,Kee=[{value:"proposed",label:"Waiting"},{value:"accepted",label:"Accepted"},{value:"rejected",label:"Rejected"},{value:"superseded",label:"Superseded"},{value:"stale",label:"Stale"},{value:"all",label:"All"}];function Zee(e){if(!e.evidenceJson)return null;try{return JSON.parse(e.evidenceJson)}catch{return null}}function I_(e){switch(e){case"proposed":return"border-blue-500/40 text-blue-200";case"accepted":return"border-emerald-500/40 text-emerald-200";case"rejected":return"border-rose-500/40 text-rose-200";case"superseded":return"border-violet-500/40 text-violet-200";case"stale":return"border-amber-500/40 text-amber-200"}}function Qee(){const[e,t]=w.useState(null),[n,r]=w.useState("proposed"),[o,s]=w.useState(0),{toast:i}=qt(),a=Kt();function l(j){t(j)}function u(j){r(j),s(0),t(null)}const{data:d=[]}=ut({queryKey:["/api/playbook-patches","proposed"],queryFn:()=>Yg("proposed")}),f=n==="all"?void 0:n,{data:p=[],isLoading:h}=ut({queryKey:["/api/playbook-patches",n],queryFn:()=>Yg(f)}),y=Math.max(1,Math.ceil(p.length/vd)),m=Math.min(o,y-1),x=w.useMemo(()=>{const j=m*vd;return p.slice(j,j+vd)},[p,m]);w.useEffect(()=>{o!==m&&s(m)},[o,m]);const{data:g,isLoading:v,isError:b,error:k}=ut({queryKey:["/api/playbook-patches",e,"preview"],queryFn:()=>o3(e),enabled:!!e}),S=g?hR(g):!1,E=p.find(j=>j.id===e)??null,P=(E==null?void 0:E.status)==="proposed",O=dt({mutationFn:j=>s3(j),onSuccess:()=>{i({title:"Patch accepted"}),t(null),a.invalidateQueries({queryKey:["/api/playbook-patches"]}),a.invalidateQueries({queryKey:["/api/playbooks"]}),a.invalidateQueries({queryKey:["/api/feedback-signals"]})},onError:j=>{i({title:"Accept failed",description:j.message,variant:"destructive"})}}),R=dt({mutationFn:j=>i3(j),onSuccess:()=>{i({title:"Patch rejected"}),t(null),a.invalidateQueries({queryKey:["/api/playbook-patches"]}),a.invalidateQueries({queryKey:["/api/feedback-signals"]})},onError:j=>{i({title:"Reject failed",description:j.message,variant:"destructive"})}}),$=n==="proposed"?"No proposals waiting for review.":n==="all"?"No playbook patches yet.":`No ${n} patches.`;return c.jsxs("div",{className:"flex h-dvh flex-col overflow-hidden bg-gray-950 text-gray-100",children:[c.jsx("header",{className:"shrink-0 border-b border-gray-800 px-4 py-4 sm:px-6",children:c.jsxs("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center gap-3",children:[c.jsx(Ya,{href:"/",children:c.jsxs(le,{variant:"ghost",size:"sm",className:"text-gray-300",children:[c.jsx(sN,{className:"mr-1 h-4 w-4"}),"Deck"]})}),c.jsx("h1",{className:"text-lg font-semibold",children:"Playbook review queue"}),c.jsxs(Yt,{variant:"secondary",children:[d.length," waiting"]}),c.jsx(Ya,{href:"/feedback-signals",className:"ml-auto text-sm hover:underline",style:{color:"#92E4DD"},children:"Feedback data →"})]})}),c.jsxs("main",{className:"mx-auto grid w-full max-w-7xl min-h-0 flex-1 gap-6 overflow-hidden px-4 py-6 sm:px-6 lg:grid-cols-[minmax(18rem,20rem)_minmax(0,1fr)] lg:items-stretch",children:[c.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col",children:[c.jsx("h2",{className:"mb-3 shrink-0 text-sm font-medium text-gray-400",children:"Proposals"}),c.jsx("div",{className:"mb-3 flex shrink-0 flex-wrap gap-1",children:Kee.map(({value:j,label:I})=>{const D=n===j;return c.jsx(le,{size:"sm",variant:D?"gold":"outline",className:D?void 0:"border-gray-600 bg-transparent text-gray-300 hover:bg-gray-800 hover:text-gray-100","aria-pressed":D,onClick:()=>u(j),children:I},j)})}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[h&&c.jsx("p",{className:"text-sm text-gray-500",children:"Loading…"}),!h&&p.length===0&&c.jsx("p",{className:"text-sm text-gray-500",children:$}),c.jsx("ul",{className:"space-y-2",children:x.map(j=>c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>l(j.id),className:`w-full rounded-lg border p-3 text-left transition ${e===j.id?"border-blue-500 bg-gray-900":"border-gray-800 bg-gray-900/50 hover:border-gray-700"}`,children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"block font-medium leading-snug",children:j.kind==="create"?`New: ${j.displayTitle}`:j.displayTitle}),j.playbookId&&j.kind!=="create"&&c.jsx("span",{className:"mt-0.5 block truncate font-mono text-xs text-gray-600",children:j.playbookId}),Pk(j.deckNames)&&c.jsxs("span",{className:"mt-1 block text-xs text-gray-500",children:["Decks: ",Pk(j.deckNames)]})]}),c.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[c.jsx(Yt,{variant:"outline",className:"shrink-0",children:j.kind}),n!=="proposed"&&c.jsx(Yt,{variant:"outline",className:`shrink-0 ${I_(j.status)}`,children:j.status})]})]}),c.jsx("p",{className:"mt-1 line-clamp-2 text-sm text-gray-400",children:j.rationale}),c.jsxs("p",{className:"mt-1 text-xs text-gray-600",children:[j.source," · ",new Date(j.createdAt).toLocaleString()]})]})},j.id))})]}),p.length>vd&&c.jsxs("div",{className:"mt-3 flex shrink-0 items-center justify-between gap-2 border-t border-gray-800 pt-3",children:[c.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"border-gray-600 bg-transparent text-gray-300 hover:bg-gray-800",disabled:m<=0,onClick:()=>s(j=>Math.max(0,j-1)),children:[c.jsx(lN,{className:"mr-1 h-4 w-4"}),"Newer"]}),c.jsxs("span",{className:"text-xs text-gray-500",children:[m+1," / ",y,c.jsxs("span",{className:"ml-1 text-gray-600",children:["(",p.length,")"]})]}),c.jsxs(le,{type:"button",size:"sm",variant:"outline",className:"border-gray-600 bg-transparent text-gray-300 hover:bg-gray-800",disabled:m>=y-1,onClick:()=>s(j=>Math.min(y-1,j+1)),children:["Older",c.jsx(cN,{className:"ml-1 h-4 w-4"})]})]})]}),c.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col overflow-hidden",children:[c.jsx("h2",{className:"mb-3 shrink-0 text-sm font-medium text-gray-400",children:"Detail"}),!E&&c.jsx("p",{className:"text-sm text-gray-500",children:"Select a proposal to preview the diff."}),E&&c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-gray-800 bg-gray-900/50",children:[c.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain p-4 sm:p-5",children:c.jsxs("div",{className:"min-w-0 space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Yt,{variant:"outline",className:I_(E.status),children:E.status}),E.resolvedAt&&c.jsxs("span",{className:"text-xs text-gray-500",children:["Resolved ",new Date(E.resolvedAt).toLocaleString()]})]}),c.jsx("p",{className:"text-sm leading-relaxed text-gray-300",children:E.rationale}),E.status==="rejected"&&E.rejectionReason&&c.jsxs("div",{className:"rounded-md border border-rose-500/40 bg-rose-500/10 p-3 text-sm text-rose-100",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-rose-300/80",children:"Rejection reason"}),c.jsx("p",{className:"mt-1",children:E.rejectionReason})]}),E.status==="superseded"&&E.supersededBy&&c.jsxs("div",{className:"rounded-md border border-violet-500/40 bg-violet-500/10 p-3 text-sm text-violet-100",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-violet-300/80",children:"Superseded by"}),c.jsx("button",{type:"button",className:"mt-1 font-mono text-sm underline-offset-2 hover:underline",onClick:()=>{const j=E.supersededBy;r("all"),s(0),l(j)},children:E.supersededBy})]}),(()=>{const j=Zee(E);return j?c.jsxs("div",{className:"rounded-md border border-gray-700 bg-gray-950 p-4 text-sm",children:[c.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:"Your correction"}),c.jsxs("p",{className:"mt-2 italic text-gray-200",children:["“",j.user_feedback_excerpt,"”"]}),j.failure_summary&&c.jsx("p",{className:"mt-2 text-gray-400",children:j.failure_summary})]}):null})(),(()=>{const j=Bee(E.conflictsJson),I=(g==null?void 0:g.trigger_conflicts)??[],D=I.length>0?I:j;return c.jsx(Wee,{conflicts:D})})(),v&&c.jsx("p",{className:"text-sm text-gray-500",children:"Loading preview…"}),b&&c.jsxs("div",{className:"rounded-md border border-rose-500/50 bg-rose-500/10 p-3 text-sm text-rose-100",children:["Preview failed —"," ",(k==null?void 0:k.message)??"could not apply ops to the current playbook.",P?" Reject and re-propose with exact list anchors or rewrite_body.":" Historical preview may be incomplete if the playbook changed."]}),g&&c.jsx(Hee,{preview:g}),E.status==="stale"&&c.jsx("p",{className:"text-sm text-amber-400",children:"Stale — playbook changed since proposal. Re-propose from a fresh session."})]})}),P?c.jsxs("div",{className:"relative z-10 shrink-0 space-y-3 border-t border-gray-800 bg-gray-950 p-4 shadow-[0_-16px_32px_rgba(0,0,0,0.55)] sm:p-5",children:[c.jsx("h3",{className:"text-sm font-medium text-gray-400",children:"Your decision"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(le,{variant:"gold",onClick:()=>O.mutate(E.id),disabled:O.isPending||b||!S,children:"Accept"}),c.jsx(le,{variant:"destructive",onClick:()=>R.mutate(E.id),disabled:R.isPending,children:"Reject"})]})]}):c.jsxs("div",{className:"shrink-0 border-t border-gray-800 bg-gray-950 px-4 py-3 text-sm text-gray-500 sm:px-5",children:["Read-only — already ",E.status,". Switch to Waiting to review open proposals."]})]})]})]})]})}const A_="border-[#C4B643] data-[state=checked]:bg-[#C4B643] data-[state=checked]:text-[#0A0A07] data-[state=indeterminate]:bg-[#C4B643] data-[state=indeterminate]:text-[#0A0A07]";function Gee(){const{toast:e}=qt(),t=Kt(),[n,r]=w.useState("open"),[o,s]=w.useState(""),[i,a]=w.useState(!1),[l,u]=w.useState(new Set),{data:d}=ut({queryKey:["/api/playbooks/vault"]}),f=(d==null?void 0:d.data)??[],p=w.useMemo(()=>{const P=new Map;for(const O of f)P.set(O.id,O.title);return P},[f]),h={status:n==="all"?void 0:n,playbookId:o||void 0,excludeInProposal:n==="open"?!i:void 0},{data:y=[],isLoading:m}=ut({queryKey:["/api/feedback-signals",h],queryFn:()=>l3(h)}),x=dt({mutationFn:P=>c3(P),onSuccess:P=>{e({title:`Discarded ${P.discarded} signal(s)`}),u(new Set),t.invalidateQueries({queryKey:["/api/feedback-signals"]})},onError:P=>{e({title:"Discard failed",description:P.message,variant:"destructive"})}}),g=P=>{u(O=>{const R=new Set(O);return R.has(P)?R.delete(P):R.add(P),R})},v=async()=>{const P=l.size>0?y.filter(O=>l.has(O.id)):y;if(P.length!==0){if(P.some(O=>!O.id)){e({title:"Copy blocked",description:"Every signal must include an id for tracking.",variant:"destructive"});return}try{await navigator.clipboard.writeText(f3(P)),e({title:"Copied curation prompt",description:`${P.length} signal id(s) included — paste into your IDE agent.`})}catch(O){e({title:"Copy failed",description:O instanceof Error?O.message:"Clipboard unavailable",variant:"destructive"})}}},b=[...l].filter(P=>{const O=y.find(R=>R.id===P);return(O==null?void 0:O.status)==="open"}),k=y.length>0&&y.every(P=>l.has(P.id)),S=y.some(P=>l.has(P.id)),E=()=>{if(k){u(new Set);return}u(new Set(y.map(P=>P.id)))};return c.jsxs("div",{className:"flex min-h-dvh flex-col bg-gray-950 text-gray-100",children:[c.jsx("header",{className:"shrink-0 border-b border-gray-800 px-4 py-4 sm:px-6",children:c.jsxs("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center gap-3",children:[c.jsx(Ya,{href:"/",children:c.jsxs(le,{variant:"ghost",size:"sm",className:"text-gray-300",children:[c.jsx(sN,{className:"mr-1 h-4 w-4"}),"Home"]})}),c.jsx("h1",{className:"text-lg font-semibold",children:"Feedback"}),c.jsx(Yt,{variant:"outline",children:y.length}),c.jsx(Ya,{href:"/playbook-patches",className:"ml-auto text-sm hover:underline",style:{color:"#92E4DD"},children:"Playbook proposals →"})]})}),c.jsxs("main",{className:"mx-auto w-full max-w-7xl flex-1 space-y-4 px-4 py-6 sm:px-6",children:[c.jsx("p",{className:"text-sm text-gray-400",children:"Durable correction data for playbook enhancement. Filter by playbook, copy rows (with ids) for an IDE agent to propose, then accept the proposal to mark feedback solved."}),c.jsxs("div",{className:"flex flex-wrap items-end gap-3 rounded-lg border border-gray-800 bg-gray-900/40 p-3",children:[c.jsxs("label",{className:"text-xs text-gray-500",children:["Playbook",c.jsxs("select",{className:"mt-1 block min-w-[12rem] rounded border border-gray-700 bg-gray-950 px-2 py-1.5 text-sm text-gray-100",value:o,onChange:P=>{s(P.target.value),u(new Set)},children:[c.jsx("option",{value:"",children:"All"}),f.map(P=>c.jsx("option",{value:P.id,children:P.title},P.id))]})]}),c.jsx("div",{className:"flex flex-wrap gap-1",children:[["open","Open"],["actioned","Actioned"],["discarded","Discarded"],["all","All"]].map(([P,O])=>{const R=n===P;return c.jsx(le,{size:"sm",variant:R?"gold":"outline",className:R?void 0:"border-gray-600 bg-transparent text-gray-300 hover:bg-gray-800 hover:text-gray-100","aria-pressed":R,onClick:()=>{r(P),u(new Set)},children:O},P)})}),n==="open"&&c.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-400",children:[c.jsx("input",{type:"checkbox",checked:i,onChange:P=>a(P.target.checked)}),"Include already in an open proposal"]}),c.jsxs("div",{className:"ml-auto flex flex-wrap gap-2",children:[c.jsxs(le,{size:"sm",variant:"outline",disabled:y.length===0,onClick:()=>void v(),children:[c.jsx(e0,{className:"mr-1 h-3.5 w-3.5"}),"Copy for agent",l.size>0?` (${l.size})`:""]}),c.jsxs(le,{size:"sm",variant:"destructive",disabled:b.length===0||x.isPending,onClick:()=>x.mutate(b),children:[c.jsx(iu,{className:"mr-1 h-3.5 w-3.5"}),"Discard selected"]})]})]}),m&&c.jsx("p",{className:"text-sm text-gray-500",children:"Loading…"}),!m&&y.length===0&&c.jsx("p",{className:"text-sm text-gray-500",children:"No signals match these filters."}),!m&&y.length>0&&c.jsx("div",{className:"overflow-x-auto rounded-lg border border-gray-800",children:c.jsxs("table",{className:"w-full min-w-[48rem] text-left text-sm",children:[c.jsx("thead",{className:"border-b border-gray-800 bg-gray-900/80 text-xs uppercase text-gray-500",children:c.jsxs("tr",{children:[c.jsx("th",{className:"w-10 px-3 py-2",children:c.jsx(Of,{checked:k?!0:S?"indeterminate":!1,onCheckedChange:E,"aria-label":"Select all visible signals",disabled:y.length===0,className:A_})}),c.jsx("th",{className:"px-3 py-2",children:"Excerpt"}),c.jsx("th",{className:"px-3 py-2",children:"Failure"}),c.jsx("th",{className:"px-3 py-2",children:"Playbook"}),c.jsx("th",{className:"px-3 py-2",children:"Source"}),c.jsx("th",{className:"px-3 py-2",children:"When"})]})}),c.jsx("tbody",{children:y.map(P=>{const O=u3(P);return c.jsxs("tr",{className:"border-b border-gray-800/80 align-top",children:[c.jsx("td",{className:"px-3 py-2",children:c.jsx(Of,{checked:l.has(P.id),onCheckedChange:()=>g(P.id),"aria-label":`Select ${P.id}`,className:A_})}),c.jsxs("td",{className:"px-3 py-2",children:[c.jsx("p",{className:"font-mono text-[11px] text-gray-600",children:P.id}),c.jsxs("p",{className:"text-gray-200",children:["“",P.userFeedbackExcerpt,"”"]}),O&&c.jsx(Yt,{variant:"outline",className:"mt-1 text-[10px]",children:"In proposal"})]}),c.jsx("td",{className:"px-3 py-2 text-gray-400",children:P.failureSummary}),c.jsx("td",{className:"px-3 py-2 text-gray-300",children:P.candidatePlaybookId?p.get(P.candidatePlaybookId)??P.candidatePlaybookId:"—"}),c.jsx("td",{className:"px-3 py-2 text-gray-500",children:P.source}),c.jsx("td",{className:"px-3 py-2 whitespace-nowrap text-gray-500",children:new Date(P.createdAt).toLocaleString()})]},P.id)})})]})})]})]})}function Jee(){return c.jsxs(xO,{children:[c.jsx(Vi,{path:"/",component:AH}),c.jsx(Vi,{path:"/oauth/callback",component:DH}),c.jsx(Vi,{path:"/playbook-patches",component:Qee}),c.jsx(Vi,{path:"/feedback-signals",component:Gee}),c.jsx(Vi,{path:"/mcp-test",component:Tee}),c.jsx(Vi,{component:MH})]})}function Yee(){return c.jsx(FO,{client:tM,children:c.jsxs(IL,{children:[c.jsx(Z4,{}),c.jsx(Jee,{})]})})}rE(document.getElementById("root")).render(c.jsx(w.StrictMode,{children:c.jsx(Yee,{})}));