react-semaphor 0.0.423 → 0.0.424
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.
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
*/var u_;function E$(){return u_||(u_=1,process.env.NODE_ENV!=="production"&&function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=C,n=tw(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;Cb.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function y(_){if(!v){if(v=!0,x=_,_=h(_),f!==void 0&&g.hasValue){var R=g.value;if(f(R,_))return S=R}return S=_}if(R=S,r(x,_))return R;var P=h(_);return f!==void 0&&f(R,P)?(x=_,R):(x=_,S=P)}var v=!1,x,S,w=d===void 0?null:d;return[function(){return y(u())},w===null?void 0:function(){return y(w())}]},[u,d,h,f]);var m=o(c,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=m},[m]),l(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Cb}process.env.NODE_ENV==="production"?xv.exports=_$():xv.exports=E$();var R$=xv.exports;const k$=cs(R$),yD={},{useDebugValue:P$}=C,{useSyncExternalStoreWithSelector:D$}=k$;let d_=!1;const M$=e=>e;function O$(e,t=M$,n){(yD?"production":void 0)!=="production"&&n&&!d_&&(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"),d_=!0);const r=D$(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return P$(r),r}const f_=e=>{(yD?"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"?w$(e):e,n=(r,o)=>O$(t,r,o);return Object.assign(n,t),n},nw=e=>e?f_(e):f_;var vD=Symbol.for("immer-nothing"),h_=Symbol.for("immer-draftable"),_r=Symbol.for("immer-state"),T$=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 or(e,...t){if(process.env.NODE_ENV!=="production"){const n=T$[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 Gl=Object.getPrototypeOf;function Yl(e){return!!e&&!!e[_r]}function ba(e){var t;return e?xD(e)||Array.isArray(e)||!!e[h_]||!!((t=e.constructor)!=null&&t[h_])||Cg(e)||_g(e):!1}var I$=Object.prototype.constructor.toString();function xD(e){if(!e||typeof e!="object")return!1;const t=Gl(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)===I$}function ip(e,t){Sg(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function Sg(e){const t=e[_r];return t?t.type_:Array.isArray(e)?1:Cg(e)?2:_g(e)?3:0}function wv(e,t){return Sg(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function wD(e,t,n){const r=Sg(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function A$(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Cg(e){return e instanceof Map}function _g(e){return e instanceof Set}function Os(e){return e.copy_||e.base_}function Sv(e,t){if(Cg(e))return new Map(e);if(_g(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=xD(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[_r];let o=Reflect.ownKeys(r);for(let i=0;i<o.length;i++){const s=o[i],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Gl(e),r)}else{const r=Gl(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function rw(e,t=!1){return Eg(e)||Yl(e)||!ba(e)||(Sg(e)>1&&(e.set=e.add=e.clear=e.delete=N$),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>rw(r,!0))),e}function N$(){or(2)}function Eg(e){return Object.isFrozen(e)}var F$={};function ya(e){const t=F$[e];return t||or(0,e),t}var qu;function SD(){return qu}function j$(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function p_(e,t){t&&(ya("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Cv(e){_v(e),e.drafts_.forEach(L$),e.drafts_=null}function _v(e){e===qu&&(qu=e.parent_)}function g_(e){return qu=j$(qu,e)}function L$(e){const t=e[_r];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function m_(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[_r].modified_&&(Cv(t),or(4)),ba(e)&&(e=sp(t,e),t.parent_||ap(t,e)),t.patches_&&ya("Patches").generateReplacementPatches_(n[_r].base_,e,t.patches_,t.inversePatches_)):e=sp(t,n,[]),Cv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==vD?e:void 0}function sp(e,t,n){if(Eg(t))return t;const r=t[_r];if(!r)return ip(t,(o,i)=>b_(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ap(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),ip(i,(a,l)=>b_(e,r,o,a,l,n,s)),ap(e,o,!1),n&&e.patches_&&ya("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function b_(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&or(5),Yl(o)){const a=i&&t&&t.type_!==3&&!wv(t.assigned_,r)?i.concat(r):void 0,l=sp(e,o,a);if(wD(n,r,l),Yl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(ba(o)&&!Eg(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;sp(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&ap(e,o)}}function ap(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&rw(t,n)}function $$(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:SD(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=ow;n&&(o=[r],i=Gu);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var ow={get(e,t){if(t===_r)return e;const n=Os(e);if(!wv(n,t))return z$(e,n,t);const r=n[t];return e.finalized_||!ba(r)?r:r===_b(e.base_,t)?(Eb(e),e.copy_[t]=Rv(r,e)):r},has(e,t){return t in Os(e)},ownKeys(e){return Reflect.ownKeys(Os(e))},set(e,t,n){const r=CD(Os(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=_b(Os(e),t),i=o==null?void 0:o[_r];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(A$(n,o)&&(n!==void 0||wv(e.base_,t)))return!0;Eb(e),Ev(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 _b(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Eb(e),Ev(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Os(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){or(11)},getPrototypeOf(e){return Gl(e.base_)},setPrototypeOf(){or(12)}},Gu={};ip(ow,(e,t)=>{Gu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Gu.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&or(13),Gu.set.call(this,e,t,void 0)};Gu.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&or(14),ow.set.call(this,e[0],t,n,e[0])};function _b(e,t){const n=e[_r];return(n?Os(n):e)[t]}function z$(e,t,n){var o;const r=CD(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function CD(e,t){if(!(t in e))return;let n=Gl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Gl(n)}}function Ev(e){e.modified_||(e.modified_=!0,e.parent_&&Ev(e.parent_))}function Eb(e){e.copy_||(e.copy_=Sv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var B$=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"&&or(6),r!==void 0&&typeof r!="function"&&or(7);let o;if(ba(t)){const i=g_(this),s=Rv(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?Cv(i):_v(i)}return p_(i,r),m_(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===vD&&(o=void 0),this.autoFreeze_&&rw(o,!0),r){const i=[],s=[];ya("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else or(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){ba(e)||or(8),Yl(e)&&(e=V$(e));const t=g_(this),n=Rv(e,void 0);return n[_r].isManual_=!0,_v(t),n}finishDraft(e,t){const n=e&&e[_r];(!n||!n.isManual_)&&or(9);const{scope_:r}=n;return p_(r,t),m_(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=ya("Patches").applyPatches_;return Yl(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Rv(e,t){const n=Cg(e)?ya("MapSet").proxyMap_(e,t):_g(e)?ya("MapSet").proxySet_(e,t):$$(e,t);return(t?t.scope_:SD()).drafts_.push(n),n}function V$(e){return Yl(e)||or(10,e),_D(e)}function _D(e){if(!ba(e)||Eg(e))return e;const t=e[_r];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Sv(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Sv(e,!0);return ip(n,(r,o)=>{wD(n,r,_D(o))}),t&&(t.finalized_=!1),n}var Er=new B$,H$=Er.produce;Er.produceWithPatches.bind(Er);Er.setAutoFreeze.bind(Er);Er.setUseStrictShallowCopy.bind(Er);Er.applyPatches.bind(Er);Er.createDraft.bind(Er);Er.finishDraft.bind(Er);const W$=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?H$(o):o;return t(a,i,...s)},e(r.setState,n,r)),ED=W$;var kv,If=Yt;if(process.env.NODE_ENV==="production")kv=If.createRoot,If.hydrateRoot;else{var y_=If.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;kv=function(e,t){y_.usingClientEntryPoint=!0;try{return If.createRoot(e,t)}finally{y_.usingClientEntryPoint=!1}}}var RD={},kD={},iw={exports:{}},Be=String,PD=function(){return{isColorSupported:!1,reset:Be,bold:Be,dim:Be,italic:Be,underline:Be,inverse:Be,hidden:Be,strikethrough:Be,black:Be,red:Be,green:Be,yellow:Be,blue:Be,magenta:Be,cyan:Be,white:Be,gray:Be,bgBlack:Be,bgRed:Be,bgGreen:Be,bgYellow:Be,bgBlue:Be,bgMagenta:Be,bgCyan:Be,bgWhite:Be,blackBright:Be,redBright:Be,greenBright:Be,yellowBright:Be,blueBright:Be,magentaBright:Be,cyanBright:Be,whiteBright:Be,bgBlackBright:Be,bgRedBright:Be,bgGreenBright:Be,bgYellowBright:Be,bgBlueBright:Be,bgMagentaBright:Be,bgCyanBright:Be,bgWhiteBright:Be}};iw.exports=PD();iw.exports.createColors=PD;var U$=iw.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(U$);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])}}})(kD);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(kD);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}}})(RD);let Rb=RD;var q$=(Rb.__esModule?Rb:{default:Rb}).default;const ft=cs(q$),lp=!1,sw=`import pandas as pd
|
|
34
34
|
df = pd.DataFrame(data) # 'data' contains the query result
|
|
35
35
|
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
36
|
-
`,cp="dm",Pv=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],G$=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],aw=["lg","md","sm","xs","xxs"],up={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[ft.teal[500],ft.teal[300],ft.gray[700],ft.gray[500],ft.gray[300]],borderColor:[ft.teal[500],ft.teal[300],ft.gray[700],ft.gray[500],ft.gray[300]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:Dv},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},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:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{datalables:{color:Dv},backgroundColor:[ft.teal[500],ft.teal[300],ft.gray[700],ft.gray[500],ft.gray[300]],borderColor:[ft.teal[500],ft.teal[300],ft.gray[700],ft.gray[500],ft.gray[300]]},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:ft.slate[800]}},y:{grid:{display:!0,color:ft.slate[800]}}}}}}};function Dv(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=Yu()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Yu()),Kl(n)}function Yu(){return se.getState().theme==="dark"?"#000000":"#FFFFFF"}function Kl(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return ft.gray[500];const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),f=parseInt(d.substring(2,4),16),p=parseInt(d.substring(4,6),16);t+=h,n+=f,r+=p,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"}const Y$=["text","name","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],K$=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],X$=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],Q$=["boolean"];function lw(e){return e.match(/[A-Z]/)?`"${e}"`:e}function Rg(e){return Y$.includes(e.toLowerCase())||/varchar/i.test(e)}function jd(e){return K$.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function yc(e){return X$.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function cw(e){return Q$.includes(e.toLowerCase())||/boolean/i.test(e)}function J$(e,t,n,r,o,i){const{measures:s,dimensions:a}=e,l=s==null?void 0:s.map(h=>`${h.calc}(${h.name}) as ${h.calc}_${h.name.replace(/"/g,"")}`).join(", "),c=(a==null?void 0:a.join(", "))||"";let u="";const d=r?`${cp}.${r}`:uw({schemaName:t,tableName:n,connectionType:o,databaseName:i});if(l&&c)return u=`SELECT ${c}, COUNT(*) as count, ${l} FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(!l&&c)return u=`SELECT ${c}, COUNT(*) as count FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(l&&!c)return u=`SELECT ${l} FROM ${d} LIMIT 100`,u}function Z$(e,t,n="AVG"){var i,s,a,l;let r={};const o=lw(e.column_name);return Rg(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),jd(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function bl(e){return Rg(e.dataType)?"string":jd(e.dataType)?"number":yc(e.dataType)?"date":cw(e.dataType)?"boolean":"string"}function e9(e){let t;const n=e.data_type.toLowerCase();return Rg(n)?t="T":jd(n)?t="#":yc(n)?t="D":cw(n)?t="B":t="?",t}function t9(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function DD(e){return e?e!=null&&e.startsWith(`${cp}.`)?e:`${cp}.${e}`:""}function MD({schemaName:e,tableName:t,modelName:n,connectionType:r,databaseName:o}){let i=uw({schemaName:e,tableName:t,connectionType:r,databaseName:o});n&&(i=DD(n));let s=i;return(l=>/[A-Z]/.test(l))(t)&&(s=s.split(".").map(c=>`"${c}"`).join(".")),s}function uw({schemaName:e,tableName:t,connectionType:n,databaseName:r}){return t==="api"||e===lw("NA")||n==="S3"||n==="API"?t:n==="S3Tables"?`${r}.${e}.${t}`:e?`${e}.${t}`:`${t}`}const n9=e=>{const t=new Date(e);return!isNaN(t.getTime())},r9=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),kg=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?n9(e)?t="date":r9(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function o9({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValues: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:kg(u),operation:"=",values:[u]};if(l!=null&&l.find(f=>f.id===n.id)){const f=n.id;if(u==null){a(n),i(f);return}else s(d)}o(n),r(d)}function v_({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return aw.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,h)=>Math.max(d,h.y+h.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function x_(e,t){if(!t)return;const n={...t};return aw.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function OD(e){const t=se.getState().dashboard.globalCacheConfig,{card:n,filter:r}=e;return t}const se=nw()(ED((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:up},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:up},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!0,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},updateEmailSettings:n=>{e(r=>{r.dashboard.emailSettings=n})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l,c,u,d,h;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(f=>f.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const f=(a=r.dashboard.filters)==null?void 0:a.filter(g=>g.sheetId===n),p=(l=r.filterValues)==null?void 0:l.filter(g=>f==null?void 0:f.some(m=>m.id===g.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(g=>!(p!=null&&p.some(m=>m.filterId===g.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(g=>g.sheetId!==n),r.selectedSheetId=(h=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:h.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{aw.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},addToAIScope:n=>{e(r=>{const{connectionId:o,connectionType:i,databaseName:s,schemaName:a,tableName:l,datamodelName:c,datamodelId:u}=n,d={connectionId:o||"",connectionType:i||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||"",datamodelId:u||""};let f=[...r.dashboard.aiScopeTables||[],d];f=f.filter((p,g,m)=>m.findIndex(y=>y.tableName===p.tableName&&y.datamodelName===p.datamodelName)===g),r.dashboard.aiScopeTables=f})},removeFromAIScope:n=>{e(r=>{const{connectionId:o,tableName:i,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===o));r.dashboard.aiScopeTables=l}else if(i){const l=a.filter(c=>!(c.tableName===i&&c.connectionId===o));r.dashboard.aiScopeTables=l}})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.python=r)}))})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var h;const d=(h=u.cards)==null?void 0:h.find(f=>f.id===r);d&&(d.title=o)}))})},setCardInfo:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.info=r)}))})},setCardDescription:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var h;const d=(h=u.cards)==null?void 0:h.find(f=>f.id===r);d&&(d.description=o)}))})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(h=>h.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l,c;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(u=>u.filterId===o.filterId);if(o.values.length===0){r.filterValues=(a=r.filterValues)==null?void 0:a.filter(u=>u.filterId!==o.filterId);return}i!==void 0&&i>-1?(l=r.filterValues)==null||l.splice(i,1,o):(c=r.filterValues)==null||c.push(o)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{v_({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=x_(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(f=>f.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(f=>f.id===r);if(a){const f=(d=a.cards)==null?void 0:d.findIndex(p=>p.id===o.id);f>-1&&((h=a.cards)==null||h.splice(f,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(o=>{var a,l;const i=(a=o.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=o.dashboard.filters)==null?void 0:l.some(c=>c.id===r);i&&!s&&(i.id=r)})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const h=0;o==="start"&&(d=0);const f=v_({id:r.id,layouts:s.layouts,minH:10,x:h,y:d});s.layouts=f,(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),x_(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(h=o.onRemoveCard)==null||h.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{o9({card:n,dataPoint:r,get:t})}}}))),Xt=()=>se(e=>e.actions);async function i9(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function TD(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),h=>h.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const h=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(h)}}catch(h){throw new Error(`Decryption failed: ${h}`)}}function ie(...e){return b$(Qi(e))}const s9=e=>Object.keys(e).length===0;async function a9(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function dw(e,t,n={}){try{const r=JSON.stringify(n),o=await i9(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await TD(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}async function l9(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(i=>{throw console.log(i.detail||"Unknown error occurred"),new Error((i==null?void 0:i.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function c9(e){if(!e)return{tenantId:"",endUserId:""};const t=Zx(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function u9(e){if(!e)return;const t=Zx(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function ID(e){return e?Zx(e).params:void 0}function d9(e){return e.charAt(0).toUpperCase()+e.slice(1)}const yl="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function f9(){var o,i;const e=(i=(o=se.getState())==null?void 0:o.authToken)==null?void 0:i.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function h9(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),o=new URLSearchParams(r).toString();o&&(n+=`?${o}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await TD(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function p9(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}var dp={exports:{}};dp.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",g="[object Map]",m="[object Number]",y="[object Null]",v="[object Object]",x="[object Proxy]",S="[object RegExp]",w="[object Set]",_="[object String]",R="[object Undefined]",P="[object WeakMap]",M="[object ArrayBuffer]",T="[object DataView]",I="[object Float32Array]",A="[object Float64Array]",U="[object Int8Array]",$="[object Int16Array]",O="[object Int32Array]",N="[object Uint8Array]",j="[object Uint8ClampedArray]",L="[object Uint16Array]",B="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,H=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,k={};k[I]=k[A]=k[U]=k[$]=k[O]=k[N]=k[j]=k[L]=k[B]=!0,k[a]=k[l]=k[M]=k[u]=k[T]=k[d]=k[h]=k[f]=k[g]=k[m]=k[v]=k[S]=k[w]=k[_]=k[P]=!1;var W=typeof ci=="object"&&ci&&ci.Object===Object&&ci,G=typeof self=="object"&&self&&self.Object===Object&&self,Y=W||G||Function("return this")(),V=t&&!t.nodeType&&t,q=V&&!0&&e&&!e.nodeType&&e,X=q&&q.exports===V,Z=X&&W.process,ne=function(){try{var z=q&&q.require&&q.require("util").types;return z||Z&&Z.binding&&Z.binding("util")}catch{}}(),J=ne&&ne.isTypedArray;function oe(z,Q,re){switch(re.length){case 0:return z.call(Q);case 1:return z.call(Q,re[0]);case 2:return z.call(Q,re[0],re[1]);case 3:return z.call(Q,re[0],re[1],re[2])}return z.apply(Q,re)}function ee(z,Q){for(var re=-1,ve=Array(z);++re<z;)ve[re]=Q(re);return ve}function ue(z){return function(Q){return z(Q)}}function fe(z,Q){return z==null?void 0:z[Q]}function xe(z,Q){return function(re){return z(Q(re))}}var pe=Array.prototype,be=Function.prototype,Ce=Object.prototype,Ke=Y["__core-js_shared__"],kt=be.toString,He=Ce.hasOwnProperty,Cn=function(){var z=/[^.]+$/.exec(Ke&&Ke.keys&&Ke.keys.IE_PROTO||"");return z?"Symbol(src)_1."+z:""}(),wt=Ce.toString,te=kt.call(Object),le=RegExp("^"+kt.call(He).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ye=X?Y.Buffer:void 0,Se=Y.Symbol,$e=Y.Uint8Array;ye&&ye.allocUnsafe;var Pt=xe(Object.getPrototypeOf,Object),_n=Object.create,gn=Ce.propertyIsEnumerable,En=pe.splice,Qt=Se?Se.toStringTag:void 0,mt=function(){try{var z=ub(Object,"defineProperty");return z({},"",{}),z}catch{}}(),Dr=ye?ye.isBuffer:void 0,mn=Math.max,Ua=Date.now,ys=ub(Y,"Map"),qo=ub(Object,"create"),Vt=function(){function z(){}return function(Q){if(!ws(Q))return{};if(_n)return _n(Q);z.prototype=Q;var re=new z;return z.prototype=void 0,re}}();function ct(z){var Q=-1,re=z==null?0:z.length;for(this.clear();++Q<re;){var ve=z[Q];this.set(ve[0],ve[1])}}function bn(){this.__data__=qo?qo(null):{},this.size=0}function we(z){var Q=this.has(z)&&delete this.__data__[z];return this.size-=Q?1:0,Q}function Ae(z){var Q=this.__data__;if(qo){var re=Q[z];return re===r?void 0:re}return He.call(Q,z)?Q[z]:void 0}function We(z){var Q=this.__data__;return qo?Q[z]!==void 0:He.call(Q,z)}function Ft(z,Q){var re=this.__data__;return this.size+=this.has(z)?0:1,re[z]=qo&&Q===void 0?r:Q,this}ct.prototype.clear=bn,ct.prototype.delete=we,ct.prototype.get=Ae,ct.prototype.has=We,ct.prototype.set=Ft;function bt(z){var Q=-1,re=z==null?0:z.length;for(this.clear();++Q<re;){var ve=z[Q];this.set(ve[0],ve[1])}}function yt(){this.__data__=[],this.size=0}function cn(z){var Q=this.__data__,re=kf(Q,z);if(re<0)return!1;var ve=Q.length-1;return re==ve?Q.pop():En.call(Q,re,1),--this.size,!0}function jt(z){var Q=this.__data__,re=kf(Q,z);return re<0?void 0:Q[re][1]}function Jt(z){return kf(this.__data__,z)>-1}function vs(z,Q){var re=this.__data__,ve=kf(re,z);return ve<0?(++this.size,re.push([z,Q])):re[ve][1]=Q,this}bt.prototype.clear=yt,bt.prototype.delete=cn,bt.prototype.get=jt,bt.prototype.has=Jt,bt.prototype.set=vs;function Mr(z){var Q=-1,re=z==null?0:z.length;for(this.clear();++Q<re;){var ve=z[Q];this.set(ve[0],ve[1])}}function co(){this.size=0,this.__data__={hash:new ct,map:new(ys||bt),string:new ct}}function xs(z){var Q=Df(this,z).delete(z);return this.size-=Q?1:0,Q}function jc(z){return Df(this,z).get(z)}function Q6(z){return Df(this,z).has(z)}function J6(z,Q){var re=Df(this,z),ve=re.size;return re.set(z,Q),this.size+=re.size==ve?0:1,this}Mr.prototype.clear=co,Mr.prototype.delete=xs,Mr.prototype.get=jc,Mr.prototype.has=Q6,Mr.prototype.set=J6;function qa(z){var Q=this.__data__=new bt(z);this.size=Q.size}function Z6(){this.__data__=new bt,this.size=0}function e8(z){var Q=this.__data__,re=Q.delete(z);return this.size=Q.size,re}function t8(z){return this.__data__.get(z)}function n8(z){return this.__data__.has(z)}function r8(z,Q){var re=this.__data__;if(re instanceof bt){var ve=re.__data__;if(!ys||ve.length<n-1)return ve.push([z,Q]),this.size=++re.size,this;re=this.__data__=new Mr(ve)}return re.set(z,Q),this.size=re.size,this}qa.prototype.clear=Z6,qa.prototype.delete=e8,qa.prototype.get=t8,qa.prototype.has=n8,qa.prototype.set=r8;function o8(z,Q){var re=hb(z),ve=!re&&fb(z),Ze=!re&&!ve&&KC(z),St=!re&&!ve&&!Ze&&QC(z),Lt=re||ve||Ze||St,rt=Lt?ee(z.length,String):[],$t=rt.length;for(var Wr in z)Lt&&(Wr=="length"||Ze&&(Wr=="offset"||Wr=="parent")||St&&(Wr=="buffer"||Wr=="byteLength"||Wr=="byteOffset")||GC(Wr,$t))||rt.push(Wr);return rt}function lb(z,Q,re){(re!==void 0&&!Mf(z[Q],re)||re===void 0&&!(Q in z))&&cb(z,Q,re)}function i8(z,Q,re){var ve=z[Q];(!(He.call(z,Q)&&Mf(ve,re))||re===void 0&&!(Q in z))&&cb(z,Q,re)}function kf(z,Q){for(var re=z.length;re--;)if(Mf(z[re][0],Q))return re;return-1}function cb(z,Q,re){Q=="__proto__"&&mt?mt(z,Q,{configurable:!0,enumerable:!0,value:re,writable:!0}):z[Q]=re}var s8=v8();function Pf(z){return z==null?z===void 0?R:y:Qt&&Qt in Object(z)?x8(z):R8(z)}function UC(z){return Lc(z)&&Pf(z)==a}function a8(z){if(!ws(z)||_8(z))return!1;var Q=gb(z)?le:H;return Q.test(M8(z))}function l8(z){return Lc(z)&&XC(z.length)&&!!k[Pf(z)]}function c8(z){if(!ws(z))return E8(z);var Q=YC(z),re=[];for(var ve in z)ve=="constructor"&&(Q||!He.call(z,ve))||re.push(ve);return re}function qC(z,Q,re,ve,Ze){z!==Q&&s8(Q,function(St,Lt){if(Ze||(Ze=new qa),ws(St))u8(z,Q,Lt,re,qC,ve,Ze);else{var rt=ve?ve(db(z,Lt),St,Lt+"",z,Q,Ze):void 0;rt===void 0&&(rt=St),lb(z,Lt,rt)}},JC)}function u8(z,Q,re,ve,Ze,St,Lt){var rt=db(z,re),$t=db(Q,re),Wr=Lt.get($t);if(Wr){lb(z,re,Wr);return}var fr=St?St(rt,$t,re+"",z,Q,Lt):void 0,$c=fr===void 0;if($c){var mb=hb($t),bb=!mb&&KC($t),e_=!mb&&!bb&&QC($t);fr=$t,mb||bb||e_?hb(rt)?fr=rt:O8(rt)?fr=m8(rt):bb?($c=!1,fr=h8($t)):e_?($c=!1,fr=g8($t)):fr=[]:T8($t)||fb($t)?(fr=rt,fb(rt)?fr=I8(rt):(!ws(rt)||gb(rt))&&(fr=w8($t))):$c=!1}$c&&(Lt.set($t,fr),Ze(fr,$t,ve,St,Lt),Lt.delete($t)),lb(z,re,fr)}function d8(z,Q){return P8(k8(z,Q,ZC),z+"")}var f8=mt?function(z,Q){return mt(z,"toString",{configurable:!0,enumerable:!1,value:N8(Q),writable:!0})}:ZC;function h8(z,Q){return z.slice()}function p8(z){var Q=new z.constructor(z.byteLength);return new $e(Q).set(new $e(z)),Q}function g8(z,Q){var re=p8(z.buffer);return new z.constructor(re,z.byteOffset,z.length)}function m8(z,Q){var re=-1,ve=z.length;for(Q||(Q=Array(ve));++re<ve;)Q[re]=z[re];return Q}function b8(z,Q,re,ve){var Ze=!re;re||(re={});for(var St=-1,Lt=Q.length;++St<Lt;){var rt=Q[St],$t=void 0;$t===void 0&&($t=z[rt]),Ze?cb(re,rt,$t):i8(re,rt,$t)}return re}function y8(z){return d8(function(Q,re){var ve=-1,Ze=re.length,St=Ze>1?re[Ze-1]:void 0,Lt=Ze>2?re[2]:void 0;for(St=z.length>3&&typeof St=="function"?(Ze--,St):void 0,Lt&&S8(re[0],re[1],Lt)&&(St=Ze<3?void 0:St,Ze=1),Q=Object(Q);++ve<Ze;){var rt=re[ve];rt&&z(Q,rt,ve,St)}return Q})}function v8(z){return function(Q,re,ve){for(var Ze=-1,St=Object(Q),Lt=ve(Q),rt=Lt.length;rt--;){var $t=Lt[++Ze];if(re(St[$t],$t,St)===!1)break}return Q}}function Df(z,Q){var re=z.__data__;return C8(Q)?re[typeof Q=="string"?"string":"hash"]:re.map}function ub(z,Q){var re=fe(z,Q);return a8(re)?re:void 0}function x8(z){var Q=He.call(z,Qt),re=z[Qt];try{z[Qt]=void 0;var ve=!0}catch{}var Ze=wt.call(z);return ve&&(Q?z[Qt]=re:delete z[Qt]),Ze}function w8(z){return typeof z.constructor=="function"&&!YC(z)?Vt(Pt(z)):{}}function GC(z,Q){var re=typeof z;return Q=Q??s,!!Q&&(re=="number"||re!="symbol"&&F.test(z))&&z>-1&&z%1==0&&z<Q}function S8(z,Q,re){if(!ws(re))return!1;var ve=typeof Q;return(ve=="number"?pb(re)&&GC(Q,re.length):ve=="string"&&Q in re)?Mf(re[Q],z):!1}function C8(z){var Q=typeof z;return Q=="string"||Q=="number"||Q=="symbol"||Q=="boolean"?z!=="__proto__":z===null}function _8(z){return!!Cn&&Cn in z}function YC(z){var Q=z&&z.constructor,re=typeof Q=="function"&&Q.prototype||Ce;return z===re}function E8(z){var Q=[];if(z!=null)for(var re in Object(z))Q.push(re);return Q}function R8(z){return wt.call(z)}function k8(z,Q,re){return Q=mn(Q===void 0?z.length-1:Q,0),function(){for(var ve=arguments,Ze=-1,St=mn(ve.length-Q,0),Lt=Array(St);++Ze<St;)Lt[Ze]=ve[Q+Ze];Ze=-1;for(var rt=Array(Q+1);++Ze<Q;)rt[Ze]=ve[Ze];return rt[Q]=re(Lt),oe(z,this,rt)}}function db(z,Q){if(!(Q==="constructor"&&typeof z[Q]=="function")&&Q!="__proto__")return z[Q]}var P8=D8(f8);function D8(z){var Q=0,re=0;return function(){var ve=Ua(),Ze=i-(ve-re);if(re=ve,Ze>0){if(++Q>=o)return arguments[0]}else Q=0;return z.apply(void 0,arguments)}}function M8(z){if(z!=null){try{return kt.call(z)}catch{}try{return z+""}catch{}}return""}function Mf(z,Q){return z===Q||z!==z&&Q!==Q}var fb=UC(function(){return arguments}())?UC:function(z){return Lc(z)&&He.call(z,"callee")&&!gn.call(z,"callee")},hb=Array.isArray;function pb(z){return z!=null&&XC(z.length)&&!gb(z)}function O8(z){return Lc(z)&&pb(z)}var KC=Dr||F8;function gb(z){if(!ws(z))return!1;var Q=Pf(z);return Q==f||Q==p||Q==c||Q==x}function XC(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=s}function ws(z){var Q=typeof z;return z!=null&&(Q=="object"||Q=="function")}function Lc(z){return z!=null&&typeof z=="object"}function T8(z){if(!Lc(z)||Pf(z)!=v)return!1;var Q=Pt(z);if(Q===null)return!0;var re=He.call(Q,"constructor")&&Q.constructor;return typeof re=="function"&&re instanceof re&&kt.call(re)==te}var QC=J?ue(J):l8;function I8(z){return b8(z,JC(z))}function JC(z){return pb(z)?o8(z):c8(z)}var A8=y8(function(z,Q,re){qC(z,Q,re)});function N8(z){return function(){return z}}function ZC(z){return z}function F8(){return!1}e.exports=A8})(dp,dp.exports);var g9=dp.exports;const Ku=cs(g9),m9={theme:"system",setTheme:()=>null},AD=C.createContext(m9);function b9({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=C.useState(()=>localStorage.getItem(n)||t);C.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return b.jsx(AD.Provider,{...r,value:s,children:e})}const ND=()=>{const e=C.useContext(AD);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var Ld=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(){}},va=typeof window>"u"||"Deno"in globalThis;function Ir(){}function y9(e,t){return typeof e=="function"?e(t):e}function Mv(e){return typeof e=="number"&&e>=0&&e!==1/0}function FD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vl(e,t){return typeof e=="function"?e(t):e}function Xr(e,t){return typeof e=="function"?e(t):e}function w_(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==fw(s,t.options))return!1}else if(!Qu(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||o&&o!==t.state.fetchStatus||i&&!i(t))}function S_(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Xu(t.options.mutationKey)!==Xu(i))return!1}else if(!Qu(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function fw(e,t){return((t==null?void 0:t.queryKeyHashFn)||Xu)(e)}function Xu(e){return JSON.stringify(e,(t,n)=>Iv(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Qu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Qu(e[n],t[n])):!1}function Ov(e,t){if(e===t)return e;const n=C_(e)&&C_(t);if(n||Iv(e)&&Iv(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&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=Ov(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function Tv(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function C_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Iv(e){if(!__(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!__(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function __(e){return Object.prototype.toString.call(e)==="[object Object]"}function v9(e){return new Promise(t=>{setTimeout(t,e)})}function Av(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Ov(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return Ov(e,t)}return t}function x9(e){return e}function w9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function S9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var fp=Symbol();function jD(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===fp&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===fp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ks,Ni,Al,rD,C9=(rD=class extends Ld{constructor(){super();ke(this,Ks);ke(this,Ni);ke(this,Al);me(this,Al,t=>{if(!va&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){K(this,Ni)||this.setEventListener(K(this,Al))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,Ni))==null||t.call(this),me(this,Ni,void 0))}setEventListener(t){var n;me(this,Al,t),(n=K(this,Ni))==null||n.call(this),me(this,Ni,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){K(this,Ks)!==t&&(me(this,Ks,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof K(this,Ks)=="boolean"?K(this,Ks):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ks=new WeakMap,Ni=new WeakMap,Al=new WeakMap,rD),hw=new C9,Nl,Fi,Fl,oD,_9=(oD=class extends Ld{constructor(){super();ke(this,Nl,!0);ke(this,Fi);ke(this,Fl);me(this,Fl,t=>{if(!va&&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(){K(this,Fi)||this.setEventListener(K(this,Fl))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,Fi))==null||t.call(this),me(this,Fi,void 0))}setEventListener(t){var n;me(this,Fl,t),(n=K(this,Fi))==null||n.call(this),me(this,Fi,t(this.setOnline.bind(this)))}setOnline(t){K(this,Nl)!==t&&(me(this,Nl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return K(this,Nl)}},Nl=new WeakMap,Fi=new WeakMap,Fl=new WeakMap,oD),hp=new _9;function Nv(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function E9(e){return Math.min(1e3*2**e,3e4)}function LD(e){return(e??"online")==="online"?hp.isOnline():!0}var $D=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function kb(e){return e instanceof $D}function zD(e){let t=!1,n=0,r=!1,o;const i=Nv(),s=g=>{var m;r||(h(new $D(g)),(m=e.abort)==null||m.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>hw.isFocused()&&(e.networkMode==="always"||hp.isOnline())&&e.canRun(),u=()=>LD(e.networkMode)&&e.canRun(),d=g=>{var m;r||(r=!0,(m=e.onSuccess)==null||m.call(e,g),o==null||o(),i.resolve(g))},h=g=>{var m;r||(r=!0,(m=e.onError)==null||m.call(e,g),o==null||o(),i.reject(g))},f=()=>new Promise(g=>{var m;o=y=>{(r||c())&&g(y)},(m=e.onPause)==null||m.call(e)}).then(()=>{var g;o=void 0,r||(g=e.onContinue)==null||g.call(e)}),p=()=>{if(r)return;let g;const m=n===0?e.initialPromise:void 0;try{g=m??e.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(d).catch(y=>{var _;if(r)return;const v=e.retry??(va?0:3),x=e.retryDelay??E9,S=typeof x=="function"?x(n,y):x,w=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(t||!w){h(y);return}n++,(_=e.onFail)==null||_.call(e,n,y),v9(S).then(()=>c()?void 0:f()).then(()=>{t?h(y):p()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():f().then(p),i)}}function R9(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var xn=R9(),Xs,iD,BD=(iD=class{constructor(){ke(this,Xs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mv(this.gcTime)&&me(this,Xs,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(va?1/0:5*60*1e3))}clearGcTimeout(){K(this,Xs)&&(clearTimeout(K(this,Xs)),me(this,Xs,void 0))}},Xs=new WeakMap,iD),jl,Ll,Tr,Qs,Dn,Id,Js,Yr,Qo,sD,k9=(sD=class extends BD{constructor(t){super();ke(this,Yr);ke(this,jl);ke(this,Ll);ke(this,Tr);ke(this,Qs);ke(this,Dn);ke(this,Id);ke(this,Js);me(this,Js,!1),me(this,Id,t.defaultOptions),this.setOptions(t.options),this.observers=[],me(this,Qs,t.client),me(this,Tr,K(this,Qs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,me(this,jl,P9(this.options)),this.state=t.state??K(this,jl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=K(this,Dn))==null?void 0:t.promise}setOptions(t){this.options={...K(this,Id),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&K(this,Tr).remove(this)}setData(t,n){const r=Av(this.state.data,t,this.options);return Qe(this,Yr,Qo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Qe(this,Yr,Qo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=K(this,Dn))==null?void 0:r.promise;return(o=K(this,Dn))==null||o.cancel(t),n?n.then(Ir).catch(Ir):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(K(this,jl))}isActive(){return this.observers.some(t=>Xr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!FD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Dn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Dn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),K(this,Tr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(K(this,Dn)&&(K(this,Js)?K(this,Dn).cancel({revert:!0}):K(this,Dn).cancelRetry()),this.scheduleGc()),K(this,Tr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Qe(this,Yr,Qo).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(K(this,Dn))return K(this,Dn).continueRetry(),K(this,Dn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.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=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(me(this,Js,!0),r.signal)})},i=()=>{const d=jD(this.options,n),h={client:K(this,Qs),queryKey:this.queryKey,meta:this.meta};return o(h),me(this,Js,!1),this.options.persister?this.options.persister(d,h,this):d(h)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:K(this,Qs),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),me(this,Ll,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Qe(this,Yr,Qo).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var h,f,p,g;kb(d)&&d.silent||Qe(this,Yr,Qo).call(this,{type:"error",error:d}),kb(d)||((f=(h=K(this,Tr).config).onError)==null||f.call(h,d,this),(g=(p=K(this,Tr).config).onSettled)==null||g.call(p,this.state.data,d,this)),this.scheduleGc()};return me(this,Dn,zD({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,f,p,g;if(d===void 0){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}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(m){a(m);return}(f=(h=K(this,Tr).config).onSuccess)==null||f.call(h,d,this),(g=(p=K(this,Tr).config).onSettled)==null||g.call(p,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,h)=>{Qe(this,Yr,Qo).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{Qe(this,Yr,Qo).call(this,{type:"pause"})},onContinue:()=>{Qe(this,Yr,Qo).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),K(this,Dn).start()}},jl=new WeakMap,Ll=new WeakMap,Tr=new WeakMap,Qs=new WeakMap,Dn=new WeakMap,Id=new WeakMap,Js=new WeakMap,Yr=new WeakSet,Qo=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,...VD(r.data,this.options),fetchMeta:t.meta??null};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 kb(o)&&o.revert&&K(this,Ll)?{...K(this,Ll),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),xn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),K(this,Tr).notify({query:this,type:"updated",action:t})})},sD);function VD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:LD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function P9(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var mo,aD,HD=(aD=class extends Ld{constructor(t={}){super();ke(this,mo);this.config=t,me(this,mo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??fw(o,n);let s=this.get(i);return s||(s=new k9({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){K(this,mo).has(t.queryHash)||(K(this,mo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=K(this,mo).get(t.queryHash);n&&(t.destroy(),n===t&&K(this,mo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){xn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return K(this,mo).get(t)}getAll(){return[...K(this,mo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>w_(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>w_(t,r)):n}notify(t){xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){xn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){xn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mo=new WeakMap,aD),bo,Ln,Zs,yo,Oi,lD,D9=(lD=class extends BD{constructor(t){super();ke(this,yo);ke(this,bo);ke(this,Ln);ke(this,Zs);this.mutationId=t.mutationId,me(this,Ln,t.mutationCache),me(this,bo,[]),this.state=t.state||M9(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){K(this,bo).includes(t)||(K(this,bo).push(t),this.clearGcTimeout(),K(this,Ln).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){me(this,bo,K(this,bo).filter(n=>n!==t)),this.scheduleGc(),K(this,Ln).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){K(this,bo).length||(this.state.status==="pending"?this.scheduleGc():K(this,Ln).remove(this))}continue(){var t;return((t=K(this,Zs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,h,f,p,g,m,y,v,x,S,w,_,R;me(this,Zs,zD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,M)=>{Qe(this,yo,Oi).call(this,{type:"failed",failureCount:P,error:M})},onPause:()=>{Qe(this,yo,Oi).call(this,{type:"pause"})},onContinue:()=>{Qe(this,yo,Oi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>K(this,Ln).canRun(this)}));const n=this.state.status==="pending",r=!K(this,Zs).canStart();try{if(!n){Qe(this,yo,Oi).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=K(this,Ln).config).onMutate)==null?void 0:i.call(o,t,this));const M=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));M!==this.state.context&&Qe(this,yo,Oi).call(this,{type:"pending",context:M,variables:t,isPaused:r})}const P=await K(this,Zs).start();return await((c=(l=K(this,Ln).config).onSuccess)==null?void 0:c.call(l,P,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,P,t,this.state.context)),await((f=(h=K(this,Ln).config).onSettled)==null?void 0:f.call(h,P,null,this.state.variables,this.state.context,this)),await((g=(p=this.options).onSettled)==null?void 0:g.call(p,P,null,t,this.state.context)),Qe(this,yo,Oi).call(this,{type:"success",data:P}),P}catch(P){try{throw await((y=(m=K(this,Ln).config).onError)==null?void 0:y.call(m,P,t,this.state.context,this)),await((x=(v=this.options).onError)==null?void 0:x.call(v,P,t,this.state.context)),await((w=(S=K(this,Ln).config).onSettled)==null?void 0:w.call(S,void 0,P,this.state.variables,this.state.context,this)),await((R=(_=this.options).onSettled)==null?void 0:R.call(_,void 0,P,t,this.state.context)),P}finally{Qe(this,yo,Oi).call(this,{type:"error",error:P})}}finally{K(this,Ln).runNext(this)}}},bo=new WeakMap,Ln=new WeakMap,Zs=new WeakMap,yo=new WeakSet,Oi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),xn.batch(()=>{K(this,bo).forEach(r=>{r.onMutationUpdate(t)}),K(this,Ln).notify({mutation:this,type:"updated",action:t})})},lD);function M9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oi,Kr,Ad,cD,O9=(cD=class extends Ld{constructor(t={}){super();ke(this,oi);ke(this,Kr);ke(this,Ad);this.config=t,me(this,oi,new Set),me(this,Kr,new Map),me(this,Ad,0)}build(t,n,r){const o=new D9({mutationCache:this,mutationId:++Of(this,Ad)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){K(this,oi).add(t);const n=Af(t);if(typeof n=="string"){const r=K(this,Kr).get(n);r?r.push(t):K(this,Kr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(K(this,oi).delete(t)){const n=Af(t);if(typeof n=="string"){const r=K(this,Kr).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&K(this,Kr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Af(t);if(typeof n=="string"){const r=K(this,Kr).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Af(t);if(typeof n=="string"){const o=(r=K(this,Kr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){xn.batch(()=>{K(this,oi).forEach(t=>{this.notify({type:"removed",mutation:t})}),K(this,oi).clear(),K(this,Kr).clear()})}getAll(){return Array.from(K(this,oi))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>S_(n,r))}findAll(t={}){return this.getAll().filter(n=>S_(t,n))}notify(t){xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return xn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ir))))}},oi=new WeakMap,Kr=new WeakMap,Ad=new WeakMap,cD);function Af(e){var t;return(t=e.options.scope)==null?void 0:t.id}function E_(e){return{onFetch:(t,n)=>{var u,d,h,f,p;const r=t.options,o=(h=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((f=t.state.data)==null?void 0:f.pages)||[],s=((p=t.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const m=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},y=jD(t.options,t.fetchOptions),v=async(x,S,w)=>{if(g)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const _={client:t.client,queryKey:t.queryKey,pageParam:S,direction:w?"backward":"forward",meta:t.options.meta};m(_);const R=await y(_),{maxPages:P}=t.options,M=w?S9:w9;return{pages:M(x.pages,R,P),pageParams:M(x.pageParams,S,P)}};if(o&&i.length){const x=o==="backward",S=x?T9:R_,w={pages:i,pageParams:s},_=S(r,w);a=await v(w,_,x)}else{const x=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:R_(r,a);if(l>0&&S==null)break;a=await v(a,S),l++}while(l<x)}return a};t.options.persister?t.fetchFn=()=>{var g,m;return(m=(g=t.options).persister)==null?void 0:m.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function R_(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function T9(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ht,ji,Li,$l,zl,$i,Bl,Vl,uD,I9=(uD=class{constructor(e={}){ke(this,Ht);ke(this,ji);ke(this,Li);ke(this,$l);ke(this,zl);ke(this,$i);ke(this,Bl);ke(this,Vl);me(this,Ht,e.queryCache||new HD),me(this,ji,e.mutationCache||new O9),me(this,Li,e.defaultOptions||{}),me(this,$l,new Map),me(this,zl,new Map),me(this,$i,0)}mount(){Of(this,$i)._++,K(this,$i)===1&&(me(this,Bl,hw.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,Ht).onFocus())})),me(this,Vl,hp.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,Ht).onOnline())})))}unmount(){var e,t;Of(this,$i)._--,K(this,$i)===0&&((e=K(this,Bl))==null||e.call(this),me(this,Bl,void 0),(t=K(this,Vl))==null||t.call(this),me(this,Vl,void 0))}isFetching(e){return K(this,Ht).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return K(this,ji).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,Ht).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=K(this,Ht).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(vl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return K(this,Ht).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=K(this,Ht).get(r.queryHash),i=o==null?void 0:o.state.data,s=y9(t,i);if(s!==void 0)return K(this,Ht).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return xn.batch(()=>K(this,Ht).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,Ht).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=K(this,Ht);xn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=K(this,Ht);return xn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=xn.batch(()=>K(this,Ht).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ir).catch(Ir)}invalidateQueries(e,t={}){return xn.batch(()=>(K(this,Ht).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=xn.batch(()=>K(this,Ht).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ir)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ir)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=K(this,Ht).build(this,t);return n.isStaleByTime(vl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ir).catch(Ir)}fetchInfiniteQuery(e){return e.behavior=E_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ir).catch(Ir)}ensureInfiniteQueryData(e){return e.behavior=E_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return hp.isOnline()?K(this,ji).resumePausedMutations():Promise.resolve()}getQueryCache(){return K(this,Ht)}getMutationCache(){return K(this,ji)}getDefaultOptions(){return K(this,Li)}setDefaultOptions(e){me(this,Li,e)}setQueryDefaults(e,t){K(this,$l).set(Xu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...K(this,$l).values()],n={};return t.forEach(r=>{Qu(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){K(this,zl).set(Xu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...K(this,zl).values()],n={};return t.forEach(r=>{Qu(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...K(this,Li).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=fw(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===fp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...K(this,Li).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){K(this,Ht).clear(),K(this,ji).clear()}},Ht=new WeakMap,ji=new WeakMap,Li=new WeakMap,$l=new WeakMap,zl=new WeakMap,$i=new WeakMap,Bl=new WeakMap,Vl=new WeakMap,uD),tr,Je,Nd,$n,ea,Hl,zi,vo,Fd,Wl,Ul,ta,na,Bi,ql,pt,iu,Fv,jv,Lv,$v,zv,Bv,Vv,WD,dD,A9=(dD=class extends Ld{constructor(t,n){super();ke(this,pt);ke(this,tr);ke(this,Je);ke(this,Nd);ke(this,$n);ke(this,ea);ke(this,Hl);ke(this,zi);ke(this,vo);ke(this,Fd);ke(this,Wl);ke(this,Ul);ke(this,ta);ke(this,na);ke(this,Bi);ke(this,ql,new Set);this.options=n,me(this,tr,t),me(this,vo,null),me(this,zi,Nv()),this.options.experimental_prefetchInRender||K(this,zi).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(K(this,Je).addObserver(this),k_(K(this,Je),this.options)?Qe(this,pt,iu).call(this):this.updateResult(),Qe(this,pt,$v).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Hv(K(this,Je),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Hv(K(this,Je),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Qe(this,pt,zv).call(this),Qe(this,pt,Bv).call(this),K(this,Je).removeObserver(this)}setOptions(t,n){const r=this.options,o=K(this,Je);if(this.options=K(this,tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xr(this.options.enabled,K(this,Je))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Qe(this,pt,Vv).call(this),K(this,Je).setOptions(this.options),r._defaulted&&!Tv(this.options,r)&&K(this,tr).getQueryCache().notify({type:"observerOptionsUpdated",query:K(this,Je),observer:this});const i=this.hasListeners();i&&P_(K(this,Je),o,this.options,r)&&Qe(this,pt,iu).call(this),this.updateResult(n),i&&(K(this,Je)!==o||Xr(this.options.enabled,K(this,Je))!==Xr(r.enabled,K(this,Je))||vl(this.options.staleTime,K(this,Je))!==vl(r.staleTime,K(this,Je)))&&Qe(this,pt,Fv).call(this);const s=Qe(this,pt,jv).call(this);i&&(K(this,Je)!==o||Xr(this.options.enabled,K(this,Je))!==Xr(r.enabled,K(this,Je))||s!==K(this,Bi))&&Qe(this,pt,Lv).call(this,s)}getOptimisticResult(t){const n=K(this,tr).getQueryCache().build(K(this,tr),t),r=this.createResult(n,t);return F9(this,r)&&(me(this,$n,r),me(this,Hl,this.options),me(this,ea,K(this,Je).state)),r}getCurrentResult(){return K(this,$n)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){K(this,ql).add(t)}getCurrentQuery(){return K(this,Je)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=K(this,tr).defaultQueryOptions(t),r=K(this,tr).getQueryCache().build(K(this,tr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Qe(this,pt,iu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),K(this,$n)))}createResult(t,n){var P;const r=K(this,Je),o=this.options,i=K(this,$n),s=K(this,ea),a=K(this,Hl),c=t!==r?t.state:K(this,Nd),{state:u}=t;let d={...u},h=!1,f;if(n._optimisticResults){const M=this.hasListeners(),T=!M&&k_(t,n),I=M&&P_(t,r,n,o);(T||I)&&(d={...d,...VD(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:g,status:m}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===K(this,Fd))f=K(this,Wl);else try{me(this,Fd,n.select),f=n.select(d.data),f=Av(i==null?void 0:i.data,f,n),me(this,Wl,f),me(this,vo,null)}catch(M){me(this,vo,M)}else f=d.data;if(n.placeholderData!==void 0&&f===void 0&&m==="pending"){let M;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))M=i.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData((P=K(this,Ul))==null?void 0:P.state.data,K(this,Ul)):n.placeholderData,n.select&&M!==void 0)try{M=n.select(M),me(this,vo,null)}catch(T){me(this,vo,T)}M!==void 0&&(m="success",f=Av(i==null?void 0:i.data,M,n),h=!0)}K(this,vo)&&(p=K(this,vo),f=K(this,Wl),g=Date.now(),m="error");const y=d.fetchStatus==="fetching",v=m==="pending",x=m==="error",S=v&&y,w=f!==void 0,R={status:m,fetchStatus:d.fetchStatus,isPending:v,isSuccess:m==="success",isError:x,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:x&&!w,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:x&&w,isStale:pw(t,n),refetch:this.refetch,promise:K(this,zi)};if(this.options.experimental_prefetchInRender){const M=A=>{R.status==="error"?A.reject(R.error):R.data!==void 0&&A.resolve(R.data)},T=()=>{const A=me(this,zi,R.promise=Nv());M(A)},I=K(this,zi);switch(I.status){case"pending":t.queryHash===r.queryHash&&M(I);break;case"fulfilled":(R.status==="error"||R.data!==I.value)&&T();break;case"rejected":(R.status!=="error"||R.error!==I.reason)&&T();break}}return R}updateResult(t){const n=K(this,$n),r=this.createResult(K(this,Je),this.options);if(me(this,ea,K(this,Je).state),me(this,Hl,this.options),K(this,ea).data!==void 0&&me(this,Ul,K(this,Je)),Tv(r,n))return;me(this,$n,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!K(this,ql).size)return!0;const l=new Set(a??K(this,ql));return this.options.throwOnError&&l.add("error"),Object.keys(K(this,$n)).some(c=>{const u=c;return K(this,$n)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Qe(this,pt,WD).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Qe(this,pt,$v).call(this)}},tr=new WeakMap,Je=new WeakMap,Nd=new WeakMap,$n=new WeakMap,ea=new WeakMap,Hl=new WeakMap,zi=new WeakMap,vo=new WeakMap,Fd=new WeakMap,Wl=new WeakMap,Ul=new WeakMap,ta=new WeakMap,na=new WeakMap,Bi=new WeakMap,ql=new WeakMap,pt=new WeakSet,iu=function(t){Qe(this,pt,Vv).call(this);let n=K(this,Je).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ir)),n},Fv=function(){Qe(this,pt,zv).call(this);const t=vl(this.options.staleTime,K(this,Je));if(va||K(this,$n).isStale||!Mv(t))return;const r=FD(K(this,$n).dataUpdatedAt,t)+1;me(this,ta,setTimeout(()=>{K(this,$n).isStale||this.updateResult()},r))},jv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(K(this,Je)):this.options.refetchInterval)??!1},Lv=function(t){Qe(this,pt,Bv).call(this),me(this,Bi,t),!(va||Xr(this.options.enabled,K(this,Je))===!1||!Mv(K(this,Bi))||K(this,Bi)===0)&&me(this,na,setInterval(()=>{(this.options.refetchIntervalInBackground||hw.isFocused())&&Qe(this,pt,iu).call(this)},K(this,Bi)))},$v=function(){Qe(this,pt,Fv).call(this),Qe(this,pt,Lv).call(this,Qe(this,pt,jv).call(this))},zv=function(){K(this,ta)&&(clearTimeout(K(this,ta)),me(this,ta,void 0))},Bv=function(){K(this,na)&&(clearInterval(K(this,na)),me(this,na,void 0))},Vv=function(){const t=K(this,tr).getQueryCache().build(K(this,tr),this.options);if(t===K(this,Je))return;const n=K(this,Je);me(this,Je,t),me(this,Nd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},WD=function(t){xn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(K(this,$n))}),K(this,tr).getQueryCache().notify({query:K(this,Je),type:"observerResultsUpdated"})})},dD);function N9(e,t){return Xr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function k_(e,t){return N9(e,t)||e.state.data!==void 0&&Hv(e,t,t.refetchOnMount)}function Hv(e,t,n){if(Xr(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&pw(e,t)}return!1}function P_(e,t,n,r){return(e!==t||Xr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&pw(e,n)}function pw(e,t){return Xr(t.enabled,e)!==!1&&e.isStaleByTime(vl(t.staleTime,e))}function F9(e,t){return!Tv(e.getCurrentResult(),t)}var gw=E.createContext(void 0),mw=e=>{const t=E.useContext(gw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},j9=({client:e,children:t})=>(E.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(gw.Provider,{value:e,children:t})),UD=E.createContext(!1),L9=()=>E.useContext(UD);UD.Provider;function $9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z9=E.createContext($9()),B9=()=>E.useContext(z9);function V9(e,t){return typeof e=="function"?e(...t):!!e}function D_(){}var H9=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},W9=e=>{E.useEffect(()=>{e.clearReset()},[e])},U9=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||V9(n,[e.error,r])),q9=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},G9=(e,t)=>e.isLoading&&e.isFetching&&!t,Y9=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,M_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function K9(e,t,n){var d,h,f,p,g;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=mw(),o=L9(),i=B9(),s=r.defaultQueryOptions(e);(h=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",q9(s),H9(s,i),W9(i);const a=!r.getQueryCache().get(s.queryHash),[l]=E.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!o&&e.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(m=>{const y=u?l.subscribe(xn.batchCalls(m)):D_;return l.updateResult(),y},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),E.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),Y9(s,c))throw M_(s,l,i);if(U9({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((p=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,s,c),s.experimental_prefetchInRender&&!va&&G9(c,o)){const m=a?M_(s,l,i):(g=r.getQueryCache().get(s.queryHash))==null?void 0:g.promise;m==null||m.catch(D_).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function $d(e,t){return K9(e,A9)}function X9(){const e=C.useContext(gw);if(e&&e.isSemaphorClient)return e}function qD({children:e}){const{setIsSessionExpired:t}=Xt(),n=X9(),[r]=C.useState(()=>{const o=new I9({queryCache:new HD({onError:i=>{i instanceof Error?(console.error(`Something went wrong: ${i.message}`),i.message==="invalid token"&&t(!0)):console.error("Something went wrong:",i)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return o.isSemaphorClient=!0,o});return n?b.jsx(b.Fragment,{children:e}):b.jsx(j9,{client:r,children:e})}const us=C.forwardRef(({children:e,className:t,...n},r)=>b.jsx("div",{className:ie("semaphor-scope",t),ref:r,...n,children:e})),Q9={id:"",authToken:void 0},GD=C.createContext(Q9),YD=({children:e,dashboardProps:t})=>b.jsx(qD,{children:b.jsx(GD.Provider,{value:t,children:b.jsx(us,{style:{height:"100%"},children:e})})});function Pr(){const e=C.useContext(GD);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function J9(){const{authToken:e,version:t}=Pr(),n=se(l=>l.selectedLensId);function r(){if(!(e!=null&&e.accessToken))return!1}const{data:o,isLoading:i,isFetching:s,isError:a}=$d({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>h9(e==null?void 0:e.accessToken,{lensId:n,version:t}),enabled:r()});return{data:o,isLoading:i,isFetching:s,isError:a}}function Z9(){const{authToken:e}=Pr(),t=se(r=>r.authToken),{setAuthToken:n}=Xt();return C.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}const KD=(e,t)=>{const n={};if(e===null||t===null)return t;const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of r){if(!(o in e)&&o in t){n[o]=t[o];continue}if(o in e&&!(o in t)){n[o]=void 0;continue}const i=e[o],s=t[o];if(!Wv(i,s))if(Array.isArray(i)&&Array.isArray(s))n[o]=s;else if(O_(i)&&O_(s)){const a=KD(i,s);Object.keys(a).length>0&&(n[o]=a)}else n[o]=s}return n},Wv=(e,t)=>{if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((o,i)=>Wv(o,t[i]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>Wv(e[o],t[o]))}return!1},O_=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Ju=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n=>Ju(n));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=Ju(e[n]));return t};function XD(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function T_(e,t){const n=XD(e);return n==="dark"?Ku({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function e7({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,selectedSheetId:i,onFilterValuesChange:s}){const{authToken:a}=Pr();Z9();const l=se(N=>N.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:h}=J9(),[f,p]=C.useState(o||[]),{theme:g,setTheme:m}=ND(),y=se(N=>N.dashboard.globalStyle),{setDashboard:v,setDashboardWithFilterValues:x,setSelectedSheetId:S,setStyle:w,setOnSaveFunction:_,setLenses:R,setSelectedLensId:P,setInitStore:M}=Xt();se(N=>N.actions.setCustomCards);const T=se(N=>N.actions.setFilterValues),I=se(N=>N.filterValues),A=se(N=>N.actions.setThemeStyle),U=se(N=>N.actions.setDashboardTheme),$=se(N=>N.actions.setOnEvent);C.useEffect(()=>{a&&M()},[a,M]),C.useEffect(()=>{if(g){const N=XD(g);U(N)}},[g,U]),C.useEffect(()=>{t&&m(t)},[t,m]);const O=C.useCallback(()=>{const N=Ju(up),j=Ku(N,y);if(e){const L=Ku(j,e),B=T_(g,L);A(B),w(L)}else{const L=T_(g,j);A(L),w(up)}},[g,e,y,A,w]);return C.useEffect(()=>{c&&c.dashboard&&O()},[g,e,y,O,c]),C.useEffect(()=>{var F,k;function N(W,G){const Y=W.filters||[],V=[];for(const q of G){const X=Y.find(Z=>Z.id===q.filterId);X&&V.push({filterId:q.filterId,connectionType:X.database==="NA"?"api":"database",name:X.column,operation:X.operation,valueType:bl(X),values:q.values})}return V}if(!c||!c.dashboard)return;const{dashboard:j,filterValues:L,defaultLensId:B,lenses:D}=c,H=N(j,f||[]);x(j,(!L||(L==null?void 0:L.length)===0?H:L)||[]),D&&R(D),B&&P(B),S(i||((k=(F=j==null?void 0:j.sheets)==null?void 0:F[0])==null?void 0:k.id)||null)},[c,v,S,T,l,R,x,P,f,i]),C.useEffect(()=>{s&&I&&s(I)},[I,s]),C.useEffect(()=>{n&&_(n),r&&$(r)},[n,_,r,$]),{isFetching:d,isLoading:u,isError:h}}function ra({className:e,...t}){return b.jsx("div",{className:ie("animate-pulse rounded-md bg-muted",e),...t})}const QD=E.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:ie("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));QD.displayName="Card";const Pg=E.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:ie("flex flex-col space-y-1.5 p-6",e),...t}));Pg.displayName="CardHeader";const vc=E.forwardRef(({className:e,...t},n)=>b.jsx("h3",{ref:n,className:ie("text-2xl font-semibold leading-none tracking-tight",e),...t}));vc.displayName="CardTitle";const bw=E.forwardRef(({className:e,...t},n)=>b.jsx("p",{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));bw.displayName="CardDescription";const Dg=E.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:ie("px-6 pt-0",e),...t}));Dg.displayName="CardContent";const JD=E.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:ie("flex items-center p-6 pt-0",e),...t}));JD.displayName="CardFooter";function ZD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:h,defaultFilterValues:f,onFilterValuesChange:p,selectedSheetId:g,...m}){const{placeholders:y}=Pr(),v=se(_=>_.themeStyle),x=se(_=>_.isSessionExpired),{isLoading:S,isError:w}=e7({customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:f,onFilterValuesChange:p,selectedSheetId:g});return S||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?b.jsx(o,{message:"loading"}):b.jsx("div",{className:"flex items-center gap-3",children:b.jsx(ra,{className:"h-1 w-full dark:h-[2px]"})})):w?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),b.jsx(i,{})):b.jsx("div",{children:"Error"})):x?(r==null||r({type:"error",message:"Session Expired"}),y!=null&&y.SessionExpired?b.jsx("div",{className:"flex h-full items-center justify-center",children:b.jsx("div",{children:y.SessionExpired})}):b.jsx("div",{className:"flex h-full items-center justify-center",children:b.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[b.jsx(vc,{children:"Session Expired"}),b.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):b.jsx("div",{className:ie("isolate flex h-full flex-col justify-between",v==null?void 0:v.dashboardPanel,e),style:{},"data-role":"dashboard-panel",...m})}function ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function t7(e,t){const n=E.createContext(t),r=i=>{const{children:s,...a}=i,l=E.useMemo(()=>a,Object.values(a));return b.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=E.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function ln(e,t=[]){let n=[];function r(i,s){const a=E.createContext(s),l=n.length;n=[...n,s];const c=d=>{var y;const{scope:h,children:f,...p}=d,g=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,m=E.useMemo(()=>p,Object.values(p));return b.jsx(g.Provider,{value:m,children:f})};c.displayName=i+"Provider";function u(d,h){var g;const f=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,p=E.useContext(f);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>E.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,n7(o,...t)]}function n7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function I_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Mg(...e){return t=>{let n=!1;const r=e.map(o=>{const i=I_(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():I_(e[o],null)}}}}function Te(...e){return E.useCallback(Mg(...e),e)}var mi=E.forwardRef((e,t)=>{const{children:n,...r}=e,o=E.Children.toArray(n),i=o.find(r7);if(i){const s=i.props.children,a=o.map(l=>l===i?E.Children.count(s)>1?E.Children.only(null):E.isValidElement(s)?s.props.children:null:l);return b.jsx(Uv,{...r,ref:t,children:E.isValidElement(s)?E.cloneElement(s,void 0,a):null})}return b.jsx(Uv,{...r,ref:t,children:n})});mi.displayName="Slot";var Uv=E.forwardRef((e,t)=>{const{children:n,...r}=e;if(E.isValidElement(n)){const o=i7(n),i=o7(r,n.props);return n.type!==E.Fragment&&(i.ref=t?Mg(t,o):o),E.cloneElement(n,i)}return E.Children.count(n)>1?E.Children.only(null):null});Uv.displayName="SlotClone";var yw=({children:e})=>b.jsx(b.Fragment,{children:e});function r7(e){return E.isValidElement(e)&&e.type===yw}function o7(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function i7(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Og(e){const t=e+"CollectionProvider",[n,r]=ln(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:p,children:g}=f,m=C.useRef(null),y=C.useRef(new Map).current;return b.jsx(o,{scope:p,itemMap:y,collectionRef:m,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=C.forwardRef((f,p)=>{const{scope:g,children:m}=f,y=i(a,g),v=Te(p,y.collectionRef);return b.jsx(mi,{ref:v,children:m})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=C.forwardRef((f,p)=>{const{scope:g,children:m,...y}=f,v=C.useRef(null),x=Te(p,v),S=i(c,g);return C.useEffect(()=>(S.itemMap.set(v,{ref:v,...y}),()=>void S.itemMap.delete(v))),b.jsx(mi,{[u]:"",ref:x,children:m})});d.displayName=c;function h(f){const p=i(e+"CollectionConsumer",f);return C.useCallback(()=>{const m=p.collectionRef.current;if(!m)return[];const y=Array.from(m.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((S,w)=>y.indexOf(S.ref.current)-y.indexOf(w.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},h,r]}var wn=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},s7=E.useId||(()=>{}),a7=0;function nn(e){const[t,n]=E.useState(s7());return wn(()=>{n(r=>r??String(a7++))},[e]),t?`radix-${t}`:""}var l7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ge=l7.reduce((e,t)=>{const n=E.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?mi:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function eM(e,t){e&&ma.flushSync(()=>e.dispatchEvent(t))}function sn(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Nn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=c7({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=sn(n),l=E.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function c7({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,o=E.useRef(r),i=sn(t);return E.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var u7=E.createContext(void 0);function Ia(e){const t=E.useContext(u7);return e||t||"ltr"}var Pb="rovingFocusGroup.onEntryFocus",d7={bubbles:!1,cancelable:!0},Tg="RovingFocusGroup",[qv,tM,f7]=Og(Tg),[h7,xc]=ln(Tg,[f7]),[p7,g7]=h7(Tg),nM=E.forwardRef((e,t)=>b.jsx(qv.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(qv.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx(m7,{...e,ref:t})})}));nM.displayName=Tg;var m7=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,h=E.useRef(null),f=Te(t,h),p=Ia(i),[g=null,m]=Nn({prop:s,defaultProp:a,onChange:l}),[y,v]=E.useState(!1),x=sn(c),S=tM(n),w=E.useRef(!1),[_,R]=E.useState(0);return E.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(Pb,x),()=>P.removeEventListener(Pb,x)},[x]),b.jsx(p7,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:g,onItemFocus:E.useCallback(P=>m(P),[m]),onItemShiftTab:E.useCallback(()=>v(!0),[]),onFocusableItemAdd:E.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:E.useCallback(()=>R(P=>P-1),[]),children:b.jsx(ge.div,{tabIndex:y||_===0?-1:0,"data-orientation":r,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:ce(e.onMouseDown,()=>{w.current=!0}),onFocus:ce(e.onFocus,P=>{const M=!w.current;if(P.target===P.currentTarget&&M&&!y){const T=new CustomEvent(Pb,d7);if(P.currentTarget.dispatchEvent(T),!T.defaultPrevented){const I=S().filter(N=>N.focusable),A=I.find(N=>N.active),U=I.find(N=>N.id===g),O=[A,U,...I].filter(Boolean).map(N=>N.ref.current);iM(O,u)}}w.current=!1}),onBlur:ce(e.onBlur,()=>v(!1))})})}),rM="RovingFocusGroupItem",oM=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=nn(),l=i||a,c=g7(rM,n),u=c.currentTabStopId===l,d=tM(n),{onFocusableItemAdd:h,onFocusableItemRemove:f}=c;return E.useEffect(()=>{if(r)return h(),()=>f()},[r,h,f]),b.jsx(qv.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:b.jsx(ge.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:ce(e.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:ce(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ce(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const g=v7(p,c.orientation,c.dir);if(g!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(g==="last")y.reverse();else if(g==="prev"||g==="next"){g==="prev"&&y.reverse();const v=y.indexOf(p.currentTarget);y=c.loop?x7(y,v+1):y.slice(v+1)}setTimeout(()=>iM(y))}})})})});oM.displayName=rM;var b7={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function y7(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function v7(e,t,n){const r=y7(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return b7[r]}function iM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function x7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var vw=nM,xw=oM;function w7(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var rn=e=>{const{present:t,children:n}=e,r=S7(t),o=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),i=Te(r.ref,C7(o));return typeof n=="function"||r.isPresent?E.cloneElement(o,{ref:i}):null};rn.displayName="Presence";function S7(e){const[t,n]=E.useState(),r=E.useRef({}),o=E.useRef(e),i=E.useRef("none"),s=e?"mounted":"unmounted",[a,l]=w7(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=Nf(r.current);i.current=a==="mounted"?c:"none"},[a]),wn(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,f=Nf(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),wn(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const g=Nf(r.current).includes(f.animationName);if(f.target===t&&g&&(l("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=f=>{f.target===t&&(i.current=Nf(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:E.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Nf(e){return(e==null?void 0:e.animationName)||"none"}function C7(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ww="Tabs",[_7,I1e]=ln(ww,[xc]),sM=xc(),[E7,Sw]=_7(ww),aM=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Ia(a),[d,h]=Nn({prop:r,onChange:o,defaultProp:i});return b.jsx(E7,{scope:n,baseId:nn(),value:d,onValueChange:h,orientation:s,dir:u,activationMode:l,children:b.jsx(ge.div,{dir:u,"data-orientation":s,...c,ref:t})})});aM.displayName=ww;var lM="TabsList",cM=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Sw(lM,n),s=sM(n);return b.jsx(vw,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:b.jsx(ge.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});cM.displayName=lM;var uM="TabsTrigger",dM=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Sw(uM,n),a=sM(n),l=pM(s.baseId,r),c=gM(s.baseId,r),u=r===s.value;return b.jsx(xw,{asChild:!0,...a,focusable:!o,active:u,children:b.jsx(ge.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:ce(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:ce(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:ce(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});dM.displayName=uM;var fM="TabsContent",hM=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Sw(fM,n),l=pM(a.baseId,r),c=gM(a.baseId,r),u=r===a.value,d=E.useRef(u);return E.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),b.jsx(rn,{present:o||u,children:({present:h})=>b.jsx(ge.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&i})})});hM.displayName=fM;function pM(e,t){return`${e}-trigger-${t}`}function gM(e,t){return`${e}-content-${t}`}var R7=aM,mM=cM,bM=dM,yM=hM;const Cw=R7,Ig=E.forwardRef(({className:e,...t},n)=>b.jsx(mM,{ref:n,className:ie("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ig.displayName=mM.displayName;const Ag=E.forwardRef(({className:e,...t},n)=>b.jsx(bM,{ref:n,className:ie("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Ag.displayName=bM.displayName;const _w=E.forwardRef(({className:e,...t},n)=>b.jsx(yM,{ref:n,className:ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));_w.displayName=yM.displayName;var vM={exports:{}},zd={},Gv={exports:{}};(function(e,t){(function(n,r){r(t)})(ci,function(n){function r(q){return function(Z,ne,J,oe,ee,ue,fe){return q(Z,ne,fe)}}function o(q){return function(Z,ne,J,oe){if(!Z||!ne||typeof Z!="object"||typeof ne!="object")return q(Z,ne,J,oe);var ee=oe.get(Z),ue=oe.get(ne);if(ee&&ue)return ee===ne&&ue===Z;oe.set(Z,ne),oe.set(ne,Z);var fe=q(Z,ne,J,oe);return oe.delete(Z),oe.delete(ne),fe}}function i(q,X){var Z={};for(var ne in q)Z[ne]=q[ne];for(var ne in X)Z[ne]=X[ne];return Z}function s(q){return q.constructor===Object||q.constructor==null}function a(q){return typeof q.then=="function"}function l(q,X){return q===X||q!==q&&X!==X}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",f="[object Map]",p="[object Number]",g="[object Object]",m="[object Set]",y="[object String]",v=Object.prototype.toString;function x(q){var X=q.areArraysEqual,Z=q.areDatesEqual,ne=q.areMapsEqual,J=q.areObjectsEqual,oe=q.areRegExpsEqual,ee=q.areSetsEqual,ue=q.createIsNestedEqual,fe=ue(xe);function xe(pe,be,Ce){if(pe===be)return!0;if(!pe||!be||typeof pe!="object"||typeof be!="object")return pe!==pe&&be!==be;if(s(pe)&&s(be))return J(pe,be,fe,Ce);var Ke=Array.isArray(pe),kt=Array.isArray(be);if(Ke||kt)return Ke===kt&&X(pe,be,fe,Ce);var He=v.call(pe);return He!==v.call(be)?!1:He===d?Z(pe,be,fe,Ce):He===h?oe(pe,be,fe,Ce):He===f?ne(pe,be,fe,Ce):He===m?ee(pe,be,fe,Ce):He===g||He===c?a(pe)||a(be)?!1:J(pe,be,fe,Ce):He===u||He===p||He===y?l(pe.valueOf(),be.valueOf()):!1}return xe}function S(q,X,Z,ne){var J=q.length;if(X.length!==J)return!1;for(;J-- >0;)if(!Z(q[J],X[J],J,J,q,X,ne))return!1;return!0}var w=o(S);function _(q,X){return l(q.valueOf(),X.valueOf())}function R(q,X,Z,ne){var J=q.size===X.size;if(!J)return!1;if(!q.size)return!0;var oe={},ee=0;return q.forEach(function(ue,fe){if(J){var xe=!1,pe=0;X.forEach(function(be,Ce){!xe&&!oe[pe]&&(xe=Z(fe,Ce,ee,pe,q,X,ne)&&Z(ue,be,fe,Ce,q,X,ne))&&(oe[pe]=!0),pe++}),ee++,J=xe}}),J}var P=o(R),M="_owner",T=Object.prototype.hasOwnProperty;function I(q,X,Z,ne){var J=Object.keys(q),oe=J.length;if(Object.keys(X).length!==oe)return!1;for(var ee;oe-- >0;){if(ee=J[oe],ee===M){var ue=!!q.$$typeof,fe=!!X.$$typeof;if((ue||fe)&&ue!==fe)return!1}if(!T.call(X,ee)||!Z(q[ee],X[ee],ee,ee,q,X,ne))return!1}return!0}var A=o(I);function U(q,X){return q.source===X.source&&q.flags===X.flags}function $(q,X,Z,ne){var J=q.size===X.size;if(!J)return!1;if(!q.size)return!0;var oe={};return q.forEach(function(ee,ue){if(J){var fe=!1,xe=0;X.forEach(function(pe,be){!fe&&!oe[xe]&&(fe=Z(ee,pe,ue,be,q,X,ne))&&(oe[xe]=!0),xe++}),J=fe}}),J}var O=o($),N=Object.freeze({areArraysEqual:S,areDatesEqual:_,areMapsEqual:R,areObjectsEqual:I,areRegExpsEqual:U,areSetsEqual:$,createIsNestedEqual:r}),j=Object.freeze({areArraysEqual:w,areDatesEqual:_,areMapsEqual:P,areObjectsEqual:A,areRegExpsEqual:U,areSetsEqual:O,createIsNestedEqual:r}),L=x(N);function B(q,X){return L(q,X,void 0)}var D=x(i(N,{createIsNestedEqual:function(){return l}}));function H(q,X){return D(q,X,void 0)}var F=x(j);function k(q,X){return F(q,X,new WeakMap)}var W=x(i(j,{createIsNestedEqual:function(){return l}}));function G(q,X){return W(q,X,new WeakMap)}function Y(q){return x(i(N,q(N)))}function V(q){var X=x(i(j,q(j)));return function(Z,ne,J){return J===void 0&&(J=new WeakMap),X(Z,ne,J)}}n.circularDeepEqual=k,n.circularShallowEqual=G,n.createCustomCircularEqual=V,n.createCustomEqual=Y,n.deepEqual=B,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Gv,Gv.exports);var Ew=Gv.exports;const Rw=ew($8);var Ye={},k7=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.bottom=kw;Ye.childrenEqual=O7;Ye.cloneLayout=xM;Ye.cloneLayoutItem=oa;Ye.collides=Ng;Ye.compact=SM;Ye.compactItem=CM;Ye.compactType=W7;Ye.correctBounds=_M;Ye.fastPositionEqual=T7;Ye.fastRGLPropsEqual=void 0;Ye.getAllCollisions=EM;Ye.getFirstCollision=Bs;Ye.getLayoutItem=Pw;Ye.getStatics=Dw;Ye.modifyLayout=wM;Ye.moveElement=au;Ye.moveElementAwayFromCollision=Kv;Ye.noop=void 0;Ye.perc=A7;Ye.resizeItemInDirection=z7;Ye.setTopLeft=V7;Ye.setTransform=B7;Ye.sortLayoutItems=Nw;Ye.sortLayoutItemsByColRow=MM;Ye.sortLayoutItemsByRowCol=DM;Ye.synchronizeLayoutWithChildren=H7;Ye.validateLayout=OM;Ye.withLayoutItem=M7;var A_=Ew,su=P7(C);function P7(e){return e&&e.__esModule?e:{default:e}}const D7=process.env.NODE_ENV==="production";function kw(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function xM(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=oa(e[n]);return t}function wM(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function M7(e,t,n){let r=Pw(e,t);return r?(r=n(oa(r)),e=wM(e,r),[e,r]):[e,null]}function oa(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function O7(e,t){return(0,A_.deepEqual)(su.default.Children.map(e,n=>n==null?void 0:n.key),su.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,A_.deepEqual)(su.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),su.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Ye.fastRGLPropsEqual=k7;function T7(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Ng(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function SM(e,t,n,r){const o=Dw(e),i=Nw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=oa(i[a]);c.static||(c=CM(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const I7={x:"w",y:"h"};function Yv(e,t,n,r){const o=I7[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Ng(t,a)&&Yv(e,a,n+t[o],r)}}t[r]=n}function CM(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(kw(e),t.y);t.y>0&&!Bs(e,t);)t.y--;else if(a)for(;t.x>0&&!Bs(e,t);)t.x--;let l;for(;(l=Bs(e,t))&&!(n===null&&i);)if(a?Yv(o,t,l.x+l.w,"x"):Yv(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Bs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function _M(e,t){const n=Dw(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Bs(n,i);)i.y++}return e}function Pw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Bs(e,t){for(let n=0,r=e.length;n<r;n++)if(Ng(e[n],t))return e[n]}function EM(e,t){return e.filter(n=>Ng(n,t))}function Dw(e){return e.filter(t=>t.static)}function au(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=Nw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const f=EM(d,t),p=f.length>0;if(p&&l)return xM(e);if(p&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let g=0,m=f.length;g<m;g++){const y=f[g];`${t.i}${t.x}${t.y}${y.i}${y.x}${y.y}`,!y.moved&&(y.static?e=Kv(e,y,t,o,s):e=Kv(e,t,y,o,s))}return e}function Kv(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const d={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=Bs(e,d),f=h&&h.y+h.h>t.y,p=h&&t.x+t.w>h.x;if(h){if(f&&a)return au(e,n,void 0,t.y+1,r,l,o);if(f&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(p&&s)return au(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,au(e,n,s?d.x:void 0,a?d.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:au(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function A7(e){return e*100+"%"}const RM=(e,t,n,r)=>e+n>r?t:n,kM=(e,t,n)=>e<0?t:n,PM=e=>Math.max(0,e),Mw=e=>Math.max(0,e),Ow=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:kM(s,e.height,o),top:Mw(s)}},Tw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:RM(e.left,e.width,s,n),left:PM(o)}},Iw=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:RM(e.left,e.width,i,n),top:Mw(r),left:PM(s)}},Aw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:kM(r,e.height,i),top:Mw(r)}},N7=function(){return Ow(arguments.length<=0?void 0:arguments[0],Tw(...arguments))},F7=function(){return Ow(arguments.length<=0?void 0:arguments[0],Iw(...arguments))},j7=function(){return Aw(arguments.length<=0?void 0:arguments[0],Tw(...arguments))},L7=function(){return Aw(arguments.length<=0?void 0:arguments[0],Iw(...arguments))},$7={n:Ow,ne:N7,e:Tw,se:j7,s:Aw,sw:L7,w:Iw,nw:F7};function z7(e,t,n,r){const o=$7[e];return o?o(t,{...t,...n},r):n}function B7(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function V7(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Nw(e,t){return t==="horizontal"?MM(e):t==="vertical"?DM(e):e}function DM(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function MM(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function H7(e,t,n,r,o){e=e||[];const i=[];su.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Pw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(oa(l)):c?(D7||OM([c],"ReactGridLayout.children"),i.push(oa({...c,i:a.key}))):i.push(oa({w:1,h:1,x:0,y:kw(i),i:String(a.key)}))});const s=_M(i,{cols:n});return o?s:SM(s,r,n)}function OM(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=i[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function W7(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const U7=()=>{};Ye.noop=U7;var $o={};Object.defineProperty($o,"__esModule",{value:!0});$o.calcGridColWidth=Fg;$o.calcGridItemPosition=q7;$o.calcGridItemWHPx=Xv;$o.calcWH=Y7;$o.calcXY=G7;$o.clamp=Vs;function Fg(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Xv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function q7(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Fg(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Xv(r,c,s[0]),u.height=Xv(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function G7(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=Fg(e);let d=Math.round((n-s[0])/(u+i[0])),h=Math.round((t-s[1])/(l+i[1]));return d=Vs(d,0,a-r),h=Vs(h,0,c-o),{x:d,y:h}}function Y7(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Fg(e);let d=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),f=Vs(d,0,l-r),p=Vs(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(f=Vs(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(p=Vs(h,0,a)),{w:f,h:p}}function Vs(e,t,n){return Math.max(Math.min(e,n),t)}var jg={},Qv={exports:{}},Ff={exports:{}},ut={};/** @license React v16.13.1
|
|
36
|
+
`,cp="dm",Pv=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],G$=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],aw=["lg","md","sm","xs","xxs"],up={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[ft.teal[500],ft.teal[300],ft.gray[700],ft.gray[500],ft.gray[300]],borderColor:[ft.teal[500],ft.teal[300],ft.gray[700],ft.gray[500],ft.gray[300]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:Dv},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},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:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{datalables:{color:Dv},backgroundColor:[ft.teal[500],ft.teal[300],ft.gray[700],ft.gray[500],ft.gray[300]],borderColor:[ft.teal[500],ft.teal[300],ft.gray[700],ft.gray[500],ft.gray[300]]},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:ft.slate[800]}},y:{grid:{display:!0,color:ft.slate[800]}}}}}}};function Dv(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=Yu()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Yu()),Kl(n)}function Yu(){return se.getState().theme==="dark"?"#000000":"#FFFFFF"}function Kl(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return ft.gray[500];const d=u.replace("#",""),h=parseInt(d.substring(0,2),16),f=parseInt(d.substring(2,4),16),p=parseInt(d.substring(4,6),16);t+=h,n+=f,r+=p,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"}const Y$=["text","name","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],K$=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],X$=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],Q$=["boolean"];function lw(e){return e.match(/[A-Z]/)?`"${e}"`:e}function Rg(e){return Y$.includes(e.toLowerCase())||/varchar/i.test(e)}function jd(e){return K$.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function yc(e){return X$.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function cw(e){return Q$.includes(e.toLowerCase())||/boolean/i.test(e)}function J$(e,t,n,r,o,i){const{measures:s,dimensions:a}=e,l=s==null?void 0:s.map(h=>`${h.calc}(${h.name}) as ${h.calc}_${h.name.replace(/"/g,"")}`).join(", "),c=(a==null?void 0:a.join(", "))||"";let u="";const d=r?`${cp}.${r}`:uw({schemaName:t,tableName:n,connectionType:o,databaseName:i});if(l&&c)return u=`SELECT ${c}, COUNT(*) as count, ${l} FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(!l&&c)return u=`SELECT ${c}, COUNT(*) as count FROM ${d} GROUP BY ${c} ORDER BY ${c} DESC LIMIT 100`,u;if(l&&!c)return u=`SELECT ${l} FROM ${d} LIMIT 100`,u}function Z$(e,t,n="AVG"){var i,s,a,l;let r={};const o=lw(e.column_name);return Rg(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),jd(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function bl(e){return Rg(e.dataType)?"string":jd(e.dataType)?"number":yc(e.dataType)?"date":cw(e.dataType)?"boolean":"string"}function e9(e){let t;const n=e.data_type.toLowerCase();return Rg(n)?t="T":jd(n)?t="#":yc(n)?t="D":cw(n)?t="B":t="?",t}function t9(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function DD(e){return e?e!=null&&e.startsWith(`${cp}.`)?e:`${cp}.${e}`:""}function MD({schemaName:e,tableName:t,modelName:n,connectionType:r,databaseName:o}){let i=uw({schemaName:e,tableName:t,connectionType:r,databaseName:o});n&&(i=DD(n));let s=i;return(l=>/[A-Z]/.test(l))(t)&&(s=s.split(".").map(c=>`"${c}"`).join(".")),s}function uw({schemaName:e,tableName:t,connectionType:n,databaseName:r}){return t==="api"||e===lw("NA")||n==="S3"||n==="API"?t:n==="S3Tables"?`${r}.${e}.${t}`:e?`${e}.${t}`:`${t}`}const n9=e=>{const t=new Date(e);return!isNaN(t.getTime())},r9=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),kg=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?n9(e)?t="date":r9(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function o9({get:e,dataPoint:t,card:n}){var h;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValues: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:kg(u),operation:"=",values:[u]};if(l!=null&&l.find(f=>f.id===n.id)){const f=n.id;if(u==null){a(n),i(f);return}else s(d)}o(n),r(d)}function v_({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return aw.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,h)=>Math.max(d,h.y+h.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function x_(e,t){if(!t)return;const n={...t};return aw.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function OD(e){const t=se.getState().dashboard.globalCacheConfig,{card:n,filter:r}=e;return t}const se=nw()(ED((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:up},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:up},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},updateEmailSettings:n=>{e(r=>{r.dashboard.emailSettings=n})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l,c,u,d,h;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(f=>f.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const f=(a=r.dashboard.filters)==null?void 0:a.filter(g=>g.sheetId===n),p=(l=r.filterValues)==null?void 0:l.filter(g=>f==null?void 0:f.some(m=>m.id===g.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(g=>!(p!=null&&p.some(m=>m.filterId===g.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(g=>g.sheetId!==n),r.selectedSheetId=(h=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:h.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{aw.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},addToAIScope:n=>{e(r=>{const{connectionId:o,connectionType:i,databaseName:s,schemaName:a,tableName:l,datamodelName:c,datamodelId:u}=n,d={connectionId:o||"",connectionType:i||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||"",datamodelId:u||""};let f=[...r.dashboard.aiScopeTables||[],d];f=f.filter((p,g,m)=>m.findIndex(y=>y.tableName===p.tableName&&y.datamodelName===p.datamodelName)===g),r.dashboard.aiScopeTables=f})},removeFromAIScope:n=>{e(r=>{const{connectionId:o,tableName:i,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===o));r.dashboard.aiScopeTables=l}else if(i){const l=a.filter(c=>!(c.tableName===i&&c.connectionId===o));r.dashboard.aiScopeTables=l}})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.python=r)}))})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var h;const d=(h=u.cards)==null?void 0:h.find(f=>f.id===r);d&&(d.title=o)}))})},setCardInfo:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===o.selectedSheetId);i&&((l=i==null?void 0:i.frames)==null||l.forEach(c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===n);u&&(u.info=r)}))})},setCardDescription:(n,r,o)=>{e(i=>{var a,l,c;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(u=>u.id===n);s&&((c=s==null?void 0:s.frames)==null||c.forEach(u=>{var h;const d=(h=u.cards)==null?void 0:h.find(f=>f.id===r);d&&(d.description=o)}))})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(h=>h.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l,c;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(u=>u.filterId===o.filterId);if(o.values.length===0){r.filterValues=(a=r.filterValues)==null?void 0:a.filter(u=>u.filterId!==o.filterId);return}i!==void 0&&i>-1?(l=r.filterValues)==null||l.splice(i,1,o):(c=r.filterValues)==null||c.push(o)}):r.filterValues=n})},removeFilterValues:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{v_({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=x_(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(f=>f.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(f=>f.id===r);if(a){const f=(d=a.cards)==null?void 0:d.findIndex(p=>p.id===o.id);f>-1&&((h=a.cards)==null||h.splice(f,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},updateFilterId:(n,r)=>{e(o=>{var a,l;const i=(a=o.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=o.dashboard.filters)==null?void 0:l.some(c=>c.id===r);i&&!s&&(i.id=r)})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const h=0;o==="start"&&(d=0);const f=v_({id:r.id,layouts:s.layouts,minH:10,x:h,y:d});s.layouts=f,(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),x_(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(h=o.onRemoveCard)==null||h.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getCardFrame:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(n){var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a){for(let l=0;l<a.length;l++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{o9({card:n,dataPoint:r,get:t})}}}))),Xt=()=>se(e=>e.actions);async function i9(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function TD(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),h=>h.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const h=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(h)}}catch(h){throw new Error(`Decryption failed: ${h}`)}}function ie(...e){return b$(Qi(e))}const s9=e=>Object.keys(e).length===0;async function a9(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function dw(e,t,n={}){try{const r=JSON.stringify(n),o=await i9(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await TD(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}async function l9(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(i=>{throw console.log(i.detail||"Unknown error occurred"),new Error((i==null?void 0:i.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function c9(e){if(!e)return{tenantId:"",endUserId:""};const t=Zx(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function u9(e){if(!e)return;const t=Zx(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function ID(e){return e?Zx(e).params:void 0}function d9(e){return e.charAt(0).toUpperCase()+e.slice(1)}const yl="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function f9(){var o,i;const e=(i=(o=se.getState())==null?void 0:o.authToken)==null?void 0:i.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function h9(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),o=new URLSearchParams(r).toString();o&&(n+=`?${o}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await TD(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function p9(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}var dp={exports:{}};dp.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",g="[object Map]",m="[object Number]",y="[object Null]",v="[object Object]",x="[object Proxy]",S="[object RegExp]",w="[object Set]",_="[object String]",R="[object Undefined]",P="[object WeakMap]",M="[object ArrayBuffer]",T="[object DataView]",I="[object Float32Array]",A="[object Float64Array]",U="[object Int8Array]",$="[object Int16Array]",O="[object Int32Array]",N="[object Uint8Array]",j="[object Uint8ClampedArray]",L="[object Uint16Array]",B="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,H=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,k={};k[I]=k[A]=k[U]=k[$]=k[O]=k[N]=k[j]=k[L]=k[B]=!0,k[a]=k[l]=k[M]=k[u]=k[T]=k[d]=k[h]=k[f]=k[g]=k[m]=k[v]=k[S]=k[w]=k[_]=k[P]=!1;var W=typeof ci=="object"&&ci&&ci.Object===Object&&ci,G=typeof self=="object"&&self&&self.Object===Object&&self,Y=W||G||Function("return this")(),V=t&&!t.nodeType&&t,q=V&&!0&&e&&!e.nodeType&&e,X=q&&q.exports===V,Z=X&&W.process,ne=function(){try{var z=q&&q.require&&q.require("util").types;return z||Z&&Z.binding&&Z.binding("util")}catch{}}(),J=ne&&ne.isTypedArray;function oe(z,Q,re){switch(re.length){case 0:return z.call(Q);case 1:return z.call(Q,re[0]);case 2:return z.call(Q,re[0],re[1]);case 3:return z.call(Q,re[0],re[1],re[2])}return z.apply(Q,re)}function ee(z,Q){for(var re=-1,ve=Array(z);++re<z;)ve[re]=Q(re);return ve}function ue(z){return function(Q){return z(Q)}}function fe(z,Q){return z==null?void 0:z[Q]}function xe(z,Q){return function(re){return z(Q(re))}}var pe=Array.prototype,be=Function.prototype,Ce=Object.prototype,Ke=Y["__core-js_shared__"],kt=be.toString,He=Ce.hasOwnProperty,Cn=function(){var z=/[^.]+$/.exec(Ke&&Ke.keys&&Ke.keys.IE_PROTO||"");return z?"Symbol(src)_1."+z:""}(),wt=Ce.toString,te=kt.call(Object),le=RegExp("^"+kt.call(He).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ye=X?Y.Buffer:void 0,Se=Y.Symbol,$e=Y.Uint8Array;ye&&ye.allocUnsafe;var Pt=xe(Object.getPrototypeOf,Object),_n=Object.create,gn=Ce.propertyIsEnumerable,En=pe.splice,Qt=Se?Se.toStringTag:void 0,mt=function(){try{var z=ub(Object,"defineProperty");return z({},"",{}),z}catch{}}(),Dr=ye?ye.isBuffer:void 0,mn=Math.max,Ua=Date.now,ys=ub(Y,"Map"),qo=ub(Object,"create"),Vt=function(){function z(){}return function(Q){if(!ws(Q))return{};if(_n)return _n(Q);z.prototype=Q;var re=new z;return z.prototype=void 0,re}}();function ct(z){var Q=-1,re=z==null?0:z.length;for(this.clear();++Q<re;){var ve=z[Q];this.set(ve[0],ve[1])}}function bn(){this.__data__=qo?qo(null):{},this.size=0}function we(z){var Q=this.has(z)&&delete this.__data__[z];return this.size-=Q?1:0,Q}function Ae(z){var Q=this.__data__;if(qo){var re=Q[z];return re===r?void 0:re}return He.call(Q,z)?Q[z]:void 0}function We(z){var Q=this.__data__;return qo?Q[z]!==void 0:He.call(Q,z)}function Ft(z,Q){var re=this.__data__;return this.size+=this.has(z)?0:1,re[z]=qo&&Q===void 0?r:Q,this}ct.prototype.clear=bn,ct.prototype.delete=we,ct.prototype.get=Ae,ct.prototype.has=We,ct.prototype.set=Ft;function bt(z){var Q=-1,re=z==null?0:z.length;for(this.clear();++Q<re;){var ve=z[Q];this.set(ve[0],ve[1])}}function yt(){this.__data__=[],this.size=0}function cn(z){var Q=this.__data__,re=kf(Q,z);if(re<0)return!1;var ve=Q.length-1;return re==ve?Q.pop():En.call(Q,re,1),--this.size,!0}function jt(z){var Q=this.__data__,re=kf(Q,z);return re<0?void 0:Q[re][1]}function Jt(z){return kf(this.__data__,z)>-1}function vs(z,Q){var re=this.__data__,ve=kf(re,z);return ve<0?(++this.size,re.push([z,Q])):re[ve][1]=Q,this}bt.prototype.clear=yt,bt.prototype.delete=cn,bt.prototype.get=jt,bt.prototype.has=Jt,bt.prototype.set=vs;function Mr(z){var Q=-1,re=z==null?0:z.length;for(this.clear();++Q<re;){var ve=z[Q];this.set(ve[0],ve[1])}}function co(){this.size=0,this.__data__={hash:new ct,map:new(ys||bt),string:new ct}}function xs(z){var Q=Df(this,z).delete(z);return this.size-=Q?1:0,Q}function jc(z){return Df(this,z).get(z)}function Q6(z){return Df(this,z).has(z)}function J6(z,Q){var re=Df(this,z),ve=re.size;return re.set(z,Q),this.size+=re.size==ve?0:1,this}Mr.prototype.clear=co,Mr.prototype.delete=xs,Mr.prototype.get=jc,Mr.prototype.has=Q6,Mr.prototype.set=J6;function qa(z){var Q=this.__data__=new bt(z);this.size=Q.size}function Z6(){this.__data__=new bt,this.size=0}function e8(z){var Q=this.__data__,re=Q.delete(z);return this.size=Q.size,re}function t8(z){return this.__data__.get(z)}function n8(z){return this.__data__.has(z)}function r8(z,Q){var re=this.__data__;if(re instanceof bt){var ve=re.__data__;if(!ys||ve.length<n-1)return ve.push([z,Q]),this.size=++re.size,this;re=this.__data__=new Mr(ve)}return re.set(z,Q),this.size=re.size,this}qa.prototype.clear=Z6,qa.prototype.delete=e8,qa.prototype.get=t8,qa.prototype.has=n8,qa.prototype.set=r8;function o8(z,Q){var re=hb(z),ve=!re&&fb(z),Ze=!re&&!ve&&KC(z),St=!re&&!ve&&!Ze&&QC(z),Lt=re||ve||Ze||St,rt=Lt?ee(z.length,String):[],$t=rt.length;for(var Wr in z)Lt&&(Wr=="length"||Ze&&(Wr=="offset"||Wr=="parent")||St&&(Wr=="buffer"||Wr=="byteLength"||Wr=="byteOffset")||GC(Wr,$t))||rt.push(Wr);return rt}function lb(z,Q,re){(re!==void 0&&!Mf(z[Q],re)||re===void 0&&!(Q in z))&&cb(z,Q,re)}function i8(z,Q,re){var ve=z[Q];(!(He.call(z,Q)&&Mf(ve,re))||re===void 0&&!(Q in z))&&cb(z,Q,re)}function kf(z,Q){for(var re=z.length;re--;)if(Mf(z[re][0],Q))return re;return-1}function cb(z,Q,re){Q=="__proto__"&&mt?mt(z,Q,{configurable:!0,enumerable:!0,value:re,writable:!0}):z[Q]=re}var s8=v8();function Pf(z){return z==null?z===void 0?R:y:Qt&&Qt in Object(z)?x8(z):R8(z)}function UC(z){return Lc(z)&&Pf(z)==a}function a8(z){if(!ws(z)||_8(z))return!1;var Q=gb(z)?le:H;return Q.test(M8(z))}function l8(z){return Lc(z)&&XC(z.length)&&!!k[Pf(z)]}function c8(z){if(!ws(z))return E8(z);var Q=YC(z),re=[];for(var ve in z)ve=="constructor"&&(Q||!He.call(z,ve))||re.push(ve);return re}function qC(z,Q,re,ve,Ze){z!==Q&&s8(Q,function(St,Lt){if(Ze||(Ze=new qa),ws(St))u8(z,Q,Lt,re,qC,ve,Ze);else{var rt=ve?ve(db(z,Lt),St,Lt+"",z,Q,Ze):void 0;rt===void 0&&(rt=St),lb(z,Lt,rt)}},JC)}function u8(z,Q,re,ve,Ze,St,Lt){var rt=db(z,re),$t=db(Q,re),Wr=Lt.get($t);if(Wr){lb(z,re,Wr);return}var fr=St?St(rt,$t,re+"",z,Q,Lt):void 0,$c=fr===void 0;if($c){var mb=hb($t),bb=!mb&&KC($t),e_=!mb&&!bb&&QC($t);fr=$t,mb||bb||e_?hb(rt)?fr=rt:O8(rt)?fr=m8(rt):bb?($c=!1,fr=h8($t)):e_?($c=!1,fr=g8($t)):fr=[]:T8($t)||fb($t)?(fr=rt,fb(rt)?fr=I8(rt):(!ws(rt)||gb(rt))&&(fr=w8($t))):$c=!1}$c&&(Lt.set($t,fr),Ze(fr,$t,ve,St,Lt),Lt.delete($t)),lb(z,re,fr)}function d8(z,Q){return P8(k8(z,Q,ZC),z+"")}var f8=mt?function(z,Q){return mt(z,"toString",{configurable:!0,enumerable:!1,value:N8(Q),writable:!0})}:ZC;function h8(z,Q){return z.slice()}function p8(z){var Q=new z.constructor(z.byteLength);return new $e(Q).set(new $e(z)),Q}function g8(z,Q){var re=p8(z.buffer);return new z.constructor(re,z.byteOffset,z.length)}function m8(z,Q){var re=-1,ve=z.length;for(Q||(Q=Array(ve));++re<ve;)Q[re]=z[re];return Q}function b8(z,Q,re,ve){var Ze=!re;re||(re={});for(var St=-1,Lt=Q.length;++St<Lt;){var rt=Q[St],$t=void 0;$t===void 0&&($t=z[rt]),Ze?cb(re,rt,$t):i8(re,rt,$t)}return re}function y8(z){return d8(function(Q,re){var ve=-1,Ze=re.length,St=Ze>1?re[Ze-1]:void 0,Lt=Ze>2?re[2]:void 0;for(St=z.length>3&&typeof St=="function"?(Ze--,St):void 0,Lt&&S8(re[0],re[1],Lt)&&(St=Ze<3?void 0:St,Ze=1),Q=Object(Q);++ve<Ze;){var rt=re[ve];rt&&z(Q,rt,ve,St)}return Q})}function v8(z){return function(Q,re,ve){for(var Ze=-1,St=Object(Q),Lt=ve(Q),rt=Lt.length;rt--;){var $t=Lt[++Ze];if(re(St[$t],$t,St)===!1)break}return Q}}function Df(z,Q){var re=z.__data__;return C8(Q)?re[typeof Q=="string"?"string":"hash"]:re.map}function ub(z,Q){var re=fe(z,Q);return a8(re)?re:void 0}function x8(z){var Q=He.call(z,Qt),re=z[Qt];try{z[Qt]=void 0;var ve=!0}catch{}var Ze=wt.call(z);return ve&&(Q?z[Qt]=re:delete z[Qt]),Ze}function w8(z){return typeof z.constructor=="function"&&!YC(z)?Vt(Pt(z)):{}}function GC(z,Q){var re=typeof z;return Q=Q??s,!!Q&&(re=="number"||re!="symbol"&&F.test(z))&&z>-1&&z%1==0&&z<Q}function S8(z,Q,re){if(!ws(re))return!1;var ve=typeof Q;return(ve=="number"?pb(re)&&GC(Q,re.length):ve=="string"&&Q in re)?Mf(re[Q],z):!1}function C8(z){var Q=typeof z;return Q=="string"||Q=="number"||Q=="symbol"||Q=="boolean"?z!=="__proto__":z===null}function _8(z){return!!Cn&&Cn in z}function YC(z){var Q=z&&z.constructor,re=typeof Q=="function"&&Q.prototype||Ce;return z===re}function E8(z){var Q=[];if(z!=null)for(var re in Object(z))Q.push(re);return Q}function R8(z){return wt.call(z)}function k8(z,Q,re){return Q=mn(Q===void 0?z.length-1:Q,0),function(){for(var ve=arguments,Ze=-1,St=mn(ve.length-Q,0),Lt=Array(St);++Ze<St;)Lt[Ze]=ve[Q+Ze];Ze=-1;for(var rt=Array(Q+1);++Ze<Q;)rt[Ze]=ve[Ze];return rt[Q]=re(Lt),oe(z,this,rt)}}function db(z,Q){if(!(Q==="constructor"&&typeof z[Q]=="function")&&Q!="__proto__")return z[Q]}var P8=D8(f8);function D8(z){var Q=0,re=0;return function(){var ve=Ua(),Ze=i-(ve-re);if(re=ve,Ze>0){if(++Q>=o)return arguments[0]}else Q=0;return z.apply(void 0,arguments)}}function M8(z){if(z!=null){try{return kt.call(z)}catch{}try{return z+""}catch{}}return""}function Mf(z,Q){return z===Q||z!==z&&Q!==Q}var fb=UC(function(){return arguments}())?UC:function(z){return Lc(z)&&He.call(z,"callee")&&!gn.call(z,"callee")},hb=Array.isArray;function pb(z){return z!=null&&XC(z.length)&&!gb(z)}function O8(z){return Lc(z)&&pb(z)}var KC=Dr||F8;function gb(z){if(!ws(z))return!1;var Q=Pf(z);return Q==f||Q==p||Q==c||Q==x}function XC(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=s}function ws(z){var Q=typeof z;return z!=null&&(Q=="object"||Q=="function")}function Lc(z){return z!=null&&typeof z=="object"}function T8(z){if(!Lc(z)||Pf(z)!=v)return!1;var Q=Pt(z);if(Q===null)return!0;var re=He.call(Q,"constructor")&&Q.constructor;return typeof re=="function"&&re instanceof re&&kt.call(re)==te}var QC=J?ue(J):l8;function I8(z){return b8(z,JC(z))}function JC(z){return pb(z)?o8(z):c8(z)}var A8=y8(function(z,Q,re){qC(z,Q,re)});function N8(z){return function(){return z}}function ZC(z){return z}function F8(){return!1}e.exports=A8})(dp,dp.exports);var g9=dp.exports;const Ku=cs(g9),m9={theme:"system",setTheme:()=>null},AD=C.createContext(m9);function b9({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=C.useState(()=>localStorage.getItem(n)||t);C.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return b.jsx(AD.Provider,{...r,value:s,children:e})}const ND=()=>{const e=C.useContext(AD);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var Ld=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(){}},va=typeof window>"u"||"Deno"in globalThis;function Ir(){}function y9(e,t){return typeof e=="function"?e(t):e}function Mv(e){return typeof e=="number"&&e>=0&&e!==1/0}function FD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vl(e,t){return typeof e=="function"?e(t):e}function Xr(e,t){return typeof e=="function"?e(t):e}function w_(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==fw(s,t.options))return!1}else if(!Qu(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||o&&o!==t.state.fetchStatus||i&&!i(t))}function S_(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Xu(t.options.mutationKey)!==Xu(i))return!1}else if(!Qu(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function fw(e,t){return((t==null?void 0:t.queryKeyHashFn)||Xu)(e)}function Xu(e){return JSON.stringify(e,(t,n)=>Iv(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Qu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Qu(e[n],t[n])):!1}function Ov(e,t){if(e===t)return e;const n=C_(e)&&C_(t);if(n||Iv(e)&&Iv(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&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=Ov(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function Tv(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function C_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Iv(e){if(!__(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!__(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function __(e){return Object.prototype.toString.call(e)==="[object Object]"}function v9(e){return new Promise(t=>{setTimeout(t,e)})}function Av(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Ov(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return Ov(e,t)}return t}function x9(e){return e}function w9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function S9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var fp=Symbol();function jD(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===fp&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===fp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ks,Ni,Al,rD,C9=(rD=class extends Ld{constructor(){super();ke(this,Ks);ke(this,Ni);ke(this,Al);me(this,Al,t=>{if(!va&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){K(this,Ni)||this.setEventListener(K(this,Al))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,Ni))==null||t.call(this),me(this,Ni,void 0))}setEventListener(t){var n;me(this,Al,t),(n=K(this,Ni))==null||n.call(this),me(this,Ni,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){K(this,Ks)!==t&&(me(this,Ks,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof K(this,Ks)=="boolean"?K(this,Ks):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ks=new WeakMap,Ni=new WeakMap,Al=new WeakMap,rD),hw=new C9,Nl,Fi,Fl,oD,_9=(oD=class extends Ld{constructor(){super();ke(this,Nl,!0);ke(this,Fi);ke(this,Fl);me(this,Fl,t=>{if(!va&&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(){K(this,Fi)||this.setEventListener(K(this,Fl))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,Fi))==null||t.call(this),me(this,Fi,void 0))}setEventListener(t){var n;me(this,Fl,t),(n=K(this,Fi))==null||n.call(this),me(this,Fi,t(this.setOnline.bind(this)))}setOnline(t){K(this,Nl)!==t&&(me(this,Nl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return K(this,Nl)}},Nl=new WeakMap,Fi=new WeakMap,Fl=new WeakMap,oD),hp=new _9;function Nv(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function E9(e){return Math.min(1e3*2**e,3e4)}function LD(e){return(e??"online")==="online"?hp.isOnline():!0}var $D=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function kb(e){return e instanceof $D}function zD(e){let t=!1,n=0,r=!1,o;const i=Nv(),s=g=>{var m;r||(h(new $D(g)),(m=e.abort)==null||m.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>hw.isFocused()&&(e.networkMode==="always"||hp.isOnline())&&e.canRun(),u=()=>LD(e.networkMode)&&e.canRun(),d=g=>{var m;r||(r=!0,(m=e.onSuccess)==null||m.call(e,g),o==null||o(),i.resolve(g))},h=g=>{var m;r||(r=!0,(m=e.onError)==null||m.call(e,g),o==null||o(),i.reject(g))},f=()=>new Promise(g=>{var m;o=y=>{(r||c())&&g(y)},(m=e.onPause)==null||m.call(e)}).then(()=>{var g;o=void 0,r||(g=e.onContinue)==null||g.call(e)}),p=()=>{if(r)return;let g;const m=n===0?e.initialPromise:void 0;try{g=m??e.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(d).catch(y=>{var _;if(r)return;const v=e.retry??(va?0:3),x=e.retryDelay??E9,S=typeof x=="function"?x(n,y):x,w=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(t||!w){h(y);return}n++,(_=e.onFail)==null||_.call(e,n,y),v9(S).then(()=>c()?void 0:f()).then(()=>{t?h(y):p()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?p():f().then(p),i)}}function R9(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var xn=R9(),Xs,iD,BD=(iD=class{constructor(){ke(this,Xs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mv(this.gcTime)&&me(this,Xs,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(va?1/0:5*60*1e3))}clearGcTimeout(){K(this,Xs)&&(clearTimeout(K(this,Xs)),me(this,Xs,void 0))}},Xs=new WeakMap,iD),jl,Ll,Tr,Qs,Dn,Id,Js,Yr,Qo,sD,k9=(sD=class extends BD{constructor(t){super();ke(this,Yr);ke(this,jl);ke(this,Ll);ke(this,Tr);ke(this,Qs);ke(this,Dn);ke(this,Id);ke(this,Js);me(this,Js,!1),me(this,Id,t.defaultOptions),this.setOptions(t.options),this.observers=[],me(this,Qs,t.client),me(this,Tr,K(this,Qs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,me(this,jl,P9(this.options)),this.state=t.state??K(this,jl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=K(this,Dn))==null?void 0:t.promise}setOptions(t){this.options={...K(this,Id),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&K(this,Tr).remove(this)}setData(t,n){const r=Av(this.state.data,t,this.options);return Qe(this,Yr,Qo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Qe(this,Yr,Qo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=K(this,Dn))==null?void 0:r.promise;return(o=K(this,Dn))==null||o.cancel(t),n?n.then(Ir).catch(Ir):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(K(this,jl))}isActive(){return this.observers.some(t=>Xr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!FD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Dn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Dn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),K(this,Tr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(K(this,Dn)&&(K(this,Js)?K(this,Dn).cancel({revert:!0}):K(this,Dn).cancelRetry()),this.scheduleGc()),K(this,Tr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Qe(this,Yr,Qo).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(K(this,Dn))return K(this,Dn).continueRetry(),K(this,Dn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(h=>h.options.queryFn);d&&this.setOptions(d.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=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(me(this,Js,!0),r.signal)})},i=()=>{const d=jD(this.options,n),h={client:K(this,Qs),queryKey:this.queryKey,meta:this.meta};return o(h),me(this,Js,!1),this.options.persister?this.options.persister(d,h,this):d(h)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:K(this,Qs),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),me(this,Ll,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Qe(this,Yr,Qo).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var h,f,p,g;kb(d)&&d.silent||Qe(this,Yr,Qo).call(this,{type:"error",error:d}),kb(d)||((f=(h=K(this,Tr).config).onError)==null||f.call(h,d,this),(g=(p=K(this,Tr).config).onSettled)==null||g.call(p,this.state.data,d,this)),this.scheduleGc()};return me(this,Dn,zD({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var h,f,p,g;if(d===void 0){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}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(m){a(m);return}(f=(h=K(this,Tr).config).onSuccess)==null||f.call(h,d,this),(g=(p=K(this,Tr).config).onSettled)==null||g.call(p,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,h)=>{Qe(this,Yr,Qo).call(this,{type:"failed",failureCount:d,error:h})},onPause:()=>{Qe(this,Yr,Qo).call(this,{type:"pause"})},onContinue:()=>{Qe(this,Yr,Qo).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),K(this,Dn).start()}},jl=new WeakMap,Ll=new WeakMap,Tr=new WeakMap,Qs=new WeakMap,Dn=new WeakMap,Id=new WeakMap,Js=new WeakMap,Yr=new WeakSet,Qo=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,...VD(r.data,this.options),fetchMeta:t.meta??null};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 kb(o)&&o.revert&&K(this,Ll)?{...K(this,Ll),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),xn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),K(this,Tr).notify({query:this,type:"updated",action:t})})},sD);function VD(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:LD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function P9(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var mo,aD,HD=(aD=class extends Ld{constructor(t={}){super();ke(this,mo);this.config=t,me(this,mo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??fw(o,n);let s=this.get(i);return s||(s=new k9({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){K(this,mo).has(t.queryHash)||(K(this,mo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=K(this,mo).get(t.queryHash);n&&(t.destroy(),n===t&&K(this,mo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){xn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return K(this,mo).get(t)}getAll(){return[...K(this,mo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>w_(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>w_(t,r)):n}notify(t){xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){xn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){xn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mo=new WeakMap,aD),bo,Ln,Zs,yo,Oi,lD,D9=(lD=class extends BD{constructor(t){super();ke(this,yo);ke(this,bo);ke(this,Ln);ke(this,Zs);this.mutationId=t.mutationId,me(this,Ln,t.mutationCache),me(this,bo,[]),this.state=t.state||M9(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){K(this,bo).includes(t)||(K(this,bo).push(t),this.clearGcTimeout(),K(this,Ln).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){me(this,bo,K(this,bo).filter(n=>n!==t)),this.scheduleGc(),K(this,Ln).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){K(this,bo).length||(this.state.status==="pending"?this.scheduleGc():K(this,Ln).remove(this))}continue(){var t;return((t=K(this,Zs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,h,f,p,g,m,y,v,x,S,w,_,R;me(this,Zs,zD({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,M)=>{Qe(this,yo,Oi).call(this,{type:"failed",failureCount:P,error:M})},onPause:()=>{Qe(this,yo,Oi).call(this,{type:"pause"})},onContinue:()=>{Qe(this,yo,Oi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>K(this,Ln).canRun(this)}));const n=this.state.status==="pending",r=!K(this,Zs).canStart();try{if(!n){Qe(this,yo,Oi).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=K(this,Ln).config).onMutate)==null?void 0:i.call(o,t,this));const M=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));M!==this.state.context&&Qe(this,yo,Oi).call(this,{type:"pending",context:M,variables:t,isPaused:r})}const P=await K(this,Zs).start();return await((c=(l=K(this,Ln).config).onSuccess)==null?void 0:c.call(l,P,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,P,t,this.state.context)),await((f=(h=K(this,Ln).config).onSettled)==null?void 0:f.call(h,P,null,this.state.variables,this.state.context,this)),await((g=(p=this.options).onSettled)==null?void 0:g.call(p,P,null,t,this.state.context)),Qe(this,yo,Oi).call(this,{type:"success",data:P}),P}catch(P){try{throw await((y=(m=K(this,Ln).config).onError)==null?void 0:y.call(m,P,t,this.state.context,this)),await((x=(v=this.options).onError)==null?void 0:x.call(v,P,t,this.state.context)),await((w=(S=K(this,Ln).config).onSettled)==null?void 0:w.call(S,void 0,P,this.state.variables,this.state.context,this)),await((R=(_=this.options).onSettled)==null?void 0:R.call(_,void 0,P,t,this.state.context)),P}finally{Qe(this,yo,Oi).call(this,{type:"error",error:P})}}finally{K(this,Ln).runNext(this)}}},bo=new WeakMap,Ln=new WeakMap,Zs=new WeakMap,yo=new WeakSet,Oi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),xn.batch(()=>{K(this,bo).forEach(r=>{r.onMutationUpdate(t)}),K(this,Ln).notify({mutation:this,type:"updated",action:t})})},lD);function M9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oi,Kr,Ad,cD,O9=(cD=class extends Ld{constructor(t={}){super();ke(this,oi);ke(this,Kr);ke(this,Ad);this.config=t,me(this,oi,new Set),me(this,Kr,new Map),me(this,Ad,0)}build(t,n,r){const o=new D9({mutationCache:this,mutationId:++Of(this,Ad)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){K(this,oi).add(t);const n=Af(t);if(typeof n=="string"){const r=K(this,Kr).get(n);r?r.push(t):K(this,Kr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(K(this,oi).delete(t)){const n=Af(t);if(typeof n=="string"){const r=K(this,Kr).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&K(this,Kr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Af(t);if(typeof n=="string"){const r=K(this,Kr).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Af(t);if(typeof n=="string"){const o=(r=K(this,Kr).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){xn.batch(()=>{K(this,oi).forEach(t=>{this.notify({type:"removed",mutation:t})}),K(this,oi).clear(),K(this,Kr).clear()})}getAll(){return Array.from(K(this,oi))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>S_(n,r))}findAll(t={}){return this.getAll().filter(n=>S_(t,n))}notify(t){xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return xn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ir))))}},oi=new WeakMap,Kr=new WeakMap,Ad=new WeakMap,cD);function Af(e){var t;return(t=e.options.scope)==null?void 0:t.id}function E_(e){return{onFetch:(t,n)=>{var u,d,h,f,p;const r=t.options,o=(h=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,i=((f=t.state.data)==null?void 0:f.pages)||[],s=((p=t.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const m=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},y=jD(t.options,t.fetchOptions),v=async(x,S,w)=>{if(g)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const _={client:t.client,queryKey:t.queryKey,pageParam:S,direction:w?"backward":"forward",meta:t.options.meta};m(_);const R=await y(_),{maxPages:P}=t.options,M=w?S9:w9;return{pages:M(x.pages,R,P),pageParams:M(x.pageParams,S,P)}};if(o&&i.length){const x=o==="backward",S=x?T9:R_,w={pages:i,pageParams:s},_=S(r,w);a=await v(w,_,x)}else{const x=e??i.length;do{const S=l===0?s[0]??r.initialPageParam:R_(r,a);if(l>0&&S==null)break;a=await v(a,S),l++}while(l<x)}return a};t.options.persister?t.fetchFn=()=>{var g,m;return(m=(g=t.options).persister)==null?void 0:m.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function R_(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function T9(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ht,ji,Li,$l,zl,$i,Bl,Vl,uD,I9=(uD=class{constructor(e={}){ke(this,Ht);ke(this,ji);ke(this,Li);ke(this,$l);ke(this,zl);ke(this,$i);ke(this,Bl);ke(this,Vl);me(this,Ht,e.queryCache||new HD),me(this,ji,e.mutationCache||new O9),me(this,Li,e.defaultOptions||{}),me(this,$l,new Map),me(this,zl,new Map),me(this,$i,0)}mount(){Of(this,$i)._++,K(this,$i)===1&&(me(this,Bl,hw.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,Ht).onFocus())})),me(this,Vl,hp.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,Ht).onOnline())})))}unmount(){var e,t;Of(this,$i)._--,K(this,$i)===0&&((e=K(this,Bl))==null||e.call(this),me(this,Bl,void 0),(t=K(this,Vl))==null||t.call(this),me(this,Vl,void 0))}isFetching(e){return K(this,Ht).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return K(this,ji).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,Ht).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=K(this,Ht).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(vl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return K(this,Ht).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=K(this,Ht).get(r.queryHash),i=o==null?void 0:o.state.data,s=y9(t,i);if(s!==void 0)return K(this,Ht).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return xn.batch(()=>K(this,Ht).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,Ht).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=K(this,Ht);xn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=K(this,Ht);return xn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=xn.batch(()=>K(this,Ht).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ir).catch(Ir)}invalidateQueries(e,t={}){return xn.batch(()=>(K(this,Ht).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=xn.batch(()=>K(this,Ht).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ir)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ir)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=K(this,Ht).build(this,t);return n.isStaleByTime(vl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ir).catch(Ir)}fetchInfiniteQuery(e){return e.behavior=E_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ir).catch(Ir)}ensureInfiniteQueryData(e){return e.behavior=E_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return hp.isOnline()?K(this,ji).resumePausedMutations():Promise.resolve()}getQueryCache(){return K(this,Ht)}getMutationCache(){return K(this,ji)}getDefaultOptions(){return K(this,Li)}setDefaultOptions(e){me(this,Li,e)}setQueryDefaults(e,t){K(this,$l).set(Xu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...K(this,$l).values()],n={};return t.forEach(r=>{Qu(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){K(this,zl).set(Xu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...K(this,zl).values()],n={};return t.forEach(r=>{Qu(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...K(this,Li).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=fw(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===fp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...K(this,Li).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){K(this,Ht).clear(),K(this,ji).clear()}},Ht=new WeakMap,ji=new WeakMap,Li=new WeakMap,$l=new WeakMap,zl=new WeakMap,$i=new WeakMap,Bl=new WeakMap,Vl=new WeakMap,uD),tr,Je,Nd,$n,ea,Hl,zi,vo,Fd,Wl,Ul,ta,na,Bi,ql,pt,iu,Fv,jv,Lv,$v,zv,Bv,Vv,WD,dD,A9=(dD=class extends Ld{constructor(t,n){super();ke(this,pt);ke(this,tr);ke(this,Je);ke(this,Nd);ke(this,$n);ke(this,ea);ke(this,Hl);ke(this,zi);ke(this,vo);ke(this,Fd);ke(this,Wl);ke(this,Ul);ke(this,ta);ke(this,na);ke(this,Bi);ke(this,ql,new Set);this.options=n,me(this,tr,t),me(this,vo,null),me(this,zi,Nv()),this.options.experimental_prefetchInRender||K(this,zi).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(K(this,Je).addObserver(this),k_(K(this,Je),this.options)?Qe(this,pt,iu).call(this):this.updateResult(),Qe(this,pt,$v).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Hv(K(this,Je),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Hv(K(this,Je),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Qe(this,pt,zv).call(this),Qe(this,pt,Bv).call(this),K(this,Je).removeObserver(this)}setOptions(t,n){const r=this.options,o=K(this,Je);if(this.options=K(this,tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xr(this.options.enabled,K(this,Je))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Qe(this,pt,Vv).call(this),K(this,Je).setOptions(this.options),r._defaulted&&!Tv(this.options,r)&&K(this,tr).getQueryCache().notify({type:"observerOptionsUpdated",query:K(this,Je),observer:this});const i=this.hasListeners();i&&P_(K(this,Je),o,this.options,r)&&Qe(this,pt,iu).call(this),this.updateResult(n),i&&(K(this,Je)!==o||Xr(this.options.enabled,K(this,Je))!==Xr(r.enabled,K(this,Je))||vl(this.options.staleTime,K(this,Je))!==vl(r.staleTime,K(this,Je)))&&Qe(this,pt,Fv).call(this);const s=Qe(this,pt,jv).call(this);i&&(K(this,Je)!==o||Xr(this.options.enabled,K(this,Je))!==Xr(r.enabled,K(this,Je))||s!==K(this,Bi))&&Qe(this,pt,Lv).call(this,s)}getOptimisticResult(t){const n=K(this,tr).getQueryCache().build(K(this,tr),t),r=this.createResult(n,t);return F9(this,r)&&(me(this,$n,r),me(this,Hl,this.options),me(this,ea,K(this,Je).state)),r}getCurrentResult(){return K(this,$n)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){K(this,ql).add(t)}getCurrentQuery(){return K(this,Je)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=K(this,tr).defaultQueryOptions(t),r=K(this,tr).getQueryCache().build(K(this,tr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Qe(this,pt,iu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),K(this,$n)))}createResult(t,n){var P;const r=K(this,Je),o=this.options,i=K(this,$n),s=K(this,ea),a=K(this,Hl),c=t!==r?t.state:K(this,Nd),{state:u}=t;let d={...u},h=!1,f;if(n._optimisticResults){const M=this.hasListeners(),T=!M&&k_(t,n),I=M&&P_(t,r,n,o);(T||I)&&(d={...d,...VD(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:g,status:m}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===K(this,Fd))f=K(this,Wl);else try{me(this,Fd,n.select),f=n.select(d.data),f=Av(i==null?void 0:i.data,f,n),me(this,Wl,f),me(this,vo,null)}catch(M){me(this,vo,M)}else f=d.data;if(n.placeholderData!==void 0&&f===void 0&&m==="pending"){let M;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))M=i.data;else if(M=typeof n.placeholderData=="function"?n.placeholderData((P=K(this,Ul))==null?void 0:P.state.data,K(this,Ul)):n.placeholderData,n.select&&M!==void 0)try{M=n.select(M),me(this,vo,null)}catch(T){me(this,vo,T)}M!==void 0&&(m="success",f=Av(i==null?void 0:i.data,M,n),h=!0)}K(this,vo)&&(p=K(this,vo),f=K(this,Wl),g=Date.now(),m="error");const y=d.fetchStatus==="fetching",v=m==="pending",x=m==="error",S=v&&y,w=f!==void 0,R={status:m,fetchStatus:d.fetchStatus,isPending:v,isSuccess:m==="success",isError:x,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:x&&!w,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:x&&w,isStale:pw(t,n),refetch:this.refetch,promise:K(this,zi)};if(this.options.experimental_prefetchInRender){const M=A=>{R.status==="error"?A.reject(R.error):R.data!==void 0&&A.resolve(R.data)},T=()=>{const A=me(this,zi,R.promise=Nv());M(A)},I=K(this,zi);switch(I.status){case"pending":t.queryHash===r.queryHash&&M(I);break;case"fulfilled":(R.status==="error"||R.data!==I.value)&&T();break;case"rejected":(R.status!=="error"||R.error!==I.reason)&&T();break}}return R}updateResult(t){const n=K(this,$n),r=this.createResult(K(this,Je),this.options);if(me(this,ea,K(this,Je).state),me(this,Hl,this.options),K(this,ea).data!==void 0&&me(this,Ul,K(this,Je)),Tv(r,n))return;me(this,$n,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!K(this,ql).size)return!0;const l=new Set(a??K(this,ql));return this.options.throwOnError&&l.add("error"),Object.keys(K(this,$n)).some(c=>{const u=c;return K(this,$n)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Qe(this,pt,WD).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Qe(this,pt,$v).call(this)}},tr=new WeakMap,Je=new WeakMap,Nd=new WeakMap,$n=new WeakMap,ea=new WeakMap,Hl=new WeakMap,zi=new WeakMap,vo=new WeakMap,Fd=new WeakMap,Wl=new WeakMap,Ul=new WeakMap,ta=new WeakMap,na=new WeakMap,Bi=new WeakMap,ql=new WeakMap,pt=new WeakSet,iu=function(t){Qe(this,pt,Vv).call(this);let n=K(this,Je).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ir)),n},Fv=function(){Qe(this,pt,zv).call(this);const t=vl(this.options.staleTime,K(this,Je));if(va||K(this,$n).isStale||!Mv(t))return;const r=FD(K(this,$n).dataUpdatedAt,t)+1;me(this,ta,setTimeout(()=>{K(this,$n).isStale||this.updateResult()},r))},jv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(K(this,Je)):this.options.refetchInterval)??!1},Lv=function(t){Qe(this,pt,Bv).call(this),me(this,Bi,t),!(va||Xr(this.options.enabled,K(this,Je))===!1||!Mv(K(this,Bi))||K(this,Bi)===0)&&me(this,na,setInterval(()=>{(this.options.refetchIntervalInBackground||hw.isFocused())&&Qe(this,pt,iu).call(this)},K(this,Bi)))},$v=function(){Qe(this,pt,Fv).call(this),Qe(this,pt,Lv).call(this,Qe(this,pt,jv).call(this))},zv=function(){K(this,ta)&&(clearTimeout(K(this,ta)),me(this,ta,void 0))},Bv=function(){K(this,na)&&(clearInterval(K(this,na)),me(this,na,void 0))},Vv=function(){const t=K(this,tr).getQueryCache().build(K(this,tr),this.options);if(t===K(this,Je))return;const n=K(this,Je);me(this,Je,t),me(this,Nd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},WD=function(t){xn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(K(this,$n))}),K(this,tr).getQueryCache().notify({query:K(this,Je),type:"observerResultsUpdated"})})},dD);function N9(e,t){return Xr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function k_(e,t){return N9(e,t)||e.state.data!==void 0&&Hv(e,t,t.refetchOnMount)}function Hv(e,t,n){if(Xr(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&pw(e,t)}return!1}function P_(e,t,n,r){return(e!==t||Xr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&pw(e,n)}function pw(e,t){return Xr(t.enabled,e)!==!1&&e.isStaleByTime(vl(t.staleTime,e))}function F9(e,t){return!Tv(e.getCurrentResult(),t)}var gw=E.createContext(void 0),mw=e=>{const t=E.useContext(gw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},j9=({client:e,children:t})=>(E.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),b.jsx(gw.Provider,{value:e,children:t})),UD=E.createContext(!1),L9=()=>E.useContext(UD);UD.Provider;function $9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var z9=E.createContext($9()),B9=()=>E.useContext(z9);function V9(e,t){return typeof e=="function"?e(...t):!!e}function D_(){}var H9=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},W9=e=>{E.useEffect(()=>{e.clearReset()},[e])},U9=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||V9(n,[e.error,r])),q9=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},G9=(e,t)=>e.isLoading&&e.isFetching&&!t,Y9=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,M_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function K9(e,t,n){var d,h,f,p,g;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=mw(),o=L9(),i=B9(),s=r.defaultQueryOptions(e);(h=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||h.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",q9(s),H9(s,i),W9(i);const a=!r.getQueryCache().get(s.queryHash),[l]=E.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!o&&e.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(m=>{const y=u?l.subscribe(xn.batchCalls(m)):D_;return l.updateResult(),y},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),E.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),Y9(s,c))throw M_(s,l,i);if(U9({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((p=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,s,c),s.experimental_prefetchInRender&&!va&&G9(c,o)){const m=a?M_(s,l,i):(g=r.getQueryCache().get(s.queryHash))==null?void 0:g.promise;m==null||m.catch(D_).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function $d(e,t){return K9(e,A9)}function X9(){const e=C.useContext(gw);if(e&&e.isSemaphorClient)return e}function qD({children:e}){const{setIsSessionExpired:t}=Xt(),n=X9(),[r]=C.useState(()=>{const o=new I9({queryCache:new HD({onError:i=>{i instanceof Error?(console.error(`Something went wrong: ${i.message}`),i.message==="invalid token"&&t(!0)):console.error("Something went wrong:",i)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return o.isSemaphorClient=!0,o});return n?b.jsx(b.Fragment,{children:e}):b.jsx(j9,{client:r,children:e})}const us=C.forwardRef(({children:e,className:t,...n},r)=>b.jsx("div",{className:ie("semaphor-scope",t),ref:r,...n,children:e})),Q9={id:"",authToken:void 0},GD=C.createContext(Q9),YD=({children:e,dashboardProps:t})=>b.jsx(qD,{children:b.jsx(GD.Provider,{value:t,children:b.jsx(us,{style:{height:"100%"},children:e})})});function Pr(){const e=C.useContext(GD);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function J9(){const{authToken:e,version:t}=Pr(),n=se(l=>l.selectedLensId);function r(){if(!(e!=null&&e.accessToken))return!1}const{data:o,isLoading:i,isFetching:s,isError:a}=$d({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>h9(e==null?void 0:e.accessToken,{lensId:n,version:t}),enabled:r()});return{data:o,isLoading:i,isFetching:s,isError:a}}function Z9(){const{authToken:e}=Pr(),t=se(r=>r.authToken),{setAuthToken:n}=Xt();return C.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}const KD=(e,t)=>{const n={};if(e===null||t===null)return t;const r=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of r){if(!(o in e)&&o in t){n[o]=t[o];continue}if(o in e&&!(o in t)){n[o]=void 0;continue}const i=e[o],s=t[o];if(!Wv(i,s))if(Array.isArray(i)&&Array.isArray(s))n[o]=s;else if(O_(i)&&O_(s)){const a=KD(i,s);Object.keys(a).length>0&&(n[o]=a)}else n[o]=s}return n},Wv=(e,t)=>{if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((o,i)=>Wv(o,t[i]));const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(o=>Wv(e[o],t[o]))}return!1},O_=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Ju=e=>{if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(n=>Ju(n));const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=Ju(e[n]));return t};function XD(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function T_(e,t){const n=XD(e);return n==="dark"?Ku({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function e7({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,selectedSheetId:i,onFilterValuesChange:s}){const{authToken:a}=Pr();Z9();const l=se(N=>N.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:h}=J9(),[f,p]=C.useState(o||[]),{theme:g,setTheme:m}=ND(),y=se(N=>N.dashboard.globalStyle),{setDashboard:v,setDashboardWithFilterValues:x,setSelectedSheetId:S,setStyle:w,setOnSaveFunction:_,setLenses:R,setSelectedLensId:P,setInitStore:M}=Xt();se(N=>N.actions.setCustomCards);const T=se(N=>N.actions.setFilterValues),I=se(N=>N.filterValues),A=se(N=>N.actions.setThemeStyle),U=se(N=>N.actions.setDashboardTheme),$=se(N=>N.actions.setOnEvent);C.useEffect(()=>{a&&M()},[a,M]),C.useEffect(()=>{if(g){const N=XD(g);U(N)}},[g,U]),C.useEffect(()=>{t&&m(t)},[t,m]);const O=C.useCallback(()=>{const N=Ju(up),j=Ku(N,y);if(e){const L=Ku(j,e),B=T_(g,L);A(B),w(L)}else{const L=T_(g,j);A(L),w(up)}},[g,e,y,A,w]);return C.useEffect(()=>{c&&c.dashboard&&O()},[g,e,y,O,c]),C.useEffect(()=>{var F,k;function N(W,G){const Y=W.filters||[],V=[];for(const q of G){const X=Y.find(Z=>Z.id===q.filterId);X&&V.push({filterId:q.filterId,connectionType:X.database==="NA"?"api":"database",name:X.column,operation:X.operation,valueType:bl(X),values:q.values})}return V}if(!c||!c.dashboard)return;const{dashboard:j,filterValues:L,defaultLensId:B,lenses:D}=c,H=N(j,f||[]);x(j,(!L||(L==null?void 0:L.length)===0?H:L)||[]),D&&R(D),B&&P(B),S(i||((k=(F=j==null?void 0:j.sheets)==null?void 0:F[0])==null?void 0:k.id)||null)},[c,v,S,T,l,R,x,P,f,i]),C.useEffect(()=>{s&&I&&s(I)},[I,s]),C.useEffect(()=>{n&&_(n),r&&$(r)},[n,_,r,$]),{isFetching:d,isLoading:u,isError:h}}function ra({className:e,...t}){return b.jsx("div",{className:ie("animate-pulse rounded-md bg-muted",e),...t})}const QD=E.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:ie("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));QD.displayName="Card";const Pg=E.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:ie("flex flex-col space-y-1.5 p-6",e),...t}));Pg.displayName="CardHeader";const vc=E.forwardRef(({className:e,...t},n)=>b.jsx("h3",{ref:n,className:ie("text-2xl font-semibold leading-none tracking-tight",e),...t}));vc.displayName="CardTitle";const bw=E.forwardRef(({className:e,...t},n)=>b.jsx("p",{ref:n,className:ie("text-sm text-muted-foreground",e),...t}));bw.displayName="CardDescription";const Dg=E.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:ie("px-6 pt-0",e),...t}));Dg.displayName="CardContent";const JD=E.forwardRef(({className:e,...t},n)=>b.jsx("div",{ref:n,className:ie("flex items-center p-6 pt-0",e),...t}));JD.displayName="CardFooter";function ZD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:h,defaultFilterValues:f,onFilterValuesChange:p,selectedSheetId:g,...m}){const{placeholders:y}=Pr(),v=se(_=>_.themeStyle),x=se(_=>_.isSessionExpired),{isLoading:S,isError:w}=e7({customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:f,onFilterValuesChange:p,selectedSheetId:g});return S||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?b.jsx(o,{message:"loading"}):b.jsx("div",{className:"flex items-center gap-3",children:b.jsx(ra,{className:"h-1 w-full dark:h-[2px]"})})):w?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),b.jsx(i,{})):b.jsx("div",{children:"Error"})):x?(r==null||r({type:"error",message:"Session Expired"}),y!=null&&y.SessionExpired?b.jsx("div",{className:"flex h-full items-center justify-center",children:b.jsx("div",{children:y.SessionExpired})}):b.jsx("div",{className:"flex h-full items-center justify-center",children:b.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[b.jsx(vc,{children:"Session Expired"}),b.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):b.jsx("div",{className:ie("isolate flex h-full flex-col justify-between",v==null?void 0:v.dashboardPanel,e),style:{},"data-role":"dashboard-panel",...m})}function ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function t7(e,t){const n=E.createContext(t),r=i=>{const{children:s,...a}=i,l=E.useMemo(()=>a,Object.values(a));return b.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=E.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function ln(e,t=[]){let n=[];function r(i,s){const a=E.createContext(s),l=n.length;n=[...n,s];const c=d=>{var y;const{scope:h,children:f,...p}=d,g=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,m=E.useMemo(()=>p,Object.values(p));return b.jsx(g.Provider,{value:m,children:f})};c.displayName=i+"Provider";function u(d,h){var g;const f=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,p=E.useContext(f);if(p)return p;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>E.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,n7(o,...t)]}function n7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function I_(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Mg(...e){return t=>{let n=!1;const r=e.map(o=>{const i=I_(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():I_(e[o],null)}}}}function Te(...e){return E.useCallback(Mg(...e),e)}var mi=E.forwardRef((e,t)=>{const{children:n,...r}=e,o=E.Children.toArray(n),i=o.find(r7);if(i){const s=i.props.children,a=o.map(l=>l===i?E.Children.count(s)>1?E.Children.only(null):E.isValidElement(s)?s.props.children:null:l);return b.jsx(Uv,{...r,ref:t,children:E.isValidElement(s)?E.cloneElement(s,void 0,a):null})}return b.jsx(Uv,{...r,ref:t,children:n})});mi.displayName="Slot";var Uv=E.forwardRef((e,t)=>{const{children:n,...r}=e;if(E.isValidElement(n)){const o=i7(n),i=o7(r,n.props);return n.type!==E.Fragment&&(i.ref=t?Mg(t,o):o),E.cloneElement(n,i)}return E.Children.count(n)>1?E.Children.only(null):null});Uv.displayName="SlotClone";var yw=({children:e})=>b.jsx(b.Fragment,{children:e});function r7(e){return E.isValidElement(e)&&e.type===yw}function o7(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function i7(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Og(e){const t=e+"CollectionProvider",[n,r]=ln(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:p,children:g}=f,m=C.useRef(null),y=C.useRef(new Map).current;return b.jsx(o,{scope:p,itemMap:y,collectionRef:m,children:g})};s.displayName=t;const a=e+"CollectionSlot",l=C.forwardRef((f,p)=>{const{scope:g,children:m}=f,y=i(a,g),v=Te(p,y.collectionRef);return b.jsx(mi,{ref:v,children:m})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=C.forwardRef((f,p)=>{const{scope:g,children:m,...y}=f,v=C.useRef(null),x=Te(p,v),S=i(c,g);return C.useEffect(()=>(S.itemMap.set(v,{ref:v,...y}),()=>void S.itemMap.delete(v))),b.jsx(mi,{[u]:"",ref:x,children:m})});d.displayName=c;function h(f){const p=i(e+"CollectionConsumer",f);return C.useCallback(()=>{const m=p.collectionRef.current;if(!m)return[];const y=Array.from(m.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((S,w)=>y.indexOf(S.ref.current)-y.indexOf(w.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},h,r]}var wn=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},s7=E.useId||(()=>{}),a7=0;function nn(e){const[t,n]=E.useState(s7());return wn(()=>{n(r=>r??String(a7++))},[e]),t?`radix-${t}`:""}var l7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ge=l7.reduce((e,t)=>{const n=E.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?mi:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function eM(e,t){e&&ma.flushSync(()=>e.dispatchEvent(t))}function sn(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Nn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=c7({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=sn(n),l=E.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function c7({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,o=E.useRef(r),i=sn(t);return E.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var u7=E.createContext(void 0);function Ia(e){const t=E.useContext(u7);return e||t||"ltr"}var Pb="rovingFocusGroup.onEntryFocus",d7={bubbles:!1,cancelable:!0},Tg="RovingFocusGroup",[qv,tM,f7]=Og(Tg),[h7,xc]=ln(Tg,[f7]),[p7,g7]=h7(Tg),nM=E.forwardRef((e,t)=>b.jsx(qv.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(qv.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx(m7,{...e,ref:t})})}));nM.displayName=Tg;var m7=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,h=E.useRef(null),f=Te(t,h),p=Ia(i),[g=null,m]=Nn({prop:s,defaultProp:a,onChange:l}),[y,v]=E.useState(!1),x=sn(c),S=tM(n),w=E.useRef(!1),[_,R]=E.useState(0);return E.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(Pb,x),()=>P.removeEventListener(Pb,x)},[x]),b.jsx(p7,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:g,onItemFocus:E.useCallback(P=>m(P),[m]),onItemShiftTab:E.useCallback(()=>v(!0),[]),onFocusableItemAdd:E.useCallback(()=>R(P=>P+1),[]),onFocusableItemRemove:E.useCallback(()=>R(P=>P-1),[]),children:b.jsx(ge.div,{tabIndex:y||_===0?-1:0,"data-orientation":r,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:ce(e.onMouseDown,()=>{w.current=!0}),onFocus:ce(e.onFocus,P=>{const M=!w.current;if(P.target===P.currentTarget&&M&&!y){const T=new CustomEvent(Pb,d7);if(P.currentTarget.dispatchEvent(T),!T.defaultPrevented){const I=S().filter(N=>N.focusable),A=I.find(N=>N.active),U=I.find(N=>N.id===g),O=[A,U,...I].filter(Boolean).map(N=>N.ref.current);iM(O,u)}}w.current=!1}),onBlur:ce(e.onBlur,()=>v(!1))})})}),rM="RovingFocusGroupItem",oM=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=nn(),l=i||a,c=g7(rM,n),u=c.currentTabStopId===l,d=tM(n),{onFocusableItemAdd:h,onFocusableItemRemove:f}=c;return E.useEffect(()=>{if(r)return h(),()=>f()},[r,h,f]),b.jsx(qv.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:b.jsx(ge.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:ce(e.onMouseDown,p=>{r?c.onItemFocus(l):p.preventDefault()}),onFocus:ce(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ce(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){c.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const g=v7(p,c.orientation,c.dir);if(g!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(g==="last")y.reverse();else if(g==="prev"||g==="next"){g==="prev"&&y.reverse();const v=y.indexOf(p.currentTarget);y=c.loop?x7(y,v+1):y.slice(v+1)}setTimeout(()=>iM(y))}})})})});oM.displayName=rM;var b7={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function y7(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function v7(e,t,n){const r=y7(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return b7[r]}function iM(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function x7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var vw=nM,xw=oM;function w7(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var rn=e=>{const{present:t,children:n}=e,r=S7(t),o=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),i=Te(r.ref,C7(o));return typeof n=="function"||r.isPresent?E.cloneElement(o,{ref:i}):null};rn.displayName="Presence";function S7(e){const[t,n]=E.useState(),r=E.useRef({}),o=E.useRef(e),i=E.useRef("none"),s=e?"mounted":"unmounted",[a,l]=w7(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=Nf(r.current);i.current=a==="mounted"?c:"none"},[a]),wn(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,f=Nf(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),wn(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const g=Nf(r.current).includes(f.animationName);if(f.target===t&&g&&(l("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=f=>{f.target===t&&(i.current=Nf(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:E.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Nf(e){return(e==null?void 0:e.animationName)||"none"}function C7(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ww="Tabs",[_7,I1e]=ln(ww,[xc]),sM=xc(),[E7,Sw]=_7(ww),aM=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Ia(a),[d,h]=Nn({prop:r,onChange:o,defaultProp:i});return b.jsx(E7,{scope:n,baseId:nn(),value:d,onValueChange:h,orientation:s,dir:u,activationMode:l,children:b.jsx(ge.div,{dir:u,"data-orientation":s,...c,ref:t})})});aM.displayName=ww;var lM="TabsList",cM=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Sw(lM,n),s=sM(n);return b.jsx(vw,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:b.jsx(ge.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});cM.displayName=lM;var uM="TabsTrigger",dM=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Sw(uM,n),a=sM(n),l=pM(s.baseId,r),c=gM(s.baseId,r),u=r===s.value;return b.jsx(xw,{asChild:!0,...a,focusable:!o,active:u,children:b.jsx(ge.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:ce(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:ce(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:ce(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});dM.displayName=uM;var fM="TabsContent",hM=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Sw(fM,n),l=pM(a.baseId,r),c=gM(a.baseId,r),u=r===a.value,d=E.useRef(u);return E.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),b.jsx(rn,{present:o||u,children:({present:h})=>b.jsx(ge.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&i})})});hM.displayName=fM;function pM(e,t){return`${e}-trigger-${t}`}function gM(e,t){return`${e}-content-${t}`}var R7=aM,mM=cM,bM=dM,yM=hM;const Cw=R7,Ig=E.forwardRef(({className:e,...t},n)=>b.jsx(mM,{ref:n,className:ie("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ig.displayName=mM.displayName;const Ag=E.forwardRef(({className:e,...t},n)=>b.jsx(bM,{ref:n,className:ie("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Ag.displayName=bM.displayName;const _w=E.forwardRef(({className:e,...t},n)=>b.jsx(yM,{ref:n,className:ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));_w.displayName=yM.displayName;var vM={exports:{}},zd={},Gv={exports:{}};(function(e,t){(function(n,r){r(t)})(ci,function(n){function r(q){return function(Z,ne,J,oe,ee,ue,fe){return q(Z,ne,fe)}}function o(q){return function(Z,ne,J,oe){if(!Z||!ne||typeof Z!="object"||typeof ne!="object")return q(Z,ne,J,oe);var ee=oe.get(Z),ue=oe.get(ne);if(ee&&ue)return ee===ne&&ue===Z;oe.set(Z,ne),oe.set(ne,Z);var fe=q(Z,ne,J,oe);return oe.delete(Z),oe.delete(ne),fe}}function i(q,X){var Z={};for(var ne in q)Z[ne]=q[ne];for(var ne in X)Z[ne]=X[ne];return Z}function s(q){return q.constructor===Object||q.constructor==null}function a(q){return typeof q.then=="function"}function l(q,X){return q===X||q!==q&&X!==X}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",f="[object Map]",p="[object Number]",g="[object Object]",m="[object Set]",y="[object String]",v=Object.prototype.toString;function x(q){var X=q.areArraysEqual,Z=q.areDatesEqual,ne=q.areMapsEqual,J=q.areObjectsEqual,oe=q.areRegExpsEqual,ee=q.areSetsEqual,ue=q.createIsNestedEqual,fe=ue(xe);function xe(pe,be,Ce){if(pe===be)return!0;if(!pe||!be||typeof pe!="object"||typeof be!="object")return pe!==pe&&be!==be;if(s(pe)&&s(be))return J(pe,be,fe,Ce);var Ke=Array.isArray(pe),kt=Array.isArray(be);if(Ke||kt)return Ke===kt&&X(pe,be,fe,Ce);var He=v.call(pe);return He!==v.call(be)?!1:He===d?Z(pe,be,fe,Ce):He===h?oe(pe,be,fe,Ce):He===f?ne(pe,be,fe,Ce):He===m?ee(pe,be,fe,Ce):He===g||He===c?a(pe)||a(be)?!1:J(pe,be,fe,Ce):He===u||He===p||He===y?l(pe.valueOf(),be.valueOf()):!1}return xe}function S(q,X,Z,ne){var J=q.length;if(X.length!==J)return!1;for(;J-- >0;)if(!Z(q[J],X[J],J,J,q,X,ne))return!1;return!0}var w=o(S);function _(q,X){return l(q.valueOf(),X.valueOf())}function R(q,X,Z,ne){var J=q.size===X.size;if(!J)return!1;if(!q.size)return!0;var oe={},ee=0;return q.forEach(function(ue,fe){if(J){var xe=!1,pe=0;X.forEach(function(be,Ce){!xe&&!oe[pe]&&(xe=Z(fe,Ce,ee,pe,q,X,ne)&&Z(ue,be,fe,Ce,q,X,ne))&&(oe[pe]=!0),pe++}),ee++,J=xe}}),J}var P=o(R),M="_owner",T=Object.prototype.hasOwnProperty;function I(q,X,Z,ne){var J=Object.keys(q),oe=J.length;if(Object.keys(X).length!==oe)return!1;for(var ee;oe-- >0;){if(ee=J[oe],ee===M){var ue=!!q.$$typeof,fe=!!X.$$typeof;if((ue||fe)&&ue!==fe)return!1}if(!T.call(X,ee)||!Z(q[ee],X[ee],ee,ee,q,X,ne))return!1}return!0}var A=o(I);function U(q,X){return q.source===X.source&&q.flags===X.flags}function $(q,X,Z,ne){var J=q.size===X.size;if(!J)return!1;if(!q.size)return!0;var oe={};return q.forEach(function(ee,ue){if(J){var fe=!1,xe=0;X.forEach(function(pe,be){!fe&&!oe[xe]&&(fe=Z(ee,pe,ue,be,q,X,ne))&&(oe[xe]=!0),xe++}),J=fe}}),J}var O=o($),N=Object.freeze({areArraysEqual:S,areDatesEqual:_,areMapsEqual:R,areObjectsEqual:I,areRegExpsEqual:U,areSetsEqual:$,createIsNestedEqual:r}),j=Object.freeze({areArraysEqual:w,areDatesEqual:_,areMapsEqual:P,areObjectsEqual:A,areRegExpsEqual:U,areSetsEqual:O,createIsNestedEqual:r}),L=x(N);function B(q,X){return L(q,X,void 0)}var D=x(i(N,{createIsNestedEqual:function(){return l}}));function H(q,X){return D(q,X,void 0)}var F=x(j);function k(q,X){return F(q,X,new WeakMap)}var W=x(i(j,{createIsNestedEqual:function(){return l}}));function G(q,X){return W(q,X,new WeakMap)}function Y(q){return x(i(N,q(N)))}function V(q){var X=x(i(j,q(j)));return function(Z,ne,J){return J===void 0&&(J=new WeakMap),X(Z,ne,J)}}n.circularDeepEqual=k,n.circularShallowEqual=G,n.createCustomCircularEqual=V,n.createCustomEqual=Y,n.deepEqual=B,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(Gv,Gv.exports);var Ew=Gv.exports;const Rw=ew($8);var Ye={},k7=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.bottom=kw;Ye.childrenEqual=O7;Ye.cloneLayout=xM;Ye.cloneLayoutItem=oa;Ye.collides=Ng;Ye.compact=SM;Ye.compactItem=CM;Ye.compactType=W7;Ye.correctBounds=_M;Ye.fastPositionEqual=T7;Ye.fastRGLPropsEqual=void 0;Ye.getAllCollisions=EM;Ye.getFirstCollision=Bs;Ye.getLayoutItem=Pw;Ye.getStatics=Dw;Ye.modifyLayout=wM;Ye.moveElement=au;Ye.moveElementAwayFromCollision=Kv;Ye.noop=void 0;Ye.perc=A7;Ye.resizeItemInDirection=z7;Ye.setTopLeft=V7;Ye.setTransform=B7;Ye.sortLayoutItems=Nw;Ye.sortLayoutItemsByColRow=MM;Ye.sortLayoutItemsByRowCol=DM;Ye.synchronizeLayoutWithChildren=H7;Ye.validateLayout=OM;Ye.withLayoutItem=M7;var A_=Ew,su=P7(C);function P7(e){return e&&e.__esModule?e:{default:e}}const D7=process.env.NODE_ENV==="production";function kw(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function xM(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=oa(e[n]);return t}function wM(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function M7(e,t,n){let r=Pw(e,t);return r?(r=n(oa(r)),e=wM(e,r),[e,r]):[e,null]}function oa(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}}function O7(e,t){return(0,A_.deepEqual)(su.default.Children.map(e,n=>n==null?void 0:n.key),su.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,A_.deepEqual)(su.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),su.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Ye.fastRGLPropsEqual=k7;function T7(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Ng(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function SM(e,t,n,r){const o=Dw(e),i=Nw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=oa(i[a]);c.static||(c=CM(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const I7={x:"w",y:"h"};function Yv(e,t,n,r){const o=I7[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Ng(t,a)&&Yv(e,a,n+t[o],r)}}t[r]=n}function CM(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(kw(e),t.y);t.y>0&&!Bs(e,t);)t.y--;else if(a)for(;t.x>0&&!Bs(e,t);)t.x--;let l;for(;(l=Bs(e,t))&&!(n===null&&i);)if(a?Yv(o,t,l.x+l.w,"x"):Yv(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Bs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function _M(e,t){const n=Dw(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;Bs(n,i);)i.y++}return e}function Pw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Bs(e,t){for(let n=0,r=e.length;n<r;n++)if(Ng(e[n],t))return e[n]}function EM(e,t){return e.filter(n=>Ng(n,t))}function Dw(e){return e.filter(t=>t.static)}function au(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${t.y}`;const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=Nw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const f=EM(d,t),p=f.length>0;if(p&&l)return xM(e);if(p&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let g=0,m=f.length;g<m;g++){const y=f[g];`${t.i}${t.x}${t.y}${y.i}${y.x}${y.y}`,!y.moved&&(y.static?e=Kv(e,y,t,o,s):e=Kv(e,t,y,o,s))}return e}function Kv(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const d={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=Bs(e,d),f=h&&h.y+h.h>t.y,p=h&&t.x+t.w>h.x;if(h){if(f&&a)return au(e,n,void 0,t.y+1,r,l,o);if(f&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(p&&s)return au(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,au(e,n,s?d.x:void 0,a?d.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:au(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function A7(e){return e*100+"%"}const RM=(e,t,n,r)=>e+n>r?t:n,kM=(e,t,n)=>e<0?t:n,PM=e=>Math.max(0,e),Mw=e=>Math.max(0,e),Ow=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:kM(s,e.height,o),top:Mw(s)}},Tw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:RM(e.left,e.width,s,n),left:PM(o)}},Iw=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:RM(e.left,e.width,i,n),top:Mw(r),left:PM(s)}},Aw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:kM(r,e.height,i),top:Mw(r)}},N7=function(){return Ow(arguments.length<=0?void 0:arguments[0],Tw(...arguments))},F7=function(){return Ow(arguments.length<=0?void 0:arguments[0],Iw(...arguments))},j7=function(){return Aw(arguments.length<=0?void 0:arguments[0],Tw(...arguments))},L7=function(){return Aw(arguments.length<=0?void 0:arguments[0],Iw(...arguments))},$7={n:Ow,ne:N7,e:Tw,se:j7,s:Aw,sw:L7,w:Iw,nw:F7};function z7(e,t,n,r){const o=$7[e];return o?o(t,{...t,...n},r):n}function B7(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function V7(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Nw(e,t){return t==="horizontal"?MM(e):t==="vertical"?DM(e):e}function DM(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function MM(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function H7(e,t,n,r,o){e=e||[];const i=[];su.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Pw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(oa(l)):c?(D7||OM([c],"ReactGridLayout.children"),i.push(oa({...c,i:a.key}))):i.push(oa({w:1,h:1,x:0,y:kw(i),i:String(a.key)}))});const s=_M(i,{cols:n});return o?s:SM(s,r,n)}function OM(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++){const a=n[s],l=i[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function W7(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const U7=()=>{};Ye.noop=U7;var $o={};Object.defineProperty($o,"__esModule",{value:!0});$o.calcGridColWidth=Fg;$o.calcGridItemPosition=q7;$o.calcGridItemWHPx=Xv;$o.calcWH=Y7;$o.calcXY=G7;$o.clamp=Vs;function Fg(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Xv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function q7(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=Fg(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Xv(r,c,s[0]),u.height=Xv(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function G7(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=Fg(e);let d=Math.round((n-s[0])/(u+i[0])),h=Math.round((t-s[1])/(l+i[1]));return d=Vs(d,0,a-r),h=Vs(h,0,c-o),{x:d,y:h}}function Y7(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=Fg(e);let d=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),f=Vs(d,0,l-r),p=Vs(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(f=Vs(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(p=Vs(h,0,a)),{w:f,h:p}}function Vs(e,t,n){return Math.max(Math.min(e,n),t)}var jg={},Qv={exports:{}},Ff={exports:{}},ut={};/** @license React v16.13.1
|
|
37
37
|
* react-is.production.min.js
|
|
38
38
|
*
|
|
39
39
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -4226,7 +4226,7 @@ const se = tx()(
|
|
|
4226
4226
|
n.isSessionExpired = !1, n.currentBreakpoint = "lg", n.dashboard = {
|
|
4227
4227
|
id: "",
|
|
4228
4228
|
style: bp
|
|
4229
|
-
}, n.showContext = !1, n.selectedSheetId = null, n.selectedCardId = null, n.selectedFrameId = null, n.selectedCard = null, n.showFilters = !1, n.isDashboardEditing = !
|
|
4229
|
+
}, n.showContext = !1, n.selectedSheetId = null, n.selectedCardId = null, n.selectedFrameId = null, n.selectedCard = null, n.showFilters = !1, n.isDashboardEditing = !1, n.isVisualEditing = !1, n.showDashboardJSON = !1, n.filteringCards = [], n.selectedLensId = void 0, n.filterValues = void 0;
|
|
4230
4230
|
});
|
|
4231
4231
|
},
|
|
4232
4232
|
updateEmailSettings: (n) => {
|
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-D1FTmCdp.js");exports.Dashboard=e.Dashboard;
|
package/dist/dashboard/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunks/index-D1FTmCdp.js"),e=require("react/jsx-runtime"),k=require("react");require("react-dom");function Qt(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>s[n]})}}return a.default=s,Object.freeze(a)}const de=Qt(k);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as L, p as Kt, u as R, a as Xe, b as Le, d as za, e as Aa, B as K, P as it, f as Fa, g as La, h as Ea, i as _a, L as Q, I as ue, j as Va, k as Ra, l as qa, m as W, n as ja, o as Pa, q as Ba, r as us, s as va, t as ee, C as Wt, v as ms, S as be, w as ve, x as Ce, y as xe, z as Oe, A as Ne, E as oe, T as Ha, F as Be, G as He, H as wt, J as De, K as Zt, M as Yt, N as Ua, O as Xt, Q as ze, R as ea, U as kt, V as Ga, W as Te, X as Ca, Y as _e, Z as p, _ as $a, $ as We, a0 as ht, a1 as Ja, a2 as Qa, a3 as Ka, a4 as Wa, a5 as Za, a6 as Ya, a7 as Xa, a8 as hs, a9 as en, aa as tn, ab as an, ac as nn, ad as sn, ae as ge, af as ps, ag as Ze, ah as je, ai as rt, aj as fs, ak as gs, al as ys, am as pt, an as Ae, ao as bs, ap as te, aq as ta, ar as lt, as as rn, at as ft, au as gt, av as fe, aw as vs, ax as et, ay as Cs, az as xs, aA as Ns, aB as ln, aC as Ss, aD as Mt, aE as ws, aF as ks, aG as Ms, aH as xa, aI as Is, aJ as Ds, aK as aa, aL as Se, aM as Ts, aN as jt, aO as Ve, aP as de, aQ as Re, aR as Os, aS as zs, aT as As, aU as Fs, aV as Ls, aW as Ot, aX as Es, aY as Na, aZ as _s, a_ as Sa, a$ as Vs, b0 as Rs, b1 as qs, b2 as js, b3 as on, b4 as Ps, b5 as na, b6 as cn, b7 as Bs, b8 as Hs, b9 as st, ba as Us, bb as Gs, bc as dn, bd as $s, be as Js, bf as Qs, bg as Ks, bh as Ws, bi as It, bj as un, bk as Zs, bl as sa, bm as ra, bn as Qe, bo as mt, bp as Ys, bq as Xs, br as er, bs as la, bt as mn, bu as hn, bv as yt, bw as tr, bx as bt, by as pn, bz as ar, bA as fn, bB as nr, bC as sr, bD as rr, bE as lr, bF as Ee, bG as ne, bH as se, bI as re, bJ as ia, bK as ir, bL as or, bM as cr, bN as dr, bO as Pt, bP as wa, bQ as gn, bR as ur, bS as mr, bT as hr, bU as pr, bV as fr, bW as gr, bX as yr, bY as br, bZ as yn, b_ as bn, b$ as vn, c0 as Cn, c1 as vr, c2 as Cr, c3 as xr, c4 as Nr, c5 as Sr, c6 as wr, c7 as kr, c8 as Mr, c9 as Ir, ca as Dr, cb as zt, cc as xn, cd as Tr, ce as Or, cf as zr, cg as Ar, ch as Fr, ci as Lr, cj as Er } from "./chunks/index-
|
|
2
|
-
import { D as No, co as So, cm as wo, cm as ko, cr as Mo, cq as Io, cp as Do, cs as To, ct as Oo, cn as zo, ck as Ao, cl as Fo } from "./chunks/index-
|
|
1
|
+
import { c as L, p as Kt, u as R, a as Xe, b as Le, d as za, e as Aa, B as K, P as it, f as Fa, g as La, h as Ea, i as _a, L as Q, I as ue, j as Va, k as Ra, l as qa, m as W, n as ja, o as Pa, q as Ba, r as us, s as va, t as ee, C as Wt, v as ms, S as be, w as ve, x as Ce, y as xe, z as Oe, A as Ne, E as oe, T as Ha, F as Be, G as He, H as wt, J as De, K as Zt, M as Yt, N as Ua, O as Xt, Q as ze, R as ea, U as kt, V as Ga, W as Te, X as Ca, Y as _e, Z as p, _ as $a, $ as We, a0 as ht, a1 as Ja, a2 as Qa, a3 as Ka, a4 as Wa, a5 as Za, a6 as Ya, a7 as Xa, a8 as hs, a9 as en, aa as tn, ab as an, ac as nn, ad as sn, ae as ge, af as ps, ag as Ze, ah as je, ai as rt, aj as fs, ak as gs, al as ys, am as pt, an as Ae, ao as bs, ap as te, aq as ta, ar as lt, as as rn, at as ft, au as gt, av as fe, aw as vs, ax as et, ay as Cs, az as xs, aA as Ns, aB as ln, aC as Ss, aD as Mt, aE as ws, aF as ks, aG as Ms, aH as xa, aI as Is, aJ as Ds, aK as aa, aL as Se, aM as Ts, aN as jt, aO as Ve, aP as de, aQ as Re, aR as Os, aS as zs, aT as As, aU as Fs, aV as Ls, aW as Ot, aX as Es, aY as Na, aZ as _s, a_ as Sa, a$ as Vs, b0 as Rs, b1 as qs, b2 as js, b3 as on, b4 as Ps, b5 as na, b6 as cn, b7 as Bs, b8 as Hs, b9 as st, ba as Us, bb as Gs, bc as dn, bd as $s, be as Js, bf as Qs, bg as Ks, bh as Ws, bi as It, bj as un, bk as Zs, bl as sa, bm as ra, bn as Qe, bo as mt, bp as Ys, bq as Xs, br as er, bs as la, bt as mn, bu as hn, bv as yt, bw as tr, bx as bt, by as pn, bz as ar, bA as fn, bB as nr, bC as sr, bD as rr, bE as lr, bF as Ee, bG as ne, bH as se, bI as re, bJ as ia, bK as ir, bL as or, bM as cr, bN as dr, bO as Pt, bP as wa, bQ as gn, bR as ur, bS as mr, bT as hr, bU as pr, bV as fr, bW as gr, bX as yr, bY as br, bZ as yn, b_ as bn, b$ as vn, c0 as Cn, c1 as vr, c2 as Cr, c3 as xr, c4 as Nr, c5 as Sr, c6 as wr, c7 as kr, c8 as Mr, c9 as Ir, ca as Dr, cb as zt, cc as xn, cd as Tr, ce as Or, cf as zr, cg as Ar, ch as Fr, ci as Lr, cj as Er } from "./chunks/index-d9uadTQT.js";
|
|
2
|
+
import { D as No, co as So, cm as wo, cm as ko, cr as Mo, cq as Io, cp as Do, cs as To, ct as Oo, cn as zo, ck as Ao, cl as Fo } from "./chunks/index-d9uadTQT.js";
|
|
3
3
|
import { jsxs as r, jsx as e, Fragment as ae } from "react/jsx-runtime";
|
|
4
4
|
import * as Je from "react";
|
|
5
5
|
import Fe, { useState as U, useMemo as Ke, useEffect as ce, useRef as Ye, useCallback as Nn, Suspense as _r } from "react";
|