UNPKG

@bobmatnyc/claude-pm-portfolio-manager

Version:

Claude PM Portfolio Management Dashboard - React-based monitoring and reporting for Claude PM managed projects

34 lines (31 loc) 274 kB
"use strict";var fa=Object.defineProperty;var pa=(s,t,r)=>t in s?fa(s,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[t]=r;var G=(s,t,r)=>(pa(s,typeof t!="symbol"?t+"":t,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react");require("react-dom");function ga(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>s[r]})}}return t.default=s,Object.freeze(t)}const S=ga(C);var Ft={exports:{}},Oe={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Cs;function ya(){if(Cs)return Oe;Cs=1;var s=C,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,n=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function i(o,c,d){var m,x={},y=null,f=null;d!==void 0&&(y=""+d),c.key!==void 0&&(y=""+c.key),c.ref!==void 0&&(f=c.ref);for(m in c)a.call(c,m)&&!l.hasOwnProperty(m)&&(x[m]=c[m]);if(o&&o.defaultProps)for(m in c=o.defaultProps,c)x[m]===void 0&&(x[m]=c[m]);return{$$typeof:t,type:o,key:y,ref:f,props:x,_owner:n.current}}return Oe.Fragment=r,Oe.jsx=i,Oe.jsxs=i,Oe}var Ie={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Rs;function va(){return Rs||(Rs=1,process.env.NODE_ENV!=="production"&&function(){var s=C,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),u=Symbol.iterator,b="@@iterator";function g(h){if(h===null||typeof h!="object")return null;var w=u&&h[u]||h[b];return typeof w=="function"?w:null}var v=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(h){{for(var w=arguments.length,P=new Array(w>1?w-1:0),A=1;A<w;A++)P[A-1]=arguments[A];j("error",h,P)}}function j(h,w,P){{var A=v.ReactDebugCurrentFrame,F=A.getStackAddendum();F!==""&&(w+="%s",P=P.concat([F]));var L=P.map(function(I){return String(I)});L.unshift("Warning: "+w),Function.prototype.apply.call(console[h],console,L)}}var N=!1,M=!1,R=!1,k=!1,E=!1,_;_=Symbol.for("react.module.reference");function $(h){return!!(typeof h=="string"||typeof h=="function"||h===a||h===l||E||h===n||h===d||h===m||k||h===f||N||M||R||typeof h=="object"&&h!==null&&(h.$$typeof===y||h.$$typeof===x||h.$$typeof===i||h.$$typeof===o||h.$$typeof===c||h.$$typeof===_||h.getModuleId!==void 0))}function X(h,w,P){var A=h.displayName;if(A)return A;var F=w.displayName||w.name||"";return F!==""?P+"("+F+")":P}function Ae(h){return h.displayName||"Context"}function K(h){if(h==null)return null;if(typeof h.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case a:return"Fragment";case r:return"Portal";case l:return"Profiler";case n:return"StrictMode";case d:return"Suspense";case m:return"SuspenseList"}if(typeof h=="object")switch(h.$$typeof){case o:var w=h;return Ae(w)+".Consumer";case i:var P=h;return Ae(P._context)+".Provider";case c:return X(h,h.render,"ForwardRef");case x:var A=h.displayName||null;return A!==null?A:K(h.type)||"Memo";case y:{var F=h,L=F._payload,I=F._init;try{return K(I(L))}catch{return null}}}return null}var de=Object.assign,De=0,is,ls,os,cs,ds,us,hs;function ms(){}ms.__reactDisabledLog=!0;function Vr(){{if(De===0){is=console.log,ls=console.info,os=console.warn,cs=console.error,ds=console.group,us=console.groupCollapsed,hs=console.groupEnd;var h={configurable:!0,enumerable:!0,value:ms,writable:!0};Object.defineProperties(console,{info:h,log:h,warn:h,error:h,group:h,groupCollapsed:h,groupEnd:h})}De++}}function Wr(){{if(De--,De===0){var h={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:de({},h,{value:is}),info:de({},h,{value:ls}),warn:de({},h,{value:os}),error:de({},h,{value:cs}),group:de({},h,{value:ds}),groupCollapsed:de({},h,{value:us}),groupEnd:de({},h,{value:hs})})}De<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Nt=v.ReactCurrentDispatcher,wt;function tt(h,w,P){{if(wt===void 0)try{throw Error()}catch(F){var A=F.stack.trim().match(/\n( *(at )?)/);wt=A&&A[1]||""}return` `+wt+h}}var St=!1,st;{var Br=typeof WeakMap=="function"?WeakMap:Map;st=new Br}function xs(h,w){if(!h||St)return"";{var P=st.get(h);if(P!==void 0)return P}var A;St=!0;var F=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var L;L=Nt.current,Nt.current=null,Vr();try{if(w){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(z){A=z}Reflect.construct(h,[],I)}else{try{I.call()}catch(z){A=z}h.call(I.prototype)}}else{try{throw Error()}catch(z){A=z}h()}}catch(z){if(z&&A&&typeof z.stack=="string"){for(var O=z.stack.split(` `),Q=A.stack.split(` `),q=O.length-1,V=Q.length-1;q>=1&&V>=0&&O[q]!==Q[V];)V--;for(;q>=1&&V>=0;q--,V--)if(O[q]!==Q[V]){if(q!==1||V!==1)do if(q--,V--,V<0||O[q]!==Q[V]){var Y=` `+O[q].replace(" at new "," at ");return h.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",h.displayName)),typeof h=="function"&&st.set(h,Y),Y}while(q>=1&&V>=0);break}}}finally{St=!1,Nt.current=L,Wr(),Error.prepareStackTrace=F}var be=h?h.displayName||h.name:"",ue=be?tt(be):"";return typeof h=="function"&&st.set(h,ue),ue}function Qr(h,w,P){return xs(h,!1)}function Kr(h){var w=h.prototype;return!!(w&&w.isReactComponent)}function rt(h,w,P){if(h==null)return"";if(typeof h=="function")return xs(h,Kr(h));if(typeof h=="string")return tt(h);switch(h){case d:return tt("Suspense");case m:return tt("SuspenseList")}if(typeof h=="object")switch(h.$$typeof){case c:return Qr(h.render);case x:return rt(h.type,w,P);case y:{var A=h,F=A._payload,L=A._init;try{return rt(L(F),w,P)}catch{}}}return""}var Me=Object.prototype.hasOwnProperty,fs={},ps=v.ReactDebugCurrentFrame;function at(h){if(h){var w=h._owner,P=rt(h.type,h._source,w?w.type:null);ps.setExtraStackFrame(P)}else ps.setExtraStackFrame(null)}function zr(h,w,P,A,F){{var L=Function.call.bind(Me);for(var I in h)if(L(h,I)){var O=void 0;try{if(typeof h[I]!="function"){var Q=Error((A||"React class")+": "+P+" type `"+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof h[I]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Q.name="Invariant Violation",Q}O=h[I](w,I,A,P,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(q){O=q}O&&!(O instanceof Error)&&(at(F),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",A||"React class",P,I,typeof O),at(null)),O instanceof Error&&!(O.message in fs)&&(fs[O.message]=!0,at(F),p("Failed %s type: %s",P,O.message),at(null))}}}var Hr=Array.isArray;function kt(h){return Hr(h)}function Gr(h){{var w=typeof Symbol=="function"&&Symbol.toStringTag,P=w&&h[Symbol.toStringTag]||h.constructor.name||"Object";return P}}function Yr(h){try{return gs(h),!1}catch{return!0}}function gs(h){return""+h}function ys(h){if(Yr(h))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Gr(h)),gs(h)}var Te=v.ReactCurrentOwner,Jr={key:!0,ref:!0,__self:!0,__source:!0},vs,bs,Et;Et={};function Xr(h){if(Me.call(h,"ref")){var w=Object.getOwnPropertyDescriptor(h,"ref").get;if(w&&w.isReactWarning)return!1}return h.ref!==void 0}function Zr(h){if(Me.call(h,"key")){var w=Object.getOwnPropertyDescriptor(h,"key").get;if(w&&w.isReactWarning)return!1}return h.key!==void 0}function ea(h,w){if(typeof h.ref=="string"&&Te.current&&w&&Te.current.stateNode!==w){var P=K(Te.current.type);Et[P]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',K(Te.current.type),h.ref),Et[P]=!0)}}function ta(h,w){{var P=function(){vs||(vs=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",w))};P.isReactWarning=!0,Object.defineProperty(h,"key",{get:P,configurable:!0})}}function sa(h,w){{var P=function(){bs||(bs=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",w))};P.isReactWarning=!0,Object.defineProperty(h,"ref",{get:P,configurable:!0})}}var ra=function(h,w,P,A,F,L,I){var O={$$typeof:t,type:h,key:w,ref:P,props:I,_owner:L};return O._store={},Object.defineProperty(O._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(O,"_self",{configurable:!1,enumerable:!1,writable:!1,value:A}),Object.defineProperty(O,"_source",{configurable:!1,enumerable:!1,writable:!1,value:F}),Object.freeze&&(Object.freeze(O.props),Object.freeze(O)),O};function aa(h,w,P,A,F){{var L,I={},O=null,Q=null;P!==void 0&&(ys(P),O=""+P),Zr(w)&&(ys(w.key),O=""+w.key),Xr(w)&&(Q=w.ref,ea(w,F));for(L in w)Me.call(w,L)&&!Jr.hasOwnProperty(L)&&(I[L]=w[L]);if(h&&h.defaultProps){var q=h.defaultProps;for(L in q)I[L]===void 0&&(I[L]=q[L])}if(O||Q){var V=typeof h=="function"?h.displayName||h.name||"Unknown":h;O&&ta(I,V),Q&&sa(I,V)}return ra(h,O,Q,F,A,Te.current,I)}}var Pt=v.ReactCurrentOwner,js=v.ReactDebugCurrentFrame;function ve(h){if(h){var w=h._owner,P=rt(h.type,h._source,w?w.type:null);js.setExtraStackFrame(P)}else js.setExtraStackFrame(null)}var Ct;Ct=!1;function Rt(h){return typeof h=="object"&&h!==null&&h.$$typeof===t}function Ns(){{if(Pt.current){var h=K(Pt.current.type);if(h)return` Check the render method of \``+h+"`."}return""}}function na(h){{if(h!==void 0){var w=h.fileName.replace(/^.*[\\\/]/,""),P=h.lineNumber;return` Check your code at `+w+":"+P+"."}return""}}var ws={};function ia(h){{var w=Ns();if(!w){var P=typeof h=="string"?h:h.displayName||h.name;P&&(w=` Check the top-level render call using <`+P+">.")}return w}}function Ss(h,w){{if(!h._store||h._store.validated||h.key!=null)return;h._store.validated=!0;var P=ia(w);if(ws[P])return;ws[P]=!0;var A="";h&&h._owner&&h._owner!==Pt.current&&(A=" It was passed a child from "+K(h._owner.type)+"."),ve(h),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',P,A),ve(null)}}function ks(h,w){{if(typeof h!="object")return;if(kt(h))for(var P=0;P<h.length;P++){var A=h[P];Rt(A)&&Ss(A,w)}else if(Rt(h))h._store&&(h._store.validated=!0);else if(h){var F=g(h);if(typeof F=="function"&&F!==h.entries)for(var L=F.call(h),I;!(I=L.next()).done;)Rt(I.value)&&Ss(I.value,w)}}}function la(h){{var w=h.type;if(w==null||typeof w=="string")return;var P;if(typeof w=="function")P=w.propTypes;else if(typeof w=="object"&&(w.$$typeof===c||w.$$typeof===x))P=w.propTypes;else return;if(P){var A=K(w);zr(P,h.props,"prop",A,h)}else if(w.PropTypes!==void 0&&!Ct){Ct=!0;var F=K(w);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",F||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function oa(h){{for(var w=Object.keys(h.props),P=0;P<w.length;P++){var A=w[P];if(A!=="children"&&A!=="key"){ve(h),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",A),ve(null);break}}h.ref!==null&&(ve(h),p("Invalid attribute `ref` supplied to `React.Fragment`."),ve(null))}}var Es={};function Ps(h,w,P,A,F,L){{var I=$(h);if(!I){var O="";(h===void 0||typeof h=="object"&&h!==null&&Object.keys(h).length===0)&&(O+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Q=na(F);Q?O+=Q:O+=Ns();var q;h===null?q="null":kt(h)?q="array":h!==void 0&&h.$$typeof===t?(q="<"+(K(h.type)||"Unknown")+" />",O=" Did you accidentally export a JSX literal instead of a component?"):q=typeof h,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",q,O)}var V=aa(h,w,P,F,L);if(V==null)return V;if(I){var Y=w.children;if(Y!==void 0)if(A)if(kt(Y)){for(var be=0;be<Y.length;be++)ks(Y[be],h);Object.freeze&&Object.freeze(Y)}else p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ks(Y,h)}if(Me.call(w,"key")){var ue=K(h),z=Object.keys(w).filter(function(xa){return xa!=="key"}),At=z.length>0?"{key: someKey, "+z.join(": ..., ")+": ...}":"{key: someKey}";if(!Es[ue+At]){var ma=z.length>0?"{"+z.join(": ..., ")+": ...}":"{}";p(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,At,ue,ma,ue),Es[ue+At]=!0}}return h===a?oa(V):la(V),V}}function ca(h,w,P){return Ps(h,w,P,!0)}function da(h,w,P){return Ps(h,w,P,!1)}var ua=da,ha=ca;Ie.Fragment=a,Ie.jsx=ua,Ie.jsxs=ha}()),Ie}process.env.NODE_ENV==="production"?Ft.exports=ya():Ft.exports=va();var e=Ft.exports;class Ge{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){const r={listener:t};return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const We=typeof window>"u"||"Deno"in window;function J(){}function ba(s,t){return typeof s=="function"?s(t):s}function Lt(s){return typeof s=="number"&&s>=0&&s!==1/0}function er(s,t){return Math.max(s+(t||0)-Date.now(),0)}function Ue(s,t,r){return gt(s)?typeof t=="function"?{...r,queryKey:s,queryFn:t}:{...t,queryKey:s}:s}function ae(s,t,r){return gt(s)?[{...t,queryKey:s},r]:[s||{},t]}function As(s,t){const{type:r="all",exact:a,fetchStatus:n,predicate:l,queryKey:i,stale:o}=s;if(gt(i)){if(a){if(t.queryHash!==Jt(i,t.options))return!1}else if(!Ne(t.queryKey,i))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||typeof n<"u"&&n!==t.state.fetchStatus||l&&!l(t))}function Ds(s,t){const{exact:r,fetching:a,predicate:n,mutationKey:l}=s;if(gt(l)){if(!t.options.mutationKey)return!1;if(r){if(ge(t.options.mutationKey)!==ge(l))return!1}else if(!Ne(t.options.mutationKey,l))return!1}return!(typeof a=="boolean"&&t.state.status==="loading"!==a||n&&!n(t))}function Jt(s,t){return((t==null?void 0:t.queryKeyHashFn)||ge)(s)}function ge(s){return JSON.stringify(s,(t,r)=>$t(r)?Object.keys(r).sort().reduce((a,n)=>(a[n]=r[n],a),{}):r)}function Ne(s,t){return tr(s,t)}function tr(s,t){return s===t?!0:typeof s!=typeof t?!1:s&&t&&typeof s=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!tr(s[r],t[r])):!1}function sr(s,t){if(s===t)return s;const r=Ms(s)&&Ms(t);if(r||$t(s)&&$t(t)){const a=r?s.length:Object.keys(s).length,n=r?t:Object.keys(t),l=n.length,i=r?[]:{};let o=0;for(let c=0;c<l;c++){const d=r?c:n[c];i[d]=sr(s[d],t[d]),i[d]===s[d]&&o++}return a===l&&o===a?s:i}return t}function Ut(s,t){if(s&&!t||t&&!s)return!1;for(const r in s)if(s[r]!==t[r])return!1;return!0}function Ms(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function $t(s){if(!Ts(s))return!1;const t=s.constructor;if(typeof t>"u")return!0;const r=t.prototype;return!(!Ts(r)||!r.hasOwnProperty("isPrototypeOf"))}function Ts(s){return Object.prototype.toString.call(s)==="[object Object]"}function gt(s){return Array.isArray(s)}function rr(s){return new Promise(t=>{setTimeout(t,s)})}function Os(s){rr(0).then(s)}function ja(){if(typeof AbortController=="function")return new AbortController}function qt(s,t,r){return r.isDataEqual!=null&&r.isDataEqual(s,t)?s:typeof r.structuralSharing=="function"?r.structuralSharing(s,t):r.structuralSharing!==!1?sr(s,t):t}class Na extends Ge{constructor(){super(),this.setup=t=>{if(!We&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const mt=new Na,Is=["online","offline"];class wa extends Ge{constructor(){super(),this.setup=t=>{if(!We&&window.addEventListener){const r=()=>t();return Is.forEach(a=>{window.addEventListener(a,r,!1)}),()=>{Is.forEach(a=>{window.removeEventListener(a,r)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var r;this.setup=t,(r=this.cleanup)==null||r.call(this),this.cleanup=t(a=>{typeof a=="boolean"?this.setOnline(a):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const xt=new wa;function Sa(s){return Math.min(1e3*2**s,3e4)}function yt(s){return(s??"online")==="online"?xt.isOnline():!0}class ar{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function it(s){return s instanceof ar}function nr(s){let t=!1,r=0,a=!1,n,l,i;const o=new Promise((g,v)=>{l=g,i=v}),c=g=>{a||(f(new ar(g)),s.abort==null||s.abort())},d=()=>{t=!0},m=()=>{t=!1},x=()=>!mt.isFocused()||s.networkMode!=="always"&&!xt.isOnline(),y=g=>{a||(a=!0,s.onSuccess==null||s.onSuccess(g),n==null||n(),l(g))},f=g=>{a||(a=!0,s.onError==null||s.onError(g),n==null||n(),i(g))},u=()=>new Promise(g=>{n=v=>{const p=a||!x();return p&&g(v),p},s.onPause==null||s.onPause()}).then(()=>{n=void 0,a||s.onContinue==null||s.onContinue()}),b=()=>{if(a)return;let g;try{g=s.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(y).catch(v=>{var p,j;if(a)return;const N=(p=s.retry)!=null?p:3,M=(j=s.retryDelay)!=null?j:Sa,R=typeof M=="function"?M(r,v):M,k=N===!0||typeof N=="number"&&r<N||typeof N=="function"&&N(r,v);if(t||!k){f(v);return}r++,s.onFail==null||s.onFail(r,v),rr(R).then(()=>{if(x())return u()}).then(()=>{t?f(v):b()})})};return yt(s.networkMode)?b():u().then(b),{promise:o,cancel:c,continue:()=>(n==null?void 0:n())?o:Promise.resolve(),cancelRetry:d,continueRetry:m}}const Xt=console;function ka(){let s=[],t=0,r=m=>{m()},a=m=>{m()};const n=m=>{let x;t++;try{x=m()}finally{t--,t||o()}return x},l=m=>{t?s.push(m):Os(()=>{r(m)})},i=m=>(...x)=>{l(()=>{m(...x)})},o=()=>{const m=s;s=[],m.length&&Os(()=>{a(()=>{m.forEach(x=>{r(x)})})})};return{batch:n,batchCalls:i,schedule:l,setNotifyFunction:m=>{r=m},setBatchNotifyFunction:m=>{a=m}}}const W=ka();class ir{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Lt(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(We?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Ea extends ir{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||Xt,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||Pa(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,r){const a=qt(this.state.data,t,this.options);return this.dispatch({data:a,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),a}setState(t,r){this.dispatch({type:"setState",state:t,setStateOptions:r})}cancel(t){var r;const a=this.promise;return(r=this.retryer)==null||r.cancel(t),a?a.then(J).catch(J):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!er(this.state.dataUpdatedAt,t)}onFocus(){var t;const r=this.observers.find(a=>a.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const r=this.observers.find(a=>a.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,r){var a,n;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var l;return(l=this.retryer)==null||l.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(u=>u.options.queryFn);f&&this.setOptions(f.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||this.logger.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const i=ja(),o={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},c=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>{if(i)return this.abortSignalConsumed=!0,i.signal}})};c(o);const d=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(o)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),m={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:d};if(c(m),(a=this.options.behavior)==null||a.onFetch(m),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((n=m.fetchOptions)==null?void 0:n.meta)){var x;this.dispatch({type:"fetch",meta:(x=m.fetchOptions)==null?void 0:x.meta})}const y=f=>{if(it(f)&&f.silent||this.dispatch({type:"error",error:f}),!it(f)){var u,b,g,v;(u=(b=this.cache.config).onError)==null||u.call(b,f,this),(g=(v=this.cache.config).onSettled)==null||g.call(v,this.state.data,f,this),process.env.NODE_ENV!=="production"&&this.logger.error(f)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=nr({fn:m.fetchFn,abort:i==null?void 0:i.abort.bind(i),onSuccess:f=>{var u,b,g,v;if(typeof f>"u"){process.env.NODE_ENV!=="production"&&this.logger.error("Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: "+this.queryHash),y(new Error(this.queryHash+" data is undefined"));return}this.setData(f),(u=(b=this.cache.config).onSuccess)==null||u.call(b,f,this),(g=(v=this.cache.config).onSettled)==null||g.call(v,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:y,onFail:(f,u)=>{this.dispatch({type:"failed",failureCount:f,error:u})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const r=a=>{var n,l;switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(n=t.meta)!=null?n:null,fetchStatus:yt(this.options.networkMode)?"fetching":"paused",...!a.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...a,data:t.data,dataUpdateCount:a.dataUpdateCount+1,dataUpdatedAt:(l=t.dataUpdatedAt)!=null?l:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return it(i)&&i.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...a,error:i,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=r(this.state),W.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function Pa(s){const t=typeof s.initialData=="function"?s.initialData():s.initialData,r=typeof t<"u",a=r?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class Ca extends Ge{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,r,a){var n;const l=r.queryKey,i=(n=r.queryHash)!=null?n:Jt(l,r);let o=this.get(i);return o||(o=new Ea({cache:this,logger:t.getLogger(),queryKey:l,queryHash:i,options:t.defaultQueryOptions(r),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(o)),o}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const r=this.queriesMap[t.queryHash];r&&(t.destroy(),this.queries=this.queries.filter(a=>a!==t),r===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){W.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,r){const[a]=ae(t,r);return typeof a.exact>"u"&&(a.exact=!0),this.queries.find(n=>As(a,n))}findAll(t,r){const[a]=ae(t,r);return Object.keys(a).length>0?this.queries.filter(n=>As(a,n)):this.queries}notify(t){W.batch(()=>{this.listeners.forEach(({listener:r})=>{r(t)})})}onFocus(){W.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){W.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class Ra extends ir{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||Xt,this.observers=[],this.state=t.state||Aa(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(r=>r!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,r;return(t=(r=this.retryer)==null?void 0:r.continue())!=null?t:this.execute()}async execute(){const t=()=>{var k;return this.retryer=nr({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(E,_)=>{this.dispatch({type:"failed",failureCount:E,error:_})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(k=this.options.retry)!=null?k:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var a,n,l,i,o,c,d,m;if(!r){var x,y,f,u;this.dispatch({type:"loading",variables:this.options.variables}),await((x=(y=this.mutationCache.config).onMutate)==null?void 0:x.call(y,this.state.variables,this));const E=await((f=(u=this.options).onMutate)==null?void 0:f.call(u,this.state.variables));E!==this.state.context&&this.dispatch({type:"loading",context:E,variables:this.state.variables})}const k=await t();return await((a=(n=this.mutationCache.config).onSuccess)==null?void 0:a.call(n,k,this.state.variables,this.state.context,this)),await((l=(i=this.options).onSuccess)==null?void 0:l.call(i,k,this.state.variables,this.state.context)),await((o=(c=this.mutationCache.config).onSettled)==null?void 0:o.call(c,k,null,this.state.variables,this.state.context,this)),await((d=(m=this.options).onSettled)==null?void 0:d.call(m,k,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:k}),k}catch(k){try{var b,g,v,p,j,N,M,R;throw await((b=(g=this.mutationCache.config).onError)==null?void 0:b.call(g,k,this.state.variables,this.state.context,this)),process.env.NODE_ENV!=="production"&&this.logger.error(k),await((v=(p=this.options).onError)==null?void 0:v.call(p,k,this.state.variables,this.state.context)),await((j=(N=this.mutationCache.config).onSettled)==null?void 0:j.call(N,void 0,k,this.state.variables,this.state.context,this)),await((M=(R=this.options).onSettled)==null?void 0:M.call(R,void 0,k,this.state.variables,this.state.context)),k}finally{this.dispatch({type:"error",error:k})}}}dispatch(t){const r=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"loading":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!yt(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...a,...t.state}}};this.state=r(this.state),W.batch(()=>{this.observers.forEach(a=>{a.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function Aa(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class Da extends Ge{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,r,a){const n=new Ra({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(r),state:a,defaultOptions:r.mutationKey?t.getMutationDefaults(r.mutationKey):void 0});return this.add(n),n}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(r=>r!==t),this.notify({type:"removed",mutation:t})}clear(){W.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(r=>Ds(t,r))}findAll(t){return this.mutations.filter(r=>Ds(t,r))}notify(t){W.batch(()=>{this.listeners.forEach(({listener:r})=>{r(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const r=this.mutations.filter(a=>a.state.isPaused);return W.batch(()=>r.reduce((a,n)=>a.then(()=>n.continue().catch(J)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function Ma(){return{onFetch:s=>{s.fetchFn=()=>{var t,r,a,n,l,i;const o=(t=s.fetchOptions)==null||(r=t.meta)==null?void 0:r.refetchPage,c=(a=s.fetchOptions)==null||(n=a.meta)==null?void 0:n.fetchMore,d=c==null?void 0:c.pageParam,m=(c==null?void 0:c.direction)==="forward",x=(c==null?void 0:c.direction)==="backward",y=((l=s.state.data)==null?void 0:l.pages)||[],f=((i=s.state.data)==null?void 0:i.pageParams)||[];let u=f,b=!1;const g=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>{var k;if((k=s.signal)!=null&&k.aborted)b=!0;else{var E;(E=s.signal)==null||E.addEventListener("abort",()=>{b=!0})}return s.signal}})},v=s.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+s.options.queryHash+"'")),p=(R,k,E,_)=>(u=_?[k,...u]:[...u,k],_?[E,...R]:[...R,E]),j=(R,k,E,_)=>{if(b)return Promise.reject("Cancelled");if(typeof E>"u"&&!k&&R.length)return Promise.resolve(R);const $={queryKey:s.queryKey,pageParam:E,meta:s.options.meta};g($);const X=v($);return Promise.resolve(X).then(K=>p(R,E,K,_))};let N;if(!y.length)N=j([]);else if(m){const R=typeof d<"u",k=R?d:_s(s.options,y);N=j(y,R,k)}else if(x){const R=typeof d<"u",k=R?d:Ta(s.options,y);N=j(y,R,k,!0)}else{u=[];const R=typeof s.options.getNextPageParam>"u";N=(o&&y[0]?o(y[0],0,y):!0)?j([],R,f[0]):Promise.resolve(p([],f[0],y[0]));for(let E=1;E<y.length;E++)N=N.then(_=>{if(o&&y[E]?o(y[E],E,y):!0){const X=R?f[E]:_s(s.options,_);return j(_,R,X)}return Promise.resolve(p(_,f[E],y[E]))})}return N.then(R=>({pages:R,pageParams:u}))}}}}function _s(s,t){return s.getNextPageParam==null?void 0:s.getNextPageParam(t[t.length-1],t)}function Ta(s,t){return s.getPreviousPageParam==null?void 0:s.getPreviousPageParam(t[0],t)}class Oa{constructor(t={}){this.queryCache=t.queryCache||new Ca,this.mutationCache=t.mutationCache||new Da,this.logger=t.logger||Xt,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0,process.env.NODE_ENV!=="production"&&t.logger&&this.logger.error("Passing a custom logger has been deprecated and will be removed in the next major version.")}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=mt.subscribe(()=>{mt.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=xt.subscribe(()=>{xt.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,r;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(t,r){const[a]=ae(t,r);return a.fetchStatus="fetching",this.queryCache.findAll(a).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,r){var a;return(a=this.queryCache.find(t,r))==null?void 0:a.state.data}ensureQueryData(t,r,a){const n=Ue(t,r,a),l=this.getQueryData(n.queryKey);return l?Promise.resolve(l):this.fetchQuery(n)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:r,state:a})=>{const n=a.data;return[r,n]})}setQueryData(t,r,a){const n=this.queryCache.find(t),l=n==null?void 0:n.state.data,i=ba(r,l);if(typeof i>"u")return;const o=Ue(t),c=this.defaultQueryOptions(o);return this.queryCache.build(this,c).setData(i,{...a,manual:!0})}setQueriesData(t,r,a){return W.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,r,a)]))}getQueryState(t,r){var a;return(a=this.queryCache.find(t,r))==null?void 0:a.state}removeQueries(t,r){const[a]=ae(t,r),n=this.queryCache;W.batch(()=>{n.findAll(a).forEach(l=>{n.remove(l)})})}resetQueries(t,r,a){const[n,l]=ae(t,r,a),i=this.queryCache,o={type:"active",...n};return W.batch(()=>(i.findAll(n).forEach(c=>{c.reset()}),this.refetchQueries(o,l)))}cancelQueries(t,r,a){const[n,l={}]=ae(t,r,a);typeof l.revert>"u"&&(l.revert=!0);const i=W.batch(()=>this.queryCache.findAll(n).map(o=>o.cancel(l)));return Promise.all(i).then(J).catch(J)}invalidateQueries(t,r,a){const[n,l]=ae(t,r,a);return W.batch(()=>{var i,o;if(this.queryCache.findAll(n).forEach(d=>{d.invalidate()}),n.refetchType==="none")return Promise.resolve();const c={...n,type:(i=(o=n.refetchType)!=null?o:n.type)!=null?i:"active"};return this.refetchQueries(c,l)})}refetchQueries(t,r,a){const[n,l]=ae(t,r,a),i=W.batch(()=>this.queryCache.findAll(n).filter(c=>!c.isDisabled()).map(c=>{var d;return c.fetch(void 0,{...l,cancelRefetch:(d=l==null?void 0:l.cancelRefetch)!=null?d:!0,meta:{refetchPage:n.refetchPage}})}));let o=Promise.all(i).then(J);return l!=null&&l.throwOnError||(o=o.catch(J)),o}fetchQuery(t,r,a){const n=Ue(t,r,a),l=this.defaultQueryOptions(n);typeof l.retry>"u"&&(l.retry=!1);const i=this.queryCache.build(this,l);return i.isStaleByTime(l.staleTime)?i.fetch(l):Promise.resolve(i.state.data)}prefetchQuery(t,r,a){return this.fetchQuery(t,r,a).then(J).catch(J)}fetchInfiniteQuery(t,r,a){const n=Ue(t,r,a);return n.behavior=Ma(),this.fetchQuery(n)}prefetchInfiniteQuery(t,r,a){return this.fetchInfiniteQuery(t,r,a).then(J).catch(J)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,r){const a=this.queryDefaults.find(n=>ge(t)===ge(n.queryKey));a?a.defaultOptions=r:this.queryDefaults.push({queryKey:t,defaultOptions:r})}getQueryDefaults(t){if(!t)return;const r=this.queryDefaults.find(a=>Ne(t,a.queryKey));return process.env.NODE_ENV!=="production"&&this.queryDefaults.filter(n=>Ne(t,n.queryKey)).length>1&&this.logger.error("[QueryClient] Several query defaults match with key '"+JSON.stringify(t)+"'. The first matching query defaults are used. Please check how query defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetquerydefaults."),r==null?void 0:r.defaultOptions}setMutationDefaults(t,r){const a=this.mutationDefaults.find(n=>ge(t)===ge(n.mutationKey));a?a.defaultOptions=r:this.mutationDefaults.push({mutationKey:t,defaultOptions:r})}getMutationDefaults(t){if(!t)return;const r=this.mutationDefaults.find(a=>Ne(t,a.mutationKey));return process.env.NODE_ENV!=="production"&&this.mutationDefaults.filter(n=>Ne(t,n.mutationKey)).length>1&&this.logger.error("[QueryClient] Several mutation defaults match with key '"+JSON.stringify(t)+"'. The first matching mutation defaults are used. Please check how mutation defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetmutationdefaults."),r==null?void 0:r.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const r={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=Jt(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class Ia extends Ge{constructor(t,r){super(),this.client=t,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),Fs(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Vt(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Vt(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,r){const a=this.options,n=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),process.env.NODE_ENV!=="production"&&typeof(t==null?void 0:t.isDataEqual)<"u"&&this.client.getLogger().error("The isDataEqual option has been deprecated and will be removed in the next major version. You can achieve the same functionality by passing a function as the structuralSharing option"),Ut(a,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=a.queryKey),this.updateQuery();const l=this.hasListeners();l&&Ls(this.currentQuery,n,this.options,a)&&this.executeFetch(),this.updateResult(r),l&&(this.currentQuery!==n||this.options.enabled!==a.enabled||this.options.staleTime!==a.staleTime)&&this.updateStaleTimeout();const i=this.computeRefetchInterval();l&&(this.currentQuery!==n||this.options.enabled!==a.enabled||i!==this.currentRefetchInterval)&&this.updateRefetchInterval(i)}getOptimisticResult(t){const r=this.client.getQueryCache().build(this.client,t),a=this.createResult(r,t);return Fa(this,a,t)&&(this.currentResult=a,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),a}getCurrentResult(){return this.currentResult}trackResult(t){const r={};return Object.keys(t).forEach(a=>{Object.defineProperty(r,a,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(a),t[a])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...r}={}){return this.fetch({...r,meta:{refetchPage:t}})}fetchOptimistic(t){const r=this.client.defaultQueryOptions(t),a=this.client.getQueryCache().build(this.client,r);return a.isFetchingOptimistic=!0,a.fetch().then(()=>this.createResult(a,r))}fetch(t){var r;return this.executeFetch({...t,cancelRefetch:(r=t.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let r=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(J)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),We||this.currentResult.isStale||!Lt(this.options.staleTime))return;const r=er(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(We||this.options.enabled===!1||!Lt(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||mt.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,r){const a=this.currentQuery,n=this.options,l=this.currentResult,i=this.currentResultState,o=this.currentResultOptions,c=t!==a,d=c?t.state:this.currentQueryInitialState,m=c?this.currentResult:this.previousQueryResult,{state:x}=t;let{dataUpdatedAt:y,error:f,errorUpdatedAt:u,fetchStatus:b,status:g}=x,v=!1,p=!1,j;if(r._optimisticResults){const E=this.hasListeners(),_=!E&&Fs(t,r),$=E&&Ls(t,a,r,n);(_||$)&&(b=yt(t.options.networkMode)?"fetching":"paused",y||(g="loading")),r._optimisticResults==="isRestoring"&&(b="idle")}if(r.keepPreviousData&&!x.dataUpdatedAt&&m!=null&&m.isSuccess&&g!=="error")j=m.data,y=m.dataUpdatedAt,g=m.status,v=!0;else if(r.select&&typeof x.data<"u")if(l&&x.data===(i==null?void 0:i.data)&&r.select===this.selectFn)j=this.selectResult;else try{this.selectFn=r.select,j=r.select(x.data),j=qt(l==null?void 0:l.data,j,r),this.selectResult=j,this.selectError=null}catch(E){process.env.NODE_ENV!=="production"&&this.client.getLogger().error(E),this.selectError=E}else j=x.data;if(typeof r.placeholderData<"u"&&typeof j>"u"&&g==="loading"){let E;if(l!=null&&l.isPlaceholderData&&r.placeholderData===(o==null?void 0:o.placeholderData))E=l.data;else if(E=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof E<"u")try{E=r.select(E),this.selectError=null}catch(_){process.env.NODE_ENV!=="production"&&this.client.getLogger().error(_),this.selectError=_}typeof E<"u"&&(g="success",j=qt(l==null?void 0:l.data,E,r),p=!0)}this.selectError&&(f=this.selectError,j=this.selectResult,u=Date.now(),g="error");const N=b==="fetching",M=g==="loading",R=g==="error";return{status:g,fetchStatus:b,isLoading:M,isSuccess:g==="success",isError:R,isInitialLoading:M&&N,data:j,dataUpdatedAt:y,error:f,errorUpdatedAt:u,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:x.dataUpdateCount>0||x.errorUpdateCount>0,isFetchedAfterMount:x.dataUpdateCount>d.dataUpdateCount||x.errorUpdateCount>d.errorUpdateCount,isFetching:N,isRefetching:N&&!M,isLoadingError:R&&x.dataUpdatedAt===0,isPaused:b==="paused",isPlaceholderData:p,isPreviousData:v,isRefetchError:R&&x.dataUpdatedAt!==0,isStale:Zt(t,r),refetch:this.refetch,remove:this.remove}}updateResult(t){const r=this.currentResult,a=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,Ut(a,r))return;this.currentResult=a;const n={cache:!0},l=()=>{if(!r)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!this.trackedProps.size)return!0;const c=new Set(o??this.trackedProps);return this.options.useErrorBoundary&&c.add("error"),Object.keys(this.currentResult).some(d=>{const m=d;return this.currentResult[m]!==r[m]&&c.has(m)})};(t==null?void 0:t.listeners)!==!1&&l()&&(n.listeners=!0),this.notify({...n,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const r={};t.type==="success"?r.onSuccess=!t.manual:t.type==="error"&&!it(t.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(t){W.batch(()=>{if(t.onSuccess){var r,a,n,l;(r=(a=this.options).onSuccess)==null||r.call(a,this.currentResult.data),(n=(l=this.options).onSettled)==null||n.call(l,this.currentResult.data,null)}else if(t.onError){var i,o,c,d;(i=(o=this.options).onError)==null||i.call(o,this.currentResult.error),(c=(d=this.options).onSettled)==null||c.call(d,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:m})=>{m(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function _a(s,t){return t.enabled!==!1&&!s.state.dataUpdatedAt&&!(s.state.status==="error"&&t.retryOnMount===!1)}function Fs(s,t){return _a(s,t)||s.state.dataUpdatedAt>0&&Vt(s,t,t.refetchOnMount)}function Vt(s,t,r){if(t.enabled!==!1){const a=typeof r=="function"?r(s):r;return a==="always"||a!==!1&&Zt(s,t)}return!1}function Ls(s,t,r,a){return r.enabled!==!1&&(s!==t||a.enabled===!1)&&(!r.suspense||s.state.status!=="error")&&Zt(s,r)}function Zt(s,t){return s.isStaleByTime(t.staleTime)}function Fa(s,t,r){return r.keepPreviousData?!1:r.placeholderData!==void 0?t.isPlaceholderData:!Ut(s.getCurrentResult(),t)}var Wt={exports:{}},Dt={};/** * @license React * use-sync-external-s