react-semaphor 0.0.248 → 0.0.249

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { J as O, L as $e, b as w, c as Ns, u as Se, j as e, M as Cs, O as Ss, P as k, Q as ws, R as ks, U as zs, V as Fs, W as Ls, X as H, Y as ge, Z as sa, _ as Wa, $ as Qa, a0 as Ja, a1 as Ya, a2 as Za, a3 as Xa, a4 as Ps, f as Y, a5 as qe, a6 as et, a7 as aa, a8 as as, a9 as ts, T as Os, e as ta, g as Ms, aa as je, ab as be, ac as ye, ad as ve, ae as Fe, af as Ne, ag as J, ah as Ds, G as o, ai as Ts, aj as As, ak as Is, w as na, v as la, t as he, al as st, r as at, N as ra, s as tt, am as nt, B as lt, an as ia, ao as rt, S as Es, z as it, n as Gs, A as oa, ap as ps, aq as de, ar as fe, as as Re, at as is, au as ca, av as ot, aw as ct, ax as da, ay as dt, az as ht, aA as ut, aB as mt, aC as xt, aD as fs, aE as pt, aF as ha, aG as Ve, aH as gs, aI as Me, aJ as js, aK as Us, aL as ft, aM as gt, aN as jt, aO as bt, aP as yt, aQ as xs, aR as vt, aS as Ks, aT as Nt, aU as Ws, aV as Ct, aW as St, aX as wt, aY as ua, l as kt, C as zt, E as Xe, d as Ft, h as Lt, aZ as Ot, i as Mt, o as Dt, a_ as Tt, m as At, a$ as It, H as Be, b0 as Et, b1 as ma, b2 as xa, b3 as es, b4 as pa, b5 as ss, b6 as Qs, b7 as Pe, b8 as Ge, b9 as Ue, ba as fa, K as Vt, bb as qt, bc as Rt, bd as ga, be as ja, bf as ba, bg as ya, bh as va, bi as Na, bj as _t, bk as Ht, bl as os, bm as Ce, bn as Ca, bo as $t, bp as Bt, bq as ns, br as Pt, bs as Gt, bt as Ut, bu as Js, bv as Kt, bw as Wt, bx as Le, by as P, bz as G, bA as Vs, bB as U, bC as Qt, bD as Jt, bE as Yt, bF as Zt, bG as Xt, bH as en, bI as sn, bJ as an, bK as tn, bL as nn } from "./index-Bqfi2Wzc.js";
1
+ import { J as O, L as $e, b as w, c as Ns, u as Se, j as e, M as Cs, O as Ss, P as k, Q as ws, R as ks, U as zs, V as Fs, W as Ls, X as H, Y as ge, Z as sa, _ as Wa, $ as Qa, a0 as Ja, a1 as Ya, a2 as Za, a3 as Xa, a4 as Ps, f as Y, a5 as qe, a6 as et, a7 as aa, a8 as as, a9 as ts, T as Os, e as ta, g as Ms, aa as je, ab as be, ac as ye, ad as ve, ae as Fe, af as Ne, ag as J, ah as Ds, G as o, ai as Ts, aj as As, ak as Is, w as na, v as la, t as he, al as st, r as at, N as ra, s as tt, am as nt, B as lt, an as ia, ao as rt, S as Es, z as it, n as Gs, A as oa, ap as ps, aq as de, ar as fe, as as Re, at as is, au as ca, av as ot, aw as ct, ax as da, ay as dt, az as ht, aA as ut, aB as mt, aC as xt, aD as fs, aE as pt, aF as ha, aG as Ve, aH as gs, aI as Me, aJ as js, aK as Us, aL as ft, aM as gt, aN as jt, aO as bt, aP as yt, aQ as xs, aR as vt, aS as Ks, aT as Nt, aU as Ws, aV as Ct, aW as St, aX as wt, aY as ua, l as kt, C as zt, E as Xe, d as Ft, h as Lt, aZ as Ot, i as Mt, o as Dt, a_ as Tt, m as At, a$ as It, H as Be, b0 as Et, b1 as ma, b2 as xa, b3 as es, b4 as pa, b5 as ss, b6 as Qs, b7 as Pe, b8 as Ge, b9 as Ue, ba as fa, K as Vt, bb as qt, bc as Rt, bd as ga, be as ja, bf as ba, bg as ya, bh as va, bi as Na, bj as _t, bk as Ht, bl as os, bm as Ce, bn as Ca, bo as $t, bp as Bt, bq as ns, br as Pt, bs as Gt, bt as Ut, bu as Js, bv as Kt, bw as Wt, bx as Le, by as P, bz as G, bA as Vs, bB as U, bC as Qt, bD as Jt, bE as Yt, bF as Zt, bG as Xt, bH as en, bI as sn, bJ as an, bK as tn, bL as nn } from "./index-4enkmjoO.js";
2
2
  import * as bs from "react";
3
3
  import ue, { useState as A, useMemo as ys, useEffect as X, useRef as _e } from "react";
4
4
  /**
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("./index-AIu_vTQd.js"),S=require("react");function ls(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>s[t]})}}return n.default=s,Object.freeze(n)}const Ce=ls(S);/**
1
+ "use strict";const e=require("./index-IjsKPI0S.js"),S=require("react");function ls(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>s[t]})}}return n.default=s,Object.freeze(n)}const Ce=ls(S);/**
2
2
  * @license lucide-react v0.379.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -9153,6 +9153,11 @@ const ke = QT()(
9153
9153
  onAddCard: n
9154
9154
  }));
9155
9155
  },
9156
+ setOnAcceptChanges: (n) => {
9157
+ e(() => ({
9158
+ onAcceptChanges: n
9159
+ }));
9160
+ },
9156
9161
  setOnUpdateCard: (n) => {
9157
9162
  e(() => ({
9158
9163
  onUpdateCard: n
@@ -85,7 +85,7 @@ __p += '`),Mt&&(Re+=`' +
85
85
  function print() { __p += __j.call(arguments, '') }
86
86
  `:`;
87
87
  `)+Re+`return __p
88
- }`;var yt=PR(function(){return jt(B,Ye+"return "+Re).apply(n,q)});if(yt.source=Re,Vb(yt))throw yt;return yt}function ez(d){return Ut(d).toLowerCase()}function tz(d){return Ut(d).toUpperCase()}function nz(d,g,x){if(d=Ut(d),d&&(x||g===n))return NC(d);if(!d||!(g=Ur(g)))return d;var P=zo(d),k=zo(g),B=LC(P,k),q=FC(P,k)+1;return Ts(P,B,q).join("")}function rz(d,g,x){if(d=Ut(d),d&&(x||g===n))return d.slice(0,zC(d)+1);if(!d||!(g=Ur(g)))return d;var P=zo(d),k=FC(P,zo(g))+1;return Ts(P,0,k).join("")}function oz(d,g,x){if(d=Ut(d),d&&(x||g===n))return d.replace(Bn,"");if(!d||!(g=Ur(g)))return d;var P=zo(d),k=LC(P,zo(g));return Ts(P,k).join("")}function iz(d,g){var x=D,P=F;if(wn(g)){var k="separator"in g?g.separator:k;x="length"in g?pt(g.length):x,P="omission"in g?Ur(g.omission):P}d=Ut(d);var B=d.length;if(Vl(d)){var q=zo(d);B=q.length}if(x>=B)return d;var ne=x-Hl(P);if(ne<1)return P;var le=q?Ts(q,0,ne).join(""):d.slice(0,ne);if(k===n)return le+P;if(q&&(ne+=le.length-ne),Hb(k)){if(d.slice(ne).search(k)){var xe,we=le;for(k.global||(k=ib(k.source,Ut(qe.exec(k))+"g")),k.lastIndex=0;xe=k.exec(we);)var Re=xe.index;le=le.slice(0,Re===n?ne:Re)}}else if(d.indexOf(Ur(k),ne)!=ne){var je=le.lastIndexOf(k);je>-1&&(le=le.slice(0,je))}return le+P}function sz(d){return d=Ut(d),d&&On.test(d)?d.replace(Xt,I7):d}var az=Xl(function(d,g,x){return d+(x?" ":"")+g.toUpperCase()}),qb=OE("toUpperCase");function RR(d,g,x){return d=Ut(d),g=x?n:g,g===n?T7(d)?F7(d):w7(d):d.match(g)||[]}var PR=St(function(d,g){try{return Hr(d,n,g)}catch(x){return Vb(x)?x:new ct(x)}}),lz=Bi(function(d,g){return yo(g,function(x){x=li(x),ji(d,x,zb(d[x],d))}),d});function cz(d){var g=d==null?0:d.length,x=Je();return d=g?yn(d,function(P){if(typeof P[1]!="function")throw new xo(s);return[x(P[0]),P[1]]}):[],St(function(P){for(var k=-1;++k<g;){var B=d[k];if(Hr(B[0],this,P))return Hr(B[1],this,P)}})}function uz(d){return I6(_o(d,f))}function Gb(d){return function(){return d}}function dz(d,g){return d==null||d!==d?g:d}var fz=TE(),hz=TE(!0);function $r(d){return d}function Yb(d){return sE(typeof d=="function"?d:_o(d,f))}function pz(d){return lE(_o(d,f))}function gz(d,g){return cE(d,_o(g,f))}var mz=St(function(d,g){return function(x){return Fu(x,d,g)}}),vz=St(function(d,g){return function(x){return Fu(d,x,g)}});function Kb(d,g,x){var P=Hn(g),k=Wh(g,P);x==null&&!(wn(g)&&(k.length||!P.length))&&(x=g,g=d,d=this,k=Wh(g,Hn(g)));var B=!(wn(x)&&"chain"in x)||!!x.chain,q=Hi(d);return yo(k,function(ne){var le=g[ne];d[ne]=le,q&&(d.prototype[ne]=function(){var xe=this.__chain__;if(B||xe){var we=d(this.__wrapped__),Re=we.__actions__=Rr(this.__actions__);return Re.push({func:le,args:arguments,thisArg:d}),we.__chain__=xe,we}return le.apply(d,Cs([this.value()],arguments))})}),d}function bz(){return Gn._===this&&(Gn._=W7),this}function Xb(){}function yz(d){return d=pt(d),St(function(g){return uE(g,d)})}var xz=Pb(yn),wz=Pb(DC),_z=Pb(Jv);function OR(d){return Mb(d)?Zv(li(d)):J6(d)}function Sz(d){return function(g){return d==null?n:Oa(d,g)}}var Cz=AE(),Ez=AE(!0);function Qb(){return[]}function Jb(){return!1}function Rz(){return{}}function Pz(){return""}function Oz(){return!0}function $z(d,g){if(d=pt(d),d<1||d>Z)return[];var x=V,P=or(d,V);g=Je(g),d-=V;for(var k=nb(P,g);++x<d;)g(x);return k}function Tz(d){return ut(d)?yn(d,li):qr(d)?[d]:Rr(YE(Ut(d)))}function Dz(d){var g=++V7;return Ut(d)+g}var Az=Xh(function(d,g){return d+g},0),kz=Ob("ceil"),Mz=Xh(function(d,g){return d/g},1),Iz=Ob("floor");function Nz(d){return d&&d.length?Hh(d,$r,hb):n}function Lz(d,g){return d&&d.length?Hh(d,Je(g,2),hb):n}function Fz(d){return MC(d,$r)}function jz(d,g){return MC(d,Je(g,2))}function zz(d){return d&&d.length?Hh(d,$r,vb):n}function Bz(d,g){return d&&d.length?Hh(d,Je(g,2),vb):n}var Vz=Xh(function(d,g){return d*g},1),Hz=Ob("round"),Wz=Xh(function(d,g){return d-g},0);function Uz(d){return d&&d.length?tb(d,$r):0}function qz(d,g){return d&&d.length?tb(d,Je(g,2)):0}return z.after=p8,z.ary=iR,z.assign=tj,z.assignIn=yR,z.assignInWith=cp,z.assignWith=nj,z.at=rj,z.before=sR,z.bind=zb,z.bindAll=lz,z.bindKey=aR,z.castArray=R8,z.chain=nR,z.chunk=I9,z.compact=N9,z.concat=L9,z.cond=cz,z.conforms=uz,z.constant=Gb,z.countBy=U4,z.create=oj,z.curry=lR,z.curryRight=cR,z.debounce=uR,z.defaults=ij,z.defaultsDeep=sj,z.defer=g8,z.delay=m8,z.difference=F9,z.differenceBy=j9,z.differenceWith=z9,z.drop=B9,z.dropRight=V9,z.dropRightWhile=H9,z.dropWhile=W9,z.fill=U9,z.filter=G4,z.flatMap=X4,z.flatMapDeep=Q4,z.flatMapDepth=J4,z.flatten=JE,z.flattenDeep=q9,z.flattenDepth=G9,z.flip=v8,z.flow=fz,z.flowRight=hz,z.fromPairs=Y9,z.functions=hj,z.functionsIn=pj,z.groupBy=Z4,z.initial=X9,z.intersection=Q9,z.intersectionBy=J9,z.intersectionWith=Z9,z.invert=mj,z.invertBy=vj,z.invokeMap=t8,z.iteratee=Yb,z.keyBy=n8,z.keys=Hn,z.keysIn=Or,z.map=rp,z.mapKeys=yj,z.mapValues=xj,z.matches=pz,z.matchesProperty=gz,z.memoize=ip,z.merge=wj,z.mergeWith=xR,z.method=mz,z.methodOf=vz,z.mixin=Kb,z.negate=sp,z.nthArg=yz,z.omit=_j,z.omitBy=Sj,z.once=b8,z.orderBy=r8,z.over=xz,z.overArgs=y8,z.overEvery=wz,z.overSome=_z,z.partial=Bb,z.partialRight=dR,z.partition=o8,z.pick=Cj,z.pickBy=wR,z.property=OR,z.propertyOf=Sz,z.pull=r4,z.pullAll=eR,z.pullAllBy=o4,z.pullAllWith=i4,z.pullAt=s4,z.range=Cz,z.rangeRight=Ez,z.rearg=x8,z.reject=a8,z.remove=a4,z.rest=w8,z.reverse=Fb,z.sampleSize=c8,z.set=Rj,z.setWith=Pj,z.shuffle=u8,z.slice=l4,z.sortBy=h8,z.sortedUniq=g4,z.sortedUniqBy=m4,z.split=Xj,z.spread=_8,z.tail=v4,z.take=b4,z.takeRight=y4,z.takeRightWhile=x4,z.takeWhile=w4,z.tap=N4,z.throttle=S8,z.thru=np,z.toArray=mR,z.toPairs=_R,z.toPairsIn=SR,z.toPath=Tz,z.toPlainObject=bR,z.transform=Oj,z.unary=C8,z.union=_4,z.unionBy=S4,z.unionWith=C4,z.uniq=E4,z.uniqBy=R4,z.uniqWith=P4,z.unset=$j,z.unzip=jb,z.unzipWith=tR,z.update=Tj,z.updateWith=Dj,z.values=Zl,z.valuesIn=Aj,z.without=O4,z.words=RR,z.wrap=E8,z.xor=$4,z.xorBy=T4,z.xorWith=D4,z.zip=A4,z.zipObject=k4,z.zipObjectDeep=M4,z.zipWith=I4,z.entries=_R,z.entriesIn=SR,z.extend=yR,z.extendWith=cp,Kb(z,z),z.add=Az,z.attempt=PR,z.camelCase=Nj,z.capitalize=CR,z.ceil=kz,z.clamp=kj,z.clone=P8,z.cloneDeep=$8,z.cloneDeepWith=T8,z.cloneWith=O8,z.conformsTo=D8,z.deburr=ER,z.defaultTo=dz,z.divide=Mz,z.endsWith=Lj,z.eq=Vo,z.escape=Fj,z.escapeRegExp=jj,z.every=q4,z.find=Y4,z.findIndex=XE,z.findKey=aj,z.findLast=K4,z.findLastIndex=QE,z.findLastKey=lj,z.floor=Iz,z.forEach=rR,z.forEachRight=oR,z.forIn=cj,z.forInRight=uj,z.forOwn=dj,z.forOwnRight=fj,z.get=Wb,z.gt=A8,z.gte=k8,z.has=gj,z.hasIn=Ub,z.head=ZE,z.identity=$r,z.includes=e8,z.indexOf=K9,z.inRange=Mj,z.invoke=bj,z.isArguments=Da,z.isArray=ut,z.isArrayBuffer=M8,z.isArrayLike=Pr,z.isArrayLikeObject=$n,z.isBoolean=I8,z.isBuffer=Ds,z.isDate=N8,z.isElement=L8,z.isEmpty=F8,z.isEqual=j8,z.isEqualWith=z8,z.isError=Vb,z.isFinite=B8,z.isFunction=Hi,z.isInteger=fR,z.isLength=ap,z.isMap=hR,z.isMatch=V8,z.isMatchWith=H8,z.isNaN=W8,z.isNative=U8,z.isNil=G8,z.isNull=q8,z.isNumber=pR,z.isObject=wn,z.isObjectLike=Cn,z.isPlainObject=Wu,z.isRegExp=Hb,z.isSafeInteger=Y8,z.isSet=gR,z.isString=lp,z.isSymbol=qr,z.isTypedArray=Jl,z.isUndefined=K8,z.isWeakMap=X8,z.isWeakSet=Q8,z.join=e4,z.kebabCase=zj,z.last=Co,z.lastIndexOf=t4,z.lowerCase=Bj,z.lowerFirst=Vj,z.lt=J8,z.lte=Z8,z.max=Nz,z.maxBy=Lz,z.mean=Fz,z.meanBy=jz,z.min=zz,z.minBy=Bz,z.stubArray=Qb,z.stubFalse=Jb,z.stubObject=Rz,z.stubString=Pz,z.stubTrue=Oz,z.multiply=Vz,z.nth=n4,z.noConflict=bz,z.noop=Xb,z.now=op,z.pad=Hj,z.padEnd=Wj,z.padStart=Uj,z.parseInt=qj,z.random=Ij,z.reduce=i8,z.reduceRight=s8,z.repeat=Gj,z.replace=Yj,z.result=Ej,z.round=Hz,z.runInContext=se,z.sample=l8,z.size=d8,z.snakeCase=Kj,z.some=f8,z.sortedIndex=c4,z.sortedIndexBy=u4,z.sortedIndexOf=d4,z.sortedLastIndex=f4,z.sortedLastIndexBy=h4,z.sortedLastIndexOf=p4,z.startCase=Qj,z.startsWith=Jj,z.subtract=Wz,z.sum=Uz,z.sumBy=qz,z.template=Zj,z.times=$z,z.toFinite=Wi,z.toInteger=pt,z.toLength=vR,z.toLower=ez,z.toNumber=Eo,z.toSafeInteger=ej,z.toString=Ut,z.toUpper=tz,z.trim=nz,z.trimEnd=rz,z.trimStart=oz,z.truncate=iz,z.unescape=sz,z.uniqueId=Dz,z.upperCase=az,z.upperFirst=qb,z.each=rR,z.eachRight=oR,z.first=ZE,Kb(z,function(){var d={};return si(z,function(g,x){Qt.call(z.prototype,x)||(d[x]=g)}),d}(),{chain:!1}),z.VERSION=r,yo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){z[d].placeholder=z}),yo(["drop","take"],function(d,g){kt.prototype[d]=function(x){x=x===n?1:Nn(pt(x),0);var P=this.__filtered__&&!g?new kt(this):this.clone();return P.__filtered__?P.__takeCount__=or(x,P.__takeCount__):P.__views__.push({size:or(x,V),type:d+(P.__dir__<0?"Right":"")}),P},kt.prototype[d+"Right"]=function(x){return this.reverse()[d](x).reverse()}}),yo(["filter","map","takeWhile"],function(d,g){var x=g+1,P=x==ee||x==te;kt.prototype[d]=function(k){var B=this.clone();return B.__iteratees__.push({iteratee:Je(k,3),type:x}),B.__filtered__=B.__filtered__||P,B}}),yo(["head","last"],function(d,g){var x="take"+(g?"Right":"");kt.prototype[d]=function(){return this[x](1).value()[0]}}),yo(["initial","tail"],function(d,g){var x="drop"+(g?"":"Right");kt.prototype[d]=function(){return this.__filtered__?new kt(this):this[x](1)}}),kt.prototype.compact=function(){return this.filter($r)},kt.prototype.find=function(d){return this.filter(d).head()},kt.prototype.findLast=function(d){return this.reverse().find(d)},kt.prototype.invokeMap=St(function(d,g){return typeof d=="function"?new kt(this):this.map(function(x){return Fu(x,d,g)})}),kt.prototype.reject=function(d){return this.filter(sp(Je(d)))},kt.prototype.slice=function(d,g){d=pt(d);var x=this;return x.__filtered__&&(d>0||g<0)?new kt(x):(d<0?x=x.takeRight(-d):d&&(x=x.drop(d)),g!==n&&(g=pt(g),x=g<0?x.dropRight(-g):x.take(g-d)),x)},kt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},kt.prototype.toArray=function(){return this.take(V)},si(kt.prototype,function(d,g){var x=/^(?:filter|find|map|reject)|While$/.test(g),P=/^(?:head|last)$/.test(g),k=z[P?"take"+(g=="last"?"Right":""):g],B=P||/^find/.test(g);k&&(z.prototype[g]=function(){var q=this.__wrapped__,ne=P?[1]:arguments,le=q instanceof kt,xe=ne[0],we=le||ut(q),Re=function(Ot){var Mt=k.apply(z,Cs([Ot],ne));return P&&je?Mt[0]:Mt};we&&x&&typeof xe=="function"&&xe.length!=1&&(le=we=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=B&&!je,yt=le&&!Ye;if(!B&&we){q=yt?q:new kt(this);var tt=d.apply(q,ne);return tt.__actions__.push({func:np,args:[Re],thisArg:n}),new wo(tt,je)}return et&&yt?d.apply(this,ne):(tt=this.thru(Re),et?P?tt.value()[0]:tt.value():tt)})}),yo(["pop","push","shift","sort","splice","unshift"],function(d){var g=Oh[d],x=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",P=/^(?:pop|shift)$/.test(d);z.prototype[d]=function(){var k=arguments;if(P&&!this.__chain__){var B=this.value();return g.apply(ut(B)?B:[],k)}return this[x](function(q){return g.apply(ut(q)?q:[],k)})}}),si(kt.prototype,function(d,g){var x=z[g];if(x){var P=x.name+"";Qt.call(Gl,P)||(Gl[P]=[]),Gl[P].push({name:g,func:x})}}),Gl[Kh(n,y).name]=[{name:"wrapper",func:n}],kt.prototype.clone=s6,kt.prototype.reverse=a6,kt.prototype.value=l6,z.prototype.at=L4,z.prototype.chain=F4,z.prototype.commit=j4,z.prototype.next=z4,z.prototype.plant=V4,z.prototype.reverse=H4,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=W4,z.prototype.first=z.prototype.head,Du&&(z.prototype[Du]=B4),z},Wl=j7();Sa?((Sa.exports=Wl)._=Wl,Yv._=Wl):Gn._=Wl}).call(qs)})(jg,jg.exports);var bc=jg.exports;const ll=Rl(bc);function YR({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};return t||(t={}),cw.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,f)=>Math.max(u,f.y+f.h),0);a.y=a.y===0?0:c,t[l].push(a)}),t}function KR(e,t){t&&cw.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const Pe=rD()(uD((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Lg},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:Lg},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})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(c=>c.id===n);o!==void 0&&o>-1&&((s=r.dashboard.sheets)==null||s.splice(o,1),r.selectedSheetId=(l=(a=r.dashboard.sheets)==null?void 0:a[0])==null?void 0:l.id)})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{cw.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})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(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===o.selectedSheetId);i&&bc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.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;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(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===o.selectedSheetId);i&&bc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.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(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(h=>h.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.data=o)})})},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;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue: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];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);YR({id:n.id,layouts:o==null?void 0:o.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);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);KR(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);p>-1&&((h=a.cards)==null||h.splice(p,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))}})},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(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0;const h=0;o==="start"&&(f=0),YR({id:r.id,layouts:s.layouts,minH:10,x:h,y: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(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),KR(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;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.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;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),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.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}))},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)=>{yV({card:n,dataPoint:r,set:e,get:t})}}}))),wr=()=>Pe(e=>e.actions),xV={theme:"system",setTheme:()=>null},vD=m.createContext(xV);function wV({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.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 R.jsx(vD.Provider,{...r,value:s,children:e})}const bD=()=>{const e=m.useContext(vD);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var Uf=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(){}},tu=typeof window>"u"||"Deno"in window;function To(){}function _V(e,t){return typeof e=="function"?e(t):e}function ax(e){return typeof e=="number"&&e>=0&&e!==1/0}function yD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function XR(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(!Gd(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function QR(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(qd(t.options.mutationKey)!==qd(i))return!1}else if(!Gd(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)||qd)(e)}function qd(e){return JSON.stringify(e,(t,n)=>cx(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Gd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Gd(e[n],t[n])):!1}function xD(e,t){if(e===t)return e;const n=JR(e)&&JR(t);if(n||cx(e)&&cx(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=xD(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function lx(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function JR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cx(e){if(!ZR(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!ZR(n)||!n.hasOwnProperty("isPrototypeOf"))}function ZR(e){return Object.prototype.toString.call(e)==="[object Object]"}function SV(e){return new Promise(t=>{setTimeout(t,e)})}function ux(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?xD(e,t):t}function CV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function EV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var el,Gs,Nc,jT,RV=(jT=class extends Uf{constructor(){super();Xe(this,el,void 0);Xe(this,Gs,void 0);Xe(this,Nc,void 0);Ve(this,Nc,t=>{if(!tu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ae(this,Gs)||this.setEventListener(ae(this,Nc))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,Gs))==null||t.call(this),Ve(this,Gs,void 0))}setEventListener(t){var n;Ve(this,Nc,t),(n=ae(this,Gs))==null||n.call(this),Ve(this,Gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ae(this,el)!==t&&(Ve(this,el,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof ae(this,el)=="boolean"?ae(this,el):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},el=new WeakMap,Gs=new WeakMap,Nc=new WeakMap,jT),zg=new RV,Lc,Ys,Fc,zT,PV=(zT=class extends Uf{constructor(){super();Xe(this,Lc,!0);Xe(this,Ys,void 0);Xe(this,Fc,void 0);Ve(this,Fc,t=>{if(!tu&&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(){ae(this,Ys)||this.setEventListener(ae(this,Fc))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,Ys))==null||t.call(this),Ve(this,Ys,void 0))}setEventListener(t){var n;Ve(this,Fc,t),(n=ae(this,Ys))==null||n.call(this),Ve(this,Ys,t(this.setOnline.bind(this)))}setOnline(t){ae(this,Lc)!==t&&(Ve(this,Lc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ae(this,Lc)}},Lc=new WeakMap,Ys=new WeakMap,Fc=new WeakMap,zT),Bg=new PV;function OV(e){return Math.min(1e3*2**e,3e4)}function Dm(e){return(e??"online")==="online"?Bg.isOnline():!0}var wD=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function a0(e){return e instanceof wD}function _D(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((w,y)=>{i=w,s=y}),l=w=>{var y;r||(p(new wD(w)),(y=e.abort)==null||y.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!zg.isFocused()||e.networkMode!=="always"&&!Bg.isOnline(),h=w=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,w),o==null||o(),i(w))},p=w=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,w),o==null||o(),s(w))},v=()=>new Promise(w=>{var y;o=_=>{const S=r||!f();return S&&w(_),S},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;o=void 0,r||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(r)return;let w;try{w=e.fn()}catch(y){w=Promise.reject(y)}Promise.resolve(w).then(h).catch(y=>{var O;if(r)return;const _=e.retry??(tu?0:3),S=e.retryDelay??OV,E=typeof S=="function"?S(n,y):S,C=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!C){p(y);return}n++,(O=e.onFail)==null||O.call(e,n,y),SV(E).then(()=>{if(f())return v()}).then(()=>{t?p(y):b()})})};return Dm(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function $V(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let p;t++;try{p=h()}finally{t--,t||c()}return p},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...p)=>{a(()=>{h(...p)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var Qn=$V(),tl,BT,SD=(BT=class{constructor(){Xe(this,tl,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ax(this.gcTime)&&Ve(this,tl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tu?1/0:5*60*1e3))}clearGcTimeout(){ae(this,tl)&&(clearTimeout(ae(this,tl)),Ve(this,tl,void 0))}},tl=new WeakMap,BT),jc,zc,Po,Ks,Oo,Wn,Af,nl,Bc,xg,Yo,Ki,VT,TV=(VT=class extends SD{constructor(t){super();Xe(this,Bc);Xe(this,Yo);Xe(this,jc,void 0);Xe(this,zc,void 0);Xe(this,Po,void 0);Xe(this,Ks,void 0);Xe(this,Oo,void 0);Xe(this,Wn,void 0);Xe(this,Af,void 0);Xe(this,nl,void 0);Ve(this,nl,!1),Ve(this,Af,t.defaultOptions),Ct(this,Bc,xg).call(this,t.options),Ve(this,Wn,[]),Ve(this,Po,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,jc,t.state||DV(this.options)),this.state=ae(this,jc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ae(this,Wn).length&&this.state.fetchStatus==="idle"&&ae(this,Po).remove(this)}setData(t,n){const r=ux(this.state.data,t,this.options);return Ct(this,Yo,Ki).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ct(this,Yo,Ki).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=ae(this,Ks);return(r=ae(this,Oo))==null||r.cancel(t),n?n.then(To).catch(To):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ae(this,jc))}isActive(){return ae(this,Wn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ae(this,Wn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!yD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=ae(this,Wn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Oo))==null||n.continue()}onOnline(){var n;const t=ae(this,Wn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Oo))==null||n.continue()}addObserver(t){ae(this,Wn).includes(t)||(ae(this,Wn).push(t),this.clearGcTimeout(),ae(this,Po).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){ae(this,Wn).includes(t)&&(Ve(this,Wn,ae(this,Wn).filter(n=>n!==t)),ae(this,Wn).length||(ae(this,Oo)&&(ae(this,nl)?ae(this,Oo).cancel({revert:!0}):ae(this,Oo).cancelRetry()),this.scheduleGc()),ae(this,Po).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return ae(this,Wn).length}invalidate(){this.state.isInvalidated||Ct(this,Yo,Ki).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ae(this,Ks))return(c=ae(this,Oo))==null||c.continueRetry(),ae(this,Ks)}if(t&&Ct(this,Bc,xg).call(this,t),!this.options.queryFn){const p=ae(this,Wn).find(v=>v.options.queryFn);p&&Ct(this,Bc,xg).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ve(this,nl,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,nl,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,zc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Ct(this,Yo,Ki).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=p=>{var v,b,w,y;a0(p)&&p.silent||Ct(this,Yo,Ki).call(this,{type:"error",error:p}),a0(p)||((b=(v=ae(this,Po).config).onError)==null||b.call(v,p,this),(y=(w=ae(this,Po).config).onSettled)==null||y.call(w,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Oo,_D({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,b,w,y;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(b=(v=ae(this,Po).config).onSuccess)==null||b.call(v,p,this),(y=(w=ae(this,Po).config).onSettled)==null||y.call(w,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{Ct(this,Yo,Ki).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{Ct(this,Yo,Ki).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Yo,Ki).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Ks,ae(this,Oo).promise),ae(this,Ks)}},jc=new WeakMap,zc=new WeakMap,Po=new WeakMap,Ks=new WeakMap,Oo=new WeakMap,Wn=new WeakMap,Af=new WeakMap,nl=new WeakMap,Bc=new WeakSet,xg=function(t){this.options={...ae(this,Af),...t},this.updateGcTime(this.options.gcTime)},Yo=new WeakSet,Ki=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Dm(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return a0(o)&&o.revert&&ae(this,zc)?{...ae(this,zc),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),Qn.batch(()=>{ae(this,Wn).forEach(r=>{r.onQueryUpdate()}),ae(this,Po).notify({query:this,type:"updated",action:t})})},VT);function DV(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var hi,HT,CD=(HT=class extends Uf{constructor(t={}){super();Xe(this,hi,void 0);this.config=t,Ve(this,hi,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 TV({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ae(this,hi).has(t.queryHash)||(ae(this,hi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ae(this,hi).get(t.queryHash);n&&(t.destroy(),n===t&&ae(this,hi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ae(this,hi).get(t)}getAll(){return[...ae(this,hi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>XR(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},hi=new WeakMap,HT),pi,kf,Zr,Vc,gi,zs,WT,AV=(WT=class extends SD{constructor(t){super();Xe(this,gi);Xe(this,pi,void 0);Xe(this,kf,void 0);Xe(this,Zr,void 0);Xe(this,Vc,void 0);this.mutationId=t.mutationId,Ve(this,kf,t.defaultOptions),Ve(this,Zr,t.mutationCache),Ve(this,pi,[]),this.state=t.state||kV(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...ae(this,kf),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ae(this,pi).includes(t)||(ae(this,pi).push(t),this.clearGcTimeout(),ae(this,Zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,pi,ae(this,pi).filter(n=>n!==t)),this.scheduleGc(),ae(this,Zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ae(this,pi).length||(this.state.status==="pending"?this.scheduleGc():ae(this,Zr).remove(this))}continue(){var t;return((t=ae(this,Vc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,h,p,v,b,w,y,_,S,E,C,O,T;const n=()=>(Ve(this,Vc,_D({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,N)=>{Ct(this,gi,zs).call(this,{type:"failed",failureCount:M,error:N})},onPause:()=>{Ct(this,gi,zs).call(this,{type:"pause"})},onContinue:()=>{Ct(this,gi,zs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ae(this,Vc).promise),r=this.state.status==="pending";try{if(!r){Ct(this,gi,zs).call(this,{type:"pending",variables:t}),await((i=(o=ae(this,Zr).config).onMutate)==null?void 0:i.call(o,t,this));const N=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));N!==this.state.context&&Ct(this,gi,zs).call(this,{type:"pending",context:N,variables:t})}const M=await n();return await((c=(l=ae(this,Zr).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,M,t,this.state.context)),await((p=(h=ae(this,Zr).config).onSettled)==null?void 0:p.call(h,M,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,M,null,t,this.state.context)),Ct(this,gi,zs).call(this,{type:"success",data:M}),M}catch(M){try{throw await((y=(w=ae(this,Zr).config).onError)==null?void 0:y.call(w,M,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,M,t,this.state.context)),await((C=(E=ae(this,Zr).config).onSettled)==null?void 0:C.call(E,void 0,M,this.state.variables,this.state.context,this)),await((T=(O=this.options).onSettled)==null?void 0:T.call(O,void 0,M,t,this.state.context)),M}finally{Ct(this,gi,zs).call(this,{type:"error",error:M})}}}},pi=new WeakMap,kf=new WeakMap,Zr=new WeakMap,Vc=new WeakMap,gi=new WeakSet,zs=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:!Dm(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qn.batch(()=>{ae(this,pi).forEach(r=>{r.onMutationUpdate(t)}),ae(this,Zr).notify({mutation:this,type:"updated",action:t})})},WT);function kV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $o,Mf,rl,UT,MV=(UT=class extends Uf{constructor(t={}){super();Xe(this,$o,void 0);Xe(this,Mf,void 0);Xe(this,rl,void 0);this.config=t,Ve(this,$o,[]),Ve(this,Mf,0)}build(t,n,r){const o=new AV({mutationCache:this,mutationId:++up(this,Mf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ae(this,$o).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,$o,ae(this,$o).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Qn.batch(()=>{ae(this,$o).forEach(t=>{this.remove(t)})})}getAll(){return ae(this,$o)}find(t){const n={exact:!0,...t};return ae(this,$o).find(r=>QR(n,r))}findAll(t={}){return ae(this,$o).filter(n=>QR(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,rl,(ae(this,rl)??Promise.resolve()).then(()=>{const t=ae(this,$o).filter(n=>n.state.isPaused);return Qn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(To)),Promise.resolve()))}).then(()=>{Ve(this,rl,void 0)})),ae(this,rl)}},$o=new WeakMap,Mf=new WeakMap,rl=new WeakMap,UT);function IV(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,w,y,_;const o=t.options,i=(w=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:w.direction,s=((y=t.state.data)==null?void 0:y.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(S,E,C)=>{if(c)return Promise.reject();if(E==null&&S.pages.length)return Promise.resolve(S);const O={queryKey:t.queryKey,pageParam:E,direction:C?"backward":"forward",meta:t.options.meta};u(O);const T=await f(O),{maxPages:M}=t.options,N=C?EV:CV;return{pages:N(S.pages,T,M),pageParams:N(S.pageParams,E,M)}};let p;if(i&&s.length){const S=i==="backward",E=S?NV:eP,C={pages:s,pageParams:a},O=E(o,C);p=await h(C,O,S)}else{p=await h(l,a[0]??o.initialPageParam);const S=e??s.length;for(let E=1;E<S;E++){const C=eP(o,p);p=await h(p,C)}}return p};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function eP(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function NV(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Ln,Xs,Qs,Hc,Wc,Js,Uc,qc,qT,LV=(qT=class{constructor(e={}){Xe(this,Ln,void 0);Xe(this,Xs,void 0);Xe(this,Qs,void 0);Xe(this,Hc,void 0);Xe(this,Wc,void 0);Xe(this,Js,void 0);Xe(this,Uc,void 0);Xe(this,qc,void 0);Ve(this,Ln,e.queryCache||new CD),Ve(this,Xs,e.mutationCache||new MV),Ve(this,Qs,e.defaultOptions||{}),Ve(this,Hc,new Map),Ve(this,Wc,new Map),Ve(this,Js,0)}mount(){up(this,Js)._++,ae(this,Js)===1&&(Ve(this,Uc,zg.subscribe(()=>{zg.isFocused()&&(this.resumePausedMutations(),ae(this,Ln).onFocus())})),Ve(this,qc,Bg.subscribe(()=>{Bg.isOnline()&&(this.resumePausedMutations(),ae(this,Ln).onOnline())})))}unmount(){var e,t;up(this,Js)._--,ae(this,Js)===0&&((e=ae(this,Uc))==null||e.call(this),Ve(this,Uc,void 0),(t=ae(this,qc))==null||t.call(this),Ve(this,qc,void 0))}isFetching(e){return ae(this,Ln).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ae(this,Xs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=ae(this,Ln).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=ae(this,Ln).find({queryKey:e}),o=r==null?void 0:r.state.data,i=_V(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return ae(this,Ln).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=ae(this,Ln).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=ae(this,Ln);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ae(this,Ln),r={type:"active",...e};return Qn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Qn.batch(()=>ae(this,Ln).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(To).catch(To)}invalidateQueries(e={},t={}){return Qn.batch(()=>{if(ae(this,Ln).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Qn.batch(()=>ae(this,Ln).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(To)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(To)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=ae(this,Ln).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(To).catch(To)}fetchInfiniteQuery(e){return e.behavior=IV(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(To).catch(To)}resumePausedMutations(){return ae(this,Xs).resumePausedMutations()}getQueryCache(){return ae(this,Ln)}getMutationCache(){return ae(this,Xs)}getDefaultOptions(){return ae(this,Qs)}setDefaultOptions(e){Ve(this,Qs,e)}setQueryDefaults(e,t){ae(this,Hc).set(qd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ae(this,Hc).values()];let n={};return t.forEach(r=>{Gd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ae(this,Wc).set(qd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ae(this,Wc).values()];let n={};return t.forEach(r=>{Gd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...ae(this,Qs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=fw(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ae(this,Qs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ae(this,Ln).clear(),ae(this,Xs).clear()}},Ln=new WeakMap,Xs=new WeakMap,Qs=new WeakMap,Hc=new WeakMap,Wc=new WeakMap,Js=new WeakMap,Uc=new WeakMap,qc=new WeakMap,qT),Ir,fn,If,vr,ol,Gc,mi,Nf,Yc,Kc,il,sl,Zs,Xc,al,vd,Lf,dx,Ff,fx,jf,hx,zf,px,Bf,gx,Vf,mx,Hf,vx,Em,ED,GT,FV=(GT=class extends Uf{constructor(t,n){super();Xe(this,al);Xe(this,Lf);Xe(this,Ff);Xe(this,jf);Xe(this,zf);Xe(this,Bf);Xe(this,Vf);Xe(this,Hf);Xe(this,Em);Xe(this,Ir,void 0);Xe(this,fn,void 0);Xe(this,If,void 0);Xe(this,vr,void 0);Xe(this,ol,void 0);Xe(this,Gc,void 0);Xe(this,mi,void 0);Xe(this,Nf,void 0);Xe(this,Yc,void 0);Xe(this,Kc,void 0);Xe(this,il,void 0);Xe(this,sl,void 0);Xe(this,Zs,void 0);Xe(this,Xc,new Set);this.options=n,Ve(this,Ir,t),Ve(this,mi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ae(this,fn).addObserver(this),tP(ae(this,fn),this.options)?Ct(this,al,vd).call(this):this.updateResult(),Ct(this,zf,px).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bx(ae(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bx(ae(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,Bf,gx).call(this),Ct(this,Vf,mx).call(this),ae(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=ae(this,fn);if(this.options=ae(this,Ir).defaultQueryOptions(t),lx(r,this.options)||ae(this,Ir).getQueryCache().notify({type:"observerOptionsUpdated",query:ae(this,fn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Ct(this,Hf,vx).call(this);const i=this.hasListeners();i&&nP(ae(this,fn),o,this.options,r)&&Ct(this,al,vd).call(this),this.updateResult(n),i&&(ae(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ct(this,Lf,dx).call(this);const s=Ct(this,Ff,fx).call(this);i&&(ae(this,fn)!==o||this.options.enabled!==r.enabled||s!==ae(this,Zs))&&Ct(this,jf,hx).call(this,s)}getOptimisticResult(t){const n=ae(this,Ir).getQueryCache().build(ae(this,Ir),t),r=this.createResult(n,t);return zV(this,r)&&(Ve(this,vr,r),Ve(this,Gc,this.options),Ve(this,ol,ae(this,fn).state)),r}getCurrentResult(){return ae(this,vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(ae(this,Xc).add(r),t[r])})}),n}getCurrentQuery(){return ae(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ae(this,Ir).defaultQueryOptions(t),r=ae(this,Ir).getQueryCache().build(ae(this,Ir),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ct(this,al,vd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ae(this,vr)))}createResult(t,n){var O;const r=ae(this,fn),o=this.options,i=ae(this,vr),s=ae(this,ol),a=ae(this,Gc),c=t!==r?t.state:ae(this,If),{state:u}=t;let{error:f,errorUpdatedAt:h,fetchStatus:p,status:v}=u,b=!1,w;if(n._optimisticResults){const T=this.hasListeners(),M=!T&&tP(t,n),N=T&&nP(t,r,n,o);(M||N)&&(p=Dm(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===ae(this,Nf))w=ae(this,Yc);else try{Ve(this,Nf,n.select),w=n.select(u.data),w=ux(i==null?void 0:i.data,w,n),Ve(this,Yc,w),Ve(this,mi,null)}catch(T){Ve(this,mi,T)}else w=u.data;if(typeof n.placeholderData<"u"&&typeof w>"u"&&v==="pending"){let T;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=i.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((O=ae(this,Kc))==null?void 0:O.state.data,ae(this,Kc)):n.placeholderData,n.select&&typeof T<"u")try{T=n.select(T),Ve(this,mi,null)}catch(M){Ve(this,mi,M)}typeof T<"u"&&(v="success",w=ux(i==null?void 0:i.data,T,n),b=!0)}ae(this,mi)&&(f=ae(this,mi),w=ae(this,Yc),h=Date.now(),v="error");const y=p==="fetching",_=v==="pending",S=v==="error",E=_&&y;return{status:v,fetchStatus:p,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:E,isLoading:E,data:w,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:b,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:hw(t,n),refetch:this.refetch}}updateResult(t){const n=ae(this,vr),r=this.createResult(ae(this,fn),this.options);if(Ve(this,ol,ae(this,fn).state),Ve(this,Gc,this.options),ae(this,ol).data!==void 0&&Ve(this,Kc,ae(this,fn)),lx(r,n))return;Ve(this,vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ae(this,Xc).size)return!0;const l=new Set(a??ae(this,Xc));return this.options.throwOnError&&l.add("error"),Object.keys(ae(this,vr)).some(c=>{const u=c;return ae(this,vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ct(this,Em,ED).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,zf,px).call(this)}},Ir=new WeakMap,fn=new WeakMap,If=new WeakMap,vr=new WeakMap,ol=new WeakMap,Gc=new WeakMap,mi=new WeakMap,Nf=new WeakMap,Yc=new WeakMap,Kc=new WeakMap,il=new WeakMap,sl=new WeakMap,Zs=new WeakMap,Xc=new WeakMap,al=new WeakSet,vd=function(t){Ct(this,Hf,vx).call(this);let n=ae(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(To)),n},Lf=new WeakSet,dx=function(){if(Ct(this,Bf,gx).call(this),tu||ae(this,vr).isStale||!ax(this.options.staleTime))return;const n=yD(ae(this,vr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,il,setTimeout(()=>{ae(this,vr).isStale||this.updateResult()},n))},Ff=new WeakSet,fx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ae(this,fn)):this.options.refetchInterval)??!1},jf=new WeakSet,hx=function(t){Ct(this,Vf,mx).call(this),Ve(this,Zs,t),!(tu||this.options.enabled===!1||!ax(ae(this,Zs))||ae(this,Zs)===0)&&Ve(this,sl,setInterval(()=>{(this.options.refetchIntervalInBackground||zg.isFocused())&&Ct(this,al,vd).call(this)},ae(this,Zs)))},zf=new WeakSet,px=function(){Ct(this,Lf,dx).call(this),Ct(this,jf,hx).call(this,Ct(this,Ff,fx).call(this))},Bf=new WeakSet,gx=function(){ae(this,il)&&(clearTimeout(ae(this,il)),Ve(this,il,void 0))},Vf=new WeakSet,mx=function(){ae(this,sl)&&(clearInterval(ae(this,sl)),Ve(this,sl,void 0))},Hf=new WeakSet,vx=function(){const t=ae(this,Ir).getQueryCache().build(ae(this,Ir),this.options);if(t===ae(this,fn))return;const n=ae(this,fn);Ve(this,fn,t),Ve(this,If,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Em=new WeakSet,ED=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ae(this,vr))}),ae(this,Ir).getQueryCache().notify({query:ae(this,fn),type:"observerResultsUpdated"})})},GT);function jV(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function tP(e,t){return jV(e,t)||e.state.dataUpdatedAt>0&&bx(e,t,t.refetchOnMount)}function bx(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&hw(e,t)}return!1}function nP(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&hw(e,n)}function hw(e,t){return e.isStaleByTime(t.staleTime)}function zV(e,t){return!lx(e.getCurrentResult(),t)}var RD=L.createContext(void 0),PD=e=>{const t=L.useContext(RD);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},BV=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.createElement(RD.Provider,{value:e},t)),OD=L.createContext(!1),VV=()=>L.useContext(OD);OD.Provider;function HV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var WV=L.createContext(HV()),UV=()=>L.useContext(WV);function qV(e,t){return typeof e=="function"?e(...t):!!e}var GV=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},YV=e=>{L.useEffect(()=>{e.clearReset()},[e])},KV=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&qV(n,[e.error,r]),XV=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},QV=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,JV=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ZV(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=PD(n),o=VV(),i=UV(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",XV(s),GV(s,i),YV(i);const[a]=L.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(L.useSyncExternalStore(L.useCallback(c=>{const u=o?()=>{}:a.subscribe(Qn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),L.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),QV(s,l))throw JV(s,a,i);if(KV({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function qf(e,t){return ZV(e,FV,t)}function $D({children:e}){const{setIsSessionExpired:t}=wr(),n=new LV({queryCache:new CD({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return R.jsx(BV,{client:n,children:e})}const vu=m.forwardRef(({children:e,className:t,...n},r)=>R.jsx("div",{className:_e("semaphor-scope",t),ref:r,...n,children:e})),eH={id:"",authToken:void 0},TD=m.createContext(eH),DD=({children:e,dashboardProps:t})=>R.jsx($D,{children:R.jsx(TD.Provider,{value:t,children:R.jsx(vu,{style:{height:"100%"},children:e})})});function Oi(){const e=m.useContext(TD);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function tH(){const{authToken:e}=Oi(),t=Pe(s=>s.selectedLensId),{data:n,isLoading:r,isFetching:o,isError:i}=qf({queryKey:["dashboard",t,e==null?void 0:e.accessToken],queryFn:()=>jB(e==null?void 0:e.accessToken,{lensId:t})});return{data:n,isLoading:r,isFetching:o,isError:i}}function AD(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function rP(e,t){const n=AD(e);return n==="dark"?ll.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function nH({customStyle:e,currentTheme:t,onSave:n,onEvent:r}){const{authToken:o}=Oi(),i=Pe(D=>D.selectedLensId),{data:s,isLoading:a,isFetching:l,isError:c}=tH(),{theme:u,setTheme:f}=bD(),h=Pe(D=>D.dashboard.globalStyle),{setDashboard:p,setDashboardWithFilterValues:v,setSelectedSheetId:b,setStyle:w,setOnSaveFunction:y,setLenses:_,setSelectedLensId:S,setInitStore:E}=Pe(D=>D.actions);Pe(D=>D.actions.setCustomCards);const C=Pe(D=>D.actions.setFilterValues),O=Pe(D=>D.actions.setThemeStyle),T=Pe(D=>D.actions.setDashboardTheme),M=Pe(D=>D.actions.setOnEvent);m.useEffect(()=>{o&&E()},[o,E]),m.useEffect(()=>{if(u){const D=AD(u);T(D)}},[u,T]),m.useEffect(()=>{t&&f(t)},[t,f]);const N=m.useCallback(()=>{const D=ll.cloneDeep(Lg),F=ll.merge(D,h);if(e){const j=ll.merge(F,e),K=rP(u,j);O(K),w(j)}else{const j=rP(u,F);O(j),w(Lg)}},[u,e,h,O,w]);return m.useEffect(()=>{s&&s.dashboard&&N()},[u,e,h,N,s]),m.useEffect(()=>{var ee;if(!s||!s.dashboard)return;const{dashboard:D,filterValues:F,defaultLensId:j,lenses:K}=s;v(D,F||[]),j&&S(j),K&&_(K),b((ee=D.sheets)==null?void 0:ee[0].id)},[s,p,b,C,i,_,v,S]),m.useEffect(()=>{n&&y(n),r&&M(r)},[n,y,r,M]),{isFetching:l,isLoading:a,isError:c}}function Am({className:e,...t}){return R.jsx("div",{className:_e("animate-pulse rounded-md bg-muted",e),...t})}const pw=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));pw.displayName="Card";const km=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));km.displayName="CardHeader";const bu=L.forwardRef(({className:e,...t},n)=>R.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight",e),...t}));bu.displayName="CardTitle";const gw=L.forwardRef(({className:e,...t},n)=>R.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));gw.displayName="CardDescription";const Mm=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("px-6 pt-0",e),...t}));Mm.displayName="CardContent";const mw=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));mw.displayName="CardFooter";function kD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,showAssistant:h,...p}){Pe(S=>S.selectedSheetId);const v=Pe(S=>S.themeStyle),b=Pe(S=>S.isSessionExpired),{isLoading:w,isError:y,isFetching:_}=nH({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return w||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?R.jsx(o,{message:"loading"}):R.jsx("div",{className:"flex items-center gap-3",children:R.jsx(Am,{className:"h-1 w-full dark:h-[2px]"})})):y?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),R.jsx(i,{})):R.jsx("div",{children:"Error"})):b?(r==null||r({type:"error",message:"Session Expired"}),R.jsx("div",{className:"flex h-full items-center justify-center",children:R.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[R.jsx(bu,{children:"Session Expired"}),R.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):R.jsx("div",{className:_e("flex h-full flex-col justify-between",v==null?void 0:v.dashboardPanel,e),role:"dashboard-panel",...p})}function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ce.apply(this,arguments)}function Me(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 tr(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:p,...v}=f,b=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:w},p)}function u(f,h){const p=(h==null?void 0:h[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,rH(o,...t)]}function rH(...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 f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function oH(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function fs(...e){return t=>e.forEach(n=>oH(n,t))}function _t(...e){return m.useCallback(fs(...e),e)}const yx=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(sH);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(xx,ce({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(xx,ce({},r,{ref:t}),n)});yx.displayName="Slot";const xx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...aH(r,n.props),ref:t?fs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});xx.displayName="SlotClone";const iH=({children:e})=>m.createElement(m.Fragment,null,e);function sH(e){return m.isValidElement(e)&&e.type===iH}function aH(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 Im(e){const t=e+"CollectionProvider",[n,r]=tr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:b}=p,w=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:y,collectionRef:w},b)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:b,children:w}=p,y=i(a,b),_=_t(v,y.collectionRef);return m.createElement(yx,{ref:_},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:b,children:w,...y}=p,_=m.useRef(null),S=_t(v,_),E=i(c,b);return m.useEffect(()=>(E.itemMap.set(_,{ref:_,...y}),()=>void E.itemMap.delete(_))),m.createElement(yx,{[u]:"",ref:S},w)});function h(p){const v=i(e+"CollectionConsumer",p);return m.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((E,C)=>y.indexOf(E.ref.current)-y.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},h,r]}const ur=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},lH=L.useId||(()=>{});let cH=0;function Zo(e){const[t,n]=L.useState(lH());return ur(()=>{e||n(r=>r??String(cH++))},[e]),e||(t?`radix-${t}`:"")}const MD=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(dH);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(wx,ce({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(wx,ce({},r,{ref:t}),n)});MD.displayName="Slot";const wx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...fH(r,n.props),ref:t?fs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});wx.displayName="SlotClone";const uH=({children:e})=>m.createElement(m.Fragment,null,e);function dH(e){return m.isValidElement(e)&&e.type===uH}function fH(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}}const hH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=hH.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?MD:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ce({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ID(e,t){e&&Cr.flushSync(()=>e.dispatchEvent(t))}function jn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function _r({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=pH({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=jn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function pH({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=jn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const gH=m.createContext(void 0);function Pl(e){const t=m.useContext(gH);return e||t||"ltr"}const l0="rovingFocusGroup.onEntryFocus",mH={bubbles:!1,cancelable:!0},vw="RovingFocusGroup",[_x,ND,vH]=Im(vw),[bH,yu]=tr(vw,[vH]),[yH,xH]=bH(vw),wH=m.forwardRef((e,t)=>m.createElement(_x.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(_x.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(_H,ce({},e,{ref:t}))))),_H=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),h=_t(t,f),p=Pl(i),[v=null,b]=_r({prop:s,defaultProp:a,onChange:l}),[w,y]=m.useState(!1),_=jn(c),S=ND(n),E=m.useRef(!1),[C,O]=m.useState(0);return m.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(l0,_),()=>T.removeEventListener(l0,_)},[_]),m.createElement(yH,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(T=>b(T),[b]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>O(T=>T-1),[])},m.createElement(Qe.div,ce({tabIndex:w||C===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{E.current=!0}),onFocus:Me(e.onFocus,T=>{const M=!E.current;if(T.target===T.currentTarget&&M&&!w){const N=new CustomEvent(l0,mH);if(T.currentTarget.dispatchEvent(N),!N.defaultPrevented){const D=S().filter(H=>H.focusable),F=D.find(H=>H.active),j=D.find(H=>H.id===v),ee=[F,j,...D].filter(Boolean).map(H=>H.ref.current);LD(ee)}}E.current=!1}),onBlur:Me(e.onBlur,()=>y(!1))})))}),SH="RovingFocusGroupItem",CH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Zo(),l=i||a,c=xH(SH,n),u=c.currentTabStopId===l,f=ND(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),m.createElement(_x.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,ce({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Me(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Me(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=PH(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let y=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const _=y.indexOf(v.currentTarget);y=c.loop?OH(y,_+1):y.slice(_+1)}setTimeout(()=>LD(y))}})})))}),EH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function PH(e,t,n){const r=RH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return EH[r]}function LD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function OH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const bw=wH,yw=CH;function $H(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const nr=e=>{const{present:t,children:n}=e,r=TH(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=_t(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};nr.displayName="Presence";function TH(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=$H(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=pp(r.current);i.current=a==="mounted"?c:"none"},[a]),ur(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=pp(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ur(()=>{if(t){const c=f=>{const p=pp(r.current).includes(f.animationName);f.target===t&&p&&Cr.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=pp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function pp(e){return(e==null?void 0:e.animationName)||"none"}const FD="Tabs",[DH,v1e]=tr(FD,[yu]),jD=yu(),[AH,xw]=DH(FD),kH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Pl(a),[f,h]=_r({prop:r,onChange:o,defaultProp:i});return m.createElement(AH,{scope:n,baseId:Zo(),value:f,onValueChange:h,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,ce({dir:u,"data-orientation":s},c,{ref:t})))}),MH="TabsList",IH=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=xw(MH,n),s=jD(n);return m.createElement(bw,ce({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,ce({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),NH="TabsTrigger",LH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=xw(NH,n),a=jD(n),l=zD(s.baseId,r),c=BD(s.baseId,r),u=r===s.value;return m.createElement(yw,ce({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,ce({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:Me(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Me(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),FH="TabsContent",jH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=xw(FH,n),l=zD(a.baseId,r),c=BD(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),m.createElement(nr,{present:o||u},({present:h})=>m.createElement(Qe.div,ce({"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:f.current?"0s":void 0}}),h&&i))});function zD(e,t){return`${e}-trigger-${t}`}function BD(e,t){return`${e}-content-${t}`}const zH=kH,VD=IH,HD=LH,WD=jH,ww=zH,Nm=L.forwardRef(({className:e,...t},n)=>R.jsx(VD,{ref:n,className:_e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Nm.displayName=VD.displayName;const Lm=L.forwardRef(({className:e,...t},n)=>R.jsx(HD,{ref:n,className:_e("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Lm.displayName=HD.displayName;const _w=L.forwardRef(({className:e,...t},n)=>R.jsx(WD,{ref:n,className:_e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));_w.displayName=WD.displayName;var UD={exports:{}},Gf={},Sx={exports:{}};(function(e,t){(function(n,r){r(t)})(qs,function(n){function r(Q){return function(ie,ve,Y,be,Se,$e,Te){return Q(ie,ve,Te)}}function o(Q){return function(ie,ve,Y,be){if(!ie||!ve||typeof ie!="object"||typeof ve!="object")return Q(ie,ve,Y,be);var Se=be.get(ie),$e=be.get(ve);if(Se&&$e)return Se===ve&&$e===ie;be.set(ie,ve),be.set(ve,ie);var Te=Q(ie,ve,Y,be);return be.delete(ie),be.delete(ve),Te}}function i(Q,J){var ie={};for(var ve in Q)ie[ve]=Q[ve];for(var ve in J)ie[ve]=J[ve];return ie}function s(Q){return Q.constructor===Object||Q.constructor==null}function a(Q){return typeof Q.then=="function"}function l(Q,J){return Q===J||Q!==Q&&J!==J}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",h="[object RegExp]",p="[object Map]",v="[object Number]",b="[object Object]",w="[object Set]",y="[object String]",_=Object.prototype.toString;function S(Q){var J=Q.areArraysEqual,ie=Q.areDatesEqual,ve=Q.areMapsEqual,Y=Q.areObjectsEqual,be=Q.areRegExpsEqual,Se=Q.areSetsEqual,$e=Q.createIsNestedEqual,Te=$e(Ue);function Ue(Be,Ie,Ke){if(Be===Ie)return!0;if(!Be||!Ie||typeof Be!="object"||typeof Ie!="object")return Be!==Be&&Ie!==Ie;if(s(Be)&&s(Ie))return Y(Be,Ie,Te,Ke);var lt=Array.isArray(Be),It=Array.isArray(Ie);if(lt||It)return lt===It&&J(Be,Ie,Te,Ke);var Dt=_.call(Be);return Dt!==_.call(Ie)?!1:Dt===f?ie(Be,Ie,Te,Ke):Dt===h?be(Be,Ie,Te,Ke):Dt===p?ve(Be,Ie,Te,Ke):Dt===w?Se(Be,Ie,Te,Ke):Dt===b||Dt===c?a(Be)||a(Ie)?!1:Y(Be,Ie,Te,Ke):Dt===u||Dt===v||Dt===y?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function E(Q,J,ie,ve){var Y=Q.length;if(J.length!==Y)return!1;for(;Y-- >0;)if(!ie(Q[Y],J[Y],Y,Y,Q,J,ve))return!1;return!0}var C=o(E);function O(Q,J){return l(Q.valueOf(),J.valueOf())}function T(Q,J,ie,ve){var Y=Q.size===J.size;if(!Y)return!1;if(!Q.size)return!0;var be={},Se=0;return Q.forEach(function($e,Te){if(Y){var Ue=!1,Be=0;J.forEach(function(Ie,Ke){!Ue&&!be[Be]&&(Ue=ie(Te,Ke,Se,Be,Q,J,ve)&&ie($e,Ie,Te,Ke,Q,J,ve))&&(be[Be]=!0),Be++}),Se++,Y=Ue}}),Y}var M=o(T),N="_owner",D=Object.prototype.hasOwnProperty;function F(Q,J,ie,ve){var Y=Object.keys(Q),be=Y.length;if(Object.keys(J).length!==be)return!1;for(var Se;be-- >0;){if(Se=Y[be],Se===N){var $e=!!Q.$$typeof,Te=!!J.$$typeof;if(($e||Te)&&$e!==Te)return!1}if(!D.call(J,Se)||!ie(Q[Se],J[Se],Se,Se,Q,J,ve))return!1}return!0}var j=o(F);function K(Q,J){return Q.source===J.source&&Q.flags===J.flags}function ee(Q,J,ie,ve){var Y=Q.size===J.size;if(!Y)return!1;if(!Q.size)return!0;var be={};return Q.forEach(function(Se,$e){if(Y){var Te=!1,Ue=0;J.forEach(function(Be,Ie){!Te&&!be[Ue]&&(Te=ie(Se,Be,$e,Ie,Q,J,ve))&&(be[Ue]=!0),Ue++}),Y=Te}}),Y}var H=o(ee),te=Object.freeze({areArraysEqual:E,areDatesEqual:O,areMapsEqual:T,areObjectsEqual:F,areRegExpsEqual:K,areSetsEqual:ee,createIsNestedEqual:r}),X=Object.freeze({areArraysEqual:C,areDatesEqual:O,areMapsEqual:M,areObjectsEqual:j,areRegExpsEqual:K,areSetsEqual:H,createIsNestedEqual:r}),Z=S(te);function W(Q,J){return Z(Q,J,void 0)}var $=S(i(te,{createIsNestedEqual:function(){return l}}));function V(Q,J){return $(Q,J,void 0)}var U=S(X);function I(Q,J){return U(Q,J,new WeakMap)}var re=S(i(X,{createIsNestedEqual:function(){return l}}));function ue(Q,J){return re(Q,J,new WeakMap)}function de(Q){return S(i(te,Q(te)))}function pe(Q){var J=S(i(X,Q(X)));return function(ie,ve,Y){return Y===void 0&&(Y=new WeakMap),J(ie,ve,Y)}}n.circularDeepEqual=I,n.circularShallowEqual=ue,n.createCustomCircularEqual=pe,n.createCustomEqual=de,n.deepEqual=W,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(Sx,Sx.exports);var Sw=Sx.exports;const Cw=rw(Qz);var Pt={},BH=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(Pt,"__esModule",{value:!0});Pt.bottom=Ew;Pt.childrenEqual=UH;Pt.cloneLayout=qD;Pt.cloneLayoutItem=cl;Pt.collides=Fm;Pt.compact=YD;Pt.compactItem=KD;Pt.compactType=iW;Pt.correctBounds=XD;Pt.fastPositionEqual=GH;Pt.fastRGLPropsEqual=void 0;Pt.getAllCollisions=QD;Pt.getFirstCollision=Xa;Pt.getLayoutItem=Rw;Pt.getStatics=Pw;Pt.modifyLayout=GD;Pt.moveElement=yd;Pt.moveElementAwayFromCollision=Ex;Pt.noop=void 0;Pt.perc=KH;Pt.resizeItemInDirection=tW;Pt.setTopLeft=rW;Pt.setTransform=nW;Pt.sortLayoutItems=kw;Pt.sortLayoutItemsByColRow=nA;Pt.sortLayoutItemsByRowCol=tA;Pt.synchronizeLayoutWithChildren=oW;Pt.validateLayout=rA;Pt.withLayoutItem=WH;var oP=Sw,bd=VH(m);function VH(e){return e&&e.__esModule?e:{default:e}}const HH=process.env.NODE_ENV==="production";function Ew(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 qD(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=cl(e[n]);return t}function GD(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 WH(e,t,n){let r=Rw(e,t);return r?(r=n(cl(r)),e=GD(e,r),[e,r]):[e,null]}function cl(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 UH(e,t){return(0,oP.deepEqual)(bd.default.Children.map(e,n=>n==null?void 0:n.key),bd.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,oP.deepEqual)(bd.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),bd.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const qH=BH;Pt.fastRGLPropsEqual=qH;function GH(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Fm(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 YD(e,t,n,r){const o=Pw(e),i=kw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=cl(i[a]);c.static||(c=KD(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const YH={x:"w",y:"h"};function Cx(e,t,n,r){const o=YH[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;Fm(t,a)&&Cx(e,a,n+t[o],r)}}t[r]=n}function KD(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Ew(e),t.y);t.y>0&&!Xa(e,t);)t.y--;else if(a)for(;t.x>0&&!Xa(e,t);)t.x--;let l;for(;(l=Xa(e,t))&&!(n===null&&i);)if(a?Cx(o,t,l.x+l.w,"x"):Cx(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Xa(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function XD(e,t){const n=Pw(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(;Xa(n,i);)i.y++}return e}function Rw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Xa(e,t){for(let n=0,r=e.length;n<r;n++)if(Fm(e[n],t))return e[n]}function QD(e,t){return e.filter(n=>Fm(n,t))}function Pw(e){return e.filter(t=>t.static)}function yd(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(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 f=kw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=QD(f,t),v=p.length>0;if(v&&l)return qD(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,w=p.length;b<w;b++){const y=p[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(y.i," at [").concat(y.x,",").concat(y.y,"]"),!y.moved&&(y.static?e=Ex(e,y,t,o,s):e=Ex(e,t,y,o,s))}return e}function Ex(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={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=Xa(e,f),p=h&&h.y+h.h>t.y,v=h&&t.x+t.w>h.x;if(h){if(p&&a)return yd(e,n,void 0,t.y+1,r,l,o);if(p&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return yd(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),yd(e,n,s?f.x:void 0,a?f.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:yd(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function KH(e){return e*100+"%"}const JD=(e,t,n,r)=>e+n>r?t:n,ZD=(e,t,n)=>e<0?t:n,eA=e=>Math.max(0,e),Ow=e=>Math.max(0,e),$w=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:ZD(s,e.height,o),top:Ow(s)}},Tw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:JD(e.left,e.width,s,n),left:eA(o)}},Dw=(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:JD(e.left,e.width,i,n),top:Ow(r),left:eA(s)}},Aw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:ZD(r,e.height,i),top:Ow(r)}},XH=function(){return $w(arguments.length<=0?void 0:arguments[0],Tw(...arguments))},QH=function(){return $w(arguments.length<=0?void 0:arguments[0],Dw(...arguments))},JH=function(){return Aw(arguments.length<=0?void 0:arguments[0],Tw(...arguments))},ZH=function(){return Aw(arguments.length<=0?void 0:arguments[0],Dw(...arguments))},eW={n:$w,ne:XH,e:Tw,se:JH,s:Aw,sw:ZH,w:Dw,nw:QH};function tW(e,t,n,r){const o=eW[e];return o?o(t,{...t,...n},r):n}function nW(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function rW(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function kw(e,t){return t==="horizontal"?nA(e):t==="vertical"?tA(e):e}function tA(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 nA(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 oW(e,t,n,r,o){e=e||[];const i=[];bd.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Rw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(cl(l)):c?(HH||rA([c],"ReactGridLayout.children"),i.push(cl({...c,i:a.key}))):i.push(cl({w:1,h:1,x:0,y:Ew(i),i:String(a.key)}))});const s=XD(i,{cols:n});return o?s:YD(s,r,n)}function rA(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++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function iW(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const sW=()=>{};Pt.noop=sW;var $i={};Object.defineProperty($i,"__esModule",{value:!0});$i.calcGridColWidth=jm;$i.calcGridItemPosition=aW;$i.calcGridItemWHPx=Rx;$i.calcWH=cW;$i.calcXY=lW;$i.clamp=Qa;function jm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Rx(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function aW(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=jm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Rx(r,c,s[0]),u.height=Rx(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 lW(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=jm(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Qa(u,0,s-r),f=Qa(f,0,l-o),{x:u,y:f}}function cW(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=jm(e);let f=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),p=Qa(f,0,l-r),v=Qa(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Qa(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Qa(h,0,a)),{w:p,h:v}}function Qa(e,t,n){return Math.max(Math.min(e,n),t)}var zm={},Px={exports:{}},c0,iP;function Mw(){if(iP)return c0;iP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return c0=e,c0}var u0,sP;function uW(){if(sP)return u0;sP=1;var e=Mw();function t(){}function n(){}return n.resetWarningCache=t,u0=function(){function r(s,a,l,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},u0}var gp={exports:{}},qt={};/** @license React v16.13.1
88
+ }`;var yt=PR(function(){return jt(B,Ye+"return "+Re).apply(n,q)});if(yt.source=Re,Vb(yt))throw yt;return yt}function ez(d){return Ut(d).toLowerCase()}function tz(d){return Ut(d).toUpperCase()}function nz(d,g,x){if(d=Ut(d),d&&(x||g===n))return NC(d);if(!d||!(g=Ur(g)))return d;var P=zo(d),k=zo(g),B=LC(P,k),q=FC(P,k)+1;return Ts(P,B,q).join("")}function rz(d,g,x){if(d=Ut(d),d&&(x||g===n))return d.slice(0,zC(d)+1);if(!d||!(g=Ur(g)))return d;var P=zo(d),k=FC(P,zo(g))+1;return Ts(P,0,k).join("")}function oz(d,g,x){if(d=Ut(d),d&&(x||g===n))return d.replace(Bn,"");if(!d||!(g=Ur(g)))return d;var P=zo(d),k=LC(P,zo(g));return Ts(P,k).join("")}function iz(d,g){var x=D,P=F;if(wn(g)){var k="separator"in g?g.separator:k;x="length"in g?pt(g.length):x,P="omission"in g?Ur(g.omission):P}d=Ut(d);var B=d.length;if(Vl(d)){var q=zo(d);B=q.length}if(x>=B)return d;var ne=x-Hl(P);if(ne<1)return P;var le=q?Ts(q,0,ne).join(""):d.slice(0,ne);if(k===n)return le+P;if(q&&(ne+=le.length-ne),Hb(k)){if(d.slice(ne).search(k)){var xe,we=le;for(k.global||(k=ib(k.source,Ut(qe.exec(k))+"g")),k.lastIndex=0;xe=k.exec(we);)var Re=xe.index;le=le.slice(0,Re===n?ne:Re)}}else if(d.indexOf(Ur(k),ne)!=ne){var je=le.lastIndexOf(k);je>-1&&(le=le.slice(0,je))}return le+P}function sz(d){return d=Ut(d),d&&On.test(d)?d.replace(Xt,I7):d}var az=Xl(function(d,g,x){return d+(x?" ":"")+g.toUpperCase()}),qb=OE("toUpperCase");function RR(d,g,x){return d=Ut(d),g=x?n:g,g===n?T7(d)?F7(d):w7(d):d.match(g)||[]}var PR=St(function(d,g){try{return Hr(d,n,g)}catch(x){return Vb(x)?x:new ct(x)}}),lz=Bi(function(d,g){return yo(g,function(x){x=li(x),ji(d,x,zb(d[x],d))}),d});function cz(d){var g=d==null?0:d.length,x=Je();return d=g?yn(d,function(P){if(typeof P[1]!="function")throw new xo(s);return[x(P[0]),P[1]]}):[],St(function(P){for(var k=-1;++k<g;){var B=d[k];if(Hr(B[0],this,P))return Hr(B[1],this,P)}})}function uz(d){return I6(_o(d,f))}function Gb(d){return function(){return d}}function dz(d,g){return d==null||d!==d?g:d}var fz=TE(),hz=TE(!0);function $r(d){return d}function Yb(d){return sE(typeof d=="function"?d:_o(d,f))}function pz(d){return lE(_o(d,f))}function gz(d,g){return cE(d,_o(g,f))}var mz=St(function(d,g){return function(x){return Fu(x,d,g)}}),vz=St(function(d,g){return function(x){return Fu(d,x,g)}});function Kb(d,g,x){var P=Hn(g),k=Wh(g,P);x==null&&!(wn(g)&&(k.length||!P.length))&&(x=g,g=d,d=this,k=Wh(g,Hn(g)));var B=!(wn(x)&&"chain"in x)||!!x.chain,q=Hi(d);return yo(k,function(ne){var le=g[ne];d[ne]=le,q&&(d.prototype[ne]=function(){var xe=this.__chain__;if(B||xe){var we=d(this.__wrapped__),Re=we.__actions__=Rr(this.__actions__);return Re.push({func:le,args:arguments,thisArg:d}),we.__chain__=xe,we}return le.apply(d,Cs([this.value()],arguments))})}),d}function bz(){return Gn._===this&&(Gn._=W7),this}function Xb(){}function yz(d){return d=pt(d),St(function(g){return uE(g,d)})}var xz=Pb(yn),wz=Pb(DC),_z=Pb(Jv);function OR(d){return Mb(d)?Zv(li(d)):J6(d)}function Sz(d){return function(g){return d==null?n:Oa(d,g)}}var Cz=AE(),Ez=AE(!0);function Qb(){return[]}function Jb(){return!1}function Rz(){return{}}function Pz(){return""}function Oz(){return!0}function $z(d,g){if(d=pt(d),d<1||d>Z)return[];var x=V,P=or(d,V);g=Je(g),d-=V;for(var k=nb(P,g);++x<d;)g(x);return k}function Tz(d){return ut(d)?yn(d,li):qr(d)?[d]:Rr(YE(Ut(d)))}function Dz(d){var g=++V7;return Ut(d)+g}var Az=Xh(function(d,g){return d+g},0),kz=Ob("ceil"),Mz=Xh(function(d,g){return d/g},1),Iz=Ob("floor");function Nz(d){return d&&d.length?Hh(d,$r,hb):n}function Lz(d,g){return d&&d.length?Hh(d,Je(g,2),hb):n}function Fz(d){return MC(d,$r)}function jz(d,g){return MC(d,Je(g,2))}function zz(d){return d&&d.length?Hh(d,$r,vb):n}function Bz(d,g){return d&&d.length?Hh(d,Je(g,2),vb):n}var Vz=Xh(function(d,g){return d*g},1),Hz=Ob("round"),Wz=Xh(function(d,g){return d-g},0);function Uz(d){return d&&d.length?tb(d,$r):0}function qz(d,g){return d&&d.length?tb(d,Je(g,2)):0}return z.after=p8,z.ary=iR,z.assign=tj,z.assignIn=yR,z.assignInWith=cp,z.assignWith=nj,z.at=rj,z.before=sR,z.bind=zb,z.bindAll=lz,z.bindKey=aR,z.castArray=R8,z.chain=nR,z.chunk=I9,z.compact=N9,z.concat=L9,z.cond=cz,z.conforms=uz,z.constant=Gb,z.countBy=U4,z.create=oj,z.curry=lR,z.curryRight=cR,z.debounce=uR,z.defaults=ij,z.defaultsDeep=sj,z.defer=g8,z.delay=m8,z.difference=F9,z.differenceBy=j9,z.differenceWith=z9,z.drop=B9,z.dropRight=V9,z.dropRightWhile=H9,z.dropWhile=W9,z.fill=U9,z.filter=G4,z.flatMap=X4,z.flatMapDeep=Q4,z.flatMapDepth=J4,z.flatten=JE,z.flattenDeep=q9,z.flattenDepth=G9,z.flip=v8,z.flow=fz,z.flowRight=hz,z.fromPairs=Y9,z.functions=hj,z.functionsIn=pj,z.groupBy=Z4,z.initial=X9,z.intersection=Q9,z.intersectionBy=J9,z.intersectionWith=Z9,z.invert=mj,z.invertBy=vj,z.invokeMap=t8,z.iteratee=Yb,z.keyBy=n8,z.keys=Hn,z.keysIn=Or,z.map=rp,z.mapKeys=yj,z.mapValues=xj,z.matches=pz,z.matchesProperty=gz,z.memoize=ip,z.merge=wj,z.mergeWith=xR,z.method=mz,z.methodOf=vz,z.mixin=Kb,z.negate=sp,z.nthArg=yz,z.omit=_j,z.omitBy=Sj,z.once=b8,z.orderBy=r8,z.over=xz,z.overArgs=y8,z.overEvery=wz,z.overSome=_z,z.partial=Bb,z.partialRight=dR,z.partition=o8,z.pick=Cj,z.pickBy=wR,z.property=OR,z.propertyOf=Sz,z.pull=r4,z.pullAll=eR,z.pullAllBy=o4,z.pullAllWith=i4,z.pullAt=s4,z.range=Cz,z.rangeRight=Ez,z.rearg=x8,z.reject=a8,z.remove=a4,z.rest=w8,z.reverse=Fb,z.sampleSize=c8,z.set=Rj,z.setWith=Pj,z.shuffle=u8,z.slice=l4,z.sortBy=h8,z.sortedUniq=g4,z.sortedUniqBy=m4,z.split=Xj,z.spread=_8,z.tail=v4,z.take=b4,z.takeRight=y4,z.takeRightWhile=x4,z.takeWhile=w4,z.tap=N4,z.throttle=S8,z.thru=np,z.toArray=mR,z.toPairs=_R,z.toPairsIn=SR,z.toPath=Tz,z.toPlainObject=bR,z.transform=Oj,z.unary=C8,z.union=_4,z.unionBy=S4,z.unionWith=C4,z.uniq=E4,z.uniqBy=R4,z.uniqWith=P4,z.unset=$j,z.unzip=jb,z.unzipWith=tR,z.update=Tj,z.updateWith=Dj,z.values=Zl,z.valuesIn=Aj,z.without=O4,z.words=RR,z.wrap=E8,z.xor=$4,z.xorBy=T4,z.xorWith=D4,z.zip=A4,z.zipObject=k4,z.zipObjectDeep=M4,z.zipWith=I4,z.entries=_R,z.entriesIn=SR,z.extend=yR,z.extendWith=cp,Kb(z,z),z.add=Az,z.attempt=PR,z.camelCase=Nj,z.capitalize=CR,z.ceil=kz,z.clamp=kj,z.clone=P8,z.cloneDeep=$8,z.cloneDeepWith=T8,z.cloneWith=O8,z.conformsTo=D8,z.deburr=ER,z.defaultTo=dz,z.divide=Mz,z.endsWith=Lj,z.eq=Vo,z.escape=Fj,z.escapeRegExp=jj,z.every=q4,z.find=Y4,z.findIndex=XE,z.findKey=aj,z.findLast=K4,z.findLastIndex=QE,z.findLastKey=lj,z.floor=Iz,z.forEach=rR,z.forEachRight=oR,z.forIn=cj,z.forInRight=uj,z.forOwn=dj,z.forOwnRight=fj,z.get=Wb,z.gt=A8,z.gte=k8,z.has=gj,z.hasIn=Ub,z.head=ZE,z.identity=$r,z.includes=e8,z.indexOf=K9,z.inRange=Mj,z.invoke=bj,z.isArguments=Da,z.isArray=ut,z.isArrayBuffer=M8,z.isArrayLike=Pr,z.isArrayLikeObject=$n,z.isBoolean=I8,z.isBuffer=Ds,z.isDate=N8,z.isElement=L8,z.isEmpty=F8,z.isEqual=j8,z.isEqualWith=z8,z.isError=Vb,z.isFinite=B8,z.isFunction=Hi,z.isInteger=fR,z.isLength=ap,z.isMap=hR,z.isMatch=V8,z.isMatchWith=H8,z.isNaN=W8,z.isNative=U8,z.isNil=G8,z.isNull=q8,z.isNumber=pR,z.isObject=wn,z.isObjectLike=Cn,z.isPlainObject=Wu,z.isRegExp=Hb,z.isSafeInteger=Y8,z.isSet=gR,z.isString=lp,z.isSymbol=qr,z.isTypedArray=Jl,z.isUndefined=K8,z.isWeakMap=X8,z.isWeakSet=Q8,z.join=e4,z.kebabCase=zj,z.last=Co,z.lastIndexOf=t4,z.lowerCase=Bj,z.lowerFirst=Vj,z.lt=J8,z.lte=Z8,z.max=Nz,z.maxBy=Lz,z.mean=Fz,z.meanBy=jz,z.min=zz,z.minBy=Bz,z.stubArray=Qb,z.stubFalse=Jb,z.stubObject=Rz,z.stubString=Pz,z.stubTrue=Oz,z.multiply=Vz,z.nth=n4,z.noConflict=bz,z.noop=Xb,z.now=op,z.pad=Hj,z.padEnd=Wj,z.padStart=Uj,z.parseInt=qj,z.random=Ij,z.reduce=i8,z.reduceRight=s8,z.repeat=Gj,z.replace=Yj,z.result=Ej,z.round=Hz,z.runInContext=se,z.sample=l8,z.size=d8,z.snakeCase=Kj,z.some=f8,z.sortedIndex=c4,z.sortedIndexBy=u4,z.sortedIndexOf=d4,z.sortedLastIndex=f4,z.sortedLastIndexBy=h4,z.sortedLastIndexOf=p4,z.startCase=Qj,z.startsWith=Jj,z.subtract=Wz,z.sum=Uz,z.sumBy=qz,z.template=Zj,z.times=$z,z.toFinite=Wi,z.toInteger=pt,z.toLength=vR,z.toLower=ez,z.toNumber=Eo,z.toSafeInteger=ej,z.toString=Ut,z.toUpper=tz,z.trim=nz,z.trimEnd=rz,z.trimStart=oz,z.truncate=iz,z.unescape=sz,z.uniqueId=Dz,z.upperCase=az,z.upperFirst=qb,z.each=rR,z.eachRight=oR,z.first=ZE,Kb(z,function(){var d={};return si(z,function(g,x){Qt.call(z.prototype,x)||(d[x]=g)}),d}(),{chain:!1}),z.VERSION=r,yo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){z[d].placeholder=z}),yo(["drop","take"],function(d,g){kt.prototype[d]=function(x){x=x===n?1:Nn(pt(x),0);var P=this.__filtered__&&!g?new kt(this):this.clone();return P.__filtered__?P.__takeCount__=or(x,P.__takeCount__):P.__views__.push({size:or(x,V),type:d+(P.__dir__<0?"Right":"")}),P},kt.prototype[d+"Right"]=function(x){return this.reverse()[d](x).reverse()}}),yo(["filter","map","takeWhile"],function(d,g){var x=g+1,P=x==ee||x==te;kt.prototype[d]=function(k){var B=this.clone();return B.__iteratees__.push({iteratee:Je(k,3),type:x}),B.__filtered__=B.__filtered__||P,B}}),yo(["head","last"],function(d,g){var x="take"+(g?"Right":"");kt.prototype[d]=function(){return this[x](1).value()[0]}}),yo(["initial","tail"],function(d,g){var x="drop"+(g?"":"Right");kt.prototype[d]=function(){return this.__filtered__?new kt(this):this[x](1)}}),kt.prototype.compact=function(){return this.filter($r)},kt.prototype.find=function(d){return this.filter(d).head()},kt.prototype.findLast=function(d){return this.reverse().find(d)},kt.prototype.invokeMap=St(function(d,g){return typeof d=="function"?new kt(this):this.map(function(x){return Fu(x,d,g)})}),kt.prototype.reject=function(d){return this.filter(sp(Je(d)))},kt.prototype.slice=function(d,g){d=pt(d);var x=this;return x.__filtered__&&(d>0||g<0)?new kt(x):(d<0?x=x.takeRight(-d):d&&(x=x.drop(d)),g!==n&&(g=pt(g),x=g<0?x.dropRight(-g):x.take(g-d)),x)},kt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},kt.prototype.toArray=function(){return this.take(V)},si(kt.prototype,function(d,g){var x=/^(?:filter|find|map|reject)|While$/.test(g),P=/^(?:head|last)$/.test(g),k=z[P?"take"+(g=="last"?"Right":""):g],B=P||/^find/.test(g);k&&(z.prototype[g]=function(){var q=this.__wrapped__,ne=P?[1]:arguments,le=q instanceof kt,xe=ne[0],we=le||ut(q),Re=function(Ot){var Mt=k.apply(z,Cs([Ot],ne));return P&&je?Mt[0]:Mt};we&&x&&typeof xe=="function"&&xe.length!=1&&(le=we=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=B&&!je,yt=le&&!Ye;if(!B&&we){q=yt?q:new kt(this);var tt=d.apply(q,ne);return tt.__actions__.push({func:np,args:[Re],thisArg:n}),new wo(tt,je)}return et&&yt?d.apply(this,ne):(tt=this.thru(Re),et?P?tt.value()[0]:tt.value():tt)})}),yo(["pop","push","shift","sort","splice","unshift"],function(d){var g=Oh[d],x=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",P=/^(?:pop|shift)$/.test(d);z.prototype[d]=function(){var k=arguments;if(P&&!this.__chain__){var B=this.value();return g.apply(ut(B)?B:[],k)}return this[x](function(q){return g.apply(ut(q)?q:[],k)})}}),si(kt.prototype,function(d,g){var x=z[g];if(x){var P=x.name+"";Qt.call(Gl,P)||(Gl[P]=[]),Gl[P].push({name:g,func:x})}}),Gl[Kh(n,y).name]=[{name:"wrapper",func:n}],kt.prototype.clone=s6,kt.prototype.reverse=a6,kt.prototype.value=l6,z.prototype.at=L4,z.prototype.chain=F4,z.prototype.commit=j4,z.prototype.next=z4,z.prototype.plant=V4,z.prototype.reverse=H4,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=W4,z.prototype.first=z.prototype.head,Du&&(z.prototype[Du]=B4),z},Wl=j7();Sa?((Sa.exports=Wl)._=Wl,Yv._=Wl):Gn._=Wl}).call(qs)})(jg,jg.exports);var bc=jg.exports;const ll=Rl(bc);function YR({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};return t||(t={}),cw.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,f)=>Math.max(u,f.y+f.h),0);a.y=a.y===0?0:c,t[l].push(a)}),t}function KR(e,t){t&&cw.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const Pe=rD()(uD((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:Lg},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:Lg},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})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(c=>c.id===n);o!==void 0&&o>-1&&((s=r.dashboard.sheets)==null||s.splice(o,1),r.selectedSheetId=(l=(a=r.dashboard.sheets)==null?void 0:a[0])==null?void 0:l.id)})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{cw.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})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(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===o.selectedSheetId);i&&bc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.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;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(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===o.selectedSheetId);i&&bc.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.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(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(h=>h.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&bc.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(h=>h.id===r);u&&(u.data=o)})})},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;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue: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];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);YR({id:n.id,layouts:o==null?void 0:o.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);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);KR(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,h;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);p>-1&&((h=a.cards)==null||h.splice(p,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))}})},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(f=>f.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let f=1/0;const h=0;o==="start"&&(f=0),YR({id:r.id,layouts:s.layouts,minH:10,x:h,y: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(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),KR(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;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.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;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),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,h;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.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)=>{yV({card:n,dataPoint:r,set:e,get:t})}}}))),wr=()=>Pe(e=>e.actions),xV={theme:"system",setTheme:()=>null},vD=m.createContext(xV);function wV({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.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 R.jsx(vD.Provider,{...r,value:s,children:e})}const bD=()=>{const e=m.useContext(vD);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var Uf=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(){}},tu=typeof window>"u"||"Deno"in window;function To(){}function _V(e,t){return typeof e=="function"?e(t):e}function ax(e){return typeof e=="number"&&e>=0&&e!==1/0}function yD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function XR(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(!Gd(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function QR(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(qd(t.options.mutationKey)!==qd(i))return!1}else if(!Gd(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)||qd)(e)}function qd(e){return JSON.stringify(e,(t,n)=>cx(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Gd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Gd(e[n],t[n])):!1}function xD(e,t){if(e===t)return e;const n=JR(e)&&JR(t);if(n||cx(e)&&cx(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=xD(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function lx(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function JR(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cx(e){if(!ZR(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!ZR(n)||!n.hasOwnProperty("isPrototypeOf"))}function ZR(e){return Object.prototype.toString.call(e)==="[object Object]"}function SV(e){return new Promise(t=>{setTimeout(t,e)})}function ux(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?xD(e,t):t}function CV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function EV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var el,Gs,Nc,jT,RV=(jT=class extends Uf{constructor(){super();Xe(this,el,void 0);Xe(this,Gs,void 0);Xe(this,Nc,void 0);Ve(this,Nc,t=>{if(!tu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ae(this,Gs)||this.setEventListener(ae(this,Nc))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,Gs))==null||t.call(this),Ve(this,Gs,void 0))}setEventListener(t){var n;Ve(this,Nc,t),(n=ae(this,Gs))==null||n.call(this),Ve(this,Gs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){ae(this,el)!==t&&(Ve(this,el,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof ae(this,el)=="boolean"?ae(this,el):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},el=new WeakMap,Gs=new WeakMap,Nc=new WeakMap,jT),zg=new RV,Lc,Ys,Fc,zT,PV=(zT=class extends Uf{constructor(){super();Xe(this,Lc,!0);Xe(this,Ys,void 0);Xe(this,Fc,void 0);Ve(this,Fc,t=>{if(!tu&&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(){ae(this,Ys)||this.setEventListener(ae(this,Fc))}onUnsubscribe(){var t;this.hasListeners()||((t=ae(this,Ys))==null||t.call(this),Ve(this,Ys,void 0))}setEventListener(t){var n;Ve(this,Fc,t),(n=ae(this,Ys))==null||n.call(this),Ve(this,Ys,t(this.setOnline.bind(this)))}setOnline(t){ae(this,Lc)!==t&&(Ve(this,Lc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return ae(this,Lc)}},Lc=new WeakMap,Ys=new WeakMap,Fc=new WeakMap,zT),Bg=new PV;function OV(e){return Math.min(1e3*2**e,3e4)}function Dm(e){return(e??"online")==="online"?Bg.isOnline():!0}var wD=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function a0(e){return e instanceof wD}function _D(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((w,y)=>{i=w,s=y}),l=w=>{var y;r||(p(new wD(w)),(y=e.abort)==null||y.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!zg.isFocused()||e.networkMode!=="always"&&!Bg.isOnline(),h=w=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,w),o==null||o(),i(w))},p=w=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,w),o==null||o(),s(w))},v=()=>new Promise(w=>{var y;o=_=>{const S=r||!f();return S&&w(_),S},(y=e.onPause)==null||y.call(e)}).then(()=>{var w;o=void 0,r||(w=e.onContinue)==null||w.call(e)}),b=()=>{if(r)return;let w;try{w=e.fn()}catch(y){w=Promise.reject(y)}Promise.resolve(w).then(h).catch(y=>{var O;if(r)return;const _=e.retry??(tu?0:3),S=e.retryDelay??OV,E=typeof S=="function"?S(n,y):S,C=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!C){p(y);return}n++,(O=e.onFail)==null||O.call(e,n,y),SV(E).then(()=>{if(f())return v()}).then(()=>{t?p(y):b()})})};return Dm(e.networkMode)?b():v().then(b),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function $V(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},s=h=>{let p;t++;try{p=h()}finally{t--,t||c()}return p},a=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...p)=>{a(()=>{h(...p)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var Qn=$V(),tl,BT,SD=(BT=class{constructor(){Xe(this,tl,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ax(this.gcTime)&&Ve(this,tl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tu?1/0:5*60*1e3))}clearGcTimeout(){ae(this,tl)&&(clearTimeout(ae(this,tl)),Ve(this,tl,void 0))}},tl=new WeakMap,BT),jc,zc,Po,Ks,Oo,Wn,Af,nl,Bc,xg,Yo,Ki,VT,TV=(VT=class extends SD{constructor(t){super();Xe(this,Bc);Xe(this,Yo);Xe(this,jc,void 0);Xe(this,zc,void 0);Xe(this,Po,void 0);Xe(this,Ks,void 0);Xe(this,Oo,void 0);Xe(this,Wn,void 0);Xe(this,Af,void 0);Xe(this,nl,void 0);Ve(this,nl,!1),Ve(this,Af,t.defaultOptions),Ct(this,Bc,xg).call(this,t.options),Ve(this,Wn,[]),Ve(this,Po,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,jc,t.state||DV(this.options)),this.state=ae(this,jc),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!ae(this,Wn).length&&this.state.fetchStatus==="idle"&&ae(this,Po).remove(this)}setData(t,n){const r=ux(this.state.data,t,this.options);return Ct(this,Yo,Ki).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ct(this,Yo,Ki).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=ae(this,Ks);return(r=ae(this,Oo))==null||r.cancel(t),n?n.then(To).catch(To):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ae(this,jc))}isActive(){return ae(this,Wn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||ae(this,Wn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!yD(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=ae(this,Wn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Oo))==null||n.continue()}onOnline(){var n;const t=ae(this,Wn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ae(this,Oo))==null||n.continue()}addObserver(t){ae(this,Wn).includes(t)||(ae(this,Wn).push(t),this.clearGcTimeout(),ae(this,Po).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){ae(this,Wn).includes(t)&&(Ve(this,Wn,ae(this,Wn).filter(n=>n!==t)),ae(this,Wn).length||(ae(this,Oo)&&(ae(this,nl)?ae(this,Oo).cancel({revert:!0}):ae(this,Oo).cancelRetry()),this.scheduleGc()),ae(this,Po).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return ae(this,Wn).length}invalidate(){this.state.isInvalidated||Ct(this,Yo,Ki).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ae(this,Ks))return(c=ae(this,Oo))==null||c.continueRetry(),ae(this,Ks)}if(t&&Ct(this,Bc,xg).call(this,t),!this.options.queryFn){const p=ae(this,Wn).find(v=>v.options.queryFn);p&&Ct(this,Bc,xg).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ve(this,nl,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ve(this,nl,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ve(this,zc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&Ct(this,Yo,Ki).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=p=>{var v,b,w,y;a0(p)&&p.silent||Ct(this,Yo,Ki).call(this,{type:"error",error:p}),a0(p)||((b=(v=ae(this,Po).config).onError)==null||b.call(v,p,this),(y=(w=ae(this,Po).config).onSettled)==null||y.call(w,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Oo,_D({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,b,w,y;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(b=(v=ae(this,Po).config).onSuccess)==null||b.call(v,p,this),(y=(w=ae(this,Po).config).onSettled)==null||y.call(w,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{Ct(this,Yo,Ki).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{Ct(this,Yo,Ki).call(this,{type:"pause"})},onContinue:()=>{Ct(this,Yo,Ki).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ve(this,Ks,ae(this,Oo).promise),ae(this,Ks)}},jc=new WeakMap,zc=new WeakMap,Po=new WeakMap,Ks=new WeakMap,Oo=new WeakMap,Wn=new WeakMap,Af=new WeakMap,nl=new WeakMap,Bc=new WeakSet,xg=function(t){this.options={...ae(this,Af),...t},this.updateGcTime(this.options.gcTime)},Yo=new WeakSet,Ki=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Dm(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return a0(o)&&o.revert&&ae(this,zc)?{...ae(this,zc),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),Qn.batch(()=>{ae(this,Wn).forEach(r=>{r.onQueryUpdate()}),ae(this,Po).notify({query:this,type:"updated",action:t})})},VT);function DV(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var hi,HT,CD=(HT=class extends Uf{constructor(t={}){super();Xe(this,hi,void 0);this.config=t,Ve(this,hi,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 TV({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){ae(this,hi).has(t.queryHash)||(ae(this,hi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ae(this,hi).get(t.queryHash);n&&(t.destroy(),n===t&&ae(this,hi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Qn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ae(this,hi).get(t)}getAll(){return[...ae(this,hi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>XR(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>XR(t,r)):n}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},hi=new WeakMap,HT),pi,kf,Zr,Vc,gi,zs,WT,AV=(WT=class extends SD{constructor(t){super();Xe(this,gi);Xe(this,pi,void 0);Xe(this,kf,void 0);Xe(this,Zr,void 0);Xe(this,Vc,void 0);this.mutationId=t.mutationId,Ve(this,kf,t.defaultOptions),Ve(this,Zr,t.mutationCache),Ve(this,pi,[]),this.state=t.state||kV(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...ae(this,kf),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ae(this,pi).includes(t)||(ae(this,pi).push(t),this.clearGcTimeout(),ae(this,Zr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,pi,ae(this,pi).filter(n=>n!==t)),this.scheduleGc(),ae(this,Zr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ae(this,pi).length||(this.state.status==="pending"?this.scheduleGc():ae(this,Zr).remove(this))}continue(){var t;return((t=ae(this,Vc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,h,p,v,b,w,y,_,S,E,C,O,T;const n=()=>(Ve(this,Vc,_D({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,N)=>{Ct(this,gi,zs).call(this,{type:"failed",failureCount:M,error:N})},onPause:()=>{Ct(this,gi,zs).call(this,{type:"pause"})},onContinue:()=>{Ct(this,gi,zs).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),ae(this,Vc).promise),r=this.state.status==="pending";try{if(!r){Ct(this,gi,zs).call(this,{type:"pending",variables:t}),await((i=(o=ae(this,Zr).config).onMutate)==null?void 0:i.call(o,t,this));const N=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));N!==this.state.context&&Ct(this,gi,zs).call(this,{type:"pending",context:N,variables:t})}const M=await n();return await((c=(l=ae(this,Zr).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,M,t,this.state.context)),await((p=(h=ae(this,Zr).config).onSettled)==null?void 0:p.call(h,M,null,this.state.variables,this.state.context,this)),await((b=(v=this.options).onSettled)==null?void 0:b.call(v,M,null,t,this.state.context)),Ct(this,gi,zs).call(this,{type:"success",data:M}),M}catch(M){try{throw await((y=(w=ae(this,Zr).config).onError)==null?void 0:y.call(w,M,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,M,t,this.state.context)),await((C=(E=ae(this,Zr).config).onSettled)==null?void 0:C.call(E,void 0,M,this.state.variables,this.state.context,this)),await((T=(O=this.options).onSettled)==null?void 0:T.call(O,void 0,M,t,this.state.context)),M}finally{Ct(this,gi,zs).call(this,{type:"error",error:M})}}}},pi=new WeakMap,kf=new WeakMap,Zr=new WeakMap,Vc=new WeakMap,gi=new WeakSet,zs=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:!Dm(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Qn.batch(()=>{ae(this,pi).forEach(r=>{r.onMutationUpdate(t)}),ae(this,Zr).notify({mutation:this,type:"updated",action:t})})},WT);function kV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $o,Mf,rl,UT,MV=(UT=class extends Uf{constructor(t={}){super();Xe(this,$o,void 0);Xe(this,Mf,void 0);Xe(this,rl,void 0);this.config=t,Ve(this,$o,[]),Ve(this,Mf,0)}build(t,n,r){const o=new AV({mutationCache:this,mutationId:++up(this,Mf)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){ae(this,$o).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,$o,ae(this,$o).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Qn.batch(()=>{ae(this,$o).forEach(t=>{this.remove(t)})})}getAll(){return ae(this,$o)}find(t){const n={exact:!0,...t};return ae(this,$o).find(r=>QR(n,r))}findAll(t={}){return ae(this,$o).filter(n=>QR(t,n))}notify(t){Qn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,rl,(ae(this,rl)??Promise.resolve()).then(()=>{const t=ae(this,$o).filter(n=>n.state.isPaused);return Qn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(To)),Promise.resolve()))}).then(()=>{Ve(this,rl,void 0)})),ae(this,rl)}},$o=new WeakMap,Mf=new WeakMap,rl=new WeakMap,UT);function IV(e){return{onFetch:(t,n)=>{const r=async()=>{var v,b,w,y,_;const o=t.options,i=(w=(b=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:w.direction,s=((y=t.state.data)==null?void 0:y.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),h=async(S,E,C)=>{if(c)return Promise.reject();if(E==null&&S.pages.length)return Promise.resolve(S);const O={queryKey:t.queryKey,pageParam:E,direction:C?"backward":"forward",meta:t.options.meta};u(O);const T=await f(O),{maxPages:M}=t.options,N=C?EV:CV;return{pages:N(S.pages,T,M),pageParams:N(S.pageParams,E,M)}};let p;if(i&&s.length){const S=i==="backward",E=S?NV:eP,C={pages:s,pageParams:a},O=E(o,C);p=await h(C,O,S)}else{p=await h(l,a[0]??o.initialPageParam);const S=e??s.length;for(let E=1;E<S;E++){const C=eP(o,p);p=await h(p,C)}}return p};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function eP(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function NV(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Ln,Xs,Qs,Hc,Wc,Js,Uc,qc,qT,LV=(qT=class{constructor(e={}){Xe(this,Ln,void 0);Xe(this,Xs,void 0);Xe(this,Qs,void 0);Xe(this,Hc,void 0);Xe(this,Wc,void 0);Xe(this,Js,void 0);Xe(this,Uc,void 0);Xe(this,qc,void 0);Ve(this,Ln,e.queryCache||new CD),Ve(this,Xs,e.mutationCache||new MV),Ve(this,Qs,e.defaultOptions||{}),Ve(this,Hc,new Map),Ve(this,Wc,new Map),Ve(this,Js,0)}mount(){up(this,Js)._++,ae(this,Js)===1&&(Ve(this,Uc,zg.subscribe(()=>{zg.isFocused()&&(this.resumePausedMutations(),ae(this,Ln).onFocus())})),Ve(this,qc,Bg.subscribe(()=>{Bg.isOnline()&&(this.resumePausedMutations(),ae(this,Ln).onOnline())})))}unmount(){var e,t;up(this,Js)._--,ae(this,Js)===0&&((e=ae(this,Uc))==null||e.call(this),Ve(this,Uc,void 0),(t=ae(this,qc))==null||t.call(this),Ve(this,qc,void 0))}isFetching(e){return ae(this,Ln).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ae(this,Xs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=ae(this,Ln).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=ae(this,Ln).find({queryKey:e}),o=r==null?void 0:r.state.data,i=_V(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return ae(this,Ln).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=ae(this,Ln).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=ae(this,Ln);Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ae(this,Ln),r={type:"active",...e};return Qn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Qn.batch(()=>ae(this,Ln).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(To).catch(To)}invalidateQueries(e={},t={}){return Qn.batch(()=>{if(ae(this,Ln).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Qn.batch(()=>ae(this,Ln).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(To)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(To)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=ae(this,Ln).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(To).catch(To)}fetchInfiniteQuery(e){return e.behavior=IV(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(To).catch(To)}resumePausedMutations(){return ae(this,Xs).resumePausedMutations()}getQueryCache(){return ae(this,Ln)}getMutationCache(){return ae(this,Xs)}getDefaultOptions(){return ae(this,Qs)}setDefaultOptions(e){Ve(this,Qs,e)}setQueryDefaults(e,t){ae(this,Hc).set(qd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ae(this,Hc).values()];let n={};return t.forEach(r=>{Gd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){ae(this,Wc).set(qd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ae(this,Wc).values()];let n={};return t.forEach(r=>{Gd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...ae(this,Qs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=fw(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ae(this,Qs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ae(this,Ln).clear(),ae(this,Xs).clear()}},Ln=new WeakMap,Xs=new WeakMap,Qs=new WeakMap,Hc=new WeakMap,Wc=new WeakMap,Js=new WeakMap,Uc=new WeakMap,qc=new WeakMap,qT),Ir,fn,If,vr,ol,Gc,mi,Nf,Yc,Kc,il,sl,Zs,Xc,al,vd,Lf,dx,Ff,fx,jf,hx,zf,px,Bf,gx,Vf,mx,Hf,vx,Em,ED,GT,FV=(GT=class extends Uf{constructor(t,n){super();Xe(this,al);Xe(this,Lf);Xe(this,Ff);Xe(this,jf);Xe(this,zf);Xe(this,Bf);Xe(this,Vf);Xe(this,Hf);Xe(this,Em);Xe(this,Ir,void 0);Xe(this,fn,void 0);Xe(this,If,void 0);Xe(this,vr,void 0);Xe(this,ol,void 0);Xe(this,Gc,void 0);Xe(this,mi,void 0);Xe(this,Nf,void 0);Xe(this,Yc,void 0);Xe(this,Kc,void 0);Xe(this,il,void 0);Xe(this,sl,void 0);Xe(this,Zs,void 0);Xe(this,Xc,new Set);this.options=n,Ve(this,Ir,t),Ve(this,mi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ae(this,fn).addObserver(this),tP(ae(this,fn),this.options)?Ct(this,al,vd).call(this):this.updateResult(),Ct(this,zf,px).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bx(ae(this,fn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bx(ae(this,fn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ct(this,Bf,gx).call(this),Ct(this,Vf,mx).call(this),ae(this,fn).removeObserver(this)}setOptions(t,n){const r=this.options,o=ae(this,fn);if(this.options=ae(this,Ir).defaultQueryOptions(t),lx(r,this.options)||ae(this,Ir).getQueryCache().notify({type:"observerOptionsUpdated",query:ae(this,fn),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),Ct(this,Hf,vx).call(this);const i=this.hasListeners();i&&nP(ae(this,fn),o,this.options,r)&&Ct(this,al,vd).call(this),this.updateResult(n),i&&(ae(this,fn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ct(this,Lf,dx).call(this);const s=Ct(this,Ff,fx).call(this);i&&(ae(this,fn)!==o||this.options.enabled!==r.enabled||s!==ae(this,Zs))&&Ct(this,jf,hx).call(this,s)}getOptimisticResult(t){const n=ae(this,Ir).getQueryCache().build(ae(this,Ir),t),r=this.createResult(n,t);return zV(this,r)&&(Ve(this,vr,r),Ve(this,Gc,this.options),Ve(this,ol,ae(this,fn).state)),r}getCurrentResult(){return ae(this,vr)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(ae(this,Xc).add(r),t[r])})}),n}getCurrentQuery(){return ae(this,fn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ae(this,Ir).defaultQueryOptions(t),r=ae(this,Ir).getQueryCache().build(ae(this,Ir),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ct(this,al,vd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ae(this,vr)))}createResult(t,n){var O;const r=ae(this,fn),o=this.options,i=ae(this,vr),s=ae(this,ol),a=ae(this,Gc),c=t!==r?t.state:ae(this,If),{state:u}=t;let{error:f,errorUpdatedAt:h,fetchStatus:p,status:v}=u,b=!1,w;if(n._optimisticResults){const T=this.hasListeners(),M=!T&&tP(t,n),N=T&&nP(t,r,n,o);(M||N)&&(p=Dm(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===ae(this,Nf))w=ae(this,Yc);else try{Ve(this,Nf,n.select),w=n.select(u.data),w=ux(i==null?void 0:i.data,w,n),Ve(this,Yc,w),Ve(this,mi,null)}catch(T){Ve(this,mi,T)}else w=u.data;if(typeof n.placeholderData<"u"&&typeof w>"u"&&v==="pending"){let T;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))T=i.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((O=ae(this,Kc))==null?void 0:O.state.data,ae(this,Kc)):n.placeholderData,n.select&&typeof T<"u")try{T=n.select(T),Ve(this,mi,null)}catch(M){Ve(this,mi,M)}typeof T<"u"&&(v="success",w=ux(i==null?void 0:i.data,T,n),b=!0)}ae(this,mi)&&(f=ae(this,mi),w=ae(this,Yc),h=Date.now(),v="error");const y=p==="fetching",_=v==="pending",S=v==="error",E=_&&y;return{status:v,fetchStatus:p,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:E,isLoading:E,data:w,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:b,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:hw(t,n),refetch:this.refetch}}updateResult(t){const n=ae(this,vr),r=this.createResult(ae(this,fn),this.options);if(Ve(this,ol,ae(this,fn).state),Ve(this,Gc,this.options),ae(this,ol).data!==void 0&&Ve(this,Kc,ae(this,fn)),lx(r,n))return;Ve(this,vr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!ae(this,Xc).size)return!0;const l=new Set(a??ae(this,Xc));return this.options.throwOnError&&l.add("error"),Object.keys(ae(this,vr)).some(c=>{const u=c;return ae(this,vr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ct(this,Em,ED).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ct(this,zf,px).call(this)}},Ir=new WeakMap,fn=new WeakMap,If=new WeakMap,vr=new WeakMap,ol=new WeakMap,Gc=new WeakMap,mi=new WeakMap,Nf=new WeakMap,Yc=new WeakMap,Kc=new WeakMap,il=new WeakMap,sl=new WeakMap,Zs=new WeakMap,Xc=new WeakMap,al=new WeakSet,vd=function(t){Ct(this,Hf,vx).call(this);let n=ae(this,fn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(To)),n},Lf=new WeakSet,dx=function(){if(Ct(this,Bf,gx).call(this),tu||ae(this,vr).isStale||!ax(this.options.staleTime))return;const n=yD(ae(this,vr).dataUpdatedAt,this.options.staleTime)+1;Ve(this,il,setTimeout(()=>{ae(this,vr).isStale||this.updateResult()},n))},Ff=new WeakSet,fx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ae(this,fn)):this.options.refetchInterval)??!1},jf=new WeakSet,hx=function(t){Ct(this,Vf,mx).call(this),Ve(this,Zs,t),!(tu||this.options.enabled===!1||!ax(ae(this,Zs))||ae(this,Zs)===0)&&Ve(this,sl,setInterval(()=>{(this.options.refetchIntervalInBackground||zg.isFocused())&&Ct(this,al,vd).call(this)},ae(this,Zs)))},zf=new WeakSet,px=function(){Ct(this,Lf,dx).call(this),Ct(this,jf,hx).call(this,Ct(this,Ff,fx).call(this))},Bf=new WeakSet,gx=function(){ae(this,il)&&(clearTimeout(ae(this,il)),Ve(this,il,void 0))},Vf=new WeakSet,mx=function(){ae(this,sl)&&(clearInterval(ae(this,sl)),Ve(this,sl,void 0))},Hf=new WeakSet,vx=function(){const t=ae(this,Ir).getQueryCache().build(ae(this,Ir),this.options);if(t===ae(this,fn))return;const n=ae(this,fn);Ve(this,fn,t),Ve(this,If,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Em=new WeakSet,ED=function(t){Qn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ae(this,vr))}),ae(this,Ir).getQueryCache().notify({query:ae(this,fn),type:"observerResultsUpdated"})})},GT);function jV(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function tP(e,t){return jV(e,t)||e.state.dataUpdatedAt>0&&bx(e,t,t.refetchOnMount)}function bx(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&hw(e,t)}return!1}function nP(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&hw(e,n)}function hw(e,t){return e.isStaleByTime(t.staleTime)}function zV(e,t){return!lx(e.getCurrentResult(),t)}var RD=L.createContext(void 0),PD=e=>{const t=L.useContext(RD);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},BV=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),L.createElement(RD.Provider,{value:e},t)),OD=L.createContext(!1),VV=()=>L.useContext(OD);OD.Provider;function HV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var WV=L.createContext(HV()),UV=()=>L.useContext(WV);function qV(e,t){return typeof e=="function"?e(...t):!!e}var GV=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},YV=e=>{L.useEffect(()=>{e.clearReset()},[e])},KV=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&qV(n,[e.error,r]),XV=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},QV=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,JV=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ZV(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=PD(n),o=VV(),i=UV(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",XV(s),GV(s,i),YV(i);const[a]=L.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(L.useSyncExternalStore(L.useCallback(c=>{const u=o?()=>{}:a.subscribe(Qn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),L.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),QV(s,l))throw JV(s,a,i);if(KV({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function qf(e,t){return ZV(e,FV,t)}function $D({children:e}){const{setIsSessionExpired:t}=wr(),n=new LV({queryCache:new CD({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return R.jsx(BV,{client:n,children:e})}const vu=m.forwardRef(({children:e,className:t,...n},r)=>R.jsx("div",{className:_e("semaphor-scope",t),ref:r,...n,children:e})),eH={id:"",authToken:void 0},TD=m.createContext(eH),DD=({children:e,dashboardProps:t})=>R.jsx($D,{children:R.jsx(TD.Provider,{value:t,children:R.jsx(vu,{style:{height:"100%"},children:e})})});function Oi(){const e=m.useContext(TD);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function tH(){const{authToken:e}=Oi(),t=Pe(s=>s.selectedLensId),{data:n,isLoading:r,isFetching:o,isError:i}=qf({queryKey:["dashboard",t,e==null?void 0:e.accessToken],queryFn:()=>jB(e==null?void 0:e.accessToken,{lensId:t})});return{data:n,isLoading:r,isFetching:o,isError:i}}function AD(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function rP(e,t){const n=AD(e);return n==="dark"?ll.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function nH({customStyle:e,currentTheme:t,onSave:n,onEvent:r}){const{authToken:o}=Oi(),i=Pe(D=>D.selectedLensId),{data:s,isLoading:a,isFetching:l,isError:c}=tH(),{theme:u,setTheme:f}=bD(),h=Pe(D=>D.dashboard.globalStyle),{setDashboard:p,setDashboardWithFilterValues:v,setSelectedSheetId:b,setStyle:w,setOnSaveFunction:y,setLenses:_,setSelectedLensId:S,setInitStore:E}=Pe(D=>D.actions);Pe(D=>D.actions.setCustomCards);const C=Pe(D=>D.actions.setFilterValues),O=Pe(D=>D.actions.setThemeStyle),T=Pe(D=>D.actions.setDashboardTheme),M=Pe(D=>D.actions.setOnEvent);m.useEffect(()=>{o&&E()},[o,E]),m.useEffect(()=>{if(u){const D=AD(u);T(D)}},[u,T]),m.useEffect(()=>{t&&f(t)},[t,f]);const N=m.useCallback(()=>{const D=ll.cloneDeep(Lg),F=ll.merge(D,h);if(e){const j=ll.merge(F,e),K=rP(u,j);O(K),w(j)}else{const j=rP(u,F);O(j),w(Lg)}},[u,e,h,O,w]);return m.useEffect(()=>{s&&s.dashboard&&N()},[u,e,h,N,s]),m.useEffect(()=>{var ee;if(!s||!s.dashboard)return;const{dashboard:D,filterValues:F,defaultLensId:j,lenses:K}=s;v(D,F||[]),j&&S(j),K&&_(K),b((ee=D.sheets)==null?void 0:ee[0].id)},[s,p,b,C,i,_,v,S]),m.useEffect(()=>{n&&y(n),r&&M(r)},[n,y,r,M]),{isFetching:l,isLoading:a,isError:c}}function Am({className:e,...t}){return R.jsx("div",{className:_e("animate-pulse rounded-md bg-muted",e),...t})}const pw=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));pw.displayName="Card";const km=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("flex flex-col space-y-1.5 p-6",e),...t}));km.displayName="CardHeader";const bu=L.forwardRef(({className:e,...t},n)=>R.jsx("h3",{ref:n,className:_e("text-2xl font-semibold leading-none tracking-tight",e),...t}));bu.displayName="CardTitle";const gw=L.forwardRef(({className:e,...t},n)=>R.jsx("p",{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));gw.displayName="CardDescription";const Mm=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("px-6 pt-0",e),...t}));Mm.displayName="CardContent";const mw=L.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:_e("flex items-center p-6 pt-0",e),...t}));mw.displayName="CardFooter";function kD({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,showAssistant:h,...p}){Pe(S=>S.selectedSheetId);const v=Pe(S=>S.themeStyle),b=Pe(S=>S.isSessionExpired),{isLoading:w,isError:y,isFetching:_}=nH({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return w||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?R.jsx(o,{message:"loading"}):R.jsx("div",{className:"flex items-center gap-3",children:R.jsx(Am,{className:"h-1 w-full dark:h-[2px]"})})):y?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),R.jsx(i,{})):R.jsx("div",{children:"Error"})):b?(r==null||r({type:"error",message:"Session Expired"}),R.jsx("div",{className:"flex h-full items-center justify-center",children:R.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[R.jsx(bu,{children:"Session Expired"}),R.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):R.jsx("div",{className:_e("flex h-full flex-col justify-between",v==null?void 0:v.dashboardPanel,e),role:"dashboard-panel",...p})}function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ce.apply(this,arguments)}function Me(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 tr(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:h,children:p,...v}=f,b=(h==null?void 0:h[e][l])||a,w=m.useMemo(()=>v,Object.values(v));return m.createElement(b.Provider,{value:w},p)}function u(f,h){const p=(h==null?void 0:h[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,rH(o,...t)]}function rH(...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 f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function oH(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function fs(...e){return t=>e.forEach(n=>oH(n,t))}function _t(...e){return m.useCallback(fs(...e),e)}const yx=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(sH);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(xx,ce({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(xx,ce({},r,{ref:t}),n)});yx.displayName="Slot";const xx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...aH(r,n.props),ref:t?fs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});xx.displayName="SlotClone";const iH=({children:e})=>m.createElement(m.Fragment,null,e);function sH(e){return m.isValidElement(e)&&e.type===iH}function aH(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 Im(e){const t=e+"CollectionProvider",[n,r]=tr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:b}=p,w=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:y,collectionRef:w},b)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:b,children:w}=p,y=i(a,b),_=_t(v,y.collectionRef);return m.createElement(yx,{ref:_},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:b,children:w,...y}=p,_=m.useRef(null),S=_t(v,_),E=i(c,b);return m.useEffect(()=>(E.itemMap.set(_,{ref:_,...y}),()=>void E.itemMap.delete(_))),m.createElement(yx,{[u]:"",ref:S},w)});function h(p){const v=i(e+"CollectionConsumer",p);return m.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const y=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((E,C)=>y.indexOf(E.ref.current)-y.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},h,r]}const ur=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},lH=L.useId||(()=>{});let cH=0;function Zo(e){const[t,n]=L.useState(lH());return ur(()=>{e||n(r=>r??String(cH++))},[e]),e||(t?`radix-${t}`:"")}const MD=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(dH);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(wx,ce({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(wx,ce({},r,{ref:t}),n)});MD.displayName="Slot";const wx=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...fH(r,n.props),ref:t?fs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});wx.displayName="SlotClone";const uH=({children:e})=>m.createElement(m.Fragment,null,e);function dH(e){return m.isValidElement(e)&&e.type===uH}function fH(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}}const hH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=hH.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?MD:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ce({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ID(e,t){e&&Cr.flushSync(()=>e.dispatchEvent(t))}function jn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function _r({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=pH({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=jn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function pH({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=jn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const gH=m.createContext(void 0);function Pl(e){const t=m.useContext(gH);return e||t||"ltr"}const l0="rovingFocusGroup.onEntryFocus",mH={bubbles:!1,cancelable:!0},vw="RovingFocusGroup",[_x,ND,vH]=Im(vw),[bH,yu]=tr(vw,[vH]),[yH,xH]=bH(vw),wH=m.forwardRef((e,t)=>m.createElement(_x.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(_x.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(_H,ce({},e,{ref:t}))))),_H=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),h=_t(t,f),p=Pl(i),[v=null,b]=_r({prop:s,defaultProp:a,onChange:l}),[w,y]=m.useState(!1),_=jn(c),S=ND(n),E=m.useRef(!1),[C,O]=m.useState(0);return m.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(l0,_),()=>T.removeEventListener(l0,_)},[_]),m.createElement(yH,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(T=>b(T),[b]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>O(T=>T-1),[])},m.createElement(Qe.div,ce({tabIndex:w||C===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{E.current=!0}),onFocus:Me(e.onFocus,T=>{const M=!E.current;if(T.target===T.currentTarget&&M&&!w){const N=new CustomEvent(l0,mH);if(T.currentTarget.dispatchEvent(N),!N.defaultPrevented){const D=S().filter(H=>H.focusable),F=D.find(H=>H.active),j=D.find(H=>H.id===v),ee=[F,j,...D].filter(Boolean).map(H=>H.ref.current);LD(ee)}}E.current=!1}),onBlur:Me(e.onBlur,()=>y(!1))})))}),SH="RovingFocusGroupItem",CH=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Zo(),l=i||a,c=xH(SH,n),u=c.currentTabStopId===l,f=ND(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),m.createElement(_x.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,ce({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Me(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Me(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Me(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=PH(v,c.orientation,c.dir);if(b!==void 0){v.preventDefault();let y=f().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const _=y.indexOf(v.currentTarget);y=c.loop?OH(y,_+1):y.slice(_+1)}setTimeout(()=>LD(y))}})})))}),EH={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RH(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function PH(e,t,n){const r=RH(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return EH[r]}function LD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function OH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const bw=wH,yw=CH;function $H(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const nr=e=>{const{present:t,children:n}=e,r=TH(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=_t(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};nr.displayName="Presence";function TH(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=$H(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=pp(r.current);i.current=a==="mounted"?c:"none"},[a]),ur(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=pp(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),ur(()=>{if(t){const c=f=>{const p=pp(r.current).includes(f.animationName);f.target===t&&p&&Cr.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=pp(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function pp(e){return(e==null?void 0:e.animationName)||"none"}const FD="Tabs",[DH,v1e]=tr(FD,[yu]),jD=yu(),[AH,xw]=DH(FD),kH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Pl(a),[f,h]=_r({prop:r,onChange:o,defaultProp:i});return m.createElement(AH,{scope:n,baseId:Zo(),value:f,onValueChange:h,orientation:s,dir:u,activationMode:l},m.createElement(Qe.div,ce({dir:u,"data-orientation":s},c,{ref:t})))}),MH="TabsList",IH=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=xw(MH,n),s=jD(n);return m.createElement(bw,ce({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,ce({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),NH="TabsTrigger",LH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=xw(NH,n),a=jD(n),l=zD(s.baseId,r),c=BD(s.baseId,r),u=r===s.value;return m.createElement(yw,ce({asChild:!0},a,{focusable:!o,active:u}),m.createElement(Qe.button,ce({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:Me(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Me(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),FH="TabsContent",jH=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=xw(FH,n),l=zD(a.baseId,r),c=BD(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),m.createElement(nr,{present:o||u},({present:h})=>m.createElement(Qe.div,ce({"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:f.current?"0s":void 0}}),h&&i))});function zD(e,t){return`${e}-trigger-${t}`}function BD(e,t){return`${e}-content-${t}`}const zH=kH,VD=IH,HD=LH,WD=jH,ww=zH,Nm=L.forwardRef(({className:e,...t},n)=>R.jsx(VD,{ref:n,className:_e("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Nm.displayName=VD.displayName;const Lm=L.forwardRef(({className:e,...t},n)=>R.jsx(HD,{ref:n,className:_e("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Lm.displayName=HD.displayName;const _w=L.forwardRef(({className:e,...t},n)=>R.jsx(WD,{ref:n,className:_e("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));_w.displayName=WD.displayName;var UD={exports:{}},Gf={},Sx={exports:{}};(function(e,t){(function(n,r){r(t)})(qs,function(n){function r(Q){return function(ie,ve,Y,be,Se,$e,Te){return Q(ie,ve,Te)}}function o(Q){return function(ie,ve,Y,be){if(!ie||!ve||typeof ie!="object"||typeof ve!="object")return Q(ie,ve,Y,be);var Se=be.get(ie),$e=be.get(ve);if(Se&&$e)return Se===ve&&$e===ie;be.set(ie,ve),be.set(ve,ie);var Te=Q(ie,ve,Y,be);return be.delete(ie),be.delete(ve),Te}}function i(Q,J){var ie={};for(var ve in Q)ie[ve]=Q[ve];for(var ve in J)ie[ve]=J[ve];return ie}function s(Q){return Q.constructor===Object||Q.constructor==null}function a(Q){return typeof Q.then=="function"}function l(Q,J){return Q===J||Q!==Q&&J!==J}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",h="[object RegExp]",p="[object Map]",v="[object Number]",b="[object Object]",w="[object Set]",y="[object String]",_=Object.prototype.toString;function S(Q){var J=Q.areArraysEqual,ie=Q.areDatesEqual,ve=Q.areMapsEqual,Y=Q.areObjectsEqual,be=Q.areRegExpsEqual,Se=Q.areSetsEqual,$e=Q.createIsNestedEqual,Te=$e(Ue);function Ue(Be,Ie,Ke){if(Be===Ie)return!0;if(!Be||!Ie||typeof Be!="object"||typeof Ie!="object")return Be!==Be&&Ie!==Ie;if(s(Be)&&s(Ie))return Y(Be,Ie,Te,Ke);var lt=Array.isArray(Be),It=Array.isArray(Ie);if(lt||It)return lt===It&&J(Be,Ie,Te,Ke);var Dt=_.call(Be);return Dt!==_.call(Ie)?!1:Dt===f?ie(Be,Ie,Te,Ke):Dt===h?be(Be,Ie,Te,Ke):Dt===p?ve(Be,Ie,Te,Ke):Dt===w?Se(Be,Ie,Te,Ke):Dt===b||Dt===c?a(Be)||a(Ie)?!1:Y(Be,Ie,Te,Ke):Dt===u||Dt===v||Dt===y?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function E(Q,J,ie,ve){var Y=Q.length;if(J.length!==Y)return!1;for(;Y-- >0;)if(!ie(Q[Y],J[Y],Y,Y,Q,J,ve))return!1;return!0}var C=o(E);function O(Q,J){return l(Q.valueOf(),J.valueOf())}function T(Q,J,ie,ve){var Y=Q.size===J.size;if(!Y)return!1;if(!Q.size)return!0;var be={},Se=0;return Q.forEach(function($e,Te){if(Y){var Ue=!1,Be=0;J.forEach(function(Ie,Ke){!Ue&&!be[Be]&&(Ue=ie(Te,Ke,Se,Be,Q,J,ve)&&ie($e,Ie,Te,Ke,Q,J,ve))&&(be[Be]=!0),Be++}),Se++,Y=Ue}}),Y}var M=o(T),N="_owner",D=Object.prototype.hasOwnProperty;function F(Q,J,ie,ve){var Y=Object.keys(Q),be=Y.length;if(Object.keys(J).length!==be)return!1;for(var Se;be-- >0;){if(Se=Y[be],Se===N){var $e=!!Q.$$typeof,Te=!!J.$$typeof;if(($e||Te)&&$e!==Te)return!1}if(!D.call(J,Se)||!ie(Q[Se],J[Se],Se,Se,Q,J,ve))return!1}return!0}var j=o(F);function K(Q,J){return Q.source===J.source&&Q.flags===J.flags}function ee(Q,J,ie,ve){var Y=Q.size===J.size;if(!Y)return!1;if(!Q.size)return!0;var be={};return Q.forEach(function(Se,$e){if(Y){var Te=!1,Ue=0;J.forEach(function(Be,Ie){!Te&&!be[Ue]&&(Te=ie(Se,Be,$e,Ie,Q,J,ve))&&(be[Ue]=!0),Ue++}),Y=Te}}),Y}var H=o(ee),te=Object.freeze({areArraysEqual:E,areDatesEqual:O,areMapsEqual:T,areObjectsEqual:F,areRegExpsEqual:K,areSetsEqual:ee,createIsNestedEqual:r}),X=Object.freeze({areArraysEqual:C,areDatesEqual:O,areMapsEqual:M,areObjectsEqual:j,areRegExpsEqual:K,areSetsEqual:H,createIsNestedEqual:r}),Z=S(te);function W(Q,J){return Z(Q,J,void 0)}var $=S(i(te,{createIsNestedEqual:function(){return l}}));function V(Q,J){return $(Q,J,void 0)}var U=S(X);function I(Q,J){return U(Q,J,new WeakMap)}var re=S(i(X,{createIsNestedEqual:function(){return l}}));function ue(Q,J){return re(Q,J,new WeakMap)}function de(Q){return S(i(te,Q(te)))}function pe(Q){var J=S(i(X,Q(X)));return function(ie,ve,Y){return Y===void 0&&(Y=new WeakMap),J(ie,ve,Y)}}n.circularDeepEqual=I,n.circularShallowEqual=ue,n.createCustomCircularEqual=pe,n.createCustomEqual=de,n.deepEqual=W,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(Sx,Sx.exports);var Sw=Sx.exports;const Cw=rw(Qz);var Pt={},BH=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(Pt,"__esModule",{value:!0});Pt.bottom=Ew;Pt.childrenEqual=UH;Pt.cloneLayout=qD;Pt.cloneLayoutItem=cl;Pt.collides=Fm;Pt.compact=YD;Pt.compactItem=KD;Pt.compactType=iW;Pt.correctBounds=XD;Pt.fastPositionEqual=GH;Pt.fastRGLPropsEqual=void 0;Pt.getAllCollisions=QD;Pt.getFirstCollision=Xa;Pt.getLayoutItem=Rw;Pt.getStatics=Pw;Pt.modifyLayout=GD;Pt.moveElement=yd;Pt.moveElementAwayFromCollision=Ex;Pt.noop=void 0;Pt.perc=KH;Pt.resizeItemInDirection=tW;Pt.setTopLeft=rW;Pt.setTransform=nW;Pt.sortLayoutItems=kw;Pt.sortLayoutItemsByColRow=nA;Pt.sortLayoutItemsByRowCol=tA;Pt.synchronizeLayoutWithChildren=oW;Pt.validateLayout=rA;Pt.withLayoutItem=WH;var oP=Sw,bd=VH(m);function VH(e){return e&&e.__esModule?e:{default:e}}const HH=process.env.NODE_ENV==="production";function Ew(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 qD(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=cl(e[n]);return t}function GD(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 WH(e,t,n){let r=Rw(e,t);return r?(r=n(cl(r)),e=GD(e,r),[e,r]):[e,null]}function cl(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 UH(e,t){return(0,oP.deepEqual)(bd.default.Children.map(e,n=>n==null?void 0:n.key),bd.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,oP.deepEqual)(bd.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),bd.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const qH=BH;Pt.fastRGLPropsEqual=qH;function GH(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Fm(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 YD(e,t,n,r){const o=Pw(e),i=kw(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=cl(i[a]);c.static||(c=KD(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const YH={x:"w",y:"h"};function Cx(e,t,n,r){const o=YH[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;Fm(t,a)&&Cx(e,a,n+t[o],r)}}t[r]=n}function KD(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Ew(e),t.y);t.y>0&&!Xa(e,t);)t.y--;else if(a)for(;t.x>0&&!Xa(e,t);)t.x--;let l;for(;(l=Xa(e,t))&&!(n===null&&i);)if(a?Cx(o,t,l.x+l.w,"x"):Cx(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Xa(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function XD(e,t){const n=Pw(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(;Xa(n,i);)i.y++}return e}function Rw(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Xa(e,t){for(let n=0,r=e.length;n<r;n++)if(Fm(e[n],t))return e[n]}function QD(e,t){return e.filter(n=>Fm(n,t))}function Pw(e){return e.filter(t=>t.static)}function yd(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(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 f=kw(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=QD(f,t),v=p.length>0;if(v&&l)return qD(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let b=0,w=p.length;b<w;b++){const y=p[b];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(y.i," at [").concat(y.x,",").concat(y.y,"]"),!y.moved&&(y.static?e=Ex(e,y,t,o,s):e=Ex(e,t,y,o,s))}return e}function Ex(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={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=Xa(e,f),p=h&&h.y+h.h>t.y,v=h&&t.x+t.w>h.x;if(h){if(p&&a)return yd(e,n,void 0,t.y+1,r,l,o);if(p&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return yd(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),yd(e,n,s?f.x:void 0,a?f.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:yd(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function KH(e){return e*100+"%"}const JD=(e,t,n,r)=>e+n>r?t:n,ZD=(e,t,n)=>e<0?t:n,eA=e=>Math.max(0,e),Ow=e=>Math.max(0,e),$w=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:ZD(s,e.height,o),top:Ow(s)}},Tw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:JD(e.left,e.width,s,n),left:eA(o)}},Dw=(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:JD(e.left,e.width,i,n),top:Ow(r),left:eA(s)}},Aw=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:ZD(r,e.height,i),top:Ow(r)}},XH=function(){return $w(arguments.length<=0?void 0:arguments[0],Tw(...arguments))},QH=function(){return $w(arguments.length<=0?void 0:arguments[0],Dw(...arguments))},JH=function(){return Aw(arguments.length<=0?void 0:arguments[0],Tw(...arguments))},ZH=function(){return Aw(arguments.length<=0?void 0:arguments[0],Dw(...arguments))},eW={n:$w,ne:XH,e:Tw,se:JH,s:Aw,sw:ZH,w:Dw,nw:QH};function tW(e,t,n,r){const o=eW[e];return o?o(t,{...t,...n},r):n}function nW(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function rW(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function kw(e,t){return t==="horizontal"?nA(e):t==="vertical"?tA(e):e}function tA(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 nA(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 oW(e,t,n,r,o){e=e||[];const i=[];bd.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Rw(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(cl(l)):c?(HH||rA([c],"ReactGridLayout.children"),i.push(cl({...c,i:a.key}))):i.push(cl({w:1,h:1,x:0,y:Ew(i),i:String(a.key)}))});const s=XD(i,{cols:n});return o?s:YD(s,r,n)}function rA(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++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function iW(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const sW=()=>{};Pt.noop=sW;var $i={};Object.defineProperty($i,"__esModule",{value:!0});$i.calcGridColWidth=jm;$i.calcGridItemPosition=aW;$i.calcGridItemWHPx=Rx;$i.calcWH=cW;$i.calcXY=lW;$i.clamp=Qa;function jm(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Rx(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function aW(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=jm(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Rx(r,c,s[0]),u.height=Rx(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 lW(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=jm(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=Qa(u,0,s-r),f=Qa(f,0,l-o),{x:u,y:f}}function cW(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=jm(e);let f=Math.round((t+s[0])/(u+s[0])),h=Math.round((n+s[1])/(c+s[1])),p=Qa(f,0,l-r),v=Qa(h,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Qa(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=Qa(h,0,a)),{w:p,h:v}}function Qa(e,t,n){return Math.max(Math.min(e,n),t)}var zm={},Px={exports:{}},c0,iP;function Mw(){if(iP)return c0;iP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return c0=e,c0}var u0,sP;function uW(){if(sP)return u0;sP=1;var e=Mw();function t(){}function n(){}return n.resetWarningCache=t,u0=function(){function r(s,a,l,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},u0}var gp={exports:{}},qt={};/** @license React v16.13.1
89
89
  * react-is.development.js
90
90
  *
91
91
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-AIu_vTQd.js");require("react");require("react-dom");exports.Dashboard=e.Dashboard;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-IjsKPI0S.js");require("react");require("react-dom");exports.Dashboard=e.Dashboard;
@@ -1,4 +1,4 @@
1
- import { D as p } from "../chunks/index-Bqfi2Wzc.js";
1
+ import { D as p } from "../chunks/index-4enkmjoO.js";
2
2
  import "react";
3
3
  import "react-dom";
4
4
  export {
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-AIu_vTQd.js"),n=require("./chunks/dashboard-plus-OKnoKUSd.js"),I=require("react");require("react-dom");function N({card:t,footer:u,className:c,...h}){const{customCards:r}=e.useSemaphorContext(),m=I.useRef(null),{isError:p,isLoading:i,isFetching:a,cfg:x,visualKey:C,handleDatapointClick:f}=e.useDashboardCard(t),l=e.useDashboardStore(s=>s.themeStyle),d=e.useDashboardStore(s=>s.selectedSheetId),E=e.useDashboardStore(s=>s.selectedCardId),j=e.useDashboardStore(s=>s.isDashboardEditing),{setCardTitle:D,setCardDescription:g,setSelectedCardId:b}=e.useDashboardActions();function S(s){s.stopPropagation(),b(d,t.id)}function T(){if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.replaceDefault){const o=s.content;if(o)return e.jsxRuntimeExports.jsx(o,{card:t})}}return t.type==="kpi"?t.data&&t.data.length>0&&e.jsxRuntimeExports.jsx(e.KPICard,{isLoading:i||a,card:t}):y}function R(){if(p)return e.jsxRuntimeExports.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(t.type==="table"&&t.data&&t.data.length>0)return e.jsxRuntimeExports.jsxs(e.ScrollArea,{children:[e.jsxRuntimeExports.jsx(e.TableVisual,{card:t,data:t.data}),e.jsxRuntimeExports.jsx(e.ScrollBar,{orientation:"horizontal"})]});if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.content){const o=s.content;return e.jsxRuntimeExports.jsx(o,{card:t})}}if(x)return e.jsxRuntimeExports.jsx(e.ChartJsVisual,{cfg:x,onDatapointClick:f},C)}function A(){if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.footer){const o=s.footer;if(o)return e.jsxRuntimeExports.jsx(o,{card:t})}}return u||null}if(!t.id)return null;const y=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(e.CardHeader,{className:"pb-4",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxRuntimeExports.jsx(e.Editable,{text:t.title,onSave:s=>D(d,t.id,s),children:e.jsxRuntimeExports.jsx(e.CardTitle,{className:"text-base",children:t.title})}),t.refreshInterval&&e.jsxRuntimeExports.jsxs(e.Tooltip,{children:[e.jsxRuntimeExports.jsx(e.TooltipTrigger,{className:"pr-1",children:e.jsxRuntimeExports.jsx("div",{className:e.cn("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":i||a})})}),e.jsxRuntimeExports.jsx(e.TooltipContent,{side:"right",align:"center",children:e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:`Realtime (${t==null?void 0:t.refreshInterval})`})})]}),!t.refreshInterval&&(i||a)&&e.jsxRuntimeExports.jsx(n.LoaderCircle,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),e.jsxRuntimeExports.jsx(e.Editable,{text:(t==null?void 0:t.description)||"",onSave:s=>g(d,t.id,s),children:e.jsxRuntimeExports.jsxs(e.CardDescription,{children:[" ",t.description]})})]}),e.jsxRuntimeExports.jsx(e.CardContent,{className:"relative flex grow flex-col overflow-auto pb-0",children:R()}),e.jsxRuntimeExports.jsx(e.CardFooter,{children:A()})]});return e.jsxRuntimeExports.jsx(e.Card,{tabIndex:-1,ref:m,role:"dashboard-card",onClick:S,className:e.cn("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":E===t.id&&j},l==null?void 0:l.dashboardCard,c),...h,children:T()})}exports.BOOLEAN_DATA_TYPES=e.BOOLEAN_DATA_TYPES;exports.DATE_DATA_TYPES=e.DATE_DATA_TYPES;exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.NUMBER_DATA_TYPES=e.NUMBER_DATA_TYPES;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.TEXT_DATA_TYPES=e.TEXT_DATA_TYPES;exports.createSqlGenConfig=e.createSqlGenConfig;exports.fmt=e.fmt;exports.getColumnDataType=e.getColumnDataType;exports.getFilterValueType=e.getFilterValueType;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.resolveDataType=e.resolveDataType;exports.useCard=e.useCard;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardStore=e.useDashboardStore;exports.useEditorActions=e.useEditorActions;exports.useEditorStore=e.useEditorStore;exports.SelectComponent=n.SelectComponent;exports.Surfboard=n.DashboardPlus;exports.cleanCard=n.cleanCard;exports.getDashbaordStateWithoutData=n.getDashbaordStateWithoutData;exports.useEditorAside=n.useEditorAside;exports.DashboardCard=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-IjsKPI0S.js"),n=require("./chunks/dashboard-plus-evpUp_5m.js"),I=require("react");require("react-dom");function N({card:t,footer:u,className:c,...h}){const{customCards:r}=e.useSemaphorContext(),m=I.useRef(null),{isError:p,isLoading:i,isFetching:a,cfg:x,visualKey:C,handleDatapointClick:f}=e.useDashboardCard(t),l=e.useDashboardStore(s=>s.themeStyle),d=e.useDashboardStore(s=>s.selectedSheetId),E=e.useDashboardStore(s=>s.selectedCardId),j=e.useDashboardStore(s=>s.isDashboardEditing),{setCardTitle:D,setCardDescription:g,setSelectedCardId:b}=e.useDashboardActions();function S(s){s.stopPropagation(),b(d,t.id)}function T(){if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.replaceDefault){const o=s.content;if(o)return e.jsxRuntimeExports.jsx(o,{card:t})}}return t.type==="kpi"?t.data&&t.data.length>0&&e.jsxRuntimeExports.jsx(e.KPICard,{isLoading:i||a,card:t}):y}function R(){if(p)return e.jsxRuntimeExports.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(t.type==="table"&&t.data&&t.data.length>0)return e.jsxRuntimeExports.jsxs(e.ScrollArea,{children:[e.jsxRuntimeExports.jsx(e.TableVisual,{card:t,data:t.data}),e.jsxRuntimeExports.jsx(e.ScrollBar,{orientation:"horizontal"})]});if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.content){const o=s.content;return e.jsxRuntimeExports.jsx(o,{card:t})}}if(x)return e.jsxRuntimeExports.jsx(e.ChartJsVisual,{cfg:x,onDatapointClick:f},C)}function A(){if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.footer){const o=s.footer;if(o)return e.jsxRuntimeExports.jsx(o,{card:t})}}return u||null}if(!t.id)return null;const y=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(e.CardHeader,{className:"pb-4",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxRuntimeExports.jsx(e.Editable,{text:t.title,onSave:s=>D(d,t.id,s),children:e.jsxRuntimeExports.jsx(e.CardTitle,{className:"text-base",children:t.title})}),t.refreshInterval&&e.jsxRuntimeExports.jsxs(e.Tooltip,{children:[e.jsxRuntimeExports.jsx(e.TooltipTrigger,{className:"pr-1",children:e.jsxRuntimeExports.jsx("div",{className:e.cn("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":i||a})})}),e.jsxRuntimeExports.jsx(e.TooltipContent,{side:"right",align:"center",children:e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:`Realtime (${t==null?void 0:t.refreshInterval})`})})]}),!t.refreshInterval&&(i||a)&&e.jsxRuntimeExports.jsx(n.LoaderCircle,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),e.jsxRuntimeExports.jsx(e.Editable,{text:(t==null?void 0:t.description)||"",onSave:s=>g(d,t.id,s),children:e.jsxRuntimeExports.jsxs(e.CardDescription,{children:[" ",t.description]})})]}),e.jsxRuntimeExports.jsx(e.CardContent,{className:"relative flex grow flex-col overflow-auto pb-0",children:R()}),e.jsxRuntimeExports.jsx(e.CardFooter,{children:A()})]});return e.jsxRuntimeExports.jsx(e.Card,{tabIndex:-1,ref:m,role:"dashboard-card",onClick:S,className:e.cn("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":E===t.id&&j},l==null?void 0:l.dashboardCard,c),...h,children:T()})}exports.BOOLEAN_DATA_TYPES=e.BOOLEAN_DATA_TYPES;exports.DATE_DATA_TYPES=e.DATE_DATA_TYPES;exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.NUMBER_DATA_TYPES=e.NUMBER_DATA_TYPES;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.TEXT_DATA_TYPES=e.TEXT_DATA_TYPES;exports.createSqlGenConfig=e.createSqlGenConfig;exports.fmt=e.fmt;exports.getColumnDataType=e.getColumnDataType;exports.getFilterValueType=e.getFilterValueType;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.resolveDataType=e.resolveDataType;exports.useCard=e.useCard;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardStore=e.useDashboardStore;exports.useEditorActions=e.useEditorActions;exports.useEditorStore=e.useEditorStore;exports.SelectComponent=n.SelectComponent;exports.Surfboard=n.DashboardPlus;exports.cleanCard=n.cleanCard;exports.getDashbaordStateWithoutData=n.getDashbaordStateWithoutData;exports.useEditorAside=n.useEditorAside;exports.DashboardCard=N;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { u as _, a as w, b as r, c as F, j as t, C as P, E as f, d as k, T as R, e as L, f as h, g as q, h as B, i as Y, k as G, l as K, K as O, S as V, m as z, n as H, o as Q } from "./chunks/index-Bqfi2Wzc.js";
2
- import { B as se, s as ae, D as oe, q as re, N as ne, I as ie, r as le, w as de, t as ue, y as ce, x as fe, A as he, v as Ce, z as me, F as xe, p as pe, H as ge, G as je } from "./chunks/index-Bqfi2Wzc.js";
3
- import { L as W } from "./chunks/dashboard-plus-oEw_T4fB.js";
4
- import { S as be, D as Se, c as Te, g as Ee, u as Ie } from "./chunks/dashboard-plus-oEw_T4fB.js";
1
+ import { u as _, a as w, b as r, c as F, j as t, C as P, E as f, d as k, T as R, e as L, f as h, g as q, h as B, i as Y, k as G, l as K, K as O, S as V, m as z, n as H, o as Q } from "./chunks/index-4enkmjoO.js";
2
+ import { B as se, s as ae, D as oe, q as re, N as ne, I as ie, r as le, w as de, t as ue, y as ce, x as fe, A as he, v as Ce, z as me, F as xe, p as pe, H as ge, G as je } from "./chunks/index-4enkmjoO.js";
3
+ import { L as W } from "./chunks/dashboard-plus--c5NKvhK.js";
4
+ import { S as be, D as Se, c as Te, g as Ee, u as Ie } from "./chunks/dashboard-plus--c5NKvhK.js";
5
5
  import J from "react";
6
6
  import "react-dom";
7
7
  function Z({
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-OKnoKUSd.js");require("../chunks/index-AIu_vTQd.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-evpUp_5m.js");require("../chunks/index-IjsKPI0S.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
@@ -1,5 +1,5 @@
1
- import { D as i } from "../chunks/dashboard-plus-oEw_T4fB.js";
2
- import "../chunks/index-Bqfi2Wzc.js";
1
+ import { D as i } from "../chunks/dashboard-plus--c5NKvhK.js";
2
+ import "../chunks/index-4enkmjoO.js";
3
3
  import "react";
4
4
  import "react-dom";
5
5
  export {
@@ -68,6 +68,7 @@ declare type Actions = {
68
68
  getStyle: () => TStyle | undefined;
69
69
  setOnSaveFunction: (onSaveFunction: (dashboard: TDashboard) => void) => void;
70
70
  setOnAddCard: (onAddCard: (card: TCard, sheetId: string) => void) => void;
71
+ setOnAcceptChanges: (onAcceptChanges: (frame: TFrame) => void) => void;
71
72
  setOnUpdateCard: (onUpdateCard: (card: TCard, sheetId: string) => void) => void;
72
73
  setOnRemoveCard: (onRemoveCard: (card: TCard, sheetId: string) => void) => void;
73
74
  setOnEvent: (onEvent: (event: TEvent) => void) => void;
@@ -252,6 +253,7 @@ export declare type DashboardStore = {
252
253
  onEvent?: (event: TEvent) => void;
253
254
  onSaveFunction?: (dashboard: TDashboard) => void;
254
255
  onAddFrame?: (card: TFrame, sheetId: string) => void;
256
+ onAcceptChanges?: (frame: TFrame) => void;
255
257
  onUpdateCard?: (card: TCard, sheetId: string) => void;
256
258
  onRemoveCard?: (card: TCard, sheetId: string) => void;
257
259
  actions: Actions;
@@ -1645,6 +1647,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1645
1647
  onEvent?: ((event: TEvent) => void) | undefined;
1646
1648
  onSaveFunction?: ((dashboard: TDashboard) => void) | undefined;
1647
1649
  onAddFrame?: ((card: TFrame, sheetId: string) => void) | undefined;
1650
+ onAcceptChanges?: ((frame: TFrame) => void) | undefined;
1648
1651
  onUpdateCard?: ((card: TCard, sheetId: string) => void) | undefined;
1649
1652
  onRemoveCard?: ((card: TCard, sheetId: string) => void) | undefined;
1650
1653
  actions: {
@@ -1702,6 +1705,7 @@ export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<DashboardSto
1702
1705
  getStyle: () => TStyle | undefined;
1703
1706
  setOnSaveFunction: (onSaveFunction: (dashboard: TDashboard) => void) => void;
1704
1707
  setOnAddCard: (onAddCard: (card: TCard, sheetId: string) => void) => void;
1708
+ setOnAcceptChanges: (onAcceptChanges: (frame: TFrame) => void) => void;
1705
1709
  setOnUpdateCard: (onUpdateCard: (card: TCard, sheetId: string) => void) => void;
1706
1710
  setOnRemoveCard: (onRemoveCard: (card: TCard, sheetId: string) => void) => void;
1707
1711
  setOnEvent: (onEvent: (event: TEvent) => void) => void;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.248",
8
+ "version": "0.0.249",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",