react-semaphor 0.0.130 → 0.0.131

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.
@@ -1,7 +1,7 @@
1
1
  var Yi = Object.defineProperty;
2
2
  var Xi = (e, t, n) => t in e ? Yi(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var Kr = (e, t, n) => (Xi(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { d as In, s as Gn, m as Vn, c as z, g as Zi, a as D, b as v, e as U, o as Dt, i as E, S as R, f as G, h as I, j as ze, k as F, l as Ji, n as Et, p as or, q as j, r as es, t as bn, F as qo, u as Mo, v as V, $ as ct, w as xn, x as jn, y as Be, z as Se, A as ke, I as ts, B as ir, C as M, D as en, E as Br, G as ns, H as Ct, J as Ht, K as Rr, L as J, P as rs, M as os, N as is, O as Mn, Q as ss, R as ls, T as as, U as Pn, V as cs, W as us } from "./index-4NI8h_Oz.js";
4
+ import { d as In, s as Gn, m as Vn, c as z, g as Zi, a as D, b as v, e as U, o as Dt, i as E, S as R, f as G, h as I, j as ze, k as F, l as Ji, n as Et, p as or, q as j, r as es, t as bn, F as qo, u as Mo, v as V, $ as ct, w as xn, x as jn, y as Be, z as Se, A as ke, I as ts, B as ir, C as M, D as en, E as Br, G as ns, H as Ct, J as Ht, K as Rr, L as J, P as rs, M as os, N as is, O as Mn, Q as ss, R as ls, T as as, U as Pn, V as cs, W as us } from "./index-EdZOjrhg.js";
5
5
  import "react";
6
6
  import "react-dom";
7
7
  var Po = {
@@ -8562,7 +8562,7 @@ var Xve = (e, t = !1) => {
8562
8562
  const t = Wz(() => {
8563
8563
  const [n] = K(this, Vc), [r] = K(this, Hc), [i] = K(this, Wc), [o] = K(this, Uc), [s] = K(this, Bc);
8564
8564
  let a;
8565
- K(this, qc) ? a = K(this, qc) : (a = Dz(() => import("./2DAFLIRC-QFhun_wr.js")), Te(this, qc, a)), BB(K(this, $f));
8565
+ K(this, qc) ? a = K(this, qc) : (a = Dz(() => import("./2DAFLIRC-46C5OmFB.js")), Te(this, qc, a)), BB(K(this, $f));
8566
8566
  const l = this;
8567
8567
  return $z(a, Rz({
8568
8568
  get queryFlavor() {
@@ -8681,14 +8681,7 @@ function qB(e, t) {
8681
8681
  ),
8682
8682
  enabled: !!(r != null && r.accessToken)
8683
8683
  // Only fetch if authToken is present
8684
- });
8685
- console.log(
8686
- "connectionsData",
8687
- m,
8688
- "selectedConnectionId",
8689
- i
8690
- );
8691
- const w = m == null ? void 0 : m.connections.find(
8684
+ }), w = m == null ? void 0 : m.connections.find(
8692
8685
  (U) => U.id === i
8693
8686
  ), _ = (w == null ? void 0 : w.type) === "API" || (w == null ? void 0 : w.type) === "S3", {
8694
8687
  data: S,
@@ -1,4 +1,4 @@
1
- import { a7 as t, a6 as r, Z as d, a2 as D, a1 as i, a0 as T, _ as l, a5 as u, a3 as A, am as n, an as E, a4 as h, ap as S, aa as b, a8 as m, aq as _, ac as C, ao as p, ab as g, ae as c, a9 as P, ad as Y, ah as f, af as y, X as q, Y as N, aj as O, ai as k, al as B, ag as v, ak as F } from "./index-4NI8h_Oz.js";
1
+ import { a7 as t, a6 as r, Z as d, a2 as D, a1 as i, a0 as T, _ as l, a5 as u, a3 as A, am as n, an as E, a4 as h, ap as S, aa as b, a8 as m, aq as _, ac as C, ao as p, ab as g, ae as c, a9 as P, ad as Y, ah as f, af as y, X as q, Y as N, aj as O, ai as k, al as B, ag as v, ak as F } from "./index-EdZOjrhg.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  export {
@@ -56,7 +56,7 @@ Check the top-level render call using <`+fe+">.")}return te}}function bs(T,te){{
56
56
  *
57
57
  * This source code is licensed under the MIT license found in the
58
58
  * LICENSE file in the root directory of this source tree.
59
- */var aE;function jF(){if(aE)return Wb;aE=1;var e=b,t=iE();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Wb.useSyncExternalStoreWithSelector=function(c,u,d,h,p){var m=i(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function w(P){if(!C){if(C=!0,_=P,P=h(P),p!==void 0&&v.hasValue){var D=v.value;if(p(D,P))return k=D}return k=P}if(D=k,r(_,P))return D;var M=h(P);return p!==void 0&&p(D,M)?D:(_=P,k=M)}var C=!1,_,k,E=d===void 0?null:d;return[function(){return w(u())},E===null?void 0:function(){return w(E())}]},[u,d,h,p]);var y=o(c,m[0],m[1]);return s(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},Wb}process.env.NODE_ENV==="production"?Bb.exports=jF():Bb.exports=RF();var zF=Bb.exports;const BF=Gd(zF);var lE={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:VF}=b,{useSyncExternalStoreWithSelector:HF}=BF;let cE=!1;function qF(e,t=e.getState,n){(lE?"production":void 0)!=="production"&&n&&!cE&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),cE=!0);const r=HF(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return VF(r),r}const uE=e=>{(lE?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?NF(e):e,n=(r,o)=>qF(t,r,o);return Object.assign(n,t),n},dE=e=>e?uE(e):uE;var fE=Symbol.for("immer-nothing"),hE=Symbol.for("immer-draftable"),po=Symbol.for("immer-state"),WF=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Gr(e,...t){if(process.env.NODE_ENV!=="production"){const n=WF[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Kc=Object.getPrototypeOf;function Yc(e){return!!e&&!!e[po]}function Ol(e){var t;return e?pE(e)||Array.isArray(e)||!!e[hE]||!!((t=e.constructor)!=null&&t[hE])||Qp(e)||Zp(e):!1}var UF=Object.prototype.constructor.toString();function pE(e){if(!e||typeof e!="object")return!1;const t=Kc(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===UF}function Jd(e,t){Xp(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Xp(e){const t=e[po];return t?t.type_:Array.isArray(e)?1:Qp(e)?2:Zp(e)?3:0}function Ub(e,t){return Xp(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gE(e,t,n){const r=Xp(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function GF(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Qp(e){return e instanceof Map}function Zp(e){return e instanceof Set}function Pl(e){return e.copy_||e.base_}function Gb(e,t){if(Qp(e))return new Map(e);if(Zp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&pE(e))return Kc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[po];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Kc(e),n)}function Kb(e,t=!1){return Jp(e)||Yc(e)||!Ol(e)||(Xp(e)>1&&(e.set=e.add=e.clear=e.delete=KF),Object.freeze(e),t&&Jd(e,(n,r)=>Kb(r,!0))),e}function KF(){Gr(2)}function Jp(e){return Object.isFrozen(e)}var YF={};function Dl(e){const t=YF[e];return t||Gr(0,e),t}var ef;function mE(){return ef}function XF(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vE(e,t){t&&(Dl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yb(e){Xb(e),e.drafts_.forEach(QF),e.drafts_=null}function Xb(e){e===ef&&(ef=e.parent_)}function bE(e){return ef=XF(ef,e)}function QF(e){const t=e[po];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yE(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[po].modified_&&(Yb(t),Gr(4)),Ol(e)&&(e=eg(t,e),t.parent_||tg(t,e)),t.patches_&&Dl("Patches").generateReplacementPatches_(n[po].base_,e,t.patches_,t.inversePatches_)):e=eg(t,n,[]),Yb(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fE?e:void 0}function eg(e,t,n){if(Jp(t))return t;const r=t[po];if(!r)return Jd(t,(o,i)=>xE(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return tg(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),Jd(i,(a,l)=>xE(e,r,o,a,l,n,s)),tg(e,o,!1),n&&e.patches_&&Dl("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function xE(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Gr(5),Yc(o)){const a=i&&t&&t.type_!==3&&!Ub(t.assigned_,r)?i.concat(r):void 0,l=eg(e,o,a);if(gE(n,r,l),Yc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(Ol(o)&&!Jp(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;eg(e,o),(!t||!t.scope_.parent_)&&tg(e,o)}}function tg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kb(t,n)}function ZF(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:mE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Qb;n&&(o=[r],i=tf);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Qb={get(e,t){if(t===po)return e;const n=Pl(e);if(!Ub(n,t))return JF(e,n,t);const r=n[t];return e.finalized_||!Ol(r)?r:r===Zb(e.base_,t)?(ey(e),e.copy_[t]=ty(r,e)):r},has(e,t){return t in Pl(e)},ownKeys(e){return Reflect.ownKeys(Pl(e))},set(e,t,n){const r=wE(Pl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Zb(Pl(e),t),i=o==null?void 0:o[po];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(GF(n,o)&&(n!==void 0||Ub(e.base_,t)))return!0;ey(e),Jb(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Zb(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ey(e),Jb(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Pl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Gr(11)},getPrototypeOf(e){return Kc(e.base_)},setPrototypeOf(){Gr(12)}},tf={};Jd(Qb,(e,t)=>{tf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),tf.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Gr(13),tf.set.call(this,e,t,void 0)},tf.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Gr(14),Qb.set.call(this,e[0],t,n,e[0])};function Zb(e,t){const n=e[po];return(n?Pl(n):e)[t]}function JF(e,t,n){var o;const r=wE(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function wE(e,t){if(!(t in e))return;let n=Kc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Kc(n)}}function Jb(e){e.modified_||(e.modified_=!0,e.parent_&&Jb(e.parent_))}function ey(e){e.copy_||(e.copy_=Gb(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var eR=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Gr(6),r!==void 0&&typeof r!="function"&&Gr(7);let o;if(Ol(t)){const i=bE(this),s=ty(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?Yb(i):Xb(i)}return vE(i,r),yE(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===fE&&(o=void 0),this.autoFreeze_&&Kb(o,!0),r){const i=[],s=[];Dl("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Gr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ol(e)||Gr(8),Yc(e)&&(e=tR(e));const t=bE(this),n=ty(e,void 0);return n[po].isManual_=!0,Xb(t),n}finishDraft(e,t){const n=e&&e[po];(!n||!n.isManual_)&&Gr(9);const{scope_:r}=n;return vE(r,t),yE(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=Dl("Patches").applyPatches_;return Yc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function ty(e,t){const n=Qp(e)?Dl("MapSet").proxyMap_(e,t):Zp(e)?Dl("MapSet").proxySet_(e,t):ZF(e,t);return(t?t.scope_:mE()).drafts_.push(n),n}function tR(e){return Yc(e)||Gr(10,e),SE(e)}function SE(e){if(!Ol(e)||Jp(e))return e;const t=e[po];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Gb(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Gb(e,!0);return Jd(n,(r,o)=>{gE(n,r,SE(o))}),t&&(t.finalized_=!1),n}var go=new eR,nR=go.produce;go.produceWithPatches.bind(go),go.setAutoFreeze.bind(go),go.setUseStrictShallowCopy.bind(go),go.applyPatches.bind(go),go.createDraft.bind(go),go.finishDraft.bind(go);const CE=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?nR(o):o;return t(a,i,...s)},e(r.setState,n,r));var ng,rg=Jt;if(process.env.NODE_ENV==="production")ng=rg.createRoot,rg.hydrateRoot;else{var _E=rg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;ng=function(e,t){_E.usingClientEntryPoint=!0;try{return rg.createRoot(e,t)}finally{_E.usingClientEntryPoint=!1}}}function EE(e,t,n){const r={count:0},o=a=>{const l=b.useRef(r.count);return b.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(o.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const i=ng(n),s=a=>{a&&(i.render(b.createElement(o,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var kE={},OE={},ny={exports:{}},On=String,PE=function(){return{isColorSupported:!1,reset:On,bold:On,dim:On,italic:On,underline:On,inverse:On,hidden:On,strikethrough:On,black:On,red:On,green:On,yellow:On,blue:On,magenta:On,cyan:On,white:On,gray:On,bgBlack:On,bgRed:On,bgGreen:On,bgYellow:On,bgBlue:On,bgMagenta:On,bgCyan:On,bgWhite:On}};ny.exports=PE(),ny.exports.createColors=PE;var rR=ny.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(rR);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(OE),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(OE);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(kE);let ry=kE;var oR=(ry.__esModule?ry:{default:ry}).default;const bn=Gd(oR),oy={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],borderColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:DE},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],borderColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],datalables:{color:DE}},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:bn.slate[800]}},y:{grid:{display:!0,color:bn.slate[800]}}}}}}};function DE(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=og()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=og()),ig(n)}function og(){return me.getState().theme==="dark"?"#000000":"#FFFFFF"}function ig(e){let t=0,n=0,r=0,o=0;const i=u=>{const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),p=parseInt(d.substring(2,4),16),m=parseInt(d.substring(4,6),16);t+=h,n+=p,r+=m,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}var nf=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(){}},Xc=typeof window>"u"||"Deno"in window;function Ho(){}function iR(e,t){return typeof e=="function"?e(t):e}function iy(e){return typeof e=="number"&&e>=0&&e!==1/0}function ME(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $E(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==sy(s,t.options))return!1}else if(!of(t.queryKey,s))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||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function TE(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(rf(t.options.mutationKey)!==rf(i))return!1}else if(!of(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function sy(e,t){return((t==null?void 0:t.queryKeyHashFn)||rf)(e)}function rf(e){return JSON.stringify(e,(t,n)=>ly(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function of(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!of(e[n],t[n])):!1}function AE(e,t){if(e===t)return e;const n=IE(e)&&IE(t);if(n||ly(e)&&ly(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=AE(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function ay(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function IE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ly(e){if(!NE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!NE(n)||!n.hasOwnProperty("isPrototypeOf"))}function NE(e){return Object.prototype.toString.call(e)==="[object Object]"}function sR(e){return new Promise(t=>{setTimeout(t,e)})}function cy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?AE(e,t):t}function aR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var cR=(f8=class extends nf{constructor(){super();Ge(this,Oc,void 0);Ge(this,rl,void 0);Ge(this,fd,void 0);je(this,fd,t=>{if(!Xc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ee(this,rl)||this.setEventListener(ee(this,fd))}onUnsubscribe(){var t;this.hasListeners()||((t=ee(this,rl))==null||t.call(this),je(this,rl,void 0))}setEventListener(t){var n;je(this,fd,t),(n=ee(this,rl))==null||n.call(this),je(this,rl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ee(this,Oc)!==t&&(je(this,Oc,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof ee(this,Oc)=="boolean"?ee(this,Oc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Oc=new WeakMap,rl=new WeakMap,fd=new WeakMap,f8),sg=new cR,uR=(h8=class extends nf{constructor(){super();Ge(this,hd,!0);Ge(this,ol,void 0);Ge(this,pd,void 0);je(this,pd,t=>{if(!Xc&&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(){ee(this,ol)||this.setEventListener(ee(this,pd))}onUnsubscribe(){var t;this.hasListeners()||((t=ee(this,ol))==null||t.call(this),je(this,ol,void 0))}setEventListener(t){var n;je(this,pd,t),(n=ee(this,ol))==null||n.call(this),je(this,ol,t(this.setOnline.bind(this)))}setOnline(t){ee(this,hd)!==t&&(je(this,hd,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ee(this,hd)}},hd=new WeakMap,ol=new WeakMap,pd=new WeakMap,h8),sf=new uR;function dR(e){return Math.min(1e3*2**e,3e4)}function ag(e){return(e??"online")==="online"?sf.isOnline():!0}var LE=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function uy(e){return e instanceof LE}function FE(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((y,w)=>{i=y,s=w}),l=y=>{var w;r||(p(new LE(y)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},u=()=>{t=!1},d=()=>!sg.isFocused()||e.networkMode!=="always"&&!sf.isOnline(),h=y=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,y),o==null||o(),i(y))},p=y=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,y),o==null||o(),s(y))},m=()=>new Promise(y=>{var w;o=C=>{const _=r||!d();return _&&y(C),_},(w=e.onPause)==null||w.call(e)}).then(()=>{var y;o=void 0,r||(y=e.onContinue)==null||y.call(e)}),v=()=>{if(r)return;let y;try{y=e.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(h).catch(w=>{var P;if(r)return;const C=e.retry??(Xc?0:3),_=e.retryDelay??dR,k=typeof _=="function"?_(n,w):_,E=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,w);if(t||!E){p(w);return}n++,(P=e.onFail)==null||P.call(e,n,w),sR(k).then(()=>{if(d())return m()}).then(()=>{t?p(w):v()})})};return ag(e.networkMode)?v():m().then(v),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function fR(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let p;t++;try{p=h()}finally{t--,t||c()}return p},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...p)=>{a(()=>{h(...p)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var br=fR(),RE=(p8=class{constructor(){Ge(this,Pc,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iy(this.gcTime)&&je(this,Pc,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xc?1/0:5*60*1e3))}clearGcTimeout(){ee(this,Pc)&&(clearTimeout(ee(this,Pc)),je(this,Pc,void 0))}},Pc=new WeakMap,p8),hR=(g8=class extends RE{constructor(t){super();Ge(this,vd);Ge(this,Ni);Ge(this,gd,void 0);Ge(this,md,void 0);Ge(this,si,void 0);Ge(this,il,void 0);Ge(this,ai,void 0);Ge(this,gr,void 0);Ge(this,pp,void 0);Ge(this,Dc,void 0);je(this,Dc,!1),je(this,pp,t.defaultOptions),Bt(this,vd,Nb).call(this,t.options),je(this,gr,[]),je(this,si,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,je(this,gd,t.state||pR(this.options)),this.state=ee(this,gd),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ee(this,gr).length&&this.state.fetchStatus==="idle"&&ee(this,si).remove(this)}setData(t,n){const r=cy(this.state.data,t,this.options);return Bt(this,Ni,ga).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Bt(this,Ni,ga).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=ee(this,il);return(r=ee(this,ai))==null||r.cancel(t),n?n.then(Ho).catch(Ho):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ee(this,gd))}isActive(){return ee(this,gr).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ee(this,gr).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!ME(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=ee(this,gr).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ee(this,ai))==null||n.continue()}onOnline(){var n;const t=ee(this,gr).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ee(this,ai))==null||n.continue()}addObserver(t){ee(this,gr).includes(t)||(ee(this,gr).push(t),this.clearGcTimeout(),ee(this,si).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){ee(this,gr).includes(t)&&(je(this,gr,ee(this,gr).filter(n=>n!==t)),ee(this,gr).length||(ee(this,ai)&&(ee(this,Dc)?ee(this,ai).cancel({revert:!0}):ee(this,ai).cancelRetry()),this.scheduleGc()),ee(this,si).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return ee(this,gr).length}invalidate(){this.state.isInvalidated||Bt(this,Ni,ga).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ee(this,il))return(c=ee(this,ai))==null||c.continueRetry(),ee(this,il)}if(t&&Bt(this,vd,Nb).call(this,t),!this.options.queryFn){const p=ee(this,gr).find(m=>m.options.queryFn);p&&Bt(this,vd,Nb).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.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 r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(je(this,Dc,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(je(this,Dc,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),je(this,md,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&Bt(this,Ni,ga).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=p=>{var m,v,y,w;uy(p)&&p.silent||Bt(this,Ni,ga).call(this,{type:"error",error:p}),uy(p)||((v=(m=ee(this,si).config).onError)==null||v.call(m,p,this),(w=(y=ee(this,si).config).onSettled)==null||w.call(y,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return je(this,ai,FE({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,v,y,w;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.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}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(v=(m=ee(this,si).config).onSuccess)==null||v.call(m,p,this),(w=(y=ee(this,si).config).onSettled)==null||w.call(y,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,m)=>{Bt(this,Ni,ga).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{Bt(this,Ni,ga).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Ni,ga).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),je(this,il,ee(this,ai).promise),ee(this,il)}},gd=new WeakMap,md=new WeakMap,si=new WeakMap,il=new WeakMap,ai=new WeakMap,gr=new WeakMap,pp=new WeakMap,Dc=new WeakMap,vd=new WeakSet,Nb=function(t){this.options={...ee(this,pp),...t},this.updateGcTime(this.options.gcTime)},Ni=new WeakSet,ga=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,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:ag(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...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}};case"error":const o=t.error;return uy(o)&&o.revert&&ee(this,md)?{...ee(this,md),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),br.batch(()=>{ee(this,gr).forEach(r=>{r.onQueryUpdate()}),ee(this,si).notify({query:this,type:"updated",action:t})})},g8);function pR(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",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 gR=(m8=class extends nf{constructor(t={}){super();Ge(this,fs,void 0);this.config=t,je(this,fs,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??sy(o,n);let s=this.get(i);return s||(s=new hR({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ee(this,fs).has(t.queryHash)||(ee(this,fs).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ee(this,fs).get(t.queryHash);n&&(t.destroy(),n===t&&ee(this,fs).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){br.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ee(this,fs).get(t)}getAll(){return[...ee(this,fs).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$E(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>$E(t,r)):n}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){br.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){br.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fs=new WeakMap,m8),mR=(v8=class extends RE{constructor(t){super();Ge(this,ps);Ge(this,hs,void 0);Ge(this,gp,void 0);Ge(this,Lo,void 0);Ge(this,bd,void 0);this.mutationId=t.mutationId,je(this,gp,t.defaultOptions),je(this,Lo,t.mutationCache),je(this,hs,[]),this.state=t.state||vR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...ee(this,gp),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ee(this,hs).includes(t)||(ee(this,hs).push(t),this.clearGcTimeout(),ee(this,Lo).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){je(this,hs,ee(this,hs).filter(n=>n!==t)),this.scheduleGc(),ee(this,Lo).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ee(this,hs).length||(this.state.status==="pending"?this.scheduleGc():ee(this,Lo).remove(this))}continue(){var t;return((t=ee(this,bd))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,h,p,m,v,y,w,C,_,k,E,P,D;const n=()=>(je(this,bd,FE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,I)=>{Bt(this,ps,_l).call(this,{type:"failed",failureCount:M,error:I})},onPause:()=>{Bt(this,ps,_l).call(this,{type:"pause"})},onContinue:()=>{Bt(this,ps,_l).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ee(this,bd).promise),r=this.state.status==="pending";try{if(!r){Bt(this,ps,_l).call(this,{type:"pending",variables:t}),await((i=(o=ee(this,Lo).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Bt(this,ps,_l).call(this,{type:"pending",context:I,variables:t})}const M=await n();return await((c=(l=ee(this,Lo).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,M,t,this.state.context)),await((p=(h=ee(this,Lo).config).onSettled)==null?void 0:p.call(h,M,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,M,null,t,this.state.context)),Bt(this,ps,_l).call(this,{type:"success",data:M}),M}catch(M){try{throw await((w=(y=ee(this,Lo).config).onError)==null?void 0:w.call(y,M,t,this.state.context,this)),await((_=(C=this.options).onError)==null?void 0:_.call(C,M,t,this.state.context)),await((E=(k=ee(this,Lo).config).onSettled)==null?void 0:E.call(k,void 0,M,this.state.variables,this.state.context,this)),await((D=(P=this.options).onSettled)==null?void 0:D.call(P,void 0,M,t,this.state.context)),M}finally{Bt(this,ps,_l).call(this,{type:"error",error:M})}}}},hs=new WeakMap,gp=new WeakMap,Lo=new WeakMap,bd=new WeakMap,ps=new WeakSet,_l=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:!ag(this.options.networkMode),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),br.batch(()=>{ee(this,hs).forEach(r=>{r.onMutationUpdate(t)}),ee(this,Lo).notify({mutation:this,type:"updated",action:t})})},v8);function vR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bR=(b8=class extends nf{constructor(t={}){super();Ge(this,li,void 0);Ge(this,mp,void 0);Ge(this,Mc,void 0);this.config=t,je(this,li,[]),je(this,mp,0)}build(t,n,r){const o=new mR({mutationCache:this,mutationId:++Ib(this,mp)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ee(this,li).push(t),this.notify({type:"added",mutation:t})}remove(t){je(this,li,ee(this,li).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){br.batch(()=>{ee(this,li).forEach(t=>{this.remove(t)})})}getAll(){return ee(this,li)}find(t){const n={exact:!0,...t};return ee(this,li).find(r=>TE(n,r))}findAll(t={}){return ee(this,li).filter(n=>TE(t,n))}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return je(this,Mc,(ee(this,Mc)??Promise.resolve()).then(()=>{const t=ee(this,li).filter(n=>n.state.isPaused);return br.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Ho)),Promise.resolve()))}).then(()=>{je(this,Mc,void 0)})),ee(this,Mc)}},li=new WeakMap,mp=new WeakMap,Mc=new WeakMap,b8);function yR(e){return{onFetch:(t,n)=>{const r=async()=>{var m,v,y,w,C;const o=t.options,i=(y=(v=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:v.fetchMore)==null?void 0:y.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((C=t.state.data)==null?void 0:C.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},d=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(_,k,E)=>{if(c)return Promise.reject();if(k==null&&_.pages.length)return Promise.resolve(_);const P={queryKey:t.queryKey,pageParam:k,direction:E?"backward":"forward",meta:t.options.meta};u(P);const D=await d(P),{maxPages:M}=t.options,I=E?lR:aR;return{pages:I(_.pages,D,M),pageParams:I(_.pageParams,k,M)}};let p;if(i&&s.length){const _=i==="backward",k=_?xR:jE,E={pages:s,pageParams:a},P=k(o,E);p=await h(E,P,_)}else{p=await h(l,a[0]??o.initialPageParam);const _=e??s.length;for(let k=1;k<_;k++){const E=jE(o,p);p=await h(p,E)}}return p};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function jE(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function xR(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var wR=(y8=class{constructor(e={}){Ge(this,cr,void 0);Ge(this,sl,void 0);Ge(this,al,void 0);Ge(this,yd,void 0);Ge(this,xd,void 0);Ge(this,ll,void 0);Ge(this,wd,void 0);Ge(this,Sd,void 0);je(this,cr,e.queryCache||new gR),je(this,sl,e.mutationCache||new bR),je(this,al,e.defaultOptions||{}),je(this,yd,new Map),je(this,xd,new Map),je(this,ll,0)}mount(){Ib(this,ll)._++,ee(this,ll)===1&&(je(this,wd,sg.subscribe(()=>{sg.isFocused()&&(this.resumePausedMutations(),ee(this,cr).onFocus())})),je(this,Sd,sf.subscribe(()=>{sf.isOnline()&&(this.resumePausedMutations(),ee(this,cr).onOnline())})))}unmount(){var e,t;Ib(this,ll)._--,ee(this,ll)===0&&((e=ee(this,wd))==null||e.call(this),je(this,wd,void 0),(t=ee(this,Sd))==null||t.call(this),je(this,Sd,void 0))}isFetching(e){return ee(this,cr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ee(this,sl).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=ee(this,cr).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=ee(this,cr).find({queryKey:e}),o=r==null?void 0:r.state.data,i=iR(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return ee(this,cr).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return br.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=ee(this,cr).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=ee(this,cr);br.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ee(this,cr),r={type:"active",...e};return br.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=br.batch(()=>ee(this,cr).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ho).catch(Ho)}invalidateQueries(e={},t={}){return br.batch(()=>{if(ee(this,cr).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=br.batch(()=>ee(this,cr).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ho)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ho)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=ee(this,cr).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ho).catch(Ho)}fetchInfiniteQuery(e){return e.behavior=yR(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ho).catch(Ho)}resumePausedMutations(){return ee(this,sl).resumePausedMutations()}getQueryCache(){return ee(this,cr)}getMutationCache(){return ee(this,sl)}getDefaultOptions(){return ee(this,al)}setDefaultOptions(e){je(this,al,e)}setQueryDefaults(e,t){ee(this,yd).set(rf(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ee(this,yd).values()];let n={};return t.forEach(r=>{of(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ee(this,xd).set(rf(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ee(this,xd).values()];let n={};return t.forEach(r=>{of(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...ee(this,al).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sy(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ee(this,al).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ee(this,cr).clear(),ee(this,sl).clear()}},cr=new WeakMap,sl=new WeakMap,al=new WeakMap,yd=new WeakMap,xd=new WeakMap,ll=new WeakMap,wd=new WeakMap,Sd=new WeakMap,y8),SR=(x8=class extends nf{constructor(t,n){super();Ge(this,Ic);Ge(this,yp);Ge(this,xp);Ge(this,wp);Ge(this,Sp);Ge(this,Cp);Ge(this,_p);Ge(this,Ep);Ge(this,Uv);Ge(this,ao,void 0);Ge(this,Tn,void 0);Ge(this,vp,void 0);Ge(this,Vr,void 0);Ge(this,$c,void 0);Ge(this,Cd,void 0);Ge(this,gs,void 0);Ge(this,bp,void 0);Ge(this,_d,void 0);Ge(this,Ed,void 0);Ge(this,Tc,void 0);Ge(this,Ac,void 0);Ge(this,cl,void 0);Ge(this,kd,new Set);this.options=n,je(this,ao,t),je(this,gs,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ee(this,Tn).addObserver(this),zE(ee(this,Tn),this.options)?Bt(this,Ic,Up).call(this):this.updateResult(),Bt(this,Sp,z2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dy(ee(this,Tn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dy(ee(this,Tn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,Cp,B2).call(this),Bt(this,_p,V2).call(this),ee(this,Tn).removeObserver(this)}setOptions(t,n){const r=this.options,o=ee(this,Tn);if(this.options=ee(this,ao).defaultQueryOptions(t),ay(r,this.options)||ee(this,ao).getQueryCache().notify({type:"observerOptionsUpdated",query:ee(this,Tn),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=r.queryKey),Bt(this,Ep,H2).call(this);const i=this.hasListeners();i&&BE(ee(this,Tn),o,this.options,r)&&Bt(this,Ic,Up).call(this),this.updateResult(n),i&&(ee(this,Tn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Bt(this,yp,F2).call(this);const s=Bt(this,xp,R2).call(this);i&&(ee(this,Tn)!==o||this.options.enabled!==r.enabled||s!==ee(this,cl))&&Bt(this,wp,j2).call(this,s)}getOptimisticResult(t){const n=ee(this,ao).getQueryCache().build(ee(this,ao),t),r=this.createResult(n,t);return _R(this,r)&&(je(this,Vr,r),je(this,Cd,this.options),je(this,$c,ee(this,Tn).state)),r}getCurrentResult(){return ee(this,Vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(ee(this,kd).add(r),t[r])})}),n}getCurrentQuery(){return ee(this,Tn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ee(this,ao).defaultQueryOptions(t),r=ee(this,ao).getQueryCache().build(ee(this,ao),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Bt(this,Ic,Up).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ee(this,Vr)))}createResult(t,n){var P;const r=ee(this,Tn),o=this.options,i=ee(this,Vr),s=ee(this,$c),a=ee(this,Cd),c=t!==r?t.state:ee(this,vp),{state:u}=t;let{error:d,errorUpdatedAt:h,fetchStatus:p,status:m}=u,v=!1,y;if(n._optimisticResults){const D=this.hasListeners(),M=!D&&zE(t,n),I=D&&BE(t,r,n,o);(M||I)&&(p=ag(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(m="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===ee(this,bp))y=ee(this,_d);else try{je(this,bp,n.select),y=n.select(u.data),y=cy(i==null?void 0:i.data,y,n),je(this,_d,y),je(this,gs,null)}catch(D){je(this,gs,D)}else y=u.data;if(typeof n.placeholderData<"u"&&typeof y>"u"&&m==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((P=ee(this,Ed))==null?void 0:P.state.data,ee(this,Ed)):n.placeholderData,n.select&&typeof D<"u")try{D=n.select(D),je(this,gs,null)}catch(M){je(this,gs,M)}typeof D<"u"&&(m="success",y=cy(i==null?void 0:i.data,D,n),v=!0)}ee(this,gs)&&(d=ee(this,gs),y=ee(this,_d),h=Date.now(),m="error");const w=p==="fetching",C=m==="pending",_=m==="error",k=C&&w;return{status:m,fetchStatus:p,isPending:C,isSuccess:m==="success",isError:_,isInitialLoading:k,isLoading:k,data:y,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!C,isLoadingError:_&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:v,isRefetchError:_&&u.dataUpdatedAt!==0,isStale:fy(t,n),refetch:this.refetch}}updateResult(t){const n=ee(this,Vr),r=this.createResult(ee(this,Tn),this.options);if(je(this,$c,ee(this,Tn).state),je(this,Cd,this.options),ee(this,$c).data!==void 0&&je(this,Ed,ee(this,Tn)),ay(r,n))return;je(this,Vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ee(this,kd).size)return!0;const l=new Set(a??ee(this,kd));return this.options.throwOnError&&l.add("error"),Object.keys(ee(this,Vr)).some(c=>{const u=c;return ee(this,Vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Bt(this,Uv,GL).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,Sp,z2).call(this)}},ao=new WeakMap,Tn=new WeakMap,vp=new WeakMap,Vr=new WeakMap,$c=new WeakMap,Cd=new WeakMap,gs=new WeakMap,bp=new WeakMap,_d=new WeakMap,Ed=new WeakMap,Tc=new WeakMap,Ac=new WeakMap,cl=new WeakMap,kd=new WeakMap,Ic=new WeakSet,Up=function(t){Bt(this,Ep,H2).call(this);let n=ee(this,Tn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ho)),n},yp=new WeakSet,F2=function(){if(Bt(this,Cp,B2).call(this),Xc||ee(this,Vr).isStale||!iy(this.options.staleTime))return;const n=ME(ee(this,Vr).dataUpdatedAt,this.options.staleTime)+1;je(this,Tc,setTimeout(()=>{ee(this,Vr).isStale||this.updateResult()},n))},xp=new WeakSet,R2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ee(this,Tn)):this.options.refetchInterval)??!1},wp=new WeakSet,j2=function(t){Bt(this,_p,V2).call(this),je(this,cl,t),!(Xc||this.options.enabled===!1||!iy(ee(this,cl))||ee(this,cl)===0)&&je(this,Ac,setInterval(()=>{(this.options.refetchIntervalInBackground||sg.isFocused())&&Bt(this,Ic,Up).call(this)},ee(this,cl)))},Sp=new WeakSet,z2=function(){Bt(this,yp,F2).call(this),Bt(this,wp,j2).call(this,Bt(this,xp,R2).call(this))},Cp=new WeakSet,B2=function(){ee(this,Tc)&&(clearTimeout(ee(this,Tc)),je(this,Tc,void 0))},_p=new WeakSet,V2=function(){ee(this,Ac)&&(clearInterval(ee(this,Ac)),je(this,Ac,void 0))},Ep=new WeakSet,H2=function(){const t=ee(this,ao).getQueryCache().build(ee(this,ao),this.options);if(t===ee(this,Tn))return;const n=ee(this,Tn);je(this,Tn,t),je(this,vp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Uv=new WeakSet,GL=function(t){br.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ee(this,Vr))}),ee(this,ao).getQueryCache().notify({query:ee(this,Tn),type:"observerResultsUpdated"})})},x8);function CR(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zE(e,t){return CR(e,t)||e.state.dataUpdatedAt>0&&dy(e,t,t.refetchOnMount)}function dy(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fy(e,t)}return!1}function BE(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&fy(e,n)}function fy(e,t){return e.isStaleByTime(t.staleTime)}function _R(e,t){return!ay(e.getCurrentResult(),t)}var VE=he.createContext(void 0),HE=e=>{const t=he.useContext(VE);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ER=({client:e,children:t})=>(he.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),he.createElement(VE.Provider,{value:e},t)),qE=he.createContext(!1),kR=()=>he.useContext(qE);qE.Provider;function OR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var PR=he.createContext(OR()),DR=()=>he.useContext(PR);function MR(e,t){return typeof e=="function"?e(...t):!!e}var $R=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},TR=e=>{he.useEffect(()=>{e.clearReset()},[e])},AR=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&MR(n,[e.error,r]),IR=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},NR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,LR=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function FR(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=HE(n),o=kR(),i=DR(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",IR(s),$R(s,i),TR(i);const[a]=he.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(he.useSyncExternalStore(he.useCallback(c=>{const u=o?()=>{}:a.subscribe(br.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),he.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),NR(s,l))throw LR(s,a,i);if(AR({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function yi(e,t){return FR(e,SR,t)}let lg;const RR=new Uint8Array(16);function jR(){if(!lg&&(lg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!lg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lg(RR)}const yr=[];for(let e=0;e<256;++e)yr.push((e+256).toString(16).slice(1));function zR(e,t=0){return yr[e[t+0]]+yr[e[t+1]]+yr[e[t+2]]+yr[e[t+3]]+"-"+yr[e[t+4]]+yr[e[t+5]]+"-"+yr[e[t+6]]+yr[e[t+7]]+"-"+yr[e[t+8]]+yr[e[t+9]]+"-"+yr[e[t+10]]+yr[e[t+11]]+yr[e[t+12]]+yr[e[t+13]]+yr[e[t+14]]+yr[e[t+15]]}const WE={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ya(e,t,n){if(WE.randomUUID&&!t&&!e)return WE.randomUUID();e=e||{};const r=e.random||(e.rng||jR)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return zR(r)}const be=dE()(CE((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:ya(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:ya(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,o,i)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),BR=()=>be(e=>e.actions);process.env.NODE_ENV==="development"&&EE("EditorStore",be);function UE({children:e}){const t=new wR;return x.jsx(ER,{client:t,children:e})}var Ot={context:void 0,registry:void 0};function af(e){Ot.context=e}var VR=(e,t)=>e===t,qo=Symbol("solid-proxy"),Qc=Symbol("solid-track"),cg={equals:VR},GE=JE,ks=1,ug=2,KE={owned:null,cleanups:null,context:null,owner:null},hy={},Qt=null,py=null,dn=null,Or=null,Os=null,dg=0;function Ps(e,t){const n=dn,r=Qt,o=e.length===0,i=t===void 0?r:t,s=o?KE:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Fn(()=>gg(s)));Qt=s,dn=null;try{return zi(a,!0)}finally{dn=n,Qt=r}}function qe(e,t){t=t?Object.assign({},cg,t):cg;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),ZE(n,o));return[QE.bind(n),r]}function gy(e,t,n){const r=fg(e,t,!0,ks);Zc(r)}function at(e,t,n){const r=fg(e,t,!1,ks);Zc(r)}function ht(e,t,n){GE=ZR;const r=fg(e,t,!1,ks);(!n||!n.render)&&(r.user=!0),Os?Os.push(r):Zc(r)}function Me(e,t,n){n=n?Object.assign({},cg,n):cg;const r=fg(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Zc(r),QE.bind(r)}function HR(e){return e&&typeof e=="object"&&"then"in e}function qR(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=hy,l=null,c=!1,u="initialValue"in i,d=typeof r=="function"&&Me(r);const h=new Set,[p,m]=(i.storage||qe)(i.initialValue),[v,y]=qe(void 0),[w,C]=qe(void 0,{equals:!1}),[_,k]=qe(u?"ready":"unresolved");if(Ot.context){l=`${Ot.context.id}${Ot.context.count++}`;let I;i.ssrLoadFrom==="initial"?a=i.initialValue:Ot.load&&(I=Ot.load(l))&&(a=I)}function E(I,F,R,B){return s===I&&(s=null,B!==void 0&&(u=!0),(I===a||F===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(B,{value:F})),a=hy,P(F,R)),F}function P(I,F){zi(()=>{F===void 0&&m(()=>I),k(F!==void 0?"errored":u?"ready":"unresolved"),y(F);for(const R of h.keys())R.decrement();h.clear()},!1)}function D(){const I=YR,F=p(),R=v();if(R!==void 0&&!s)throw R;return dn&&!dn.user&&I&&gy(()=>{w(),s&&(I.resolved||h.has(I)||(I.increment(),h.add(I)))}),F}function M(I=!0){if(I!==!1&&c)return;c=!1;const F=d?d():r;if(F==null||F===!1){E(s,Fn(p));return}const R=a!==hy?a:Fn(()=>o(F,{value:p(),refetching:I}));return HR(R)?(s=R,"value"in R?(R.status==="success"?E(s,R.value,void 0,F):E(s,void 0,void 0,F),R):(c=!0,queueMicrotask(()=>c=!1),zi(()=>{k(u?"refreshing":"pending"),C()},!1),R.then(B=>E(R,B,void 0,F),B=>E(R,void 0,t5(B),F)))):(E(s,R,void 0,F),R)}return Object.defineProperties(D,{state:{get:()=>_()},error:{get:()=>v()},loading:{get(){const I=_();return I==="pending"||I==="refreshing"}},latest:{get(){if(!u)return D();const I=v();if(I&&!s)throw I;return p()}}}),d?gy(()=>M(!1)):M(!1),[D,{refetch:M,mutate:m}]}function YE(e){return zi(e,!1)}function Fn(e){if(dn===null)return e();const t=dn;dn=null;try{return e()}finally{dn=t}}function xi(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i){i=!1;return}const l=Fn(()=>t(a,o,s));return o=a,l}}function Ml(e){ht(()=>Fn(e))}function pt(e){return Qt===null||(Qt.cleanups===null?Qt.cleanups=[e]:Qt.cleanups.push(e)),e}function my(){return dn}function XE(){return Qt}function WR(e,t){const n=Qt,r=dn;Qt=e,dn=null;try{return zi(t,!0)}catch(o){by(o)}finally{Qt=n,dn=r}}function UR(e){const t=dn,n=Qt;return Promise.resolve().then(()=>{dn=t,Qt=n;let r;return zi(e,!1),dn=Qt=null,r?r.done:void 0})}var[GR,u2e]=qe(!1);function KR(){return[GR,UR]}function Kr(e,t){const n=Symbol("context");return{id:n,Provider:JR(n),defaultValue:e}}function Yr(e){return Qt&&Qt.context&&Qt.context[e.id]!==void 0?Qt.context[e.id]:e.defaultValue}function vy(e){const t=Me(e),n=Me(()=>yy(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var YR;function QE(){if(this.sources&&this.state)if(this.state===ks)Zc(this);else{const e=Or;Or=null,zi(()=>pg(this),!1),Or=e}if(dn){const e=this.observers?this.observers.length:0;dn.sources?(dn.sources.push(this),dn.sourceSlots.push(e)):(dn.sources=[this],dn.sourceSlots=[e]),this.observers?(this.observers.push(dn),this.observerSlots.push(dn.sources.length-1)):(this.observers=[dn],this.observerSlots=[dn.sources.length-1])}return this.value}function ZE(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&zi(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=py&&py.running;s&&py.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?Or.push(i):Os.push(i),i.observers&&e5(i)),s||(i.state=ks)}if(Or.length>1e6)throw Or=[],new Error},!1)),t}function Zc(e){if(!e.fn)return;gg(e);const t=dg;XR(e,e.value,t)}function XR(e,t,n){let r;const o=Qt,i=dn;dn=Qt=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=ks,e.owned&&e.owned.forEach(gg),e.owned=null),e.updatedAt=n+1,by(s)}finally{dn=i,Qt=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?ZE(e,r):e.value=r,e.updatedAt=n)}function fg(e,t,n,r=ks,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Qt,context:Qt?Qt.context:null,pure:n};return Qt===null||Qt!==KE&&(Qt.owned?Qt.owned.push(i):Qt.owned=[i]),i}function hg(e){if(e.state===0)return;if(e.state===ug)return pg(e);if(e.suspense&&Fn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<dg);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===ks)Zc(e);else if(e.state===ug){const r=Or;Or=null,zi(()=>pg(e,t[0]),!1),Or=r}}function zi(e,t){if(Or)return e();let n=!1;t||(Or=[]),Os?n=!0:Os=[],dg++;try{const r=e();return QR(n),r}catch(r){n||(Os=null),Or=null,by(r)}}function QR(e){if(Or&&(JE(Or),Or=null),e)return;const t=Os;Os=null,t.length&&zi(()=>GE(t),!1)}function JE(e){for(let t=0;t<e.length;t++)hg(e[t])}function ZR(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:hg(r)}if(Ot.context){if(Ot.count){Ot.effects||(Ot.effects=[]),Ot.effects.push(...e.slice(0,n));return}else Ot.effects&&(e=[...Ot.effects,...e],n+=Ot.effects.length,delete Ot.effects);af()}for(t=0;t<n;t++)hg(e[t])}function pg(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===ks?r!==t&&(!r.updatedAt||r.updatedAt<dg)&&hg(r):o===ug&&pg(r,t)}}}function e5(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=ug,n.pure?Or.push(n):Os.push(n),n.observers&&e5(n))}}function gg(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)gg(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function t5(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function by(e,t=Qt){throw t5(e)}function yy(e){if(typeof e=="function"&&!e.length)return yy(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=yy(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function JR(e,t){return function(r){let o;return at(()=>o=Fn(()=>(Qt.context={...Qt.context,[e]:r.value},vy(()=>r.children))),void 0),o}}var xy=Symbol("fallback");function mg(e){for(let t=0;t<e.length;t++)e[t]()}function e6(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return pt(()=>mg(i)),()=>{let l=e()||[],c,u;return l[Qc],Fn(()=>{let h=l.length,p,m,v,y,w,C,_,k,E;if(h===0)s!==0&&(mg(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[xy],o[0]=Ps(P=>(i[0]=P,n.fallback())),s=1);else if(s===0){for(o=new Array(h),u=0;u<h;u++)r[u]=l[u],o[u]=Ps(d);s=h}else{for(v=new Array(h),y=new Array(h),a&&(w=new Array(h)),C=0,_=Math.min(s,h);C<_&&r[C]===l[C];C++);for(_=s-1,k=h-1;_>=C&&k>=C&&r[_]===l[k];_--,k--)v[k]=o[_],y[k]=i[_],a&&(w[k]=a[_]);for(p=new Map,m=new Array(k+1),u=k;u>=C;u--)E=l[u],c=p.get(E),m[u]=c===void 0?-1:c,p.set(E,u);for(c=C;c<=_;c++)E=r[c],u=p.get(E),u!==void 0&&u!==-1?(v[u]=o[c],y[u]=i[c],a&&(w[u]=a[c]),u=m[u],p.set(E,u)):i[c]();for(u=C;u<h;u++)u in v?(o[u]=v[u],i[u]=y[u],a&&(a[u]=w[u],a[u](u))):o[u]=Ps(d);o=o.slice(0,s=h),r=l.slice(0)}return o});function d(h){if(i[u]=h,a){const[p,m]=qe(u);return a[u]=m,t(l[u],p)}return t(l[u])}}}function t6(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return pt(()=>mg(i)),()=>{const c=e()||[];return c[Qc],Fn(()=>{if(c.length===0)return a!==0&&(mg(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[xy],o[0]=Ps(d=>(i[0]=d,n.fallback())),a=1),o;for(r[0]===xy&&(i[0](),i=[],r=[],o=[],a=0),l=0;l<c.length;l++)l<r.length&&r[l]!==c[l]?s[l](()=>c[l]):l>=r.length&&(o[l]=Ps(u));for(;l<r.length;l++)i[l]();return a=s.length=i.length=c.length,r=c.slice(0),o=o.slice(0,a)});function u(d){i[l]=d;const[h,p]=qe(c[l]);return s[l]=p,t(h,l)}}}function Q(e,t){return Fn(()=>e(t||{}))}function vg(){return!0}var wy={get(e,t,n){return t===qo?n:e.get(t)},has(e,t){return t===qo?!0:e.has(t)},set:vg,deleteProperty:vg,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:vg,deleteProperty:vg}},ownKeys(e){return e.keys()}};function Sy(e){return(e=typeof e=="function"?e():e)?e:{}}function n6(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Pt(...e){let t=!1;for(let i=0;i<e.length;i++){const s=e[i];t=t||!!s&&qo in s,e[i]=typeof s=="function"?(t=!0,Me(s)):s}if(t)return new Proxy({get(i){for(let s=e.length-1;s>=0;s--){const a=Sy(e[s])[i];if(a!==void 0)return a}},has(i){for(let s=e.length-1;s>=0;s--)if(i in Sy(e[s]))return!0;return!1},keys(){const i=[];for(let s=0;s<e.length;s++)i.push(...Object.keys(Sy(e[s])));return[...new Set(i)]}},wy);const n={},r={},o=new Set;for(let i=e.length-1;i>=0;i--){const s=e[i];if(!s)continue;const a=Object.getOwnPropertyNames(s);for(let l=0,c=a.length;l<c;l++){const u=a[l];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(s,u);if(!o.has(u))d.get?(o.add(u),Object.defineProperty(n,u,{enumerable:!0,configurable:!0,get:n6.bind(r[u]=[d.get.bind(s)])})):(d.value!==void 0&&o.add(u),n[u]=d.value);else{const h=r[u];h?d.get?h.push(d.get.bind(s)):d.value!==void 0&&h.push(()=>d.value):n[u]===void 0&&(n[u]=d.value)}}}return n}function rn(e,...t){if(qo in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},wy));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},wy)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}function r6(e){let t,n;const r=o=>{const i=Ot.context;if(i){const[a,l]=qe();Ot.count||(Ot.count=0),Ot.count++,(n||(n=e())).then(c=>{af(i),Ot.count--,l(()=>c.default),af()}),t=a}else if(!t){const[a]=qR(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return Me(()=>(s=t())&&Fn(()=>{if(!i)return s(o);const a=Ot.context;af(i);const l=s(o);return af(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}var o6=0;function wi(){const e=Ot.context;return e?`${e.id}${e.count++}`:`cl-${o6++}`}var n5=e=>`Stale read from <${e}>.`;function r5(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Me(e6(()=>e.each,e.children,t||void 0))}function i6(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Me(t6(()=>e.each,e.children,t||void 0))}function ut(e){const t=e.keyed,n=Me(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return Me(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Fn(()=>o(t?r:()=>{if(!Fn(n))throw n5("Show");return e.when})):o}return e.fallback},void 0,void 0)}function s6(e){let t=!1;const n=(i,s)=>i[0]===s[0]&&(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=vy(()=>e.children),o=Me(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return Me(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?Fn(()=>l(t?s:()=>{if(Fn(o)[0]!==i)throw n5("Match");return a.when})):l},void 0,void 0)}function Cy(e){return e}var a6=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],l6=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...a6]),c6=new Set(["innerHTML","textContent","innerText","children"]),u6=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),d6=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function f6(e,t){const n=d6[e];return typeof n=="object"?n[t]?n.$:void 0:n}var h6=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),p6=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),g6={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function m6(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,p;for(;++d<o&&d<i&&!((p=c.get(t[d]))==null||p!==u+h);)h++;if(h>u-a){const m=t[s];for(;a<u;)e.insertBefore(n[a++],m)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}var o5="_$DX_DELEGATE";function v6(e,t,n,r={}){let o;return Ps(i=>{o=i,t===document?e():ke(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function Ye(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>Fn(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function lf(e,t=window.document){const n=t[o5]||(t[o5]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,_6))}}function Te(e,t,n){Ot.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function b6(e,t,n,r){Ot.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Le(e,t){Ot.context||(t==null?e.removeAttribute("class"):e.className=t)}function i5(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function y6(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(s5(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(s5(e,a,!0),n[a]=l)}return n}function x6(e,t,n){if(!t)return n?Te(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function bg(e,t={},n,r){const o={};return r||at(()=>o.children=Jc(e,t.children,o.children)),at(()=>t.ref&&t.ref(e)),at(()=>w6(e,t,n,!0,o,!0)),o}function cf(e,t,n){return Fn(()=>e(t,n))}function ke(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Jc(e,t,r,n);at(o=>Jc(e,t(),o,n),r)}function w6(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=a5(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||Jc(e,t.children);continue}const a=t[s];o[s]=a5(e,s,a,o[s],n,i)}}function S6(e){let t,n;return!Ot.context||!(t=Ot.registry.get(n=E6()))?e():(Ot.completed&&Ot.completed.add(t),Ot.registry.delete(n),t)}function C6(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function s5(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function a5(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return x6(e,n,r);if(t==="classList")return y6(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=h6.has(d);if(!h&&r){const p=Array.isArray(r)?r[0]:r;e.removeEventListener(d,p)}(h||n)&&(i5(e,d,n,h),h&&lf([d]))}else if(t.slice(0,5)==="attr:")Te(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=c6.has(t))||!o&&((c=f6(t,e.tagName))||(a=l6.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),a=!0;else if(Ot.context)return n;t==="class"||t==="className"?Le(e,n):s&&!a&&!l?e[C6(t)]=n:e[c||t]=n}else{const d=o&&t.indexOf(":")>-1&&g6[t.split(":")[0]];d?b6(e,d,t,n):Te(e,u6[t]||t,n)}return n}function _6(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Ot.registry&&!Ot.done&&(Ot.done=_$HY.done=!0);n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Jc(e,t,n,r,o){if(Ot.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():a.push(c)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(Ot.context)return n;if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data=t:a=document.createTextNode(t),n=eu(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(Ot.context)return n;n=eu(e,n,r)}else{if(i==="function")return at(()=>{let a=t();for(;typeof a=="function";)a=a();n=Jc(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(_y(a,t,n,o))return at(()=>n=Jc(e,a,n,r,!0)),()=>n;if(Ot.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let c=a[0],u=[c];for(;(c=c.nextSibling)!==r;)u.push(c);return n=u}if(a.length===0){if(n=eu(e,n,r),s)return n}else l?n.length===0?l5(e,a,r):m6(e,n,a):(n&&eu(e),l5(e,a));n=a}else if(t.nodeType){if(Ot.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=eu(e,n,r,t);eu(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function _y(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=_y(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=_y(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function l5(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function eu(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function E6(){const e=Ot.context;return`${e.id}${e.count++}`}var k6="http://www.w3.org/2000/svg";function c5(e,t=!1){return t?document.createElementNS(k6,e):document.createElement(e)}function O6(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=XE();let i,s=!!Ot.context;return ht(()=>{s&&(XE().user=s=!1),i||(i=WR(o,()=>Me(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=qe(!1),u=()=>c(!0);Ps(d=>ke(a,()=>l()?d():i(),null)),pt(u)}else{const l=c5(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),ke(c,i),a.appendChild(l),e.ref&&e.ref(l),pt(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Ey(e){const[t,n]=rn(e,["component"]),r=Me(()=>t.component);return Me(()=>{const o=r();switch(typeof o){case"function":return Fn(()=>o(n));case"string":const i=p6.has(o),s=Ot.context?S6():c5(o,i);return bg(s,n,i),s}})}var P6=function(){function e(){this.keyToValue=new Map,this.valueToKey=new Map}return e.prototype.set=function(t,n){this.keyToValue.set(t,n),this.valueToKey.set(n,t)},e.prototype.getByKey=function(t){return this.keyToValue.get(t)},e.prototype.getByValue=function(t){return this.valueToKey.get(t)},e.prototype.clear=function(){this.keyToValue.clear(),this.valueToKey.clear()},e}(),u5=function(){function e(t){this.generateIdentifier=t,this.kv=new P6}return e.prototype.register=function(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))},e.prototype.clear=function(){this.kv.clear()},e.prototype.getIdentifier=function(t){return this.kv.getByValue(t)},e.prototype.getValue=function(t){return this.kv.getByKey(t)},e}(),D6=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),M6=function(e){D6(t,e);function t(){var n=e.call(this,function(r){return r.name})||this;return n.classToAllowedProps=new Map,n}return t.prototype.register=function(n,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(n,r.allowProps),e.prototype.register.call(this,n,r.identifier)):e.prototype.register.call(this,n,r)},t.prototype.getAllowedProps=function(n){return this.classToAllowedProps.get(n)},t}(u5),$6=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i};function T6(e){if("values"in Object)return Object.values(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function A6(e,t){var n=T6(e);if("find"in n)return n.find(t);for(var r=n,o=0;o<r.length;o++){var i=r[o];if(t(i))return i}}function tu(e,t){Object.entries(e).forEach(function(n){var r=$6(n,2),o=r[0],i=r[1];return t(i,o)})}function yg(e,t){return e.indexOf(t)!==-1}function d5(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t(r))return r}}var I6=function(){function e(){this.transfomers={}}return e.prototype.register=function(t){this.transfomers[t.name]=t},e.prototype.findApplicable=function(t){return A6(this.transfomers,function(n){return n.isApplicable(t)})},e.prototype.findByName=function(t){return this.transfomers[t]},e}(),N6=function(e){return Object.prototype.toString.call(e).slice(8,-1)},f5=function(e){return typeof e>"u"},L6=function(e){return e===null},uf=function(e){return typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype},ky=function(e){return uf(e)&&Object.keys(e).length===0},xa=function(e){return Array.isArray(e)},F6=function(e){return typeof e=="string"},R6=function(e){return typeof e=="number"&&!isNaN(e)},j6=function(e){return typeof e=="boolean"},z6=function(e){return e instanceof RegExp},df=function(e){return e instanceof Map},ff=function(e){return e instanceof Set},h5=function(e){return N6(e)==="Symbol"},B6=function(e){return e instanceof Date&&!isNaN(e.valueOf())},V6=function(e){return e instanceof Error},p5=function(e){return typeof e=="number"&&isNaN(e)},H6=function(e){return j6(e)||L6(e)||f5(e)||R6(e)||F6(e)||h5(e)},q6=function(e){return typeof e=="bigint"},W6=function(e){return e===1/0||e===-1/0},U6=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},G6=function(e){return e instanceof URL},g5=function(e){return e.replace(/\./g,"\\.")},Oy=function(e){return e.map(String).map(g5).join(".")},hf=function(e){for(var t=[],n="",r=0;r<e.length;r++){var o=e.charAt(r),i=o==="\\"&&e.charAt(r+1)===".";if(i){n+=".",r++;continue}var s=o===".";if(s){t.push(n),n="";continue}n+=o}var a=n;return t.push(a),t},Py=function(){return Py=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Py.apply(this,arguments)},Dy=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},My=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function Bi(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var m5=[Bi(f5,"undefined",function(){return null},function(){}),Bi(q6,"bigint",function(e){return e.toString()},function(e){return typeof BigInt<"u"?BigInt(e):e}),Bi(B6,"Date",function(e){return e.toISOString()},function(e){return new Date(e)}),Bi(V6,"Error",function(e,t){var n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(function(r){n[r]=e[r]}),n},function(e,t){var n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(function(r){n[r]=e[r]}),n}),Bi(z6,"regexp",function(e){return""+e},function(e){var t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Bi(ff,"set",function(e){return My([],Dy(e.values()))},function(e){return new Set(e)}),Bi(df,"map",function(e){return My([],Dy(e.entries()))},function(e){return new Map(e)}),Bi(function(e){return p5(e)||W6(e)},"number",function(e){return p5(e)?"NaN":e>0?"Infinity":"-Infinity"},Number),Bi(function(e){return e===0&&1/e===-1/0},"number",function(){return"-0"},Number),Bi(G6,"URL",function(e){return e.toString()},function(e){return new URL(e)})];function xg(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var v5=xg(function(e,t){if(h5(e)){var n=!!t.symbolRegistry.getIdentifier(e);return n}return!1},function(e,t){var n=t.symbolRegistry.getIdentifier(e);return["symbol",n]},function(e){return e.description},function(e,t,n){var r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),K6=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(e,t){return e[t.name]=t,e},{}),b5=xg(U6,function(e){return["typed-array",e.constructor.name]},function(e){return My([],Dy(e))},function(e,t){var n=K6[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function y5(e,t){if(e!=null&&e.constructor){var n=!!t.classRegistry.getIdentifier(e.constructor);return n}return!1}var x5=xg(y5,function(e,t){var n=t.classRegistry.getIdentifier(e.constructor);return["class",n]},function(e,t){var n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return Py({},e);var r={};return n.forEach(function(o){r[o]=e[o]}),r},function(e,t,n){var r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),w5=xg(function(e,t){return!!t.customTransformerRegistry.findApplicable(e)},function(e,t){var n=t.customTransformerRegistry.findApplicable(e);return["custom",n.name]},function(e,t){var n=t.customTransformerRegistry.findApplicable(e);return n.serialize(e)},function(e,t,n){var r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),Y6=[x5,v5,w5,b5],S5=function(e,t){var n=d5(Y6,function(o){return o.isApplicable(e,t)});if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};var r=d5(m5,function(o){return o.isApplicable(e,t)});if(r)return{value:r.transform(e,t),type:r.annotation}},C5={};m5.forEach(function(e){C5[e.annotation]=e});var X6=function(e,t,n){if(xa(t))switch(t[0]){case"symbol":return v5.untransform(e,t,n);case"class":return x5.untransform(e,t,n);case"custom":return w5.untransform(e,t,n);case"typed-array":return b5.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{var r=C5[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},nu=function(e,t){for(var n=e.keys();t>0;)n.next(),t--;return n.next().value};function _5(e){if(yg(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(yg(e,"prototype"))throw new Error("prototype is not allowed as a property");if(yg(e,"constructor"))throw new Error("constructor is not allowed as a property")}var Q6=function(e,t){_5(t);for(var n=0;n<t.length;n++){var r=t[n];if(ff(e))e=nu(e,+r);else if(df(e)){var o=+r,i=+t[++n]==0?"key":"value",s=nu(e,o);switch(i){case"key":e=s;break;case"value":e=e.get(s);break}}else e=e[r]}return e},$y=function(e,t,n){if(_5(t),t.length===0)return n(e);for(var r=e,o=0;o<t.length-1;o++){var i=t[o];if(xa(r)){var s=+i;r=r[s]}else if(uf(r))r=r[i];else if(ff(r)){var a=+i;r=nu(r,a)}else if(df(r)){var l=o===t.length-2;if(l)break;var a=+i,c=+t[++o]==0?"key":"value",u=nu(r,a);switch(c){case"key":r=u;break;case"value":r=r.get(u);break}}}var d=t[t.length-1];if(xa(r)?r[+d]=n(r[+d]):uf(r)&&(r[d]=n(r[d])),ff(r)){var h=nu(r,+d),p=n(h);h!==p&&(r.delete(h),r.add(p))}if(df(r)){var a=+t[t.length-2],m=nu(r,a),c=+d==0?"key":"value";switch(c){case"key":{var v=n(m);r.set(v,r.get(m)),v!==m&&r.delete(m);break}case"value":{r.set(m,n(r.get(m)));break}}}return e},Ds=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},wa=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function Ty(e,t,n){if(n===void 0&&(n=[]),!!e){if(!xa(e)){tu(e,function(s,a){return Ty(s,t,wa(wa([],Ds(n)),Ds(hf(a))))});return}var r=Ds(e,2),o=r[0],i=r[1];i&&tu(i,function(s,a){Ty(s,t,wa(wa([],Ds(n)),Ds(hf(a))))}),t(o,n)}}function Z6(e,t,n){return Ty(t,function(r,o){e=$y(e,o,function(i){return X6(i,r,n)})}),e}function J6(e,t){function n(s,a){var l=Q6(e,hf(a));s.map(hf).forEach(function(c){e=$y(e,c,function(){return l})})}if(xa(t)){var r=Ds(t,2),o=r[0],i=r[1];o.forEach(function(s){e=$y(e,hf(s),function(){return e})}),i&&tu(i,n)}else tu(t,n);return e}var ej=function(e,t){return uf(e)||xa(e)||df(e)||ff(e)||y5(e,t)};function tj(e,t,n){var r=n.get(e);r?r.push(t):n.set(e,[t])}function nj(e,t){var n={},r=void 0;return e.forEach(function(o){if(!(o.length<=1)){t||(o=o.map(function(l){return l.map(String)}).sort(function(l,c){return l.length-c.length}));var i=Ds(o),s=i[0],a=i.slice(1);s.length===0?r=a.map(Oy):n[Oy(s)]=a.map(Oy)}}),r?ky(n)?[r]:[r,n]:ky(n)?void 0:n}var E5=function(e,t,n,r,o,i,s){var a;o===void 0&&(o=[]),i===void 0&&(i=[]),s===void 0&&(s=new Map);var l=H6(e);if(!l){tj(e,o,t);var c=s.get(e);if(c)return r?{transformedValue:null}:c}if(!ej(e,n)){var u=S5(e,n),d=u?{transformedValue:u.value,annotations:[u.type]}:{transformedValue:e};return l||s.set(e,d),d}if(yg(i,e))return{transformedValue:null};var h=S5(e,n),p=(a=h==null?void 0:h.value)!==null&&a!==void 0?a:e,m=xa(p)?[]:{},v={};tu(p,function(w,C){var _=E5(w,t,n,r,wa(wa([],Ds(o)),[C]),wa(wa([],Ds(i)),[e]),s);m[C]=_.transformedValue,xa(_.annotations)?v[C]=_.annotations:uf(_.annotations)&&tu(_.annotations,function(k,E){v[g5(C)+"."+E]=k})});var y=ky(v)?{transformedValue:m,annotations:h?[h.type]:void 0}:{transformedValue:m,annotations:h?[h.type,v]:v};return l||s.set(e,y),y};function k5(e){return Object.prototype.toString.call(e).slice(8,-1)}function rj(e){if(k5(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function O5(e){return k5(e)==="Array"}function oj(e,t,n,r,o){const i={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";i==="enumerable"&&(e[t]=n),o&&i==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Ay(e,t={}){if(O5(e))return e.map(o=>Ay(o,t));if(!rj(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((o,i)=>{if(O5(t.props)&&!t.props.includes(i))return o;const s=e[i],a=Ay(s,t);return oj(o,i,a,e,t.nonenumerable),o},{})}var $l=function(){return $l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},$l.apply(this,arguments)},ij=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},sj=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},P5=function(){function e(t){var n=t===void 0?{}:t,r=n.dedupe,o=r===void 0?!1:r;this.classRegistry=new M6,this.symbolRegistry=new u5(function(i){var s;return(s=i.description)!==null&&s!==void 0?s:""}),this.customTransformerRegistry=new I6,this.allowedErrorProps=[],this.dedupe=o}return e.prototype.serialize=function(t){var n=new Map,r=E5(t,n,this,this.dedupe),o={json:r.transformedValue};r.annotations&&(o.meta=$l($l({},o.meta),{values:r.annotations}));var i=nj(n,this.dedupe);return i&&(o.meta=$l($l({},o.meta),{referentialEqualities:i})),o},e.prototype.deserialize=function(t){var n=t.json,r=t.meta,o=Ay(n);return r!=null&&r.values&&(o=Z6(o,r.values,this)),r!=null&&r.referentialEqualities&&(o=J6(o,r.referentialEqualities)),o},e.prototype.stringify=function(t){return JSON.stringify(this.serialize(t))},e.prototype.parse=function(t){return this.deserialize(JSON.parse(t))},e.prototype.registerClass=function(t,n){this.classRegistry.register(t,n)},e.prototype.registerSymbol=function(t,n){this.symbolRegistry.register(t,n)},e.prototype.registerCustom=function(t,n){this.customTransformerRegistry.register($l({name:n},t))},e.prototype.allowErrorProps=function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];(t=this.allowedErrorProps).push.apply(t,sj([],ij(n)))},e.defaultInstance=new e,e.serialize=e.defaultInstance.serialize.bind(e.defaultInstance),e.deserialize=e.defaultInstance.deserialize.bind(e.defaultInstance),e.stringify=e.defaultInstance.stringify.bind(e.defaultInstance),e.parse=e.defaultInstance.parse.bind(e.defaultInstance),e.registerClass=e.defaultInstance.registerClass.bind(e.defaultInstance),e.registerSymbol=e.defaultInstance.registerSymbol.bind(e.defaultInstance),e.registerCustom=e.defaultInstance.registerCustom.bind(e.defaultInstance),e.allowErrorProps=e.defaultInstance.allowErrorProps.bind(e.defaultInstance),e}(),aj=P5.serialize,lj=P5.stringify;function ru(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function cj(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function uj({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function ou({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function dj(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var wg=(e,t=!1)=>{const{json:n}=aj(e);return JSON.stringify(n,null,t?2:void 0)},Sg=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,fj=(e,t)=>e.queryHash.localeCompare(t.queryHash),D5=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,hj=(e,t)=>Sg(e)===Sg(t)?D5(e,t):Sg(e)>Sg(t)?1:-1,Iy={status:hj,"query hash":fj,"last updated":D5},Cg=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,M5=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,pj=(e,t)=>Cg(e)===Cg(t)?M5(e,t):Cg(e)>Cg(t)?1:-1,Ny={status:pj,"last updated":M5},$5=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),gj=()=>{const[e,t]=qe("dark");return Ml(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const r=o=>{t(o.matches?"dark":"light")};n.addEventListener("change",r),pt(()=>n.removeEventListener("change",r))}),e},Tl=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const r=new Map(e);if(t.length===1)return r.set(t[0],n),r;const[o,...i]=t;return r.set(o,Tl(r.get(o),i,n)),r}if(e instanceof Set){const r=Tl(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(t.length===1)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=Tl(r[o],i,n),r}if(e instanceof Object){const r={...e};if(t.length===1)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=Tl(r[o],i,n),r}return e},pf=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[r,...o]=t;return n.set(r,pf(n.get(r),o)),n}if(e instanceof Set){const n=pf(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((i,s)=>s.toString()!==t[0]);const[r,...o]=t;return n[r]=pf(n[r],o),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[r,...o]=t;return n[r]=pf(n[r],o),n}return e},mj=e=>{if(!e||document.querySelector("#_goober"))return;const n=document.createElement("style"),r=document.createTextNode("");n.appendChild(r),n.id="_goober",n.setAttribute("nonce",e),document.head.appendChild(n)},vj=(w8=class{constructor(e){Ge(this,Od,void 0);Ge(this,kp,void 0);Ge(this,Op,void 0);Ge(this,Pp,void 0);Ge(this,Nc,!1);Ge(this,Dp,void 0);Ge(this,Pd,void 0);Ge(this,Dd,void 0);Ge(this,Md,void 0);Ge(this,$d,void 0);Ge(this,Td,void 0);Ge(this,Mp,void 0);const{client:t,queryFlavor:n,version:r,onlineManager:o,buttonPosition:i,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c}=e;je(this,Od,qe(t)),je(this,Op,n),je(this,Pp,r),je(this,kp,o),je(this,Dp,c),je(this,Pd,qe(i)),je(this,Dd,qe(s)),je(this,Md,qe(a)),je(this,$d,qe(l))}setButtonPosition(e){ee(this,Pd)[1](e)}setPosition(e){ee(this,Dd)[1](e)}setInitialIsOpen(e){ee(this,Md)[1](e)}setErrorTypes(e){ee(this,$d)[1](e)}setClient(e){ee(this,Od)[1](e)}mount(e){if(ee(this,Nc))throw new Error("Devtools is already mounted");const t=v6(()=>{const[n]=ee(this,Pd),[r]=ee(this,Dd),[o]=ee(this,Md),[i]=ee(this,$d),[s]=ee(this,Od);let a;ee(this,Td)?a=ee(this,Td):(a=r6(()=>Promise.resolve().then(()=>Zbe)),je(this,Td,a)),mj(ee(this,Dp));const l=this;return Q(a,Pt({get queryFlavor(){return ee(l,Op)},get version(){return ee(l,Pp)},get onlineManager(){return ee(l,kp)}},{get client(){return s()},get buttonPosition(){return n()},get position(){return r()},get initialIsOpen(){return o()},get errorTypes(){return i()}}))},e);je(this,Nc,!0),je(this,Mp,t)}unmount(){var e;if(!ee(this,Nc))throw new Error("Devtools is not mounted");(e=ee(this,Mp))==null||e.call(this),je(this,Nc,!1)}},Od=new WeakMap,kp=new WeakMap,Op=new WeakMap,Pp=new WeakMap,Nc=new WeakMap,Dp=new WeakMap,Pd=new WeakMap,Dd=new WeakMap,Md=new WeakMap,$d=new WeakMap,Td=new WeakMap,Mp=new WeakMap,w8);function bj(e){const t=HE(),n=e.client||t,r=he.useRef(null),{buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}=e,[c]=he.useState(new vj({client:n,queryFlavor:"React Query",version:"5",onlineManager:sf,buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}));return he.useEffect(()=>{c.setClient(n)},[n,c]),he.useEffect(()=>{o&&c.setButtonPosition(o)},[o,c]),he.useEffect(()=>{i&&c.setPosition(i)},[i,c]),he.useEffect(()=>{c.setInitialIsOpen(s||!1)},[s,c]),he.useEffect(()=>{c.setErrorTypes(a||[])},[a,c]),he.useEffect(()=>(r.current&&c.mount(r.current),()=>{c.unmount()}),[c]),he.createElement("div",{className:"tsqd-parent-container",ref:r})}var yj=process.env.NODE_ENV!=="development"?function(){return null}:bj;const xj={id:"",authToken:void 0},T5=b.createContext(xj),A5=({children:e,dashboardProps:t})=>x.jsxs(UE,{children:[x.jsx(T5.Provider,{value:t,children:e}),x.jsx(yj,{initialIsOpen:!1})]});function Vi(){const e=b.useContext(T5);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function I5(e,t){var xe;let n=b.useMemo(()=>[],[]);const r=Vi().authToken||e,o=be(K=>K.selectedConnectionId),i=be(K=>K.selectedDatabaseName),s=be(K=>K.selectedSchemaName),a=be(K=>K.selectedTableName),l=be(K=>K.actions.setCurrentColumns),c=be(K=>K.actions.setSelectedConnectionId),u=be(K=>K.actions.setSelectedDatabaseName),d=be(K=>K.actions.setSelectedSchemaName),h=be(K=>K.actions.setSelectedTableName),p=be(K=>K.actions.setCardSql),{data:m,isLoading:v,isError:y}=yi({queryKey:["connections"],queryFn:()=>Gc("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)});console.log("connectionsData",m,"selectedConnectionId",o);const w=m==null?void 0:m.connections.find(K=>K.id===o),C=(w==null?void 0:w.type)==="API"||(w==null?void 0:w.type)==="S3",{data:_,isLoading:k,isFetching:E,isError:P,refetch:D}=yi({queryKey:[o],queryFn:()=>Gc("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:o}),enabled:!!o&&!C}),{data:M,isLoading:I,isFetching:F,isError:R,refetch:B}=yi({queryKey:[o,i],queryFn:()=>Gc("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i}),enabled:!!o&&!!i&&!C}),{data:ie,isLoading:q,isFetching:z,isError:X,refetch:U}=yi({queryKey:[o,i,s],queryFn:()=>Gc("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i,schema_name:s}),enabled:!!o&&!!i&&!!s&&!C}),{data:Z,isLoading:G,isFetching:$,isError:H}=yi({queryKey:[o,i,s,a],queryFn:()=>Gc("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i,schema_name:s,table_name:a}),enabled:!!o&&!!i&&!!s&&!!a||C});b.useEffect(()=>{l(n)},[Z,l,n]),b.useEffect(()=>{var K;C&&(u("NA"),d("NA"),h((K=w==null?void 0:w.type)==null?void 0:K.toLowerCase()))},[C,p,h,d,u,w]);const re=C?(xe=w==null?void 0:w.type)==null?void 0:xe.toLowerCase():a||"",N=C?"":s||"";function V(K){d(K),h("")}function ue(K){u(K),d(""),h("")}function ce(K){c(K)}_&&_.databases.length>0,M&&M.schemas.length>0,Z&&Z.columns.length>0&&(n=Z.columns.map(K=>({...K,data_type:K.data_type.toLowerCase()}))),P&&(n=[]),(H||y)&&(n=[]);const pe=m==null?void 0:m.connections.map(K=>({id:K.id,name:K.name,type:K.type})),se=_==null?void 0:_.databases.map(K=>({id:K.database_name,name:K.database_name})),ne=M==null?void 0:M.schemas.map(K=>({id:K.schema_name,name:K.schema_name})),le=ie==null?void 0:ie.tables.map(K=>({id:K.table_name,name:K.table_name}));return{connectionItems:pe,isConnectionsLoading:v,isConnectionsError:y,databaseItems:se,isDatabasesLoadingOrFetching:k||E,isDatabaseError:P,schemaItems:ne,isSchemaLoadingOrFetching:I||F,isSchemaError:R,tableItems:le,isTableLoadingOrFetching:q||z,isTableError:X,columns:n,isColumnsLoadingOrFetching:G||$,isColumnsError:H,isAPIConnection:C,tableName:re,schemaName:N,handleConnectionChange:ce,handleDatabaseChange:ue,handleSchemaChange:V}}const wj=e=>{const t=new Date(e);return!isNaN(t.getTime())},Sj=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),_g=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?wj(e)?t="date":Sj(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function Cj({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(h=n.preferences)==null?void 0:h.filterOnClickField,valueType:_g(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),i(p);return}else s(d)}o(n),r(d)}var Eg={exports:{}};/**
59
+ */var aE;function jF(){if(aE)return Wb;aE=1;var e=b,t=iE();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Wb.useSyncExternalStoreWithSelector=function(c,u,d,h,p){var m=i(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function w(P){if(!C){if(C=!0,_=P,P=h(P),p!==void 0&&v.hasValue){var D=v.value;if(p(D,P))return k=D}return k=P}if(D=k,r(_,P))return D;var M=h(P);return p!==void 0&&p(D,M)?D:(_=P,k=M)}var C=!1,_,k,E=d===void 0?null:d;return[function(){return w(u())},E===null?void 0:function(){return w(E())}]},[u,d,h,p]);var y=o(c,m[0],m[1]);return s(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},Wb}process.env.NODE_ENV==="production"?Bb.exports=jF():Bb.exports=RF();var zF=Bb.exports;const BF=Gd(zF);var lE={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:VF}=b,{useSyncExternalStoreWithSelector:HF}=BF;let cE=!1;function qF(e,t=e.getState,n){(lE?"production":void 0)!=="production"&&n&&!cE&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),cE=!0);const r=HF(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return VF(r),r}const uE=e=>{(lE?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?NF(e):e,n=(r,o)=>qF(t,r,o);return Object.assign(n,t),n},dE=e=>e?uE(e):uE;var fE=Symbol.for("immer-nothing"),hE=Symbol.for("immer-draftable"),po=Symbol.for("immer-state"),WF=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Gr(e,...t){if(process.env.NODE_ENV!=="production"){const n=WF[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Kc=Object.getPrototypeOf;function Yc(e){return!!e&&!!e[po]}function Ol(e){var t;return e?pE(e)||Array.isArray(e)||!!e[hE]||!!((t=e.constructor)!=null&&t[hE])||Qp(e)||Zp(e):!1}var UF=Object.prototype.constructor.toString();function pE(e){if(!e||typeof e!="object")return!1;const t=Kc(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===UF}function Jd(e,t){Xp(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Xp(e){const t=e[po];return t?t.type_:Array.isArray(e)?1:Qp(e)?2:Zp(e)?3:0}function Ub(e,t){return Xp(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gE(e,t,n){const r=Xp(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function GF(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Qp(e){return e instanceof Map}function Zp(e){return e instanceof Set}function Pl(e){return e.copy_||e.base_}function Gb(e,t){if(Qp(e))return new Map(e);if(Zp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&pE(e))return Kc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[po];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(Kc(e),n)}function Kb(e,t=!1){return Jp(e)||Yc(e)||!Ol(e)||(Xp(e)>1&&(e.set=e.add=e.clear=e.delete=KF),Object.freeze(e),t&&Jd(e,(n,r)=>Kb(r,!0))),e}function KF(){Gr(2)}function Jp(e){return Object.isFrozen(e)}var YF={};function Dl(e){const t=YF[e];return t||Gr(0,e),t}var ef;function mE(){return ef}function XF(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vE(e,t){t&&(Dl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yb(e){Xb(e),e.drafts_.forEach(QF),e.drafts_=null}function Xb(e){e===ef&&(ef=e.parent_)}function bE(e){return ef=XF(ef,e)}function QF(e){const t=e[po];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yE(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[po].modified_&&(Yb(t),Gr(4)),Ol(e)&&(e=eg(t,e),t.parent_||tg(t,e)),t.patches_&&Dl("Patches").generateReplacementPatches_(n[po].base_,e,t.patches_,t.inversePatches_)):e=eg(t,n,[]),Yb(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==fE?e:void 0}function eg(e,t,n){if(Jp(t))return t;const r=t[po];if(!r)return Jd(t,(o,i)=>xE(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return tg(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),Jd(i,(a,l)=>xE(e,r,o,a,l,n,s)),tg(e,o,!1),n&&e.patches_&&Dl("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function xE(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Gr(5),Yc(o)){const a=i&&t&&t.type_!==3&&!Ub(t.assigned_,r)?i.concat(r):void 0,l=eg(e,o,a);if(gE(n,r,l),Yc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(Ol(o)&&!Jp(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;eg(e,o),(!t||!t.scope_.parent_)&&tg(e,o)}}function tg(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kb(t,n)}function ZF(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:mE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Qb;n&&(o=[r],i=tf);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Qb={get(e,t){if(t===po)return e;const n=Pl(e);if(!Ub(n,t))return JF(e,n,t);const r=n[t];return e.finalized_||!Ol(r)?r:r===Zb(e.base_,t)?(ey(e),e.copy_[t]=ty(r,e)):r},has(e,t){return t in Pl(e)},ownKeys(e){return Reflect.ownKeys(Pl(e))},set(e,t,n){const r=wE(Pl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Zb(Pl(e),t),i=o==null?void 0:o[po];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(GF(n,o)&&(n!==void 0||Ub(e.base_,t)))return!0;ey(e),Jb(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Zb(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ey(e),Jb(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Pl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Gr(11)},getPrototypeOf(e){return Kc(e.base_)},setPrototypeOf(){Gr(12)}},tf={};Jd(Qb,(e,t)=>{tf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),tf.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Gr(13),tf.set.call(this,e,t,void 0)},tf.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Gr(14),Qb.set.call(this,e[0],t,n,e[0])};function Zb(e,t){const n=e[po];return(n?Pl(n):e)[t]}function JF(e,t,n){var o;const r=wE(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function wE(e,t){if(!(t in e))return;let n=Kc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Kc(n)}}function Jb(e){e.modified_||(e.modified_=!0,e.parent_&&Jb(e.parent_))}function ey(e){e.copy_||(e.copy_=Gb(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var eR=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Gr(6),r!==void 0&&typeof r!="function"&&Gr(7);let o;if(Ol(t)){const i=bE(this),s=ty(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?Yb(i):Xb(i)}return vE(i,r),yE(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===fE&&(o=void 0),this.autoFreeze_&&Kb(o,!0),r){const i=[],s=[];Dl("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Gr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ol(e)||Gr(8),Yc(e)&&(e=tR(e));const t=bE(this),n=ty(e,void 0);return n[po].isManual_=!0,Xb(t),n}finishDraft(e,t){const n=e&&e[po];(!n||!n.isManual_)&&Gr(9);const{scope_:r}=n;return vE(r,t),yE(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=Dl("Patches").applyPatches_;return Yc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function ty(e,t){const n=Qp(e)?Dl("MapSet").proxyMap_(e,t):Zp(e)?Dl("MapSet").proxySet_(e,t):ZF(e,t);return(t?t.scope_:mE()).drafts_.push(n),n}function tR(e){return Yc(e)||Gr(10,e),SE(e)}function SE(e){if(!Ol(e)||Jp(e))return e;const t=e[po];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Gb(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Gb(e,!0);return Jd(n,(r,o)=>{gE(n,r,SE(o))}),t&&(t.finalized_=!1),n}var go=new eR,nR=go.produce;go.produceWithPatches.bind(go),go.setAutoFreeze.bind(go),go.setUseStrictShallowCopy.bind(go),go.applyPatches.bind(go),go.createDraft.bind(go),go.finishDraft.bind(go);const CE=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?nR(o):o;return t(a,i,...s)},e(r.setState,n,r));var ng,rg=Jt;if(process.env.NODE_ENV==="production")ng=rg.createRoot,rg.hydrateRoot;else{var _E=rg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;ng=function(e,t){_E.usingClientEntryPoint=!0;try{return rg.createRoot(e,t)}finally{_E.usingClientEntryPoint=!1}}}function EE(e,t,n){const r={count:0},o=a=>{const l=b.useRef(r.count);return b.useEffect(()=>{l.current+=1,l.current===r.count+1&&(l.current-=1,t.setState(a))}),null};if(o.displayName=`((${e})) devtool`,typeof document>"u")return;if(!n){let a=document.getElementById(`simple-zustand-devtools-${e}`);a||(a=document.createElement("div"),a.id=`simple-zustand-devtools-${e}`),document.body.appendChild(a),n=a}const i=ng(n),s=a=>{a&&(i.render(b.createElement(o,Object.assign({},a))),r.count+=1)};s(t.getState()),t.subscribe(s)}var kE={},OE={},ny={exports:{}},On=String,PE=function(){return{isColorSupported:!1,reset:On,bold:On,dim:On,italic:On,underline:On,inverse:On,hidden:On,strikethrough:On,black:On,red:On,green:On,yellow:On,blue:On,magenta:On,cyan:On,white:On,gray:On,bgBlack:On,bgRed:On,bgGreen:On,bgYellow:On,bgBlue:On,bgMagenta:On,bgCyan:On,bgWhite:On}};ny.exports=PE(),ny.exports.createColors=PE;var rR=ny.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(rR);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(OE),function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(OE);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}}(kE);let ry=kE;var oR=(ry.__esModule?ry:{default:ry}).default;const bn=Gd(oR),oy={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],borderColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:DE},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],borderColor:[bn.blue[500],bn.teal[500],bn.amber[500],bn.red[500],bn.indigo[500],bn.green[500]],datalables:{color:DE}},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:bn.slate[800]}},y:{grid:{display:!0,color:bn.slate[800]}}}}}}};function DE(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=og()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=og()),ig(n)}function og(){return me.getState().theme==="dark"?"#000000":"#FFFFFF"}function ig(e){let t=0,n=0,r=0,o=0;const i=u=>{const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),p=parseInt(d.substring(2,4),16),m=parseInt(d.substring(4,6),16);t+=h,n+=p,r+=m,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}var nf=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(){}},Xc=typeof window>"u"||"Deno"in window;function Ho(){}function iR(e,t){return typeof e=="function"?e(t):e}function iy(e){return typeof e=="number"&&e>=0&&e!==1/0}function ME(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $E(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==sy(s,t.options))return!1}else if(!of(t.queryKey,s))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||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function TE(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(rf(t.options.mutationKey)!==rf(i))return!1}else if(!of(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function sy(e,t){return((t==null?void 0:t.queryKeyHashFn)||rf)(e)}function rf(e){return JSON.stringify(e,(t,n)=>ly(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function of(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!of(e[n],t[n])):!1}function AE(e,t){if(e===t)return e;const n=IE(e)&&IE(t);if(n||ly(e)&&ly(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=AE(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function ay(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function IE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ly(e){if(!NE(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!NE(n)||!n.hasOwnProperty("isPrototypeOf"))}function NE(e){return Object.prototype.toString.call(e)==="[object Object]"}function sR(e){return new Promise(t=>{setTimeout(t,e)})}function cy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?AE(e,t):t}function aR(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lR(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var cR=(f8=class extends nf{constructor(){super();Ge(this,Oc,void 0);Ge(this,rl,void 0);Ge(this,fd,void 0);je(this,fd,t=>{if(!Xc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ee(this,rl)||this.setEventListener(ee(this,fd))}onUnsubscribe(){var t;this.hasListeners()||((t=ee(this,rl))==null||t.call(this),je(this,rl,void 0))}setEventListener(t){var n;je(this,fd,t),(n=ee(this,rl))==null||n.call(this),je(this,rl,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ee(this,Oc)!==t&&(je(this,Oc,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof ee(this,Oc)=="boolean"?ee(this,Oc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Oc=new WeakMap,rl=new WeakMap,fd=new WeakMap,f8),sg=new cR,uR=(h8=class extends nf{constructor(){super();Ge(this,hd,!0);Ge(this,ol,void 0);Ge(this,pd,void 0);je(this,pd,t=>{if(!Xc&&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(){ee(this,ol)||this.setEventListener(ee(this,pd))}onUnsubscribe(){var t;this.hasListeners()||((t=ee(this,ol))==null||t.call(this),je(this,ol,void 0))}setEventListener(t){var n;je(this,pd,t),(n=ee(this,ol))==null||n.call(this),je(this,ol,t(this.setOnline.bind(this)))}setOnline(t){ee(this,hd)!==t&&(je(this,hd,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ee(this,hd)}},hd=new WeakMap,ol=new WeakMap,pd=new WeakMap,h8),sf=new uR;function dR(e){return Math.min(1e3*2**e,3e4)}function ag(e){return(e??"online")==="online"?sf.isOnline():!0}var LE=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function uy(e){return e instanceof LE}function FE(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((y,w)=>{i=y,s=w}),l=y=>{var w;r||(p(new LE(y)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},u=()=>{t=!1},d=()=>!sg.isFocused()||e.networkMode!=="always"&&!sf.isOnline(),h=y=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,y),o==null||o(),i(y))},p=y=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,y),o==null||o(),s(y))},m=()=>new Promise(y=>{var w;o=C=>{const _=r||!d();return _&&y(C),_},(w=e.onPause)==null||w.call(e)}).then(()=>{var y;o=void 0,r||(y=e.onContinue)==null||y.call(e)}),v=()=>{if(r)return;let y;try{y=e.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(h).catch(w=>{var P;if(r)return;const C=e.retry??(Xc?0:3),_=e.retryDelay??dR,k=typeof _=="function"?_(n,w):_,E=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,w);if(t||!E){p(w);return}n++,(P=e.onFail)==null||P.call(e,n,w),sR(k).then(()=>{if(d())return m()}).then(()=>{t?p(w):v()})})};return ag(e.networkMode)?v():m().then(v),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function fR(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let p;t++;try{p=h()}finally{t--,t||c()}return p},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...p)=>{a(()=>{h(...p)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var br=fR(),RE=(p8=class{constructor(){Ge(this,Pc,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iy(this.gcTime)&&je(this,Pc,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xc?1/0:5*60*1e3))}clearGcTimeout(){ee(this,Pc)&&(clearTimeout(ee(this,Pc)),je(this,Pc,void 0))}},Pc=new WeakMap,p8),hR=(g8=class extends RE{constructor(t){super();Ge(this,vd);Ge(this,Ni);Ge(this,gd,void 0);Ge(this,md,void 0);Ge(this,si,void 0);Ge(this,il,void 0);Ge(this,ai,void 0);Ge(this,gr,void 0);Ge(this,pp,void 0);Ge(this,Dc,void 0);je(this,Dc,!1),je(this,pp,t.defaultOptions),Bt(this,vd,Nb).call(this,t.options),je(this,gr,[]),je(this,si,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,je(this,gd,t.state||pR(this.options)),this.state=ee(this,gd),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ee(this,gr).length&&this.state.fetchStatus==="idle"&&ee(this,si).remove(this)}setData(t,n){const r=cy(this.state.data,t,this.options);return Bt(this,Ni,ga).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Bt(this,Ni,ga).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=ee(this,il);return(r=ee(this,ai))==null||r.cancel(t),n?n.then(Ho).catch(Ho):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ee(this,gd))}isActive(){return ee(this,gr).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ee(this,gr).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!ME(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=ee(this,gr).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ee(this,ai))==null||n.continue()}onOnline(){var n;const t=ee(this,gr).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ee(this,ai))==null||n.continue()}addObserver(t){ee(this,gr).includes(t)||(ee(this,gr).push(t),this.clearGcTimeout(),ee(this,si).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){ee(this,gr).includes(t)&&(je(this,gr,ee(this,gr).filter(n=>n!==t)),ee(this,gr).length||(ee(this,ai)&&(ee(this,Dc)?ee(this,ai).cancel({revert:!0}):ee(this,ai).cancelRetry()),this.scheduleGc()),ee(this,si).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return ee(this,gr).length}invalidate(){this.state.isInvalidated||Bt(this,Ni,ga).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ee(this,il))return(c=ee(this,ai))==null||c.continueRetry(),ee(this,il)}if(t&&Bt(this,vd,Nb).call(this,t),!this.options.queryFn){const p=ee(this,gr).find(m=>m.options.queryFn);p&&Bt(this,vd,Nb).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.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 r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(je(this,Dc,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(je(this,Dc,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),je(this,md,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&Bt(this,Ni,ga).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=p=>{var m,v,y,w;uy(p)&&p.silent||Bt(this,Ni,ga).call(this,{type:"error",error:p}),uy(p)||((v=(m=ee(this,si).config).onError)==null||v.call(m,p,this),(w=(y=ee(this,si).config).onSettled)==null||w.call(y,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return je(this,ai,FE({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,v,y,w;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.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}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(v=(m=ee(this,si).config).onSuccess)==null||v.call(m,p,this),(w=(y=ee(this,si).config).onSettled)==null||w.call(y,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,m)=>{Bt(this,Ni,ga).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{Bt(this,Ni,ga).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Ni,ga).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),je(this,il,ee(this,ai).promise),ee(this,il)}},gd=new WeakMap,md=new WeakMap,si=new WeakMap,il=new WeakMap,ai=new WeakMap,gr=new WeakMap,pp=new WeakMap,Dc=new WeakMap,vd=new WeakSet,Nb=function(t){this.options={...ee(this,pp),...t},this.updateGcTime(this.options.gcTime)},Ni=new WeakSet,ga=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,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:ag(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...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}};case"error":const o=t.error;return uy(o)&&o.revert&&ee(this,md)?{...ee(this,md),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),br.batch(()=>{ee(this,gr).forEach(r=>{r.onQueryUpdate()}),ee(this,si).notify({query:this,type:"updated",action:t})})},g8);function pR(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",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 gR=(m8=class extends nf{constructor(t={}){super();Ge(this,fs,void 0);this.config=t,je(this,fs,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??sy(o,n);let s=this.get(i);return s||(s=new hR({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ee(this,fs).has(t.queryHash)||(ee(this,fs).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ee(this,fs).get(t.queryHash);n&&(t.destroy(),n===t&&ee(this,fs).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){br.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ee(this,fs).get(t)}getAll(){return[...ee(this,fs).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$E(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>$E(t,r)):n}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){br.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){br.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fs=new WeakMap,m8),mR=(v8=class extends RE{constructor(t){super();Ge(this,ps);Ge(this,hs,void 0);Ge(this,gp,void 0);Ge(this,Lo,void 0);Ge(this,bd,void 0);this.mutationId=t.mutationId,je(this,gp,t.defaultOptions),je(this,Lo,t.mutationCache),je(this,hs,[]),this.state=t.state||vR(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...ee(this,gp),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ee(this,hs).includes(t)||(ee(this,hs).push(t),this.clearGcTimeout(),ee(this,Lo).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){je(this,hs,ee(this,hs).filter(n=>n!==t)),this.scheduleGc(),ee(this,Lo).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ee(this,hs).length||(this.state.status==="pending"?this.scheduleGc():ee(this,Lo).remove(this))}continue(){var t;return((t=ee(this,bd))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,h,p,m,v,y,w,C,_,k,E,P,D;const n=()=>(je(this,bd,FE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,I)=>{Bt(this,ps,_l).call(this,{type:"failed",failureCount:M,error:I})},onPause:()=>{Bt(this,ps,_l).call(this,{type:"pause"})},onContinue:()=>{Bt(this,ps,_l).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ee(this,bd).promise),r=this.state.status==="pending";try{if(!r){Bt(this,ps,_l).call(this,{type:"pending",variables:t}),await((i=(o=ee(this,Lo).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&Bt(this,ps,_l).call(this,{type:"pending",context:I,variables:t})}const M=await n();return await((c=(l=ee(this,Lo).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,M,t,this.state.context)),await((p=(h=ee(this,Lo).config).onSettled)==null?void 0:p.call(h,M,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,M,null,t,this.state.context)),Bt(this,ps,_l).call(this,{type:"success",data:M}),M}catch(M){try{throw await((w=(y=ee(this,Lo).config).onError)==null?void 0:w.call(y,M,t,this.state.context,this)),await((_=(C=this.options).onError)==null?void 0:_.call(C,M,t,this.state.context)),await((E=(k=ee(this,Lo).config).onSettled)==null?void 0:E.call(k,void 0,M,this.state.variables,this.state.context,this)),await((D=(P=this.options).onSettled)==null?void 0:D.call(P,void 0,M,t,this.state.context)),M}finally{Bt(this,ps,_l).call(this,{type:"error",error:M})}}}},hs=new WeakMap,gp=new WeakMap,Lo=new WeakMap,bd=new WeakMap,ps=new WeakSet,_l=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:!ag(this.options.networkMode),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),br.batch(()=>{ee(this,hs).forEach(r=>{r.onMutationUpdate(t)}),ee(this,Lo).notify({mutation:this,type:"updated",action:t})})},v8);function vR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bR=(b8=class extends nf{constructor(t={}){super();Ge(this,li,void 0);Ge(this,mp,void 0);Ge(this,Mc,void 0);this.config=t,je(this,li,[]),je(this,mp,0)}build(t,n,r){const o=new mR({mutationCache:this,mutationId:++Ib(this,mp)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ee(this,li).push(t),this.notify({type:"added",mutation:t})}remove(t){je(this,li,ee(this,li).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){br.batch(()=>{ee(this,li).forEach(t=>{this.remove(t)})})}getAll(){return ee(this,li)}find(t){const n={exact:!0,...t};return ee(this,li).find(r=>TE(n,r))}findAll(t={}){return ee(this,li).filter(n=>TE(t,n))}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return je(this,Mc,(ee(this,Mc)??Promise.resolve()).then(()=>{const t=ee(this,li).filter(n=>n.state.isPaused);return br.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Ho)),Promise.resolve()))}).then(()=>{je(this,Mc,void 0)})),ee(this,Mc)}},li=new WeakMap,mp=new WeakMap,Mc=new WeakMap,b8);function yR(e){return{onFetch:(t,n)=>{const r=async()=>{var m,v,y,w,C;const o=t.options,i=(y=(v=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:v.fetchMore)==null?void 0:y.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((C=t.state.data)==null?void 0:C.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},d=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(_,k,E)=>{if(c)return Promise.reject();if(k==null&&_.pages.length)return Promise.resolve(_);const P={queryKey:t.queryKey,pageParam:k,direction:E?"backward":"forward",meta:t.options.meta};u(P);const D=await d(P),{maxPages:M}=t.options,I=E?lR:aR;return{pages:I(_.pages,D,M),pageParams:I(_.pageParams,k,M)}};let p;if(i&&s.length){const _=i==="backward",k=_?xR:jE,E={pages:s,pageParams:a},P=k(o,E);p=await h(E,P,_)}else{p=await h(l,a[0]??o.initialPageParam);const _=e??s.length;for(let k=1;k<_;k++){const E=jE(o,p);p=await h(p,E)}}return p};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function jE(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function xR(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var wR=(y8=class{constructor(e={}){Ge(this,cr,void 0);Ge(this,sl,void 0);Ge(this,al,void 0);Ge(this,yd,void 0);Ge(this,xd,void 0);Ge(this,ll,void 0);Ge(this,wd,void 0);Ge(this,Sd,void 0);je(this,cr,e.queryCache||new gR),je(this,sl,e.mutationCache||new bR),je(this,al,e.defaultOptions||{}),je(this,yd,new Map),je(this,xd,new Map),je(this,ll,0)}mount(){Ib(this,ll)._++,ee(this,ll)===1&&(je(this,wd,sg.subscribe(()=>{sg.isFocused()&&(this.resumePausedMutations(),ee(this,cr).onFocus())})),je(this,Sd,sf.subscribe(()=>{sf.isOnline()&&(this.resumePausedMutations(),ee(this,cr).onOnline())})))}unmount(){var e,t;Ib(this,ll)._--,ee(this,ll)===0&&((e=ee(this,wd))==null||e.call(this),je(this,wd,void 0),(t=ee(this,Sd))==null||t.call(this),je(this,Sd,void 0))}isFetching(e){return ee(this,cr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ee(this,sl).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=ee(this,cr).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=ee(this,cr).find({queryKey:e}),o=r==null?void 0:r.state.data,i=iR(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return ee(this,cr).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return br.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=ee(this,cr).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=ee(this,cr);br.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ee(this,cr),r={type:"active",...e};return br.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=br.batch(()=>ee(this,cr).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ho).catch(Ho)}invalidateQueries(e={},t={}){return br.batch(()=>{if(ee(this,cr).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=br.batch(()=>ee(this,cr).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ho)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ho)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=ee(this,cr).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ho).catch(Ho)}fetchInfiniteQuery(e){return e.behavior=yR(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ho).catch(Ho)}resumePausedMutations(){return ee(this,sl).resumePausedMutations()}getQueryCache(){return ee(this,cr)}getMutationCache(){return ee(this,sl)}getDefaultOptions(){return ee(this,al)}setDefaultOptions(e){je(this,al,e)}setQueryDefaults(e,t){ee(this,yd).set(rf(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ee(this,yd).values()];let n={};return t.forEach(r=>{of(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ee(this,xd).set(rf(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ee(this,xd).values()];let n={};return t.forEach(r=>{of(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...ee(this,al).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sy(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ee(this,al).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ee(this,cr).clear(),ee(this,sl).clear()}},cr=new WeakMap,sl=new WeakMap,al=new WeakMap,yd=new WeakMap,xd=new WeakMap,ll=new WeakMap,wd=new WeakMap,Sd=new WeakMap,y8),SR=(x8=class extends nf{constructor(t,n){super();Ge(this,Ic);Ge(this,yp);Ge(this,xp);Ge(this,wp);Ge(this,Sp);Ge(this,Cp);Ge(this,_p);Ge(this,Ep);Ge(this,Uv);Ge(this,ao,void 0);Ge(this,Tn,void 0);Ge(this,vp,void 0);Ge(this,Vr,void 0);Ge(this,$c,void 0);Ge(this,Cd,void 0);Ge(this,gs,void 0);Ge(this,bp,void 0);Ge(this,_d,void 0);Ge(this,Ed,void 0);Ge(this,Tc,void 0);Ge(this,Ac,void 0);Ge(this,cl,void 0);Ge(this,kd,new Set);this.options=n,je(this,ao,t),je(this,gs,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ee(this,Tn).addObserver(this),zE(ee(this,Tn),this.options)?Bt(this,Ic,Up).call(this):this.updateResult(),Bt(this,Sp,z2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dy(ee(this,Tn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dy(ee(this,Tn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,Cp,B2).call(this),Bt(this,_p,V2).call(this),ee(this,Tn).removeObserver(this)}setOptions(t,n){const r=this.options,o=ee(this,Tn);if(this.options=ee(this,ao).defaultQueryOptions(t),ay(r,this.options)||ee(this,ao).getQueryCache().notify({type:"observerOptionsUpdated",query:ee(this,Tn),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=r.queryKey),Bt(this,Ep,H2).call(this);const i=this.hasListeners();i&&BE(ee(this,Tn),o,this.options,r)&&Bt(this,Ic,Up).call(this),this.updateResult(n),i&&(ee(this,Tn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Bt(this,yp,F2).call(this);const s=Bt(this,xp,R2).call(this);i&&(ee(this,Tn)!==o||this.options.enabled!==r.enabled||s!==ee(this,cl))&&Bt(this,wp,j2).call(this,s)}getOptimisticResult(t){const n=ee(this,ao).getQueryCache().build(ee(this,ao),t),r=this.createResult(n,t);return _R(this,r)&&(je(this,Vr,r),je(this,Cd,this.options),je(this,$c,ee(this,Tn).state)),r}getCurrentResult(){return ee(this,Vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(ee(this,kd).add(r),t[r])})}),n}getCurrentQuery(){return ee(this,Tn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ee(this,ao).defaultQueryOptions(t),r=ee(this,ao).getQueryCache().build(ee(this,ao),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Bt(this,Ic,Up).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ee(this,Vr)))}createResult(t,n){var P;const r=ee(this,Tn),o=this.options,i=ee(this,Vr),s=ee(this,$c),a=ee(this,Cd),c=t!==r?t.state:ee(this,vp),{state:u}=t;let{error:d,errorUpdatedAt:h,fetchStatus:p,status:m}=u,v=!1,y;if(n._optimisticResults){const D=this.hasListeners(),M=!D&&zE(t,n),I=D&&BE(t,r,n,o);(M||I)&&(p=ag(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(m="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===ee(this,bp))y=ee(this,_d);else try{je(this,bp,n.select),y=n.select(u.data),y=cy(i==null?void 0:i.data,y,n),je(this,_d,y),je(this,gs,null)}catch(D){je(this,gs,D)}else y=u.data;if(typeof n.placeholderData<"u"&&typeof y>"u"&&m==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((P=ee(this,Ed))==null?void 0:P.state.data,ee(this,Ed)):n.placeholderData,n.select&&typeof D<"u")try{D=n.select(D),je(this,gs,null)}catch(M){je(this,gs,M)}typeof D<"u"&&(m="success",y=cy(i==null?void 0:i.data,D,n),v=!0)}ee(this,gs)&&(d=ee(this,gs),y=ee(this,_d),h=Date.now(),m="error");const w=p==="fetching",C=m==="pending",_=m==="error",k=C&&w;return{status:m,fetchStatus:p,isPending:C,isSuccess:m==="success",isError:_,isInitialLoading:k,isLoading:k,data:y,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!C,isLoadingError:_&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:v,isRefetchError:_&&u.dataUpdatedAt!==0,isStale:fy(t,n),refetch:this.refetch}}updateResult(t){const n=ee(this,Vr),r=this.createResult(ee(this,Tn),this.options);if(je(this,$c,ee(this,Tn).state),je(this,Cd,this.options),ee(this,$c).data!==void 0&&je(this,Ed,ee(this,Tn)),ay(r,n))return;je(this,Vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ee(this,kd).size)return!0;const l=new Set(a??ee(this,kd));return this.options.throwOnError&&l.add("error"),Object.keys(ee(this,Vr)).some(c=>{const u=c;return ee(this,Vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Bt(this,Uv,GL).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,Sp,z2).call(this)}},ao=new WeakMap,Tn=new WeakMap,vp=new WeakMap,Vr=new WeakMap,$c=new WeakMap,Cd=new WeakMap,gs=new WeakMap,bp=new WeakMap,_d=new WeakMap,Ed=new WeakMap,Tc=new WeakMap,Ac=new WeakMap,cl=new WeakMap,kd=new WeakMap,Ic=new WeakSet,Up=function(t){Bt(this,Ep,H2).call(this);let n=ee(this,Tn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ho)),n},yp=new WeakSet,F2=function(){if(Bt(this,Cp,B2).call(this),Xc||ee(this,Vr).isStale||!iy(this.options.staleTime))return;const n=ME(ee(this,Vr).dataUpdatedAt,this.options.staleTime)+1;je(this,Tc,setTimeout(()=>{ee(this,Vr).isStale||this.updateResult()},n))},xp=new WeakSet,R2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ee(this,Tn)):this.options.refetchInterval)??!1},wp=new WeakSet,j2=function(t){Bt(this,_p,V2).call(this),je(this,cl,t),!(Xc||this.options.enabled===!1||!iy(ee(this,cl))||ee(this,cl)===0)&&je(this,Ac,setInterval(()=>{(this.options.refetchIntervalInBackground||sg.isFocused())&&Bt(this,Ic,Up).call(this)},ee(this,cl)))},Sp=new WeakSet,z2=function(){Bt(this,yp,F2).call(this),Bt(this,wp,j2).call(this,Bt(this,xp,R2).call(this))},Cp=new WeakSet,B2=function(){ee(this,Tc)&&(clearTimeout(ee(this,Tc)),je(this,Tc,void 0))},_p=new WeakSet,V2=function(){ee(this,Ac)&&(clearInterval(ee(this,Ac)),je(this,Ac,void 0))},Ep=new WeakSet,H2=function(){const t=ee(this,ao).getQueryCache().build(ee(this,ao),this.options);if(t===ee(this,Tn))return;const n=ee(this,Tn);je(this,Tn,t),je(this,vp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Uv=new WeakSet,GL=function(t){br.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ee(this,Vr))}),ee(this,ao).getQueryCache().notify({query:ee(this,Tn),type:"observerResultsUpdated"})})},x8);function CR(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function zE(e,t){return CR(e,t)||e.state.dataUpdatedAt>0&&dy(e,t,t.refetchOnMount)}function dy(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&fy(e,t)}return!1}function BE(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&fy(e,n)}function fy(e,t){return e.isStaleByTime(t.staleTime)}function _R(e,t){return!ay(e.getCurrentResult(),t)}var VE=he.createContext(void 0),HE=e=>{const t=he.useContext(VE);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ER=({client:e,children:t})=>(he.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),he.createElement(VE.Provider,{value:e},t)),qE=he.createContext(!1),kR=()=>he.useContext(qE);qE.Provider;function OR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var PR=he.createContext(OR()),DR=()=>he.useContext(PR);function MR(e,t){return typeof e=="function"?e(...t):!!e}var $R=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},TR=e=>{he.useEffect(()=>{e.clearReset()},[e])},AR=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&MR(n,[e.error,r]),IR=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},NR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,LR=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function FR(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=HE(n),o=kR(),i=DR(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",IR(s),$R(s,i),TR(i);const[a]=he.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(he.useSyncExternalStore(he.useCallback(c=>{const u=o?()=>{}:a.subscribe(br.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),he.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),NR(s,l))throw LR(s,a,i);if(AR({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function yi(e,t){return FR(e,SR,t)}let lg;const RR=new Uint8Array(16);function jR(){if(!lg&&(lg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!lg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lg(RR)}const yr=[];for(let e=0;e<256;++e)yr.push((e+256).toString(16).slice(1));function zR(e,t=0){return yr[e[t+0]]+yr[e[t+1]]+yr[e[t+2]]+yr[e[t+3]]+"-"+yr[e[t+4]]+yr[e[t+5]]+"-"+yr[e[t+6]]+yr[e[t+7]]+"-"+yr[e[t+8]]+yr[e[t+9]]+"-"+yr[e[t+10]]+yr[e[t+11]]+yr[e[t+12]]+yr[e[t+13]]+yr[e[t+14]]+yr[e[t+15]]}const WE={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ya(e,t,n){if(WE.randomUUID&&!t&&!e)return WE.randomUUID();e=e||{};const r=e.random||(e.rng||jR)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return zR(r)}const be=dE()(CE((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:ya(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:ya(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,o,i)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),BR=()=>be(e=>e.actions);process.env.NODE_ENV==="development"&&EE("EditorStore",be);function UE({children:e}){const t=new wR;return x.jsx(ER,{client:t,children:e})}var Ot={context:void 0,registry:void 0};function af(e){Ot.context=e}var VR=(e,t)=>e===t,qo=Symbol("solid-proxy"),Qc=Symbol("solid-track"),cg={equals:VR},GE=JE,ks=1,ug=2,KE={owned:null,cleanups:null,context:null,owner:null},hy={},Qt=null,py=null,dn=null,Or=null,Os=null,dg=0;function Ps(e,t){const n=dn,r=Qt,o=e.length===0,i=t===void 0?r:t,s=o?KE:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Fn(()=>gg(s)));Qt=s,dn=null;try{return zi(a,!0)}finally{dn=n,Qt=r}}function qe(e,t){t=t?Object.assign({},cg,t):cg;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),ZE(n,o));return[QE.bind(n),r]}function gy(e,t,n){const r=fg(e,t,!0,ks);Zc(r)}function at(e,t,n){const r=fg(e,t,!1,ks);Zc(r)}function ht(e,t,n){GE=ZR;const r=fg(e,t,!1,ks);(!n||!n.render)&&(r.user=!0),Os?Os.push(r):Zc(r)}function Me(e,t,n){n=n?Object.assign({},cg,n):cg;const r=fg(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Zc(r),QE.bind(r)}function HR(e){return e&&typeof e=="object"&&"then"in e}function qR(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=hy,l=null,c=!1,u="initialValue"in i,d=typeof r=="function"&&Me(r);const h=new Set,[p,m]=(i.storage||qe)(i.initialValue),[v,y]=qe(void 0),[w,C]=qe(void 0,{equals:!1}),[_,k]=qe(u?"ready":"unresolved");if(Ot.context){l=`${Ot.context.id}${Ot.context.count++}`;let I;i.ssrLoadFrom==="initial"?a=i.initialValue:Ot.load&&(I=Ot.load(l))&&(a=I)}function E(I,F,R,B){return s===I&&(s=null,B!==void 0&&(u=!0),(I===a||F===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(B,{value:F})),a=hy,P(F,R)),F}function P(I,F){zi(()=>{F===void 0&&m(()=>I),k(F!==void 0?"errored":u?"ready":"unresolved"),y(F);for(const R of h.keys())R.decrement();h.clear()},!1)}function D(){const I=YR,F=p(),R=v();if(R!==void 0&&!s)throw R;return dn&&!dn.user&&I&&gy(()=>{w(),s&&(I.resolved||h.has(I)||(I.increment(),h.add(I)))}),F}function M(I=!0){if(I!==!1&&c)return;c=!1;const F=d?d():r;if(F==null||F===!1){E(s,Fn(p));return}const R=a!==hy?a:Fn(()=>o(F,{value:p(),refetching:I}));return HR(R)?(s=R,"value"in R?(R.status==="success"?E(s,R.value,void 0,F):E(s,void 0,void 0,F),R):(c=!0,queueMicrotask(()=>c=!1),zi(()=>{k(u?"refreshing":"pending"),C()},!1),R.then(B=>E(R,B,void 0,F),B=>E(R,void 0,t5(B),F)))):(E(s,R,void 0,F),R)}return Object.defineProperties(D,{state:{get:()=>_()},error:{get:()=>v()},loading:{get(){const I=_();return I==="pending"||I==="refreshing"}},latest:{get(){if(!u)return D();const I=v();if(I&&!s)throw I;return p()}}}),d?gy(()=>M(!1)):M(!1),[D,{refetch:M,mutate:m}]}function YE(e){return zi(e,!1)}function Fn(e){if(dn===null)return e();const t=dn;dn=null;try{return e()}finally{dn=t}}function xi(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let c=0;c<e.length;c++)a[c]=e[c]()}else a=e();if(i){i=!1;return}const l=Fn(()=>t(a,o,s));return o=a,l}}function Ml(e){ht(()=>Fn(e))}function pt(e){return Qt===null||(Qt.cleanups===null?Qt.cleanups=[e]:Qt.cleanups.push(e)),e}function my(){return dn}function XE(){return Qt}function WR(e,t){const n=Qt,r=dn;Qt=e,dn=null;try{return zi(t,!0)}catch(o){by(o)}finally{Qt=n,dn=r}}function UR(e){const t=dn,n=Qt;return Promise.resolve().then(()=>{dn=t,Qt=n;let r;return zi(e,!1),dn=Qt=null,r?r.done:void 0})}var[GR,u2e]=qe(!1);function KR(){return[GR,UR]}function Kr(e,t){const n=Symbol("context");return{id:n,Provider:JR(n),defaultValue:e}}function Yr(e){return Qt&&Qt.context&&Qt.context[e.id]!==void 0?Qt.context[e.id]:e.defaultValue}function vy(e){const t=Me(e),n=Me(()=>yy(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var YR;function QE(){if(this.sources&&this.state)if(this.state===ks)Zc(this);else{const e=Or;Or=null,zi(()=>pg(this),!1),Or=e}if(dn){const e=this.observers?this.observers.length:0;dn.sources?(dn.sources.push(this),dn.sourceSlots.push(e)):(dn.sources=[this],dn.sourceSlots=[e]),this.observers?(this.observers.push(dn),this.observerSlots.push(dn.sources.length-1)):(this.observers=[dn],this.observerSlots=[dn.sources.length-1])}return this.value}function ZE(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&zi(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=py&&py.running;s&&py.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?Or.push(i):Os.push(i),i.observers&&e5(i)),s||(i.state=ks)}if(Or.length>1e6)throw Or=[],new Error},!1)),t}function Zc(e){if(!e.fn)return;gg(e);const t=dg;XR(e,e.value,t)}function XR(e,t,n){let r;const o=Qt,i=dn;dn=Qt=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=ks,e.owned&&e.owned.forEach(gg),e.owned=null),e.updatedAt=n+1,by(s)}finally{dn=i,Qt=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?ZE(e,r):e.value=r,e.updatedAt=n)}function fg(e,t,n,r=ks,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:Qt,context:Qt?Qt.context:null,pure:n};return Qt===null||Qt!==KE&&(Qt.owned?Qt.owned.push(i):Qt.owned=[i]),i}function hg(e){if(e.state===0)return;if(e.state===ug)return pg(e);if(e.suspense&&Fn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<dg);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===ks)Zc(e);else if(e.state===ug){const r=Or;Or=null,zi(()=>pg(e,t[0]),!1),Or=r}}function zi(e,t){if(Or)return e();let n=!1;t||(Or=[]),Os?n=!0:Os=[],dg++;try{const r=e();return QR(n),r}catch(r){n||(Os=null),Or=null,by(r)}}function QR(e){if(Or&&(JE(Or),Or=null),e)return;const t=Os;Os=null,t.length&&zi(()=>GE(t),!1)}function JE(e){for(let t=0;t<e.length;t++)hg(e[t])}function ZR(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:hg(r)}if(Ot.context){if(Ot.count){Ot.effects||(Ot.effects=[]),Ot.effects.push(...e.slice(0,n));return}else Ot.effects&&(e=[...Ot.effects,...e],n+=Ot.effects.length,delete Ot.effects);af()}for(t=0;t<n;t++)hg(e[t])}function pg(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===ks?r!==t&&(!r.updatedAt||r.updatedAt<dg)&&hg(r):o===ug&&pg(r,t)}}}function e5(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=ug,n.pure?Or.push(n):Os.push(n),n.observers&&e5(n))}}function gg(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)gg(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function t5(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function by(e,t=Qt){throw t5(e)}function yy(e){if(typeof e=="function"&&!e.length)return yy(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=yy(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function JR(e,t){return function(r){let o;return at(()=>o=Fn(()=>(Qt.context={...Qt.context,[e]:r.value},vy(()=>r.children))),void 0),o}}var xy=Symbol("fallback");function mg(e){for(let t=0;t<e.length;t++)e[t]()}function e6(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return pt(()=>mg(i)),()=>{let l=e()||[],c,u;return l[Qc],Fn(()=>{let h=l.length,p,m,v,y,w,C,_,k,E;if(h===0)s!==0&&(mg(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[xy],o[0]=Ps(P=>(i[0]=P,n.fallback())),s=1);else if(s===0){for(o=new Array(h),u=0;u<h;u++)r[u]=l[u],o[u]=Ps(d);s=h}else{for(v=new Array(h),y=new Array(h),a&&(w=new Array(h)),C=0,_=Math.min(s,h);C<_&&r[C]===l[C];C++);for(_=s-1,k=h-1;_>=C&&k>=C&&r[_]===l[k];_--,k--)v[k]=o[_],y[k]=i[_],a&&(w[k]=a[_]);for(p=new Map,m=new Array(k+1),u=k;u>=C;u--)E=l[u],c=p.get(E),m[u]=c===void 0?-1:c,p.set(E,u);for(c=C;c<=_;c++)E=r[c],u=p.get(E),u!==void 0&&u!==-1?(v[u]=o[c],y[u]=i[c],a&&(w[u]=a[c]),u=m[u],p.set(E,u)):i[c]();for(u=C;u<h;u++)u in v?(o[u]=v[u],i[u]=y[u],a&&(a[u]=w[u],a[u](u))):o[u]=Ps(d);o=o.slice(0,s=h),r=l.slice(0)}return o});function d(h){if(i[u]=h,a){const[p,m]=qe(u);return a[u]=m,t(l[u],p)}return t(l[u])}}}function t6(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return pt(()=>mg(i)),()=>{const c=e()||[];return c[Qc],Fn(()=>{if(c.length===0)return a!==0&&(mg(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[xy],o[0]=Ps(d=>(i[0]=d,n.fallback())),a=1),o;for(r[0]===xy&&(i[0](),i=[],r=[],o=[],a=0),l=0;l<c.length;l++)l<r.length&&r[l]!==c[l]?s[l](()=>c[l]):l>=r.length&&(o[l]=Ps(u));for(;l<r.length;l++)i[l]();return a=s.length=i.length=c.length,r=c.slice(0),o=o.slice(0,a)});function u(d){i[l]=d;const[h,p]=qe(c[l]);return s[l]=p,t(h,l)}}}function Q(e,t){return Fn(()=>e(t||{}))}function vg(){return!0}var wy={get(e,t,n){return t===qo?n:e.get(t)},has(e,t){return t===qo?!0:e.has(t)},set:vg,deleteProperty:vg,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:vg,deleteProperty:vg}},ownKeys(e){return e.keys()}};function Sy(e){return(e=typeof e=="function"?e():e)?e:{}}function n6(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function Pt(...e){let t=!1;for(let i=0;i<e.length;i++){const s=e[i];t=t||!!s&&qo in s,e[i]=typeof s=="function"?(t=!0,Me(s)):s}if(t)return new Proxy({get(i){for(let s=e.length-1;s>=0;s--){const a=Sy(e[s])[i];if(a!==void 0)return a}},has(i){for(let s=e.length-1;s>=0;s--)if(i in Sy(e[s]))return!0;return!1},keys(){const i=[];for(let s=0;s<e.length;s++)i.push(...Object.keys(Sy(e[s])));return[...new Set(i)]}},wy);const n={},r={},o=new Set;for(let i=e.length-1;i>=0;i--){const s=e[i];if(!s)continue;const a=Object.getOwnPropertyNames(s);for(let l=0,c=a.length;l<c;l++){const u=a[l];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(s,u);if(!o.has(u))d.get?(o.add(u),Object.defineProperty(n,u,{enumerable:!0,configurable:!0,get:n6.bind(r[u]=[d.get.bind(s)])})):(d.value!==void 0&&o.add(u),n[u]=d.value);else{const h=r[u];h?d.get?h.push(d.get.bind(s)):d.value!==void 0&&h.push(()=>d.value):n[u]===void 0&&(n[u]=d.value)}}}return n}function rn(e,...t){if(qo in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},wy));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},wy)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const c of t)c.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}function r6(e){let t,n;const r=o=>{const i=Ot.context;if(i){const[a,l]=qe();Ot.count||(Ot.count=0),Ot.count++,(n||(n=e())).then(c=>{af(i),Ot.count--,l(()=>c.default),af()}),t=a}else if(!t){const[a]=qR(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return Me(()=>(s=t())&&Fn(()=>{if(!i)return s(o);const a=Ot.context;af(i);const l=s(o);return af(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}var o6=0;function wi(){const e=Ot.context;return e?`${e.id}${e.count++}`:`cl-${o6++}`}var n5=e=>`Stale read from <${e}>.`;function r5(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Me(e6(()=>e.each,e.children,t||void 0))}function i6(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Me(t6(()=>e.each,e.children,t||void 0))}function ut(e){const t=e.keyed,n=Me(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return Me(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?Fn(()=>o(t?r:()=>{if(!Fn(n))throw n5("Show");return e.when})):o}return e.fallback},void 0,void 0)}function s6(e){let t=!1;const n=(i,s)=>i[0]===s[0]&&(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=vy(()=>e.children),o=Me(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return Me(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?Fn(()=>l(t?s:()=>{if(Fn(o)[0]!==i)throw n5("Match");return a.when})):l},void 0,void 0)}function Cy(e){return e}var a6=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],l6=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...a6]),c6=new Set(["innerHTML","textContent","innerText","children"]),u6=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),d6=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function f6(e,t){const n=d6[e];return typeof n=="object"?n[t]?n.$:void 0:n}var h6=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),p6=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),g6={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function m6(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const u=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],u)}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const u=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],u),t[o]=n[i]}else{if(!c){c=new Map;let d=a;for(;d<i;)c.set(n[d],d++)}const u=c.get(t[s]);if(u!=null)if(a<u&&u<i){let d=s,h=1,p;for(;++d<o&&d<i&&!((p=c.get(t[d]))==null||p!==u+h);)h++;if(h>u-a){const m=t[s];for(;a<u;)e.insertBefore(n[a++],m)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}var o5="_$DX_DELEGATE";function v6(e,t,n,r={}){let o;return Ps(i=>{o=i,t===document?e():ke(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function Ye(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>Fn(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function lf(e,t=window.document){const n=t[o5]||(t[o5]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,_6))}}function Te(e,t,n){Ot.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function b6(e,t,n,r){Ot.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Le(e,t){Ot.context||(t==null?e.removeAttribute("class"):e.className=t)}function i5(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function y6(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(s5(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(s5(e,a,!0),n[a]=l)}return n}function x6(e,t,n){if(!t)return n?Te(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function bg(e,t={},n,r){const o={};return r||at(()=>o.children=Jc(e,t.children,o.children)),at(()=>t.ref&&t.ref(e)),at(()=>w6(e,t,n,!0,o,!0)),o}function cf(e,t,n){return Fn(()=>e(t,n))}function ke(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Jc(e,t,r,n);at(o=>Jc(e,t(),o,n),r)}function w6(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=a5(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||Jc(e,t.children);continue}const a=t[s];o[s]=a5(e,s,a,o[s],n,i)}}function S6(e){let t,n;return!Ot.context||!(t=Ot.registry.get(n=E6()))?e():(Ot.completed&&Ot.completed.add(t),Ot.registry.delete(n),t)}function C6(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function s5(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function a5(e,t,n,r,o,i){let s,a,l,c,u;if(t==="style")return x6(e,n,r);if(t==="classList")return y6(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),h=h6.has(d);if(!h&&r){const p=Array.isArray(r)?r[0]:r;e.removeEventListener(d,p)}(h||n)&&(i5(e,d,n,h),h&&lf([d]))}else if(t.slice(0,5)==="attr:")Te(e,t.slice(5),n);else if((u=t.slice(0,5)==="prop:")||(l=c6.has(t))||!o&&((c=f6(t,e.tagName))||(a=l6.has(t)))||(s=e.nodeName.includes("-"))){if(u)t=t.slice(5),a=!0;else if(Ot.context)return n;t==="class"||t==="className"?Le(e,n):s&&!a&&!l?e[C6(t)]=n:e[c||t]=n}else{const d=o&&t.indexOf(":")>-1&&g6[t.split(":")[0]];d?b6(e,d,t,n):Te(e,u6[t]||t,n)}return n}function _6(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Ot.registry&&!Ot.done&&(Ot.done=_$HY.done=!0);n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Jc(e,t,n,r,o){if(Ot.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const c=n[l];c.nodeType===8&&c.data.slice(0,2)==="!$"?c.remove():a.push(c)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(Ot.context)return n;if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data=t:a=document.createTextNode(t),n=eu(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(Ot.context)return n;n=eu(e,n,r)}else{if(i==="function")return at(()=>{let a=t();for(;typeof a=="function";)a=a();n=Jc(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(_y(a,t,n,o))return at(()=>n=Jc(e,a,n,r,!0)),()=>n;if(Ot.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let c=a[0],u=[c];for(;(c=c.nextSibling)!==r;)u.push(c);return n=u}if(a.length===0){if(n=eu(e,n,r),s)return n}else l?n.length===0?l5(e,a,r):m6(e,n,a):(n&&eu(e),l5(e,a));n=a}else if(t.nodeType){if(Ot.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=eu(e,n,r,t);eu(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function _y(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],c;if(!(a==null||a===!0||a===!1))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=_y(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=_y(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const u=String(a);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return o}function l5(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function eu(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function E6(){const e=Ot.context;return`${e.id}${e.count++}`}var k6="http://www.w3.org/2000/svg";function c5(e,t=!1){return t?document.createElementNS(k6,e):document.createElement(e)}function O6(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=XE();let i,s=!!Ot.context;return ht(()=>{s&&(XE().user=s=!1),i||(i=WR(o,()=>Me(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=qe(!1),u=()=>c(!0);Ps(d=>ke(a,()=>l()?d():i(),null)),pt(u)}else{const l=c5(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),ke(c,i),a.appendChild(l),e.ref&&e.ref(l),pt(()=>a.removeChild(l))}},void 0,{render:!s}),n}function Ey(e){const[t,n]=rn(e,["component"]),r=Me(()=>t.component);return Me(()=>{const o=r();switch(typeof o){case"function":return Fn(()=>o(n));case"string":const i=p6.has(o),s=Ot.context?S6():c5(o,i);return bg(s,n,i),s}})}var P6=function(){function e(){this.keyToValue=new Map,this.valueToKey=new Map}return e.prototype.set=function(t,n){this.keyToValue.set(t,n),this.valueToKey.set(n,t)},e.prototype.getByKey=function(t){return this.keyToValue.get(t)},e.prototype.getByValue=function(t){return this.valueToKey.get(t)},e.prototype.clear=function(){this.keyToValue.clear(),this.valueToKey.clear()},e}(),u5=function(){function e(t){this.generateIdentifier=t,this.kv=new P6}return e.prototype.register=function(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))},e.prototype.clear=function(){this.kv.clear()},e.prototype.getIdentifier=function(t){return this.kv.getByValue(t)},e.prototype.getValue=function(t){return this.kv.getByKey(t)},e}(),D6=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),M6=function(e){D6(t,e);function t(){var n=e.call(this,function(r){return r.name})||this;return n.classToAllowedProps=new Map,n}return t.prototype.register=function(n,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(n,r.allowProps),e.prototype.register.call(this,n,r.identifier)):e.prototype.register.call(this,n,r)},t.prototype.getAllowedProps=function(n){return this.classToAllowedProps.get(n)},t}(u5),$6=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i};function T6(e){if("values"in Object)return Object.values(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function A6(e,t){var n=T6(e);if("find"in n)return n.find(t);for(var r=n,o=0;o<r.length;o++){var i=r[o];if(t(i))return i}}function tu(e,t){Object.entries(e).forEach(function(n){var r=$6(n,2),o=r[0],i=r[1];return t(i,o)})}function yg(e,t){return e.indexOf(t)!==-1}function d5(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t(r))return r}}var I6=function(){function e(){this.transfomers={}}return e.prototype.register=function(t){this.transfomers[t.name]=t},e.prototype.findApplicable=function(t){return A6(this.transfomers,function(n){return n.isApplicable(t)})},e.prototype.findByName=function(t){return this.transfomers[t]},e}(),N6=function(e){return Object.prototype.toString.call(e).slice(8,-1)},f5=function(e){return typeof e>"u"},L6=function(e){return e===null},uf=function(e){return typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype},ky=function(e){return uf(e)&&Object.keys(e).length===0},xa=function(e){return Array.isArray(e)},F6=function(e){return typeof e=="string"},R6=function(e){return typeof e=="number"&&!isNaN(e)},j6=function(e){return typeof e=="boolean"},z6=function(e){return e instanceof RegExp},df=function(e){return e instanceof Map},ff=function(e){return e instanceof Set},h5=function(e){return N6(e)==="Symbol"},B6=function(e){return e instanceof Date&&!isNaN(e.valueOf())},V6=function(e){return e instanceof Error},p5=function(e){return typeof e=="number"&&isNaN(e)},H6=function(e){return j6(e)||L6(e)||f5(e)||R6(e)||F6(e)||h5(e)},q6=function(e){return typeof e=="bigint"},W6=function(e){return e===1/0||e===-1/0},U6=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},G6=function(e){return e instanceof URL},g5=function(e){return e.replace(/\./g,"\\.")},Oy=function(e){return e.map(String).map(g5).join(".")},hf=function(e){for(var t=[],n="",r=0;r<e.length;r++){var o=e.charAt(r),i=o==="\\"&&e.charAt(r+1)===".";if(i){n+=".",r++;continue}var s=o===".";if(s){t.push(n),n="";continue}n+=o}var a=n;return t.push(a),t},Py=function(){return Py=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Py.apply(this,arguments)},Dy=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},My=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function Bi(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var m5=[Bi(f5,"undefined",function(){return null},function(){}),Bi(q6,"bigint",function(e){return e.toString()},function(e){return typeof BigInt<"u"?BigInt(e):e}),Bi(B6,"Date",function(e){return e.toISOString()},function(e){return new Date(e)}),Bi(V6,"Error",function(e,t){var n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(function(r){n[r]=e[r]}),n},function(e,t){var n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(function(r){n[r]=e[r]}),n}),Bi(z6,"regexp",function(e){return""+e},function(e){var t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),Bi(ff,"set",function(e){return My([],Dy(e.values()))},function(e){return new Set(e)}),Bi(df,"map",function(e){return My([],Dy(e.entries()))},function(e){return new Map(e)}),Bi(function(e){return p5(e)||W6(e)},"number",function(e){return p5(e)?"NaN":e>0?"Infinity":"-Infinity"},Number),Bi(function(e){return e===0&&1/e===-1/0},"number",function(){return"-0"},Number),Bi(G6,"URL",function(e){return e.toString()},function(e){return new URL(e)})];function xg(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var v5=xg(function(e,t){if(h5(e)){var n=!!t.symbolRegistry.getIdentifier(e);return n}return!1},function(e,t){var n=t.symbolRegistry.getIdentifier(e);return["symbol",n]},function(e){return e.description},function(e,t,n){var r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),K6=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(e,t){return e[t.name]=t,e},{}),b5=xg(U6,function(e){return["typed-array",e.constructor.name]},function(e){return My([],Dy(e))},function(e,t){var n=K6[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function y5(e,t){if(e!=null&&e.constructor){var n=!!t.classRegistry.getIdentifier(e.constructor);return n}return!1}var x5=xg(y5,function(e,t){var n=t.classRegistry.getIdentifier(e.constructor);return["class",n]},function(e,t){var n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return Py({},e);var r={};return n.forEach(function(o){r[o]=e[o]}),r},function(e,t,n){var r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),w5=xg(function(e,t){return!!t.customTransformerRegistry.findApplicable(e)},function(e,t){var n=t.customTransformerRegistry.findApplicable(e);return["custom",n.name]},function(e,t){var n=t.customTransformerRegistry.findApplicable(e);return n.serialize(e)},function(e,t,n){var r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),Y6=[x5,v5,w5,b5],S5=function(e,t){var n=d5(Y6,function(o){return o.isApplicable(e,t)});if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};var r=d5(m5,function(o){return o.isApplicable(e,t)});if(r)return{value:r.transform(e,t),type:r.annotation}},C5={};m5.forEach(function(e){C5[e.annotation]=e});var X6=function(e,t,n){if(xa(t))switch(t[0]){case"symbol":return v5.untransform(e,t,n);case"class":return x5.untransform(e,t,n);case"custom":return w5.untransform(e,t,n);case"typed-array":return b5.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{var r=C5[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},nu=function(e,t){for(var n=e.keys();t>0;)n.next(),t--;return n.next().value};function _5(e){if(yg(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(yg(e,"prototype"))throw new Error("prototype is not allowed as a property");if(yg(e,"constructor"))throw new Error("constructor is not allowed as a property")}var Q6=function(e,t){_5(t);for(var n=0;n<t.length;n++){var r=t[n];if(ff(e))e=nu(e,+r);else if(df(e)){var o=+r,i=+t[++n]==0?"key":"value",s=nu(e,o);switch(i){case"key":e=s;break;case"value":e=e.get(s);break}}else e=e[r]}return e},$y=function(e,t,n){if(_5(t),t.length===0)return n(e);for(var r=e,o=0;o<t.length-1;o++){var i=t[o];if(xa(r)){var s=+i;r=r[s]}else if(uf(r))r=r[i];else if(ff(r)){var a=+i;r=nu(r,a)}else if(df(r)){var l=o===t.length-2;if(l)break;var a=+i,c=+t[++o]==0?"key":"value",u=nu(r,a);switch(c){case"key":r=u;break;case"value":r=r.get(u);break}}}var d=t[t.length-1];if(xa(r)?r[+d]=n(r[+d]):uf(r)&&(r[d]=n(r[d])),ff(r)){var h=nu(r,+d),p=n(h);h!==p&&(r.delete(h),r.add(p))}if(df(r)){var a=+t[t.length-2],m=nu(r,a),c=+d==0?"key":"value";switch(c){case"key":{var v=n(m);r.set(v,r.get(m)),v!==m&&r.delete(m);break}case"value":{r.set(m,n(r.get(m)));break}}}return e},Ds=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},wa=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function Ty(e,t,n){if(n===void 0&&(n=[]),!!e){if(!xa(e)){tu(e,function(s,a){return Ty(s,t,wa(wa([],Ds(n)),Ds(hf(a))))});return}var r=Ds(e,2),o=r[0],i=r[1];i&&tu(i,function(s,a){Ty(s,t,wa(wa([],Ds(n)),Ds(hf(a))))}),t(o,n)}}function Z6(e,t,n){return Ty(t,function(r,o){e=$y(e,o,function(i){return X6(i,r,n)})}),e}function J6(e,t){function n(s,a){var l=Q6(e,hf(a));s.map(hf).forEach(function(c){e=$y(e,c,function(){return l})})}if(xa(t)){var r=Ds(t,2),o=r[0],i=r[1];o.forEach(function(s){e=$y(e,hf(s),function(){return e})}),i&&tu(i,n)}else tu(t,n);return e}var ej=function(e,t){return uf(e)||xa(e)||df(e)||ff(e)||y5(e,t)};function tj(e,t,n){var r=n.get(e);r?r.push(t):n.set(e,[t])}function nj(e,t){var n={},r=void 0;return e.forEach(function(o){if(!(o.length<=1)){t||(o=o.map(function(l){return l.map(String)}).sort(function(l,c){return l.length-c.length}));var i=Ds(o),s=i[0],a=i.slice(1);s.length===0?r=a.map(Oy):n[Oy(s)]=a.map(Oy)}}),r?ky(n)?[r]:[r,n]:ky(n)?void 0:n}var E5=function(e,t,n,r,o,i,s){var a;o===void 0&&(o=[]),i===void 0&&(i=[]),s===void 0&&(s=new Map);var l=H6(e);if(!l){tj(e,o,t);var c=s.get(e);if(c)return r?{transformedValue:null}:c}if(!ej(e,n)){var u=S5(e,n),d=u?{transformedValue:u.value,annotations:[u.type]}:{transformedValue:e};return l||s.set(e,d),d}if(yg(i,e))return{transformedValue:null};var h=S5(e,n),p=(a=h==null?void 0:h.value)!==null&&a!==void 0?a:e,m=xa(p)?[]:{},v={};tu(p,function(w,C){var _=E5(w,t,n,r,wa(wa([],Ds(o)),[C]),wa(wa([],Ds(i)),[e]),s);m[C]=_.transformedValue,xa(_.annotations)?v[C]=_.annotations:uf(_.annotations)&&tu(_.annotations,function(k,E){v[g5(C)+"."+E]=k})});var y=ky(v)?{transformedValue:m,annotations:h?[h.type]:void 0}:{transformedValue:m,annotations:h?[h.type,v]:v};return l||s.set(e,y),y};function k5(e){return Object.prototype.toString.call(e).slice(8,-1)}function rj(e){if(k5(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function O5(e){return k5(e)==="Array"}function oj(e,t,n,r,o){const i={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";i==="enumerable"&&(e[t]=n),o&&i==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function Ay(e,t={}){if(O5(e))return e.map(o=>Ay(o,t));if(!rj(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((o,i)=>{if(O5(t.props)&&!t.props.includes(i))return o;const s=e[i],a=Ay(s,t);return oj(o,i,a,e,t.nonenumerable),o},{})}var $l=function(){return $l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},$l.apply(this,arguments)},ij=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},sj=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},P5=function(){function e(t){var n=t===void 0?{}:t,r=n.dedupe,o=r===void 0?!1:r;this.classRegistry=new M6,this.symbolRegistry=new u5(function(i){var s;return(s=i.description)!==null&&s!==void 0?s:""}),this.customTransformerRegistry=new I6,this.allowedErrorProps=[],this.dedupe=o}return e.prototype.serialize=function(t){var n=new Map,r=E5(t,n,this,this.dedupe),o={json:r.transformedValue};r.annotations&&(o.meta=$l($l({},o.meta),{values:r.annotations}));var i=nj(n,this.dedupe);return i&&(o.meta=$l($l({},o.meta),{referentialEqualities:i})),o},e.prototype.deserialize=function(t){var n=t.json,r=t.meta,o=Ay(n);return r!=null&&r.values&&(o=Z6(o,r.values,this)),r!=null&&r.referentialEqualities&&(o=J6(o,r.referentialEqualities)),o},e.prototype.stringify=function(t){return JSON.stringify(this.serialize(t))},e.prototype.parse=function(t){return this.deserialize(JSON.parse(t))},e.prototype.registerClass=function(t,n){this.classRegistry.register(t,n)},e.prototype.registerSymbol=function(t,n){this.symbolRegistry.register(t,n)},e.prototype.registerCustom=function(t,n){this.customTransformerRegistry.register($l({name:n},t))},e.prototype.allowErrorProps=function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];(t=this.allowedErrorProps).push.apply(t,sj([],ij(n)))},e.defaultInstance=new e,e.serialize=e.defaultInstance.serialize.bind(e.defaultInstance),e.deserialize=e.defaultInstance.deserialize.bind(e.defaultInstance),e.stringify=e.defaultInstance.stringify.bind(e.defaultInstance),e.parse=e.defaultInstance.parse.bind(e.defaultInstance),e.registerClass=e.defaultInstance.registerClass.bind(e.defaultInstance),e.registerSymbol=e.defaultInstance.registerSymbol.bind(e.defaultInstance),e.registerCustom=e.defaultInstance.registerCustom.bind(e.defaultInstance),e.allowErrorProps=e.defaultInstance.allowErrorProps.bind(e.defaultInstance),e}(),aj=P5.serialize,lj=P5.stringify;function ru(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function cj(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function uj({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function ou({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function dj(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var wg=(e,t=!1)=>{const{json:n}=aj(e);return JSON.stringify(n,null,t?2:void 0)},Sg=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,fj=(e,t)=>e.queryHash.localeCompare(t.queryHash),D5=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,hj=(e,t)=>Sg(e)===Sg(t)?D5(e,t):Sg(e)>Sg(t)?1:-1,Iy={status:hj,"query hash":fj,"last updated":D5},Cg=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,M5=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,pj=(e,t)=>Cg(e)===Cg(t)?M5(e,t):Cg(e)>Cg(t)?1:-1,Ny={status:pj,"last updated":M5},$5=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),gj=()=>{const[e,t]=qe("dark");return Ml(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const r=o=>{t(o.matches?"dark":"light")};n.addEventListener("change",r),pt(()=>n.removeEventListener("change",r))}),e},Tl=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const r=new Map(e);if(t.length===1)return r.set(t[0],n),r;const[o,...i]=t;return r.set(o,Tl(r.get(o),i,n)),r}if(e instanceof Set){const r=Tl(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(t.length===1)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=Tl(r[o],i,n),r}if(e instanceof Object){const r={...e};if(t.length===1)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=Tl(r[o],i,n),r}return e},pf=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[r,...o]=t;return n.set(r,pf(n.get(r),o)),n}if(e instanceof Set){const n=pf(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((i,s)=>s.toString()!==t[0]);const[r,...o]=t;return n[r]=pf(n[r],o),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[r,...o]=t;return n[r]=pf(n[r],o),n}return e},mj=e=>{if(!e||document.querySelector("#_goober"))return;const n=document.createElement("style"),r=document.createTextNode("");n.appendChild(r),n.id="_goober",n.setAttribute("nonce",e),document.head.appendChild(n)},vj=(w8=class{constructor(e){Ge(this,Od,void 0);Ge(this,kp,void 0);Ge(this,Op,void 0);Ge(this,Pp,void 0);Ge(this,Nc,!1);Ge(this,Dp,void 0);Ge(this,Pd,void 0);Ge(this,Dd,void 0);Ge(this,Md,void 0);Ge(this,$d,void 0);Ge(this,Td,void 0);Ge(this,Mp,void 0);const{client:t,queryFlavor:n,version:r,onlineManager:o,buttonPosition:i,position:s,initialIsOpen:a,errorTypes:l,styleNonce:c}=e;je(this,Od,qe(t)),je(this,Op,n),je(this,Pp,r),je(this,kp,o),je(this,Dp,c),je(this,Pd,qe(i)),je(this,Dd,qe(s)),je(this,Md,qe(a)),je(this,$d,qe(l))}setButtonPosition(e){ee(this,Pd)[1](e)}setPosition(e){ee(this,Dd)[1](e)}setInitialIsOpen(e){ee(this,Md)[1](e)}setErrorTypes(e){ee(this,$d)[1](e)}setClient(e){ee(this,Od)[1](e)}mount(e){if(ee(this,Nc))throw new Error("Devtools is already mounted");const t=v6(()=>{const[n]=ee(this,Pd),[r]=ee(this,Dd),[o]=ee(this,Md),[i]=ee(this,$d),[s]=ee(this,Od);let a;ee(this,Td)?a=ee(this,Td):(a=r6(()=>Promise.resolve().then(()=>Zbe)),je(this,Td,a)),mj(ee(this,Dp));const l=this;return Q(a,Pt({get queryFlavor(){return ee(l,Op)},get version(){return ee(l,Pp)},get onlineManager(){return ee(l,kp)}},{get client(){return s()},get buttonPosition(){return n()},get position(){return r()},get initialIsOpen(){return o()},get errorTypes(){return i()}}))},e);je(this,Nc,!0),je(this,Mp,t)}unmount(){var e;if(!ee(this,Nc))throw new Error("Devtools is not mounted");(e=ee(this,Mp))==null||e.call(this),je(this,Nc,!1)}},Od=new WeakMap,kp=new WeakMap,Op=new WeakMap,Pp=new WeakMap,Nc=new WeakMap,Dp=new WeakMap,Pd=new WeakMap,Dd=new WeakMap,Md=new WeakMap,$d=new WeakMap,Td=new WeakMap,Mp=new WeakMap,w8);function bj(e){const t=HE(),n=e.client||t,r=he.useRef(null),{buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}=e,[c]=he.useState(new vj({client:n,queryFlavor:"React Query",version:"5",onlineManager:sf,buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}));return he.useEffect(()=>{c.setClient(n)},[n,c]),he.useEffect(()=>{o&&c.setButtonPosition(o)},[o,c]),he.useEffect(()=>{i&&c.setPosition(i)},[i,c]),he.useEffect(()=>{c.setInitialIsOpen(s||!1)},[s,c]),he.useEffect(()=>{c.setErrorTypes(a||[])},[a,c]),he.useEffect(()=>(r.current&&c.mount(r.current),()=>{c.unmount()}),[c]),he.createElement("div",{className:"tsqd-parent-container",ref:r})}var yj=process.env.NODE_ENV!=="development"?function(){return null}:bj;const xj={id:"",authToken:void 0},T5=b.createContext(xj),A5=({children:e,dashboardProps:t})=>x.jsxs(UE,{children:[x.jsx(T5.Provider,{value:t,children:e}),x.jsx(yj,{initialIsOpen:!1})]});function Vi(){const e=b.useContext(T5);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function I5(e,t){var xe;let n=b.useMemo(()=>[],[]);const r=Vi().authToken||e,o=be(K=>K.selectedConnectionId),i=be(K=>K.selectedDatabaseName),s=be(K=>K.selectedSchemaName),a=be(K=>K.selectedTableName),l=be(K=>K.actions.setCurrentColumns),c=be(K=>K.actions.setSelectedConnectionId),u=be(K=>K.actions.setSelectedDatabaseName),d=be(K=>K.actions.setSelectedSchemaName),h=be(K=>K.actions.setSelectedTableName),p=be(K=>K.actions.setCardSql),{data:m,isLoading:v,isError:y}=yi({queryKey:["connections"],queryFn:()=>Gc("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)}),w=m==null?void 0:m.connections.find(K=>K.id===o),C=(w==null?void 0:w.type)==="API"||(w==null?void 0:w.type)==="S3",{data:_,isLoading:k,isFetching:E,isError:P,refetch:D}=yi({queryKey:[o],queryFn:()=>Gc("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:o}),enabled:!!o&&!C}),{data:M,isLoading:I,isFetching:F,isError:R,refetch:B}=yi({queryKey:[o,i],queryFn:()=>Gc("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i}),enabled:!!o&&!!i&&!C}),{data:ie,isLoading:q,isFetching:z,isError:X,refetch:U}=yi({queryKey:[o,i,s],queryFn:()=>Gc("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i,schema_name:s}),enabled:!!o&&!!i&&!!s&&!C}),{data:Z,isLoading:G,isFetching:$,isError:H}=yi({queryKey:[o,i,s,a],queryFn:()=>Gc("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i,schema_name:s,table_name:a}),enabled:!!o&&!!i&&!!s&&!!a||C});b.useEffect(()=>{l(n)},[Z,l,n]),b.useEffect(()=>{var K;C&&(u("NA"),d("NA"),h((K=w==null?void 0:w.type)==null?void 0:K.toLowerCase()))},[C,p,h,d,u,w]);const re=C?(xe=w==null?void 0:w.type)==null?void 0:xe.toLowerCase():a||"",N=C?"":s||"";function V(K){d(K),h("")}function ue(K){u(K),d(""),h("")}function ce(K){c(K)}_&&_.databases.length>0,M&&M.schemas.length>0,Z&&Z.columns.length>0&&(n=Z.columns.map(K=>({...K,data_type:K.data_type.toLowerCase()}))),P&&(n=[]),(H||y)&&(n=[]);const pe=m==null?void 0:m.connections.map(K=>({id:K.id,name:K.name,type:K.type})),se=_==null?void 0:_.databases.map(K=>({id:K.database_name,name:K.database_name})),ne=M==null?void 0:M.schemas.map(K=>({id:K.schema_name,name:K.schema_name})),le=ie==null?void 0:ie.tables.map(K=>({id:K.table_name,name:K.table_name}));return{connectionItems:pe,isConnectionsLoading:v,isConnectionsError:y,databaseItems:se,isDatabasesLoadingOrFetching:k||E,isDatabaseError:P,schemaItems:ne,isSchemaLoadingOrFetching:I||F,isSchemaError:R,tableItems:le,isTableLoadingOrFetching:q||z,isTableError:X,columns:n,isColumnsLoadingOrFetching:G||$,isColumnsError:H,isAPIConnection:C,tableName:re,schemaName:N,handleConnectionChange:ce,handleDatabaseChange:ue,handleSchemaChange:V}}const wj=e=>{const t=new Date(e);return!isNaN(t.getTime())},Sj=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),_g=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?wj(e)?t="date":Sj(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function Cj({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(h=n.preferences)==null?void 0:h.filterOnClickField,valueType:_g(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),i(p);return}else s(d)}o(n),r(d)}var Eg={exports:{}};/**
60
60
  * @license
61
61
  * Lodash <https://lodash.com/>
62
62
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.130",
8
+ "version": "0.0.131",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",