react-semaphor 0.0.290 → 0.0.291
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.
- package/dist/chunks/{dashboard-plus-LDgc9sdb.js → dashboard-plus-0OULctzd.js} +2 -2
- package/dist/chunks/{dashboard-plus-tpC9RwP9.js → dashboard-plus-oC4vRia7.js} +2 -2
- package/dist/chunks/{index-s1-3fkbc.js → index-FhvN1zHF.js} +1 -1
- package/dist/chunks/{index-CGIUYFBx.js → index-j6u8TMrb.js} +1 -1
- package/dist/chunks/{lucide-react-Tu85lAAG.js → lucide-react-C382QbK3.js} +1 -1
- package/dist/chunks/{lucide-react-TsHimnSy.js → lucide-react-KlIkHuLE.js} +3 -3
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
|
@@ -85,7 +85,7 @@ __p += '`),jt&&(Pe+=`' +
|
|
|
85
85
|
function print() { __p += __j.call(arguments, '') }
|
|
86
86
|
`:`;
|
|
87
87
|
`)+Pe+`return __p
|
|
88
|
-
}`;var St=cP(function(){return Ut(H,Ye+"return "+Pe).apply(n,Q)});if(St.source=Pe,jy(St))throw St;return St}function IW(f){return Jt(f).toLowerCase()}function NW(f){return Jt(f).toUpperCase()}function LW(f,g,w){if(f=Jt(f),f&&(w||g===n))return vR(f);if(!f||!(g=so(g)))return f;var P=ai(f),N=ai(g),H=yR(P,N),Q=xR(P,N)+1;return os(P,H,Q).join("")}function FW(f,g,w){if(f=Jt(f),f&&(w||g===n))return f.slice(0,_R(f)+1);if(!f||!(g=so(g)))return f;var P=ai(f),N=xR(P,ai(g))+1;return os(P,0,N).join("")}function jW(f,g,w){if(f=Jt(f),f&&(w||g===n))return f.replace(Jn,"");if(!f||!(g=so(g)))return f;var P=ai(f),N=yR(P,ai(g));return os(P,N).join("")}function zW(f,g){var w=L,P=F;if(On(g)){var N="separator"in g?g.separator:N;w="length"in g?bt(g.length):w,P="omission"in g?so(g.omission):P}f=Jt(f);var H=f.length;if(Tc(f)){var Q=ai(f);H=Q.length}if(w>=H)return f;var re=w-Ac(P);if(re<1)return P;var le=Q?os(Q,0,re).join(""):f.slice(0,re);if(N===n)return le+P;if(Q&&(re+=le.length-re),zy(N)){if(f.slice(re).search(N)){var _e,Se=le;for(N.global||(N=ny(N.source,Jt(Ge.exec(N))+"g")),N.lastIndex=0;_e=N.exec(Se);)var Pe=_e.index;le=le.slice(0,Pe===n?re:Pe)}}else if(f.indexOf(so(N),re)!=re){var je=le.lastIndexOf(N);je>-1&&(le=le.slice(0,je))}return le+P}function BW(f){return f=Jt(f),f&&jn.test(f)?f.replace(rn,mj):f}var VW=jc(function(f,g,w){return f+(w?" ":"")+g.toUpperCase()}),Hy=u5("toUpperCase");function lP(f,g,w){return f=Jt(f),g=w?n:g,g===n?dj(f)?yj(f):nj(f):f.match(g)||[]}var cP=Pt(function(f,g){try{return io(f,n,g)}catch(w){return jy(w)?w:new ft(w)}}),HW=ha(function(f,g){return No(g,function(w){w=Oi(w),da(f,w,Ly(f[w],f))}),f});function WW(f){var g=f==null?0:f.length,w=Je();return f=g?Pn(f,function(P){if(typeof P[1]!="function")throw new Lo(a);return[w(P[0]),P[1]]}):[],Pt(function(P){for(var N=-1;++N<g;){var H=f[N];if(io(H[0],this,P))return io(H[1],this,P)}})}function UW(f){return mz(jo(f,d))}function Wy(f){return function(){return f}}function GW(f,g){return f==null||f!==f?g:f}var qW=f5(),YW=f5(!0);function Wr(f){return f}function Uy(f){return VR(typeof f=="function"?f:jo(f,d))}function KW(f){return WR(jo(f,d))}function XW(f,g){return UR(f,jo(g,d))}var QW=Pt(function(f,g){return function(w){return zd(w,f,g)}}),JW=Pt(function(f,g){return function(w){return zd(f,w,g)}});function Gy(f,g,w){var P=er(g),N=ag(g,P);w==null&&!(On(g)&&(N.length||!P.length))&&(w=g,g=f,f=this,N=ag(g,er(g)));var H=!(On(w)&&"chain"in w)||!!w.chain,Q=ga(f);return No(N,function(re){var le=g[re];f[re]=le,Q&&(f.prototype[re]=function(){var _e=this.__chain__;if(H||_e){var Se=f(this.__wrapped__),Pe=Se.__actions__=Br(this.__actions__);return Pe.push({func:le,args:arguments,thisArg:f}),Se.__chain__=_e,Se}return le.apply(f,Ja([this.value()],arguments))})}),f}function ZW(){return ar._===this&&(ar._=Ej),this}function qy(){}function eU(f){return f=bt(f),Pt(function(g){return GR(g,f)})}var tU=Cy(Pn),nU=Cy(hR),rU=Cy(Kv);function uP(f){return Ty(f)?Xv(Oi(f)):Mz(f)}function oU(f){return function(g){return f==null?n:il(f,g)}}var iU=p5(),aU=p5(!0);function Yy(){return[]}function Ky(){return!1}function sU(){return{}}function lU(){return""}function cU(){return!0}function uU(f,g){if(f=bt(f),f<1||f>K)return[];var w=V,P=mr(f,V);g=Je(g),f-=V;for(var N=Zv(P,g);++w<f;)g(w);return N}function dU(f){return ht(f)?Pn(f,Oi):lo(f)?[f]:Br(D5(Jt(f)))}function fU(f){var g=++Sj;return Jt(f)+g}var hU=fg(function(f,g){return f+g},0),pU=Ey("ceil"),gU=fg(function(f,g){return f/g},1),mU=Ey("floor");function bU(f){return f&&f.length?ig(f,Wr,uy):n}function vU(f,g){return f&&f.length?ig(f,Je(g,2),uy):n}function yU(f){return mR(f,Wr)}function xU(f,g){return mR(f,Je(g,2))}function wU(f){return f&&f.length?ig(f,Wr,py):n}function _U(f,g){return f&&f.length?ig(f,Je(g,2),py):n}var SU=fg(function(f,g){return f*g},1),CU=Ey("round"),EU=fg(function(f,g){return f-g},0);function RU(f){return f&&f.length?Jv(f,Wr):0}function PU(f,g){return f&&f.length?Jv(f,Je(g,2)):0}return B.after=KV,B.ary=B5,B.assign=NH,B.assignIn=tP,B.assignInWith=Eg,B.assignWith=LH,B.at=FH,B.before=V5,B.bind=Ly,B.bindAll=HW,B.bindKey=H5,B.castArray=sH,B.chain=F5,B.chunk=mB,B.compact=bB,B.concat=vB,B.cond=WW,B.conforms=UW,B.constant=Wy,B.countBy=RV,B.create=jH,B.curry=W5,B.curryRight=U5,B.debounce=G5,B.defaults=zH,B.defaultsDeep=BH,B.defer=XV,B.delay=QV,B.difference=yB,B.differenceBy=xB,B.differenceWith=wB,B.drop=_B,B.dropRight=SB,B.dropRightWhile=CB,B.dropWhile=EB,B.fill=RB,B.filter=$V,B.flatMap=TV,B.flatMapDeep=AV,B.flatMapDepth=MV,B.flatten=k5,B.flattenDeep=PB,B.flattenDepth=$B,B.flip=JV,B.flow=qW,B.flowRight=YW,B.fromPairs=OB,B.functions=YH,B.functionsIn=KH,B.groupBy=kV,B.initial=TB,B.intersection=AB,B.intersectionBy=MB,B.intersectionWith=kB,B.invert=QH,B.invertBy=JH,B.invokeMap=NV,B.iteratee=Uy,B.keyBy=LV,B.keys=er,B.keysIn=Hr,B.map=yg,B.mapKeys=eW,B.mapValues=tW,B.matches=KW,B.matchesProperty=XW,B.memoize=wg,B.merge=nW,B.mergeWith=nP,B.method=QW,B.methodOf=JW,B.mixin=Gy,B.negate=_g,B.nthArg=eU,B.omit=rW,B.omitBy=oW,B.once=ZV,B.orderBy=FV,B.over=tU,B.overArgs=eH,B.overEvery=nU,B.overSome=rU,B.partial=Fy,B.partialRight=q5,B.partition=jV,B.pick=iW,B.pickBy=rP,B.property=uP,B.propertyOf=oU,B.pull=FB,B.pullAll=N5,B.pullAllBy=jB,B.pullAllWith=zB,B.pullAt=BB,B.range=iU,B.rangeRight=aU,B.rearg=tH,B.reject=VV,B.remove=VB,B.rest=nH,B.reverse=Iy,B.sampleSize=WV,B.set=sW,B.setWith=lW,B.shuffle=UV,B.slice=HB,B.sortBy=YV,B.sortedUniq=XB,B.sortedUniqBy=QB,B.split=TW,B.spread=rH,B.tail=JB,B.take=ZB,B.takeRight=eV,B.takeRightWhile=tV,B.takeWhile=nV,B.tap=bV,B.throttle=oH,B.thru=vg,B.toArray=J5,B.toPairs=oP,B.toPairsIn=iP,B.toPath=dU,B.toPlainObject=eP,B.transform=cW,B.unary=iH,B.union=rV,B.unionBy=oV,B.unionWith=iV,B.uniq=aV,B.uniqBy=sV,B.uniqWith=lV,B.unset=uW,B.unzip=Ny,B.unzipWith=L5,B.update=dW,B.updateWith=fW,B.values=Vc,B.valuesIn=hW,B.without=cV,B.words=lP,B.wrap=aH,B.xor=uV,B.xorBy=dV,B.xorWith=fV,B.zip=hV,B.zipObject=pV,B.zipObjectDeep=gV,B.zipWith=mV,B.entries=oP,B.entriesIn=iP,B.extend=tP,B.extendWith=Eg,Gy(B,B),B.add=hU,B.attempt=cP,B.camelCase=bW,B.capitalize=aP,B.ceil=pU,B.clamp=pW,B.clone=lH,B.cloneDeep=uH,B.cloneDeepWith=dH,B.cloneWith=cH,B.conformsTo=fH,B.deburr=sP,B.defaultTo=GW,B.divide=gU,B.endsWith=vW,B.eq=li,B.escape=yW,B.escapeRegExp=xW,B.every=PV,B.find=OV,B.findIndex=A5,B.findKey=VH,B.findLast=DV,B.findLastIndex=M5,B.findLastKey=HH,B.floor=mU,B.forEach=j5,B.forEachRight=z5,B.forIn=WH,B.forInRight=UH,B.forOwn=GH,B.forOwnRight=qH,B.get=By,B.gt=hH,B.gte=pH,B.has=XH,B.hasIn=Vy,B.head=I5,B.identity=Wr,B.includes=IV,B.indexOf=DB,B.inRange=gW,B.invoke=ZH,B.isArguments=ll,B.isArray=ht,B.isArrayBuffer=gH,B.isArrayLike=Vr,B.isArrayLikeObject=zn,B.isBoolean=mH,B.isBuffer=is,B.isDate=bH,B.isElement=vH,B.isEmpty=yH,B.isEqual=xH,B.isEqualWith=wH,B.isError=jy,B.isFinite=_H,B.isFunction=ga,B.isInteger=Y5,B.isLength=Sg,B.isMap=K5,B.isMatch=SH,B.isMatchWith=CH,B.isNaN=EH,B.isNative=RH,B.isNil=$H,B.isNull=PH,B.isNumber=X5,B.isObject=On,B.isObjectLike=Mn,B.isPlainObject=Gd,B.isRegExp=zy,B.isSafeInteger=OH,B.isSet=Q5,B.isString=Cg,B.isSymbol=lo,B.isTypedArray=Bc,B.isUndefined=DH,B.isWeakMap=TH,B.isWeakSet=AH,B.join=IB,B.kebabCase=wW,B.last=Bo,B.lastIndexOf=NB,B.lowerCase=_W,B.lowerFirst=SW,B.lt=MH,B.lte=kH,B.max=bU,B.maxBy=vU,B.mean=yU,B.meanBy=xU,B.min=wU,B.minBy=_U,B.stubArray=Yy,B.stubFalse=Ky,B.stubObject=sU,B.stubString=lU,B.stubTrue=cU,B.multiply=SU,B.nth=LB,B.noConflict=ZW,B.noop=qy,B.now=xg,B.pad=CW,B.padEnd=EW,B.padStart=RW,B.parseInt=PW,B.random=mW,B.reduce=zV,B.reduceRight=BV,B.repeat=$W,B.replace=OW,B.result=aW,B.round=CU,B.runInContext=ie,B.sample=HV,B.size=GV,B.snakeCase=DW,B.some=qV,B.sortedIndex=WB,B.sortedIndexBy=UB,B.sortedIndexOf=GB,B.sortedLastIndex=qB,B.sortedLastIndexBy=YB,B.sortedLastIndexOf=KB,B.startCase=AW,B.startsWith=MW,B.subtract=EU,B.sum=RU,B.sumBy=PU,B.template=kW,B.times=uU,B.toFinite=ma,B.toInteger=bt,B.toLength=Z5,B.toLower=IW,B.toNumber=Vo,B.toSafeInteger=IH,B.toString=Jt,B.toUpper=NW,B.trim=LW,B.trimEnd=FW,B.trimStart=jW,B.truncate=zW,B.unescape=BW,B.uniqueId=fU,B.upperCase=VW,B.upperFirst=Hy,B.each=j5,B.eachRight=z5,B.first=I5,Gy(B,function(){var f={};return Pi(B,function(g,w){on.call(B.prototype,w)||(f[w]=g)}),f}(),{chain:!1}),B.VERSION=r,No(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){B[f].placeholder=B}),No(["drop","take"],function(f,g){Ft.prototype[f]=function(w){w=w===n?1:qn(bt(w),0);var P=this.__filtered__&&!g?new Ft(this):this.clone();return P.__filtered__?P.__takeCount__=mr(w,P.__takeCount__):P.__views__.push({size:mr(w,V),type:f+(P.__dir__<0?"Right":"")}),P},Ft.prototype[f+"Right"]=function(w){return this.reverse()[f](w).reverse()}}),No(["filter","map","takeWhile"],function(f,g){var w=g+1,P=w==G||w==q;Ft.prototype[f]=function(N){var H=this.clone();return H.__iteratees__.push({iteratee:Je(N,3),type:w}),H.__filtered__=H.__filtered__||P,H}}),No(["head","last"],function(f,g){var w="take"+(g?"Right":"");Ft.prototype[f]=function(){return this[w](1).value()[0]}}),No(["initial","tail"],function(f,g){var w="drop"+(g?"":"Right");Ft.prototype[f]=function(){return this.__filtered__?new Ft(this):this[w](1)}}),Ft.prototype.compact=function(){return this.filter(Wr)},Ft.prototype.find=function(f){return this.filter(f).head()},Ft.prototype.findLast=function(f){return this.reverse().find(f)},Ft.prototype.invokeMap=Pt(function(f,g){return typeof f=="function"?new Ft(this):this.map(function(w){return zd(w,f,g)})}),Ft.prototype.reject=function(f){return this.filter(_g(Je(f)))},Ft.prototype.slice=function(f,g){f=bt(f);var w=this;return w.__filtered__&&(f>0||g<0)?new Ft(w):(f<0?w=w.takeRight(-f):f&&(w=w.drop(f)),g!==n&&(g=bt(g),w=g<0?w.dropRight(-g):w.take(g-f)),w)},Ft.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},Ft.prototype.toArray=function(){return this.take(V)},Pi(Ft.prototype,function(f,g){var w=/^(?:filter|find|map|reject)|While$/.test(g),P=/^(?:head|last)$/.test(g),N=B[P?"take"+(g=="last"?"Right":""):g],H=P||/^find/.test(g);N&&(B.prototype[g]=function(){var Q=this.__wrapped__,re=P?[1]:arguments,le=Q instanceof Ft,_e=re[0],Se=le||ht(Q),Pe=function(Mt){var jt=N.apply(B,Ja([Mt],re));return P&&je?jt[0]:jt};Se&&w&&typeof _e=="function"&&_e.length!=1&&(le=Se=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=H&&!je,St=le&&!Ye;if(!H&&Se){Q=St?Q:new Ft(this);var tt=f.apply(Q,re);return tt.__actions__.push({func:vg,args:[Pe],thisArg:n}),new Fo(tt,je)}return et&&St?f.apply(this,re):(tt=this.thru(Pe),et?P?tt.value()[0]:tt.value():tt)})}),No(["pop","push","shift","sort","splice","unshift"],function(f){var g=Wp[f],w=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",P=/^(?:pop|shift)$/.test(f);B.prototype[f]=function(){var N=arguments;if(P&&!this.__chain__){var H=this.value();return g.apply(ht(H)?H:[],N)}return this[w](function(Q){return g.apply(ht(Q)?Q:[],N)})}}),Pi(Ft.prototype,function(f,g){var w=B[g];if(w){var P=w.name+"";on.call(Nc,P)||(Nc[P]=[]),Nc[P].push({name:g,func:w})}}),Nc[dg(n,y).name]=[{name:"wrapper",func:n}],Ft.prototype.clone=Bj,Ft.prototype.reverse=Vj,Ft.prototype.value=Hj,B.prototype.at=vV,B.prototype.chain=yV,B.prototype.commit=xV,B.prototype.next=wV,B.prototype.plant=SV,B.prototype.reverse=CV,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=EV,B.prototype.first=B.prototype.head,Md&&(B.prototype[Md]=_V),B},Mc=xj();el?((el.exports=Mc)._=Mc,Uv._=Mc):ar._=Mc}).call(vs)})(f0,f0.exports);var au=f0.exports;const Bl=pc(au);function DP({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:a}){const s={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:a||10};return t||(t={}),OS.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,d)=>Math.max(u,d.y+d.h),0);s.y=s.y===0?0:c,t[l].push(s)}),t}function TP(e,t){t&&OS.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}function wb(e){return xe.getState().dashboard.globalCacheConfig}const xe=$M()(IM((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:d0},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:d0},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!0,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,a,s,l,c,u,d,h;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(p=>p.id===n);if(o!==void 0&&o>-1){(a=r.dashboard.sheets)==null||a.splice(o,1);const p=(s=r.dashboard.filters)==null?void 0:s.filter(v=>v.sheetId===n),b=(l=r.filterValues)==null?void 0:l.filter(v=>p==null?void 0:p.some(x=>x.id===v.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(v=>!(b!=null&&b.some(x=>x.filterId===v.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(v=>v.sheetId!==n),r.selectedSheetId=(h=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:h.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(s=>{OS.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:s.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const a={...n,layouts:i};r.dashboard.sheets.push(a)})},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 a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===o.selectedSheetId);i&&au.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.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,a;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(s=>s.id===n);o!=null&&o>-1&&((a=r.dashboard.baseQueries)==null||a.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,a;const o=(i=r.filteringCards)==null?void 0:i.findIndex(s=>s.id===n.id);o!==void 0&&o>-1&&((a=r.filteringCards)==null||a.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 a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var s,l;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(c=>c.id===n);a&&au.forEach(a.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===o.selectedSheetId);i&&au.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var s,l;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(c=>c.id===n);a&&au.forEach(a.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var s,l,c,u;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(d=>d.id===n);if(a){const d=(c=a.cards)==null?void 0:c.find(h=>h.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var s,l;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(c=>c.id===n);a&&au.forEach(a.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.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 a,s,l;const i=(a=r==null?void 0:r.filterValues)==null?void 0:a.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(s=r.filterValues)==null||s.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,a;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(a=r.dashboard.sheets)==null||a.find(s=>s.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(s=>{DP({id:n.id,layouts:s.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,a;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(s>-1){(i=r.dashboard.filters)==null||i.splice(s,1),(a=r.dashboard.sheets)==null||a.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{TP(n,c.layouts)})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,h;const a=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!a)return;const s=(u=a==null?void 0:a.frames)==null?void 0:u.find(p=>p.id===r);if(s){const p=(d=s.cards)==null?void 0:d.findIndex(b=>b.id===o.id);p>-1&&((h=s.cards)==null||h.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(s=>s.id===n.id);a>-1&&((i=r.dashboard.filters)==null||i.splice(a,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var s,l,c,u;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(d=>d.id===n);if(a){a.frames||(a.frames=[]),(c=a.frames)==null||c.push(r);let d=1/0;const h=0;o==="start"&&(d=0),DP({id:r.id,layouts:a.layouts,minH:10,x:h,y:d}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var a,s,l,c,u;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),TP(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var s,l,c,u,d;const i=(l=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(h=>h.id===n),a=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(a,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var s,l,c,u,d;const i=(l=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(h=>h.id===n),a=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(a,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var s,l,c,u,d,h;const i=(l=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(p=>p.id===n),a=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(a,1),(d=i.layout)==null||d.splice(a,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 a,s,l;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.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,a;((a=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:a.find(s=>s.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,a;((a=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:a.find(s=>s.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 a=0;a<r.length;a++){const s=r[a].frames;if(s){for(let l=0;l<s.length;l++)if((i=s[l].cards)==null?void 0:i.find(u=>u.id===n))return s[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(a=>a.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(a=>a.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let a=0;a<r.length;a++){const s=r[a].frames;if(s)for(let l=0;l<s.length;l++){const c=(i=s[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 a=0;a<r.length;a++){const s=r[a].frames;if(s){for(let l=0;l<s.length;l++)if((i=s[l].cards)==null?void 0:i.find(u=>u.id===n))return r[a]}}},handleDataPointClickAction:(n,r)=>{tq({card:n,dataPoint:r,set:e,get:t})}}}))),Sr=()=>xe(e=>e.actions),nq={theme:"system",setTheme:()=>null},VM=m.createContext(nq);function rq({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const s=window.document.documentElement;if(s.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";s.classList.add(l);return}s.classList.add(o)},[o]);const a={theme:o,setTheme:s=>{localStorage.setItem(n,s),i(s)}};return R.jsx(VM.Provider,{...r,value:a,children:e})}const HM=()=>{const e=m.useContext(VM);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var ap=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(){}},qu=typeof window>"u"||"Deno"in window;function qo(){}function oq(e,t){return typeof e=="function"?e(t):e}function dw(e){return typeof e=="number"&&e>=0&&e!==1/0}function WM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function AP(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==AS(a,t.options))return!1}else if(!ah(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function MP(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ih(t.options.mutationKey)!==ih(i))return!1}else if(!ah(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function AS(e,t){return((t==null?void 0:t.queryKeyHashFn)||ih)(e)}function ih(e){return JSON.stringify(e,(t,n)=>hw(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ah(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ah(e[n],t[n])):!1}function UM(e,t){if(e===t)return e;const n=kP(e)&&kP(t);if(n||hw(e)&&hw(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),a=i.length,s=n?[]:{};let l=0;for(let c=0;c<a;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(s[u]=void 0,l++):(s[u]=UM(e[u],t[u]),s[u]===e[u]&&e[u]!==void 0&&l++)}return o===a&&l===o?e:s}return t}function fw(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function kP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function hw(e){if(!IP(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!IP(n)||!n.hasOwnProperty("isPrototypeOf"))}function IP(e){return Object.prototype.toString.call(e)==="[object Object]"}function iq(e){return new Promise(t=>{setTimeout(t,e)})}function pw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?UM(e,t):t}function aq(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function sq(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ml,xs,Ou,uM,lq=(uM=class extends ap{constructor(){super();Xe(this,Ml,void 0);Xe(this,xs,void 0);Xe(this,Ou,void 0);Ve(this,Ou,t=>{if(!qu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){se(this,xs)||this.setEventListener(se(this,Ou))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,xs))==null||t.call(this),Ve(this,xs,void 0))}setEventListener(t){var n;Ve(this,Ou,t),(n=se(this,xs))==null||n.call(this),Ve(this,xs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){se(this,Ml)!==t&&(Ve(this,Ml,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof se(this,Ml)=="boolean"?se(this,Ml):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ml=new WeakMap,xs=new WeakMap,Ou=new WeakMap,uM),h0=new lq,Du,ws,Tu,dM,cq=(dM=class extends ap{constructor(){super();Xe(this,Du,!0);Xe(this,ws,void 0);Xe(this,Tu,void 0);Ve(this,Tu,t=>{if(!qu&&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(){se(this,ws)||this.setEventListener(se(this,Tu))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,ws))==null||t.call(this),Ve(this,ws,void 0))}setEventListener(t){var n;Ve(this,Tu,t),(n=se(this,ws))==null||n.call(this),Ve(this,ws,t(this.setOnline.bind(this)))}setOnline(t){se(this,Du)!==t&&(Ve(this,Du,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return se(this,Du)}},Du=new WeakMap,ws=new WeakMap,Tu=new WeakMap,dM),p0=new cq;function uq(e){return Math.min(1e3*2**e,3e4)}function _b(e){return(e??"online")==="online"?p0.isOnline():!0}var GM=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function o1(e){return e instanceof GM}function qM(e){let t=!1,n=0,r=!1,o,i,a;const s=new Promise((x,y)=>{i=x,a=y}),l=x=>{var y;r||(p(new GM(x)),(y=e.abort)==null||y.call(e))},c=()=>{t=!0},u=()=>{t=!1},d=()=>!h0.isFocused()||e.networkMode!=="always"&&!p0.isOnline(),h=x=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,x),o==null||o(),i(x))},p=x=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,x),o==null||o(),a(x))},b=()=>new Promise(x=>{var y;o=_=>{const S=r||!d();return S&&x(_),S},(y=e.onPause)==null||y.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),v=()=>{if(r)return;let x;try{x=e.fn()}catch(y){x=Promise.reject(y)}Promise.resolve(x).then(h).catch(y=>{var $;if(r)return;const _=e.retry??(qu?0:3),S=e.retryDelay??uq,E=typeof S=="function"?S(n,y):S,C=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!C){p(y);return}n++,($=e.onFail)==null||$.call(e,n,y),iq(E).then(()=>{if(d())return b()}).then(()=>{t?p(y):v()})})};return _b(e.networkMode)?v():b().then(v),{promise:s,cancel:l,continue:()=>(o==null?void 0:o())?s:Promise.resolve(),cancelRetry:c,continueRetry:u}}function dq(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},a=h=>{let p;t++;try{p=h()}finally{t--,t||c()}return p},s=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...p)=>{s(()=>{h(...p)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{n(p)})})})};return{batch:a,batchCalls:l,schedule:s,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var ur=dq(),kl,fM,YM=(fM=class{constructor(){Xe(this,kl,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dw(this.gcTime)&&Ve(this,kl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qu?1/0:5*60*1e3))}clearGcTimeout(){se(this,kl)&&(clearTimeout(se(this,kl)),Ve(this,kl,void 0))}},kl=new WeakMap,fM),Au,Mu,Wo,_s,Uo,tr,qh,Il,ku,Gm,hi,wa,hM,fq=(hM=class extends YM{constructor(t){super();Xe(this,ku);Xe(this,hi);Xe(this,Au,void 0);Xe(this,Mu,void 0);Xe(this,Wo,void 0);Xe(this,_s,void 0);Xe(this,Uo,void 0);Xe(this,tr,void 0);Xe(this,qh,void 0);Xe(this,Il,void 0);Ve(this,Il,!1),Ve(this,qh,t.defaultOptions),$t(this,ku,Gm).call(this,t.options),Ve(this,tr,[]),Ve(this,Wo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,Au,t.state||hq(this.options)),this.state=se(this,Au),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!se(this,tr).length&&this.state.fetchStatus==="idle"&&se(this,Wo).remove(this)}setData(t,n){const r=pw(this.state.data,t,this.options);return $t(this,hi,wa).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){$t(this,hi,wa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=se(this,_s);return(r=se(this,Uo))==null||r.cancel(t),n?n.then(qo).catch(qo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(se(this,Au))}isActive(){return se(this,tr).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||se(this,tr).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!WM(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=se(this,tr).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Uo))==null||n.continue()}onOnline(){var n;const t=se(this,tr).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Uo))==null||n.continue()}addObserver(t){se(this,tr).includes(t)||(se(this,tr).push(t),this.clearGcTimeout(),se(this,Wo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){se(this,tr).includes(t)&&(Ve(this,tr,se(this,tr).filter(n=>n!==t)),se(this,tr).length||(se(this,Uo)&&(se(this,Il)?se(this,Uo).cancel({revert:!0}):se(this,Uo).cancelRetry()),this.scheduleGc()),se(this,Wo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return se(this,tr).length}invalidate(){this.state.isInvalidated||$t(this,hi,wa).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(se(this,_s))return(c=se(this,Uo))==null||c.continueRetry(),se(this,_s)}if(t&&$t(this,ku,Gm).call(this,t),!this.options.queryFn){const p=se(this,tr).find(b=>b.options.queryFn);p&&$t(this,ku,Gm).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,Il,!0),r.signal)})};i(o);const a=()=>this.options.queryFn?(Ve(this,Il,!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}'`)),s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};i(s),(u=this.options.behavior)==null||u.onFetch(s,this),Ve(this,Mu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=s.fetchOptions)==null?void 0:d.meta))&&$t(this,hi,wa).call(this,{type:"fetch",meta:(h=s.fetchOptions)==null?void 0:h.meta});const l=p=>{var b,v,x,y;o1(p)&&p.silent||$t(this,hi,wa).call(this,{type:"error",error:p}),o1(p)||((v=(b=se(this,Wo).config).onError)==null||v.call(b,p,this),(y=(x=se(this,Wo).config).onSettled)==null||y.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Uo,qM({fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var b,v,x,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),(v=(b=se(this,Wo).config).onSuccess)==null||v.call(b,p,this),(y=(x=se(this,Wo).config).onSettled)==null||y.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,b)=>{$t(this,hi,wa).call(this,{type:"failed",failureCount:p,error:b})},onPause:()=>{$t(this,hi,wa).call(this,{type:"pause"})},onContinue:()=>{$t(this,hi,wa).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode})),Ve(this,_s,se(this,Uo).promise),se(this,_s)}},Au=new WeakMap,Mu=new WeakMap,Wo=new WeakMap,_s=new WeakMap,Uo=new WeakMap,tr=new WeakMap,qh=new WeakMap,Il=new WeakMap,ku=new WeakSet,Gm=function(t){this.options={...se(this,qh),...t},this.updateGcTime(this.options.gcTime)},hi=new WeakSet,wa=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:_b(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 o1(o)&&o.revert&&se(this,Mu)?{...se(this,Mu),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),ur.batch(()=>{se(this,tr).forEach(r=>{r.onQueryUpdate()}),se(this,Wo).notify({query:this,type:"updated",action:t})})},hM);function hq(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 Ii,pM,KM=(pM=class extends ap{constructor(t={}){super();Xe(this,Ii,void 0);this.config=t,Ve(this,Ii,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??AS(o,n);let a=this.get(i);return a||(a=new fq({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){se(this,Ii).has(t.queryHash)||(se(this,Ii).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=se(this,Ii).get(t.queryHash);n&&(t.destroy(),n===t&&se(this,Ii).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ur.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return se(this,Ii).get(t)}getAll(){return[...se(this,Ii).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>AP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>AP(t,r)):n}notify(t){ur.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ur.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ur.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ii=new WeakMap,pM),Ni,Yh,mo,Iu,Li,ps,gM,pq=(gM=class extends YM{constructor(t){super();Xe(this,Li);Xe(this,Ni,void 0);Xe(this,Yh,void 0);Xe(this,mo,void 0);Xe(this,Iu,void 0);this.mutationId=t.mutationId,Ve(this,Yh,t.defaultOptions),Ve(this,mo,t.mutationCache),Ve(this,Ni,[]),this.state=t.state||gq(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...se(this,Yh),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){se(this,Ni).includes(t)||(se(this,Ni).push(t),this.clearGcTimeout(),se(this,mo).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,Ni,se(this,Ni).filter(n=>n!==t)),this.scheduleGc(),se(this,mo).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){se(this,Ni).length||(this.state.status==="pending"?this.scheduleGc():se(this,mo).remove(this))}continue(){var t;return((t=se(this,Iu))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,a,s,l,c,u,d,h,p,b,v,x,y,_,S,E,C,$,O;const n=()=>(Ve(this,Iu,qM({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(D,M)=>{$t(this,Li,ps).call(this,{type:"failed",failureCount:D,error:M})},onPause:()=>{$t(this,Li,ps).call(this,{type:"pause"})},onContinue:()=>{$t(this,Li,ps).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),se(this,Iu).promise),r=this.state.status==="pending";try{if(!r){$t(this,Li,ps).call(this,{type:"pending",variables:t}),await((i=(o=se(this,mo).config).onMutate)==null?void 0:i.call(o,t,this));const M=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));M!==this.state.context&&$t(this,Li,ps).call(this,{type:"pending",context:M,variables:t})}const D=await n();return await((c=(l=se(this,mo).config).onSuccess)==null?void 0:c.call(l,D,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,D,t,this.state.context)),await((p=(h=se(this,mo).config).onSettled)==null?void 0:p.call(h,D,null,this.state.variables,this.state.context,this)),await((v=(b=this.options).onSettled)==null?void 0:v.call(b,D,null,t,this.state.context)),$t(this,Li,ps).call(this,{type:"success",data:D}),D}catch(D){try{throw await((y=(x=se(this,mo).config).onError)==null?void 0:y.call(x,D,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,D,t,this.state.context)),await((C=(E=se(this,mo).config).onSettled)==null?void 0:C.call(E,void 0,D,this.state.variables,this.state.context,this)),await((O=($=this.options).onSettled)==null?void 0:O.call($,void 0,D,t,this.state.context)),D}finally{$t(this,Li,ps).call(this,{type:"error",error:D})}}}},Ni=new WeakMap,Yh=new WeakMap,mo=new WeakMap,Iu=new WeakMap,Li=new WeakSet,ps=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:!_b(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),ur.batch(()=>{se(this,Ni).forEach(r=>{r.onMutationUpdate(t)}),se(this,mo).notify({mutation:this,type:"updated",action:t})})},gM);function gq(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Go,Kh,Nl,mM,mq=(mM=class extends ap{constructor(t={}){super();Xe(this,Go,void 0);Xe(this,Kh,void 0);Xe(this,Nl,void 0);this.config=t,Ve(this,Go,[]),Ve(this,Kh,0)}build(t,n,r){const o=new pq({mutationCache:this,mutationId:++Rg(this,Kh)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){se(this,Go).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,Go,se(this,Go).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){ur.batch(()=>{se(this,Go).forEach(t=>{this.remove(t)})})}getAll(){return se(this,Go)}find(t){const n={exact:!0,...t};return se(this,Go).find(r=>MP(n,r))}findAll(t={}){return se(this,Go).filter(n=>MP(t,n))}notify(t){ur.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,Nl,(se(this,Nl)??Promise.resolve()).then(()=>{const t=se(this,Go).filter(n=>n.state.isPaused);return ur.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(qo)),Promise.resolve()))}).then(()=>{Ve(this,Nl,void 0)})),se(this,Nl)}},Go=new WeakMap,Kh=new WeakMap,Nl=new WeakMap,mM);function bq(e){return{onFetch:(t,n)=>{const r=async()=>{var b,v,x,y,_;const o=t.options,i=(x=(v=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:v.fetchMore)==null?void 0:x.direction,a=((y=t.state.data)==null?void 0:y.pages)||[],s=((_=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)})},d=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 $={queryKey:t.queryKey,pageParam:E,direction:C?"backward":"forward",meta:t.options.meta};u($);const O=await d($),{maxPages:D}=t.options,M=C?sq:aq;return{pages:M(S.pages,O,D),pageParams:M(S.pageParams,E,D)}};let p;if(i&&a.length){const S=i==="backward",E=S?vq:NP,C={pages:a,pageParams:s},$=E(o,C);p=await h(C,$,S)}else{p=await h(l,s[0]??o.initialPageParam);const S=e??a.length;for(let E=1;E<S;E++){const C=NP(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 NP(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function vq(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Yn,Ss,Cs,Nu,Lu,Es,Fu,ju,bM,yq=(bM=class{constructor(e={}){Xe(this,Yn,void 0);Xe(this,Ss,void 0);Xe(this,Cs,void 0);Xe(this,Nu,void 0);Xe(this,Lu,void 0);Xe(this,Es,void 0);Xe(this,Fu,void 0);Xe(this,ju,void 0);Ve(this,Yn,e.queryCache||new KM),Ve(this,Ss,e.mutationCache||new mq),Ve(this,Cs,e.defaultOptions||{}),Ve(this,Nu,new Map),Ve(this,Lu,new Map),Ve(this,Es,0)}mount(){Rg(this,Es)._++,se(this,Es)===1&&(Ve(this,Fu,h0.subscribe(()=>{h0.isFocused()&&(this.resumePausedMutations(),se(this,Yn).onFocus())})),Ve(this,ju,p0.subscribe(()=>{p0.isOnline()&&(this.resumePausedMutations(),se(this,Yn).onOnline())})))}unmount(){var e,t;Rg(this,Es)._--,se(this,Es)===0&&((e=se(this,Fu))==null||e.call(this),Ve(this,Fu,void 0),(t=se(this,ju))==null||t.call(this),Ve(this,ju,void 0))}isFetching(e){return se(this,Yn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return se(this,Ss).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=se(this,Yn).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=se(this,Yn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=oq(t,o);if(typeof i>"u")return;const a=this.defaultQueryOptions({queryKey:e});return se(this,Yn).build(this,a).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return ur.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=se(this,Yn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=se(this,Yn);ur.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=se(this,Yn),r={type:"active",...e};return ur.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=ur.batch(()=>se(this,Yn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(qo).catch(qo)}invalidateQueries(e={},t={}){return ur.batch(()=>{if(se(this,Yn).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=ur.batch(()=>se(this,Yn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(qo)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(qo)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=se(this,Yn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qo).catch(qo)}fetchInfiniteQuery(e){return e.behavior=bq(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qo).catch(qo)}resumePausedMutations(){return se(this,Ss).resumePausedMutations()}getQueryCache(){return se(this,Yn)}getMutationCache(){return se(this,Ss)}getDefaultOptions(){return se(this,Cs)}setDefaultOptions(e){Ve(this,Cs,e)}setQueryDefaults(e,t){se(this,Nu).set(ih(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...se(this,Nu).values()];let n={};return t.forEach(r=>{ah(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){se(this,Lu).set(ih(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...se(this,Lu).values()];let n={};return t.forEach(r=>{ah(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...se(this,Cs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=AS(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:{...se(this,Cs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){se(this,Yn).clear(),se(this,Ss).clear()}},Yn=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,Nu=new WeakMap,Lu=new WeakMap,Es=new WeakMap,Fu=new WeakMap,ju=new WeakMap,bM),Xr,xn,Xh,Ar,Ll,zu,Fi,Qh,Bu,Vu,Fl,jl,Rs,Hu,zl,wf,Jh,gw,Zh,mw,ep,bw,tp,vw,np,yw,rp,xw,op,ww,hb,XM,vM,xq=(vM=class extends ap{constructor(t,n){super();Xe(this,zl);Xe(this,Jh);Xe(this,Zh);Xe(this,ep);Xe(this,tp);Xe(this,np);Xe(this,rp);Xe(this,op);Xe(this,hb);Xe(this,Xr,void 0);Xe(this,xn,void 0);Xe(this,Xh,void 0);Xe(this,Ar,void 0);Xe(this,Ll,void 0);Xe(this,zu,void 0);Xe(this,Fi,void 0);Xe(this,Qh,void 0);Xe(this,Bu,void 0);Xe(this,Vu,void 0);Xe(this,Fl,void 0);Xe(this,jl,void 0);Xe(this,Rs,void 0);Xe(this,Hu,new Set);this.options=n,Ve(this,Xr,t),Ve(this,Fi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(se(this,xn).addObserver(this),LP(se(this,xn),this.options)?$t(this,zl,wf).call(this):this.updateResult(),$t(this,tp,vw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _w(se(this,xn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _w(se(this,xn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,$t(this,np,yw).call(this),$t(this,rp,xw).call(this),se(this,xn).removeObserver(this)}setOptions(t,n){const r=this.options,o=se(this,xn);if(this.options=se(this,Xr).defaultQueryOptions(t),fw(r,this.options)||se(this,Xr).getQueryCache().notify({type:"observerOptionsUpdated",query:se(this,xn),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),$t(this,op,ww).call(this);const i=this.hasListeners();i&&FP(se(this,xn),o,this.options,r)&&$t(this,zl,wf).call(this),this.updateResult(n),i&&(se(this,xn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&$t(this,Jh,gw).call(this);const a=$t(this,Zh,mw).call(this);i&&(se(this,xn)!==o||this.options.enabled!==r.enabled||a!==se(this,Rs))&&$t(this,ep,bw).call(this,a)}getOptimisticResult(t){const n=se(this,Xr).getQueryCache().build(se(this,Xr),t),r=this.createResult(n,t);return _q(this,r)&&(Ve(this,Ar,r),Ve(this,zu,this.options),Ve(this,Ll,se(this,xn).state)),r}getCurrentResult(){return se(this,Ar)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(se(this,Hu).add(r),t[r])})}),n}getCurrentQuery(){return se(this,xn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=se(this,Xr).defaultQueryOptions(t),r=se(this,Xr).getQueryCache().build(se(this,Xr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return $t(this,zl,wf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),se(this,Ar)))}createResult(t,n){var $;const r=se(this,xn),o=this.options,i=se(this,Ar),a=se(this,Ll),s=se(this,zu),c=t!==r?t.state:se(this,Xh),{state:u}=t;let{error:d,errorUpdatedAt:h,fetchStatus:p,status:b}=u,v=!1,x;if(n._optimisticResults){const O=this.hasListeners(),D=!O&&LP(t,n),M=O&&FP(t,r,n,o);(D||M)&&(p=_b(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(b="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(a==null?void 0:a.data)&&n.select===se(this,Qh))x=se(this,Bu);else try{Ve(this,Qh,n.select),x=n.select(u.data),x=pw(i==null?void 0:i.data,x,n),Ve(this,Bu,x),Ve(this,Fi,null)}catch(O){Ve(this,Fi,O)}else x=u.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&b==="pending"){let O;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))O=i.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData(($=se(this,Vu))==null?void 0:$.state.data,se(this,Vu)):n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),Ve(this,Fi,null)}catch(D){Ve(this,Fi,D)}typeof O<"u"&&(b="success",x=pw(i==null?void 0:i.data,O,n),v=!0)}se(this,Fi)&&(d=se(this,Fi),x=se(this,Bu),h=Date.now(),b="error");const y=p==="fetching",_=b==="pending",S=b==="error",E=_&&y;return{status:b,fetchStatus:p,isPending:_,isSuccess:b==="success",isError:S,isInitialLoading:E,isLoading:E,data:x,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:v,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:MS(t,n),refetch:this.refetch}}updateResult(t){const n=se(this,Ar),r=this.createResult(se(this,xn),this.options);if(Ve(this,Ll,se(this,xn).state),Ve(this,zu,this.options),se(this,Ll).data!==void 0&&Ve(this,Vu,se(this,xn)),fw(r,n))return;Ve(this,Ar,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!se(this,Hu).size)return!0;const l=new Set(s??se(this,Hu));return this.options.throwOnError&&l.add("error"),Object.keys(se(this,Ar)).some(c=>{const u=c;return se(this,Ar)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),$t(this,hb,XM).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&$t(this,tp,vw).call(this)}},Xr=new WeakMap,xn=new WeakMap,Xh=new WeakMap,Ar=new WeakMap,Ll=new WeakMap,zu=new WeakMap,Fi=new WeakMap,Qh=new WeakMap,Bu=new WeakMap,Vu=new WeakMap,Fl=new WeakMap,jl=new WeakMap,Rs=new WeakMap,Hu=new WeakMap,zl=new WeakSet,wf=function(t){$t(this,op,ww).call(this);let n=se(this,xn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(qo)),n},Jh=new WeakSet,gw=function(){if($t(this,np,yw).call(this),qu||se(this,Ar).isStale||!dw(this.options.staleTime))return;const n=WM(se(this,Ar).dataUpdatedAt,this.options.staleTime)+1;Ve(this,Fl,setTimeout(()=>{se(this,Ar).isStale||this.updateResult()},n))},Zh=new WeakSet,mw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(se(this,xn)):this.options.refetchInterval)??!1},ep=new WeakSet,bw=function(t){$t(this,rp,xw).call(this),Ve(this,Rs,t),!(qu||this.options.enabled===!1||!dw(se(this,Rs))||se(this,Rs)===0)&&Ve(this,jl,setInterval(()=>{(this.options.refetchIntervalInBackground||h0.isFocused())&&$t(this,zl,wf).call(this)},se(this,Rs)))},tp=new WeakSet,vw=function(){$t(this,Jh,gw).call(this),$t(this,ep,bw).call(this,$t(this,Zh,mw).call(this))},np=new WeakSet,yw=function(){se(this,Fl)&&(clearTimeout(se(this,Fl)),Ve(this,Fl,void 0))},rp=new WeakSet,xw=function(){se(this,jl)&&(clearInterval(se(this,jl)),Ve(this,jl,void 0))},op=new WeakSet,ww=function(){const t=se(this,Xr).getQueryCache().build(se(this,Xr),this.options);if(t===se(this,xn))return;const n=se(this,xn);Ve(this,xn,t),Ve(this,Xh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},hb=new WeakSet,XM=function(t){ur.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(se(this,Ar))}),se(this,Xr).getQueryCache().notify({query:se(this,xn),type:"observerResultsUpdated"})})},vM);function wq(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function LP(e,t){return wq(e,t)||e.state.dataUpdatedAt>0&&_w(e,t,t.refetchOnMount)}function _w(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&MS(e,t)}return!1}function FP(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&MS(e,n)}function MS(e,t){return e.isStaleByTime(t.staleTime)}function _q(e,t){return!fw(e.getCurrentResult(),t)}var QM=j.createContext(void 0),JM=e=>{const t=j.useContext(QM);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Sq=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),j.createElement(QM.Provider,{value:e},t)),ZM=j.createContext(!1),Cq=()=>j.useContext(ZM);ZM.Provider;function Eq(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Rq=j.createContext(Eq()),Pq=()=>j.useContext(Rq);function $q(e,t){return typeof e=="function"?e(...t):!!e}var Oq=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},Dq=e=>{j.useEffect(()=>{e.clearReset()},[e])},Tq=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&$q(n,[e.error,r]),Aq=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Mq=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,kq=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Iq(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=JM(n),o=Cq(),i=Pq(),a=r.defaultQueryOptions(e);a._optimisticResults=o?"isRestoring":"optimistic",Aq(a),Oq(a,i),Dq(i);const[s]=j.useState(()=>new t(r,a)),l=s.getOptimisticResult(a);if(j.useSyncExternalStore(j.useCallback(c=>{const u=o?()=>{}:s.subscribe(ur.batchCalls(c));return s.updateResult(),u},[s,o]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),j.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),Mq(a,l))throw kq(a,s,i);if(Tq({result:l,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return a.notifyOnChangeProps?l:s.trackResult(l)}function sp(e,t){return Iq(e,xq,t)}function e6({children:e}){const{setIsSessionExpired:t}=Sr(),n=new yq({queryCache:new KM({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return R.jsx(Sq,{client:n,children:e})}const gc=m.forwardRef(({children:e,className:t,...n},r)=>R.jsx("div",{className:we("semaphor-scope",t),ref:r,...n,children:e})),Nq={id:"",authToken:void 0},t6=m.createContext(Nq),n6=({children:e,dashboardProps:t})=>R.jsx(e6,{children:R.jsx(t6.Provider,{value:t,children:R.jsx(gc,{style:{height:"100%"},children:e})})});function _i(){const e=m.useContext(t6);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function Lq(){const{authToken:e,version:t}=_i(),n=xe(s=>s.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:a}=sp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>xG(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:o,isFetching:i,isError:a}}function r6(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function jP(e,t){const n=r6(e);return n==="dark"?Bl.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function Fq({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,onFilterValuesChange:i}){const{authToken:a}=_i(),s=xe(A=>A.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:d}=Lq(),[h,p]=m.useState(o||[]),{theme:b,setTheme:v}=HM(),x=xe(A=>A.dashboard.globalStyle),{setDashboard:y,setDashboardWithFilterValues:_,setSelectedSheetId:S,setStyle:E,setOnSaveFunction:C,setLenses:$,setSelectedLensId:O,setInitStore:D}=xe(A=>A.actions);xe(A=>A.actions.setCustomCards);const M=xe(A=>A.actions.setFilterValues),L=xe(A=>A.filterValues),F=xe(A=>A.actions.setThemeStyle),z=xe(A=>A.actions.setDashboardTheme),X=xe(A=>A.actions.setOnEvent);m.useEffect(()=>{a&&D()},[a,D]),m.useEffect(()=>{if(b){const A=r6(b);z(A)}},[b,z]),m.useEffect(()=>{t&&v(t)},[t,v]);const G=m.useCallback(()=>{const A=Bl.cloneDeep(d0),q=Bl.merge(A,x);if(e){const U=Bl.merge(q,e),K=jP(b,U);F(K),E(U)}else{const U=jP(b,q);F(U),E(d0)}},[b,e,x,F,E]);return m.useEffect(()=>{l&&l.dashboard&&G()},[b,e,x,G,l]),m.useEffect(()=>{var V,Y;function A(I,ne){const ce=I.filters||[],ue=[];for(const he of ne){const Z=ce.find(te=>te.id===he.filterId);Z&&ue.push({filterId:he.filterId,connectionType:Z.database==="NA"?"api":"database",name:Z.column,operation:Z.operation,valueType:bu(Z),values:he.values})}return ue}if(!l||!l.dashboard)return;const{dashboard:q,filterValues:U,defaultLensId:K,lenses:W}=l,T=A(q,h||[]);_(q,U||T||[]),K&&O(K),W&&$(W),S(((Y=(V=q==null?void 0:q.sheets)==null?void 0:V[0])==null?void 0:Y.id)||null)},[l,y,S,M,s,$,_,O,h]),m.useEffect(()=>{i&&L&&i(L)},[L,i]),m.useEffect(()=>{n&&C(n),r&&X(r)},[n,C,r,X]),{isFetching:u,isLoading:c,isError:d}}function Sb({className:e,...t}){return R.jsx("div",{className:we("animate-pulse rounded-md bg-muted",e),...t})}const kS=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:we("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));kS.displayName="Card";const Cb=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:we("flex flex-col space-y-1.5 p-6",e),...t}));Cb.displayName="CardHeader";const gd=j.forwardRef(({className:e,...t},n)=>R.jsx("h3",{ref:n,className:we("text-2xl font-semibold leading-none tracking-tight",e),...t}));gd.displayName="CardTitle";const IS=j.forwardRef(({className:e,...t},n)=>R.jsx("p",{ref:n,className:we("text-sm text-muted-foreground",e),...t}));IS.displayName="CardDescription";const Eb=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:we("px-6 pt-0",e),...t}));Eb.displayName="CardContent";const NS=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:we("flex items-center p-6 pt-0",e),...t}));NS.displayName="CardFooter";function o6({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:a,id:s,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:h,defaultFilterValues:p,onFilterValuesChange:b,...v}){xe(C=>C.selectedSheetId);const x=xe(C=>C.themeStyle),y=xe(C=>C.isSessionExpired),{isLoading:_,isError:S,isFetching:E}=Fq({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:p,onFilterValuesChange:b});return _||!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(Sb,{className:"h-1 w-full dark:h-[2px]"})})):S?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),R.jsx(i,{})):R.jsx("div",{children:"Error"})):y?(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(gd,{children:"Session Expired"}),R.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):R.jsx("div",{className:we("flex h-full flex-col justify-between",x==null?void 0:x.dashboardPanel,e),style:{},role:"dashboard-panel",...v})}function de(){return de=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},de.apply(this,arguments)}function ke(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 hr(e,t=[]){let n=[];function r(i,a){const s=m.createContext(a),l=n.length;n=[...n,a];function c(d){const{scope:h,children:p,...b}=d,v=(h==null?void 0:h[e][l])||s,x=m.useMemo(()=>b,Object.values(b));return m.createElement(v.Provider,{value:x},p)}function u(d,h){const p=(h==null?void 0:h[e][l])||s,b=m.useContext(p);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>m.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,jq(o,...t)]}function jq(...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 a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function zq(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function za(...e){return t=>e.forEach(n=>zq(n,t))}function Rt(...e){return m.useCallback(za(...e),e)}const Sw=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Vq);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(Cw,de({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(Cw,de({},r,{ref:t}),n)});Sw.displayName="Slot";const Cw=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Hq(r,n.props),ref:t?za(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Cw.displayName="SlotClone";const Bq=({children:e})=>m.createElement(m.Fragment,null,e);function Vq(e){return m.isValidElement(e)&&e.type===Bq}function Hq(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]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Rb(e){const t=e+"CollectionProvider",[n,r]=hr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:b,children:v}=p,x=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:y,collectionRef:x},v)},s=e+"CollectionSlot",l=m.forwardRef((p,b)=>{const{scope:v,children:x}=p,y=i(s,v),_=Rt(b,y.collectionRef);return m.createElement(Sw,{ref:_},x)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=m.forwardRef((p,b)=>{const{scope:v,children:x,...y}=p,_=m.useRef(null),S=Rt(b,_),E=i(c,v);return m.useEffect(()=>(E.itemMap.set(_,{ref:_,...y}),()=>void E.itemMap.delete(_))),m.createElement(Sw,{[u]:"",ref:S},x)});function h(p){const b=i(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((E,C)=>y.indexOf(E.ref.current)-y.indexOf(C.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},h,r]}const Cr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Wq=j.useId||(()=>{});let Uq=0;function yi(e){const[t,n]=j.useState(Wq());return Cr(()=>{e||n(r=>r??String(Uq++))},[e]),e||(t?`radix-${t}`:"")}const i6=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(qq);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(Ew,de({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(Ew,de({},r,{ref:t}),n)});i6.displayName="Slot";const Ew=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Yq(r,n.props),ref:t?za(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Ew.displayName="SlotClone";const Gq=({children:e})=>m.createElement(m.Fragment,null,e);function qq(e){return m.isValidElement(e)&&e.type===Gq}function Yq(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]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const Kq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=Kq.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?i6:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(s,de({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function a6(e,t){e&&Er.flushSync(()=>e.dispatchEvent(t))}function Xn(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 Lr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Xq({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=Xn(n),l=m.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function Xq({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=Xn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Qq=m.createContext(void 0);function mc(e){const t=m.useContext(Qq);return e||t||"ltr"}const i1="rovingFocusGroup.onEntryFocus",Jq={bubbles:!1,cancelable:!0},LS="RovingFocusGroup",[Rw,s6,Zq]=Rb(LS),[eY,md]=hr(LS,[Zq]),[tY,nY]=eY(LS),rY=m.forwardRef((e,t)=>m.createElement(Rw.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Rw.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(oY,de({},e,{ref:t}))))),oY=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,d=m.useRef(null),h=Rt(t,d),p=mc(i),[b=null,v]=Lr({prop:a,defaultProp:s,onChange:l}),[x,y]=m.useState(!1),_=Xn(c),S=s6(n),E=m.useRef(!1),[C,$]=m.useState(0);return m.useEffect(()=>{const O=d.current;if(O)return O.addEventListener(i1,_),()=>O.removeEventListener(i1,_)},[_]),m.createElement(tY,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(O=>v(O),[v]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>$(O=>O+1),[]),onFocusableItemRemove:m.useCallback(()=>$(O=>O-1),[])},m.createElement(Qe.div,de({tabIndex:x||C===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{E.current=!0}),onFocus:ke(e.onFocus,O=>{const D=!E.current;if(O.target===O.currentTarget&&D&&!x){const M=new CustomEvent(i1,Jq);if(O.currentTarget.dispatchEvent(M),!M.defaultPrevented){const L=S().filter(A=>A.focusable),F=L.find(A=>A.active),z=L.find(A=>A.id===b),G=[F,z,...L].filter(Boolean).map(A=>A.ref.current);l6(G)}}E.current=!1}),onBlur:ke(e.onBlur,()=>y(!1))})))}),iY="RovingFocusGroupItem",aY=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,s=yi(),l=i||s,c=nY(iY,n),u=c.currentTabStopId===l,d=s6(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),m.createElement(Rw.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,de({tabIndex:u?0:-1,"data-orientation":c.orientation},a,{ref:t,onMouseDown:ke(e.onMouseDown,b=>{r?c.onItemFocus(l):b.preventDefault()}),onFocus:ke(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ke(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=cY(b,c.orientation,c.dir);if(v!==void 0){b.preventDefault();let y=d().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const _=y.indexOf(b.currentTarget);y=c.loop?uY(y,_+1):y.slice(_+1)}setTimeout(()=>l6(y))}})})))}),sY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cY(e,t,n){const r=lY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sY[r]}function l6(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function uY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const FS=rY,jS=aY;function dY(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const pr=e=>{const{present:t,children:n}=e,r=fY(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Rt(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};pr.displayName="Presence";function fY(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),a=e?"mounted":"unmounted",[s,l]=dY(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Dg(r.current);i.current=s==="mounted"?c:"none"},[s]),Cr(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=Dg(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]),Cr(()=>{if(t){const c=d=>{const p=Dg(r.current).includes(d.animationName);d.target===t&&p&&Er.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Dg(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(s),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Dg(e){return(e==null?void 0:e.animationName)||"none"}const c6="Tabs",[hY,jRe]=hr(c6,[md]),u6=md(),[pY,zS]=hY(c6),gY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=mc(s),[d,h]=Lr({prop:r,onChange:o,defaultProp:i});return m.createElement(pY,{scope:n,baseId:yi(),value:d,onValueChange:h,orientation:a,dir:u,activationMode:l},m.createElement(Qe.div,de({dir:u,"data-orientation":a},c,{ref:t})))}),mY="TabsList",bY=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=zS(mY,n),a=u6(n);return m.createElement(FS,de({asChild:!0},a,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,de({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),vY="TabsTrigger",yY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=zS(vY,n),s=u6(n),l=d6(a.baseId,r),c=f6(a.baseId,r),u=r===a.value;return m.createElement(jS,de({asChild:!0},s,{focusable:!o,active:u}),m.createElement(Qe.button,de({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:ke(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:ke(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:ke(e.onFocus,()=>{const d=a.activationMode!=="manual";!u&&!o&&d&&a.onValueChange(r)})})))}),xY="TabsContent",wY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=zS(xY,n),l=d6(s.baseId,r),c=f6(s.baseId,r),u=r===s.value,d=m.useRef(u);return m.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),m.createElement(pr,{present:o||u},({present:h})=>m.createElement(Qe.div,de({"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},a,{ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0}}),h&&i))});function d6(e,t){return`${e}-trigger-${t}`}function f6(e,t){return`${e}-content-${t}`}const _Y=gY,h6=bY,p6=yY,g6=wY,BS=_Y,Pb=j.forwardRef(({className:e,...t},n)=>R.jsx(h6,{ref:n,className:we("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Pb.displayName=h6.displayName;const $b=j.forwardRef(({className:e,...t},n)=>R.jsx(p6,{ref:n,className:we("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}));$b.displayName=p6.displayName;const VS=j.forwardRef(({className:e,...t},n)=>R.jsx(g6,{ref:n,className:we("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));VS.displayName=g6.displayName;var m6={exports:{}},lp={},Pw={exports:{}};(function(e,t){(function(n,r){r(t)})(vs,function(n){function r(Z){return function(ae,me,ee,ve,Ce,Oe,De){return Z(ae,me,De)}}function o(Z){return function(ae,me,ee,ve){if(!ae||!me||typeof ae!="object"||typeof me!="object")return Z(ae,me,ee,ve);var Ce=ve.get(ae),Oe=ve.get(me);if(Ce&&Oe)return Ce===me&&Oe===ae;ve.set(ae,me),ve.set(me,ae);var De=Z(ae,me,ee,ve);return ve.delete(ae),ve.delete(me),De}}function i(Z,te){var ae={};for(var me in Z)ae[me]=Z[me];for(var me in te)ae[me]=te[me];return ae}function a(Z){return Z.constructor===Object||Z.constructor==null}function s(Z){return typeof Z.then=="function"}function l(Z,te){return Z===te||Z!==Z&&te!==te}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",p="[object Map]",b="[object Number]",v="[object Object]",x="[object Set]",y="[object String]",_=Object.prototype.toString;function S(Z){var te=Z.areArraysEqual,ae=Z.areDatesEqual,me=Z.areMapsEqual,ee=Z.areObjectsEqual,ve=Z.areRegExpsEqual,Ce=Z.areSetsEqual,Oe=Z.createIsNestedEqual,De=Oe(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(a(Be)&&a(Ie))return ee(Be,Ie,De,Ke);var dt=Array.isArray(Be),zt=Array.isArray(Ie);if(dt||zt)return dt===zt&&te(Be,Ie,De,Ke);var Nt=_.call(Be);return Nt!==_.call(Ie)?!1:Nt===d?ae(Be,Ie,De,Ke):Nt===h?ve(Be,Ie,De,Ke):Nt===p?me(Be,Ie,De,Ke):Nt===x?Ce(Be,Ie,De,Ke):Nt===v||Nt===c?s(Be)||s(Ie)?!1:ee(Be,Ie,De,Ke):Nt===u||Nt===b||Nt===y?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function E(Z,te,ae,me){var ee=Z.length;if(te.length!==ee)return!1;for(;ee-- >0;)if(!ae(Z[ee],te[ee],ee,ee,Z,te,me))return!1;return!0}var C=o(E);function $(Z,te){return l(Z.valueOf(),te.valueOf())}function O(Z,te,ae,me){var ee=Z.size===te.size;if(!ee)return!1;if(!Z.size)return!0;var ve={},Ce=0;return Z.forEach(function(Oe,De){if(ee){var Ue=!1,Be=0;te.forEach(function(Ie,Ke){!Ue&&!ve[Be]&&(Ue=ae(De,Ke,Ce,Be,Z,te,me)&&ae(Oe,Ie,De,Ke,Z,te,me))&&(ve[Be]=!0),Be++}),Ce++,ee=Ue}}),ee}var D=o(O),M="_owner",L=Object.prototype.hasOwnProperty;function F(Z,te,ae,me){var ee=Object.keys(Z),ve=ee.length;if(Object.keys(te).length!==ve)return!1;for(var Ce;ve-- >0;){if(Ce=ee[ve],Ce===M){var Oe=!!Z.$$typeof,De=!!te.$$typeof;if((Oe||De)&&Oe!==De)return!1}if(!L.call(te,Ce)||!ae(Z[Ce],te[Ce],Ce,Ce,Z,te,me))return!1}return!0}var z=o(F);function X(Z,te){return Z.source===te.source&&Z.flags===te.flags}function G(Z,te,ae,me){var ee=Z.size===te.size;if(!ee)return!1;if(!Z.size)return!0;var ve={};return Z.forEach(function(Ce,Oe){if(ee){var De=!1,Ue=0;te.forEach(function(Be,Ie){!De&&!ve[Ue]&&(De=ae(Ce,Be,Oe,Ie,Z,te,me))&&(ve[Ue]=!0),Ue++}),ee=De}}),ee}var A=o(G),q=Object.freeze({areArraysEqual:E,areDatesEqual:$,areMapsEqual:O,areObjectsEqual:F,areRegExpsEqual:X,areSetsEqual:G,createIsNestedEqual:r}),U=Object.freeze({areArraysEqual:C,areDatesEqual:$,areMapsEqual:D,areObjectsEqual:z,areRegExpsEqual:X,areSetsEqual:A,createIsNestedEqual:r}),K=S(q);function W(Z,te){return K(Z,te,void 0)}var T=S(i(q,{createIsNestedEqual:function(){return l}}));function V(Z,te){return T(Z,te,void 0)}var Y=S(U);function I(Z,te){return Y(Z,te,new WeakMap)}var ne=S(i(U,{createIsNestedEqual:function(){return l}}));function ce(Z,te){return ne(Z,te,new WeakMap)}function ue(Z){return S(i(q,Z(q)))}function he(Z){var te=S(i(U,Z(U)));return function(ae,me,ee){return ee===void 0&&(ee=new WeakMap),te(ae,me,ee)}}n.circularDeepEqual=I,n.circularShallowEqual=ce,n.createCustomCircularEqual=he,n.createCustomEqual=ue,n.deepEqual=W,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(Pw,Pw.exports);var HS=Pw.exports;const WS=SS(AU);var At={},SY=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(At,"__esModule",{value:!0});At.bottom=US;At.childrenEqual=PY;At.cloneLayout=b6;At.cloneLayoutItem=Vl;At.collides=Ob;At.compact=y6;At.compactItem=x6;At.compactType=BY;At.correctBounds=w6;At.fastPositionEqual=OY;At.fastRGLPropsEqual=void 0;At.getAllCollisions=_6;At.getFirstCollision=$l;At.getLayoutItem=GS;At.getStatics=qS;At.modifyLayout=v6;At.moveElement=Sf;At.moveElementAwayFromCollision=Ow;At.noop=void 0;At.perc=TY;At.resizeItemInDirection=LY;At.setTopLeft=jY;At.setTransform=FY;At.sortLayoutItems=ZS;At.sortLayoutItemsByColRow=P6;At.sortLayoutItemsByRowCol=R6;At.synchronizeLayoutWithChildren=zY;At.validateLayout=$6;At.withLayoutItem=RY;var zP=HS,_f=CY(m);function CY(e){return e&&e.__esModule?e:{default:e}}const EY=process.env.NODE_ENV==="production";function US(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 b6(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Vl(e[n]);return t}function v6(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 RY(e,t,n){let r=GS(e,t);return r?(r=n(Vl(r)),e=v6(e,r),[e,r]):[e,null]}function Vl(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 PY(e,t){return(0,zP.deepEqual)(_f.default.Children.map(e,n=>n==null?void 0:n.key),_f.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,zP.deepEqual)(_f.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),_f.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const $Y=SY;At.fastRGLPropsEqual=$Y;function OY(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Ob(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 y6(e,t,n,r){const o=qS(e),i=ZS(e,t),a=Array(e.length);for(let s=0,l=i.length;s<l;s++){let c=Vl(i[s]);c.static||(c=x6(o,c,t,n,i,r),o.push(c)),a[e.indexOf(i[s])]=c,c.moved=!1}return a}const DY={x:"w",y:"h"};function $w(e,t,n,r){const o=DY[r];t[r]+=1;const i=e.map(a=>a.i).indexOf(t.i);for(let a=i+1;a<e.length;a++){const s=e[a];if(!s.static){if(s.y>t.y+t.h)break;Ob(t,s)&&$w(e,s,n+t[o],r)}}t[r]=n}function x6(e,t,n,r,o,i){const a=n==="vertical",s=n==="horizontal";if(a)for(t.y=Math.min(US(e),t.y);t.y>0&&!$l(e,t);)t.y--;else if(s)for(;t.x>0&&!$l(e,t);)t.x--;let l;for(;(l=$l(e,t))&&!(n===null&&i);)if(s?$w(o,t,l.x+l.w,"x"):$w(o,t,l.y+l.h,"y"),s&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!$l(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function w6(e,t){const n=qS(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(;$l(n,i);)i.y++}return e}function GS(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function $l(e,t){for(let n=0,r=e.length;n<r;n++)if(Ob(e[n],t))return e[n]}function _6(e,t){return e.filter(n=>Ob(n,t))}function qS(e){return e.filter(t=>t.static)}function Sf(e,t,n,r,o,i,a,s,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 d=ZS(e,a);(a==="vertical"&&typeof r=="number"?u>=r:a==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const p=_6(d,t),b=p.length>0;if(b&&l)return b6(e);if(b&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let v=0,x=p.length;v<x;v++){const y=p[v];"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=Ow(e,y,t,o,a):e=Ow(e,t,y,o,a))}return e}function Ow(e,t,n,r,o,i){const a=o==="horizontal",s=o==="vertical",l=t.static;if(r){r=!1;const d={x:a?Math.max(t.x-n.w,0):n.x,y:s?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=$l(e,d),p=h&&h.y+h.h>t.y,b=h&&t.x+t.w>h.x;if(h){if(p&&s)return Sf(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(b&&a)return Sf(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(d.x,",").concat(d.y,"]."),Sf(e,n,a?d.x:void 0,s?d.y:void 0,r,l,o)}const c=a?n.x+1:void 0,u=s?n.y+1:void 0;return c==null&&u==null?e:Sf(e,n,a?n.x+1:void 0,s?n.y+1:void 0,r,l,o)}function TY(e){return e*100+"%"}const S6=(e,t,n,r)=>e+n>r?t:n,C6=(e,t,n)=>e<0?t:n,E6=e=>Math.max(0,e),YS=e=>Math.max(0,e),KS=(e,t,n)=>{let{left:r,height:o,width:i}=t;const a=e.top-(o-e.height);return{left:r,width:i,height:C6(a,e.height,o),top:YS(a)}},XS=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{top:r,height:i,width:S6(e.left,e.width,a,n),left:E6(o)}},QS=(e,t,n)=>{let{top:r,height:o,width:i}=t;const a=e.left-(i-e.width);return{height:o,width:a<0?e.width:S6(e.left,e.width,i,n),top:YS(r),left:E6(a)}},JS=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{width:a,left:o,height:C6(r,e.height,i),top:YS(r)}},AY=function(){return KS(arguments.length<=0?void 0:arguments[0],XS(...arguments))},MY=function(){return KS(arguments.length<=0?void 0:arguments[0],QS(...arguments))},kY=function(){return JS(arguments.length<=0?void 0:arguments[0],XS(...arguments))},IY=function(){return JS(arguments.length<=0?void 0:arguments[0],QS(...arguments))},NY={n:KS,ne:AY,e:XS,se:kY,s:JS,sw:IY,w:QS,nw:MY};function LY(e,t,n,r){const o=NY[e];return o?o(t,{...t,...n},r):n}function FY(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 jY(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 ZS(e,t){return t==="horizontal"?P6(e):t==="vertical"?R6(e):e}function R6(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 P6(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 zY(e,t,n,r,o){e=e||[];const i=[];_f.default.Children.forEach(t,s=>{if((s==null?void 0:s.key)==null)return;const l=GS(e,String(s.key)),c=s.props["data-grid"];l&&c==null?i.push(Vl(l)):c?(EY||$6([c],"ReactGridLayout.children"),i.push(Vl({...c,i:s.key}))):i.push(Vl({w:1,h:1,x:0,y:US(i),i:String(s.key)}))});const a=w6(i,{cols:n});return o?a:y6(a,r,n)}function $6(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 a=0;a<n.length;a++)if(typeof i[n[a]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[a]+" must be a number!")}}function BY(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const VY=()=>{};At.noop=VY;var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.calcGridColWidth=Db;ea.calcGridItemPosition=HY;ea.calcGridItemWHPx=Dw;ea.calcWH=UY;ea.calcXY=WY;ea.clamp=Ol;function Db(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Dw(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function HY(e,t,n,r,o,i){const{margin:a,containerPadding:s,rowHeight:l}=e,c=Db(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Dw(r,c,a[0]),u.height=Dw(o,l,a[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+a[1])*n+s[1]),u.left=Math.round((c+a[0])*t+s[0])),u}function WY(e,t,n,r,o){const{margin:i,cols:a,rowHeight:s,maxRows:l}=e,c=Db(e);let u=Math.round((n-i[0])/(c+i[0])),d=Math.round((t-i[1])/(s+i[1]));return u=Ol(u,0,a-r),d=Ol(d,0,l-o),{x:u,y:d}}function UY(e,t,n,r,o,i){const{margin:a,maxRows:s,cols:l,rowHeight:c}=e,u=Db(e);let d=Math.round((t+a[0])/(u+a[0])),h=Math.round((n+a[1])/(c+a[1])),p=Ol(d,0,l-r),b=Ol(h,0,s-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Ol(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=Ol(h,0,s)),{w:p,h:b}}function Ol(e,t,n){return Math.max(Math.min(e,n),t)}var Tb={},Tw={exports:{}},a1,BP;function eC(){if(BP)return a1;BP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return a1=e,a1}var s1,VP;function GY(){if(VP)return s1;VP=1;var e=eC();function t(){}function n(){}return n.resetWarningCache=t,s1=function(){function r(a,s,l,c,u,d){if(d!==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},s1}var Tg={exports:{}},Zt={};/** @license React v16.13.1
|
|
88
|
+
}`;var St=cP(function(){return Ut(H,Ye+"return "+Pe).apply(n,Q)});if(St.source=Pe,jy(St))throw St;return St}function IW(f){return Jt(f).toLowerCase()}function NW(f){return Jt(f).toUpperCase()}function LW(f,g,w){if(f=Jt(f),f&&(w||g===n))return vR(f);if(!f||!(g=so(g)))return f;var P=ai(f),N=ai(g),H=yR(P,N),Q=xR(P,N)+1;return os(P,H,Q).join("")}function FW(f,g,w){if(f=Jt(f),f&&(w||g===n))return f.slice(0,_R(f)+1);if(!f||!(g=so(g)))return f;var P=ai(f),N=xR(P,ai(g))+1;return os(P,0,N).join("")}function jW(f,g,w){if(f=Jt(f),f&&(w||g===n))return f.replace(Jn,"");if(!f||!(g=so(g)))return f;var P=ai(f),N=yR(P,ai(g));return os(P,N).join("")}function zW(f,g){var w=L,P=F;if(On(g)){var N="separator"in g?g.separator:N;w="length"in g?bt(g.length):w,P="omission"in g?so(g.omission):P}f=Jt(f);var H=f.length;if(Tc(f)){var Q=ai(f);H=Q.length}if(w>=H)return f;var re=w-Ac(P);if(re<1)return P;var le=Q?os(Q,0,re).join(""):f.slice(0,re);if(N===n)return le+P;if(Q&&(re+=le.length-re),zy(N)){if(f.slice(re).search(N)){var _e,Se=le;for(N.global||(N=ny(N.source,Jt(Ge.exec(N))+"g")),N.lastIndex=0;_e=N.exec(Se);)var Pe=_e.index;le=le.slice(0,Pe===n?re:Pe)}}else if(f.indexOf(so(N),re)!=re){var je=le.lastIndexOf(N);je>-1&&(le=le.slice(0,je))}return le+P}function BW(f){return f=Jt(f),f&&jn.test(f)?f.replace(rn,mj):f}var VW=jc(function(f,g,w){return f+(w?" ":"")+g.toUpperCase()}),Hy=u5("toUpperCase");function lP(f,g,w){return f=Jt(f),g=w?n:g,g===n?dj(f)?yj(f):nj(f):f.match(g)||[]}var cP=Pt(function(f,g){try{return io(f,n,g)}catch(w){return jy(w)?w:new ft(w)}}),HW=ha(function(f,g){return No(g,function(w){w=Oi(w),da(f,w,Ly(f[w],f))}),f});function WW(f){var g=f==null?0:f.length,w=Je();return f=g?Pn(f,function(P){if(typeof P[1]!="function")throw new Lo(a);return[w(P[0]),P[1]]}):[],Pt(function(P){for(var N=-1;++N<g;){var H=f[N];if(io(H[0],this,P))return io(H[1],this,P)}})}function UW(f){return mz(jo(f,d))}function Wy(f){return function(){return f}}function GW(f,g){return f==null||f!==f?g:f}var qW=f5(),YW=f5(!0);function Wr(f){return f}function Uy(f){return VR(typeof f=="function"?f:jo(f,d))}function KW(f){return WR(jo(f,d))}function XW(f,g){return UR(f,jo(g,d))}var QW=Pt(function(f,g){return function(w){return zd(w,f,g)}}),JW=Pt(function(f,g){return function(w){return zd(f,w,g)}});function Gy(f,g,w){var P=er(g),N=ag(g,P);w==null&&!(On(g)&&(N.length||!P.length))&&(w=g,g=f,f=this,N=ag(g,er(g)));var H=!(On(w)&&"chain"in w)||!!w.chain,Q=ga(f);return No(N,function(re){var le=g[re];f[re]=le,Q&&(f.prototype[re]=function(){var _e=this.__chain__;if(H||_e){var Se=f(this.__wrapped__),Pe=Se.__actions__=Br(this.__actions__);return Pe.push({func:le,args:arguments,thisArg:f}),Se.__chain__=_e,Se}return le.apply(f,Ja([this.value()],arguments))})}),f}function ZW(){return ar._===this&&(ar._=Ej),this}function qy(){}function eU(f){return f=bt(f),Pt(function(g){return GR(g,f)})}var tU=Cy(Pn),nU=Cy(hR),rU=Cy(Kv);function uP(f){return Ty(f)?Xv(Oi(f)):Mz(f)}function oU(f){return function(g){return f==null?n:il(f,g)}}var iU=p5(),aU=p5(!0);function Yy(){return[]}function Ky(){return!1}function sU(){return{}}function lU(){return""}function cU(){return!0}function uU(f,g){if(f=bt(f),f<1||f>K)return[];var w=V,P=mr(f,V);g=Je(g),f-=V;for(var N=Zv(P,g);++w<f;)g(w);return N}function dU(f){return ht(f)?Pn(f,Oi):lo(f)?[f]:Br(D5(Jt(f)))}function fU(f){var g=++Sj;return Jt(f)+g}var hU=fg(function(f,g){return f+g},0),pU=Ey("ceil"),gU=fg(function(f,g){return f/g},1),mU=Ey("floor");function bU(f){return f&&f.length?ig(f,Wr,uy):n}function vU(f,g){return f&&f.length?ig(f,Je(g,2),uy):n}function yU(f){return mR(f,Wr)}function xU(f,g){return mR(f,Je(g,2))}function wU(f){return f&&f.length?ig(f,Wr,py):n}function _U(f,g){return f&&f.length?ig(f,Je(g,2),py):n}var SU=fg(function(f,g){return f*g},1),CU=Ey("round"),EU=fg(function(f,g){return f-g},0);function RU(f){return f&&f.length?Jv(f,Wr):0}function PU(f,g){return f&&f.length?Jv(f,Je(g,2)):0}return B.after=KV,B.ary=B5,B.assign=NH,B.assignIn=tP,B.assignInWith=Eg,B.assignWith=LH,B.at=FH,B.before=V5,B.bind=Ly,B.bindAll=HW,B.bindKey=H5,B.castArray=sH,B.chain=F5,B.chunk=mB,B.compact=bB,B.concat=vB,B.cond=WW,B.conforms=UW,B.constant=Wy,B.countBy=RV,B.create=jH,B.curry=W5,B.curryRight=U5,B.debounce=G5,B.defaults=zH,B.defaultsDeep=BH,B.defer=XV,B.delay=QV,B.difference=yB,B.differenceBy=xB,B.differenceWith=wB,B.drop=_B,B.dropRight=SB,B.dropRightWhile=CB,B.dropWhile=EB,B.fill=RB,B.filter=$V,B.flatMap=TV,B.flatMapDeep=AV,B.flatMapDepth=MV,B.flatten=k5,B.flattenDeep=PB,B.flattenDepth=$B,B.flip=JV,B.flow=qW,B.flowRight=YW,B.fromPairs=OB,B.functions=YH,B.functionsIn=KH,B.groupBy=kV,B.initial=TB,B.intersection=AB,B.intersectionBy=MB,B.intersectionWith=kB,B.invert=QH,B.invertBy=JH,B.invokeMap=NV,B.iteratee=Uy,B.keyBy=LV,B.keys=er,B.keysIn=Hr,B.map=yg,B.mapKeys=eW,B.mapValues=tW,B.matches=KW,B.matchesProperty=XW,B.memoize=wg,B.merge=nW,B.mergeWith=nP,B.method=QW,B.methodOf=JW,B.mixin=Gy,B.negate=_g,B.nthArg=eU,B.omit=rW,B.omitBy=oW,B.once=ZV,B.orderBy=FV,B.over=tU,B.overArgs=eH,B.overEvery=nU,B.overSome=rU,B.partial=Fy,B.partialRight=q5,B.partition=jV,B.pick=iW,B.pickBy=rP,B.property=uP,B.propertyOf=oU,B.pull=FB,B.pullAll=N5,B.pullAllBy=jB,B.pullAllWith=zB,B.pullAt=BB,B.range=iU,B.rangeRight=aU,B.rearg=tH,B.reject=VV,B.remove=VB,B.rest=nH,B.reverse=Iy,B.sampleSize=WV,B.set=sW,B.setWith=lW,B.shuffle=UV,B.slice=HB,B.sortBy=YV,B.sortedUniq=XB,B.sortedUniqBy=QB,B.split=TW,B.spread=rH,B.tail=JB,B.take=ZB,B.takeRight=eV,B.takeRightWhile=tV,B.takeWhile=nV,B.tap=bV,B.throttle=oH,B.thru=vg,B.toArray=J5,B.toPairs=oP,B.toPairsIn=iP,B.toPath=dU,B.toPlainObject=eP,B.transform=cW,B.unary=iH,B.union=rV,B.unionBy=oV,B.unionWith=iV,B.uniq=aV,B.uniqBy=sV,B.uniqWith=lV,B.unset=uW,B.unzip=Ny,B.unzipWith=L5,B.update=dW,B.updateWith=fW,B.values=Vc,B.valuesIn=hW,B.without=cV,B.words=lP,B.wrap=aH,B.xor=uV,B.xorBy=dV,B.xorWith=fV,B.zip=hV,B.zipObject=pV,B.zipObjectDeep=gV,B.zipWith=mV,B.entries=oP,B.entriesIn=iP,B.extend=tP,B.extendWith=Eg,Gy(B,B),B.add=hU,B.attempt=cP,B.camelCase=bW,B.capitalize=aP,B.ceil=pU,B.clamp=pW,B.clone=lH,B.cloneDeep=uH,B.cloneDeepWith=dH,B.cloneWith=cH,B.conformsTo=fH,B.deburr=sP,B.defaultTo=GW,B.divide=gU,B.endsWith=vW,B.eq=li,B.escape=yW,B.escapeRegExp=xW,B.every=PV,B.find=OV,B.findIndex=A5,B.findKey=VH,B.findLast=DV,B.findLastIndex=M5,B.findLastKey=HH,B.floor=mU,B.forEach=j5,B.forEachRight=z5,B.forIn=WH,B.forInRight=UH,B.forOwn=GH,B.forOwnRight=qH,B.get=By,B.gt=hH,B.gte=pH,B.has=XH,B.hasIn=Vy,B.head=I5,B.identity=Wr,B.includes=IV,B.indexOf=DB,B.inRange=gW,B.invoke=ZH,B.isArguments=ll,B.isArray=ht,B.isArrayBuffer=gH,B.isArrayLike=Vr,B.isArrayLikeObject=zn,B.isBoolean=mH,B.isBuffer=is,B.isDate=bH,B.isElement=vH,B.isEmpty=yH,B.isEqual=xH,B.isEqualWith=wH,B.isError=jy,B.isFinite=_H,B.isFunction=ga,B.isInteger=Y5,B.isLength=Sg,B.isMap=K5,B.isMatch=SH,B.isMatchWith=CH,B.isNaN=EH,B.isNative=RH,B.isNil=$H,B.isNull=PH,B.isNumber=X5,B.isObject=On,B.isObjectLike=Mn,B.isPlainObject=Gd,B.isRegExp=zy,B.isSafeInteger=OH,B.isSet=Q5,B.isString=Cg,B.isSymbol=lo,B.isTypedArray=Bc,B.isUndefined=DH,B.isWeakMap=TH,B.isWeakSet=AH,B.join=IB,B.kebabCase=wW,B.last=Bo,B.lastIndexOf=NB,B.lowerCase=_W,B.lowerFirst=SW,B.lt=MH,B.lte=kH,B.max=bU,B.maxBy=vU,B.mean=yU,B.meanBy=xU,B.min=wU,B.minBy=_U,B.stubArray=Yy,B.stubFalse=Ky,B.stubObject=sU,B.stubString=lU,B.stubTrue=cU,B.multiply=SU,B.nth=LB,B.noConflict=ZW,B.noop=qy,B.now=xg,B.pad=CW,B.padEnd=EW,B.padStart=RW,B.parseInt=PW,B.random=mW,B.reduce=zV,B.reduceRight=BV,B.repeat=$W,B.replace=OW,B.result=aW,B.round=CU,B.runInContext=ie,B.sample=HV,B.size=GV,B.snakeCase=DW,B.some=qV,B.sortedIndex=WB,B.sortedIndexBy=UB,B.sortedIndexOf=GB,B.sortedLastIndex=qB,B.sortedLastIndexBy=YB,B.sortedLastIndexOf=KB,B.startCase=AW,B.startsWith=MW,B.subtract=EU,B.sum=RU,B.sumBy=PU,B.template=kW,B.times=uU,B.toFinite=ma,B.toInteger=bt,B.toLength=Z5,B.toLower=IW,B.toNumber=Vo,B.toSafeInteger=IH,B.toString=Jt,B.toUpper=NW,B.trim=LW,B.trimEnd=FW,B.trimStart=jW,B.truncate=zW,B.unescape=BW,B.uniqueId=fU,B.upperCase=VW,B.upperFirst=Hy,B.each=j5,B.eachRight=z5,B.first=I5,Gy(B,function(){var f={};return Pi(B,function(g,w){on.call(B.prototype,w)||(f[w]=g)}),f}(),{chain:!1}),B.VERSION=r,No(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){B[f].placeholder=B}),No(["drop","take"],function(f,g){Ft.prototype[f]=function(w){w=w===n?1:qn(bt(w),0);var P=this.__filtered__&&!g?new Ft(this):this.clone();return P.__filtered__?P.__takeCount__=mr(w,P.__takeCount__):P.__views__.push({size:mr(w,V),type:f+(P.__dir__<0?"Right":"")}),P},Ft.prototype[f+"Right"]=function(w){return this.reverse()[f](w).reverse()}}),No(["filter","map","takeWhile"],function(f,g){var w=g+1,P=w==G||w==q;Ft.prototype[f]=function(N){var H=this.clone();return H.__iteratees__.push({iteratee:Je(N,3),type:w}),H.__filtered__=H.__filtered__||P,H}}),No(["head","last"],function(f,g){var w="take"+(g?"Right":"");Ft.prototype[f]=function(){return this[w](1).value()[0]}}),No(["initial","tail"],function(f,g){var w="drop"+(g?"":"Right");Ft.prototype[f]=function(){return this.__filtered__?new Ft(this):this[w](1)}}),Ft.prototype.compact=function(){return this.filter(Wr)},Ft.prototype.find=function(f){return this.filter(f).head()},Ft.prototype.findLast=function(f){return this.reverse().find(f)},Ft.prototype.invokeMap=Pt(function(f,g){return typeof f=="function"?new Ft(this):this.map(function(w){return zd(w,f,g)})}),Ft.prototype.reject=function(f){return this.filter(_g(Je(f)))},Ft.prototype.slice=function(f,g){f=bt(f);var w=this;return w.__filtered__&&(f>0||g<0)?new Ft(w):(f<0?w=w.takeRight(-f):f&&(w=w.drop(f)),g!==n&&(g=bt(g),w=g<0?w.dropRight(-g):w.take(g-f)),w)},Ft.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},Ft.prototype.toArray=function(){return this.take(V)},Pi(Ft.prototype,function(f,g){var w=/^(?:filter|find|map|reject)|While$/.test(g),P=/^(?:head|last)$/.test(g),N=B[P?"take"+(g=="last"?"Right":""):g],H=P||/^find/.test(g);N&&(B.prototype[g]=function(){var Q=this.__wrapped__,re=P?[1]:arguments,le=Q instanceof Ft,_e=re[0],Se=le||ht(Q),Pe=function(Mt){var jt=N.apply(B,Ja([Mt],re));return P&&je?jt[0]:jt};Se&&w&&typeof _e=="function"&&_e.length!=1&&(le=Se=!1);var je=this.__chain__,Ye=!!this.__actions__.length,et=H&&!je,St=le&&!Ye;if(!H&&Se){Q=St?Q:new Ft(this);var tt=f.apply(Q,re);return tt.__actions__.push({func:vg,args:[Pe],thisArg:n}),new Fo(tt,je)}return et&&St?f.apply(this,re):(tt=this.thru(Pe),et?P?tt.value()[0]:tt.value():tt)})}),No(["pop","push","shift","sort","splice","unshift"],function(f){var g=Wp[f],w=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",P=/^(?:pop|shift)$/.test(f);B.prototype[f]=function(){var N=arguments;if(P&&!this.__chain__){var H=this.value();return g.apply(ht(H)?H:[],N)}return this[w](function(Q){return g.apply(ht(Q)?Q:[],N)})}}),Pi(Ft.prototype,function(f,g){var w=B[g];if(w){var P=w.name+"";on.call(Nc,P)||(Nc[P]=[]),Nc[P].push({name:g,func:w})}}),Nc[dg(n,y).name]=[{name:"wrapper",func:n}],Ft.prototype.clone=Bj,Ft.prototype.reverse=Vj,Ft.prototype.value=Hj,B.prototype.at=vV,B.prototype.chain=yV,B.prototype.commit=xV,B.prototype.next=wV,B.prototype.plant=SV,B.prototype.reverse=CV,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=EV,B.prototype.first=B.prototype.head,Md&&(B.prototype[Md]=_V),B},Mc=xj();el?((el.exports=Mc)._=Mc,Uv._=Mc):ar._=Mc}).call(vs)})(f0,f0.exports);var au=f0.exports;const Bl=pc(au);function DP({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:a}){const s={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:a||10};return t||(t={}),OS.forEach(l=>{t!=null&&t[l]||(t={...t,[l]:[]});const c=t[l].reduce((u,d)=>Math.max(u,d.y+d.h),0);s.y=s.y===0?0:c,t[l].push(s)}),t}function TP(e,t){t&&OS.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}function wb(e){return xe.getState().dashboard.globalCacheConfig}const xe=$M()(IM((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:d0},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:d0},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,a,s,l,c,u,d,h;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(p=>p.id===n);if(o!==void 0&&o>-1){(a=r.dashboard.sheets)==null||a.splice(o,1);const p=(s=r.dashboard.filters)==null?void 0:s.filter(v=>v.sheetId===n),b=(l=r.filterValues)==null?void 0:l.filter(v=>p==null?void 0:p.some(x=>x.id===v.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(v=>!(b!=null&&b.some(x=>x.filterId===v.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(v=>v.sheetId!==n),r.selectedSheetId=(h=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:h.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(s=>{OS.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:s.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const a={...n,layouts:i};r.dashboard.sheets.push(a)})},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 a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===o.selectedSheetId);i&&au.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.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,a;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(s=>s.id===n);o!=null&&o>-1&&((a=r.dashboard.baseQueries)==null||a.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,a;const o=(i=r.filteringCards)==null?void 0:i.findIndex(s=>s.id===n.id);o!==void 0&&o>-1&&((a=r.filteringCards)==null||a.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 a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===n);i&&(i.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var s,l;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(c=>c.id===n);a&&au.forEach(a.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===o.selectedSheetId);i&&au.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var s,l;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(c=>c.id===n);a&&au.forEach(a.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var s,l,c,u;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(d=>d.id===n);if(a){const d=(c=a.cards)==null?void 0:c.find(h=>h.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var s,l;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(c=>c.id===n);a&&au.forEach(a.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(h=>h.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var a,s;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.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 a,s,l;const i=(a=r==null?void 0:r.filterValues)==null?void 0:a.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(s=r.filterValues)==null||s.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,a;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(a=r.dashboard.sheets)==null||a.find(s=>s.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(s=>{DP({id:n.id,layouts:s.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,a;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(s>-1){(i=r.dashboard.filters)==null||i.splice(s,1),(a=r.dashboard.sheets)==null||a.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{TP(n,c.layouts)})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,h;const a=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!a)return;const s=(u=a==null?void 0:a.frames)==null?void 0:u.find(p=>p.id===r);if(s){const p=(d=s.cards)==null?void 0:d.findIndex(b=>b.id===o.id);p>-1&&((h=s.cards)==null||h.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(s=>s.id===n.id);a>-1&&((i=r.dashboard.filters)==null||i.splice(a,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var s,l,c,u;const a=(l=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(d=>d.id===n);if(a){a.frames||(a.frames=[]),(c=a.frames)==null||c.push(r);let d=1/0;const h=0;o==="start"&&(d=0),DP({id:r.id,layouts:a.layouts,minH:10,x:h,y:d}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var a,s,l,c,u;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(h=>h.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),TP(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var s,l,c,u,d;const i=(l=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(h=>h.id===n),a=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.frames)==null||u.splice(a,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var s,l,c,u,d;const i=(l=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(h=>h.id===n),a=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(a,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var s,l,c,u,d,h;const i=(l=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:l.find(p=>p.id===n),a=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(a,1),(d=i.layout)==null||d.splice(a,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 a,s,l;const i=(s=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:s.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,a;((a=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:a.find(s=>s.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,a;((a=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:a.find(s=>s.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 a=0;a<r.length;a++){const s=r[a].frames;if(s){for(let l=0;l<s.length;l++)if((i=s[l].cards)==null?void 0:i.find(u=>u.id===n))return s[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(a=>a.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(a=>a.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let a=0;a<r.length;a++){const s=r[a].frames;if(s)for(let l=0;l<s.length;l++){const c=(i=s[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 a=0;a<r.length;a++){const s=r[a].frames;if(s){for(let l=0;l<s.length;l++)if((i=s[l].cards)==null?void 0:i.find(u=>u.id===n))return r[a]}}},handleDataPointClickAction:(n,r)=>{tq({card:n,dataPoint:r,set:e,get:t})}}}))),Sr=()=>xe(e=>e.actions),nq={theme:"system",setTheme:()=>null},VM=m.createContext(nq);function rq({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const s=window.document.documentElement;if(s.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";s.classList.add(l);return}s.classList.add(o)},[o]);const a={theme:o,setTheme:s=>{localStorage.setItem(n,s),i(s)}};return R.jsx(VM.Provider,{...r,value:a,children:e})}const HM=()=>{const e=m.useContext(VM);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var ap=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(){}},qu=typeof window>"u"||"Deno"in window;function qo(){}function oq(e,t){return typeof e=="function"?e(t):e}function dw(e){return typeof e=="number"&&e>=0&&e!==1/0}function WM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function AP(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(a){if(r){if(t.queryHash!==AS(a,t.options))return!1}else if(!ah(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function MP(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ih(t.options.mutationKey)!==ih(i))return!1}else if(!ah(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function AS(e,t){return((t==null?void 0:t.queryKeyHashFn)||ih)(e)}function ih(e){return JSON.stringify(e,(t,n)=>hw(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function ah(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ah(e[n],t[n])):!1}function UM(e,t){if(e===t)return e;const n=kP(e)&&kP(t);if(n||hw(e)&&hw(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),a=i.length,s=n?[]:{};let l=0;for(let c=0;c<a;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(s[u]=void 0,l++):(s[u]=UM(e[u],t[u]),s[u]===e[u]&&e[u]!==void 0&&l++)}return o===a&&l===o?e:s}return t}function fw(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function kP(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function hw(e){if(!IP(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!IP(n)||!n.hasOwnProperty("isPrototypeOf"))}function IP(e){return Object.prototype.toString.call(e)==="[object Object]"}function iq(e){return new Promise(t=>{setTimeout(t,e)})}function pw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?UM(e,t):t}function aq(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function sq(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ml,xs,Ou,uM,lq=(uM=class extends ap{constructor(){super();Xe(this,Ml,void 0);Xe(this,xs,void 0);Xe(this,Ou,void 0);Ve(this,Ou,t=>{if(!qu&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){se(this,xs)||this.setEventListener(se(this,Ou))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,xs))==null||t.call(this),Ve(this,xs,void 0))}setEventListener(t){var n;Ve(this,Ou,t),(n=se(this,xs))==null||n.call(this),Ve(this,xs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){se(this,Ml)!==t&&(Ve(this,Ml,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof se(this,Ml)=="boolean"?se(this,Ml):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ml=new WeakMap,xs=new WeakMap,Ou=new WeakMap,uM),h0=new lq,Du,ws,Tu,dM,cq=(dM=class extends ap{constructor(){super();Xe(this,Du,!0);Xe(this,ws,void 0);Xe(this,Tu,void 0);Ve(this,Tu,t=>{if(!qu&&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(){se(this,ws)||this.setEventListener(se(this,Tu))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,ws))==null||t.call(this),Ve(this,ws,void 0))}setEventListener(t){var n;Ve(this,Tu,t),(n=se(this,ws))==null||n.call(this),Ve(this,ws,t(this.setOnline.bind(this)))}setOnline(t){se(this,Du)!==t&&(Ve(this,Du,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return se(this,Du)}},Du=new WeakMap,ws=new WeakMap,Tu=new WeakMap,dM),p0=new cq;function uq(e){return Math.min(1e3*2**e,3e4)}function _b(e){return(e??"online")==="online"?p0.isOnline():!0}var GM=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function o1(e){return e instanceof GM}function qM(e){let t=!1,n=0,r=!1,o,i,a;const s=new Promise((x,y)=>{i=x,a=y}),l=x=>{var y;r||(p(new GM(x)),(y=e.abort)==null||y.call(e))},c=()=>{t=!0},u=()=>{t=!1},d=()=>!h0.isFocused()||e.networkMode!=="always"&&!p0.isOnline(),h=x=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,x),o==null||o(),i(x))},p=x=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,x),o==null||o(),a(x))},b=()=>new Promise(x=>{var y;o=_=>{const S=r||!d();return S&&x(_),S},(y=e.onPause)==null||y.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),v=()=>{if(r)return;let x;try{x=e.fn()}catch(y){x=Promise.reject(y)}Promise.resolve(x).then(h).catch(y=>{var $;if(r)return;const _=e.retry??(qu?0:3),S=e.retryDelay??uq,E=typeof S=="function"?S(n,y):S,C=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,y);if(t||!C){p(y);return}n++,($=e.onFail)==null||$.call(e,n,y),iq(E).then(()=>{if(d())return b()}).then(()=>{t?p(y):v()})})};return _b(e.networkMode)?v():b().then(v),{promise:s,cancel:l,continue:()=>(o==null?void 0:o())?s:Promise.resolve(),cancelRetry:c,continueRetry:u}}function dq(){let e=[],t=0,n=h=>{h()},r=h=>{h()},o=h=>setTimeout(h,0);const i=h=>{o=h},a=h=>{let p;t++;try{p=h()}finally{t--,t||c()}return p},s=h=>{t?e.push(h):o(()=>{n(h)})},l=h=>(...p)=>{s(()=>{h(...p)})},c=()=>{const h=e;e=[],h.length&&o(()=>{r(()=>{h.forEach(p=>{n(p)})})})};return{batch:a,batchCalls:l,schedule:s,setNotifyFunction:h=>{n=h},setBatchNotifyFunction:h=>{r=h},setScheduler:i}}var ur=dq(),kl,fM,YM=(fM=class{constructor(){Xe(this,kl,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dw(this.gcTime)&&Ve(this,kl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qu?1/0:5*60*1e3))}clearGcTimeout(){se(this,kl)&&(clearTimeout(se(this,kl)),Ve(this,kl,void 0))}},kl=new WeakMap,fM),Au,Mu,Wo,_s,Uo,tr,qh,Il,ku,Gm,hi,wa,hM,fq=(hM=class extends YM{constructor(t){super();Xe(this,ku);Xe(this,hi);Xe(this,Au,void 0);Xe(this,Mu,void 0);Xe(this,Wo,void 0);Xe(this,_s,void 0);Xe(this,Uo,void 0);Xe(this,tr,void 0);Xe(this,qh,void 0);Xe(this,Il,void 0);Ve(this,Il,!1),Ve(this,qh,t.defaultOptions),$t(this,ku,Gm).call(this,t.options),Ve(this,tr,[]),Ve(this,Wo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ve(this,Au,t.state||hq(this.options)),this.state=se(this,Au),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!se(this,tr).length&&this.state.fetchStatus==="idle"&&se(this,Wo).remove(this)}setData(t,n){const r=pw(this.state.data,t,this.options);return $t(this,hi,wa).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){$t(this,hi,wa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=se(this,_s);return(r=se(this,Uo))==null||r.cancel(t),n?n.then(qo).catch(qo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(se(this,Au))}isActive(){return se(this,tr).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||se(this,tr).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!WM(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=se(this,tr).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Uo))==null||n.continue()}onOnline(){var n;const t=se(this,tr).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Uo))==null||n.continue()}addObserver(t){se(this,tr).includes(t)||(se(this,tr).push(t),this.clearGcTimeout(),se(this,Wo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){se(this,tr).includes(t)&&(Ve(this,tr,se(this,tr).filter(n=>n!==t)),se(this,tr).length||(se(this,Uo)&&(se(this,Il)?se(this,Uo).cancel({revert:!0}):se(this,Uo).cancelRetry()),this.scheduleGc()),se(this,Wo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return se(this,tr).length}invalidate(){this.state.isInvalidated||$t(this,hi,wa).call(this,{type:"invalidate"})}fetch(t,n){var c,u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(se(this,_s))return(c=se(this,Uo))==null||c.continueRetry(),se(this,_s)}if(t&&$t(this,ku,Gm).call(this,t),!this.options.queryFn){const p=se(this,tr).find(b=>b.options.queryFn);p&&$t(this,ku,Gm).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,Il,!0),r.signal)})};i(o);const a=()=>this.options.queryFn?(Ve(this,Il,!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}'`)),s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};i(s),(u=this.options.behavior)==null||u.onFetch(s,this),Ve(this,Mu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=s.fetchOptions)==null?void 0:d.meta))&&$t(this,hi,wa).call(this,{type:"fetch",meta:(h=s.fetchOptions)==null?void 0:h.meta});const l=p=>{var b,v,x,y;o1(p)&&p.silent||$t(this,hi,wa).call(this,{type:"error",error:p}),o1(p)||((v=(b=se(this,Wo).config).onError)==null||v.call(b,p,this),(y=(x=se(this,Wo).config).onSettled)==null||y.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ve(this,Uo,qM({fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var b,v,x,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),(v=(b=se(this,Wo).config).onSuccess)==null||v.call(b,p,this),(y=(x=se(this,Wo).config).onSettled)==null||y.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,b)=>{$t(this,hi,wa).call(this,{type:"failed",failureCount:p,error:b})},onPause:()=>{$t(this,hi,wa).call(this,{type:"pause"})},onContinue:()=>{$t(this,hi,wa).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode})),Ve(this,_s,se(this,Uo).promise),se(this,_s)}},Au=new WeakMap,Mu=new WeakMap,Wo=new WeakMap,_s=new WeakMap,Uo=new WeakMap,tr=new WeakMap,qh=new WeakMap,Il=new WeakMap,ku=new WeakSet,Gm=function(t){this.options={...se(this,qh),...t},this.updateGcTime(this.options.gcTime)},hi=new WeakSet,wa=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:_b(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 o1(o)&&o.revert&&se(this,Mu)?{...se(this,Mu),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),ur.batch(()=>{se(this,tr).forEach(r=>{r.onQueryUpdate()}),se(this,Wo).notify({query:this,type:"updated",action:t})})},hM);function hq(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 Ii,pM,KM=(pM=class extends ap{constructor(t={}){super();Xe(this,Ii,void 0);this.config=t,Ve(this,Ii,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??AS(o,n);let a=this.get(i);return a||(a=new fq({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){se(this,Ii).has(t.queryHash)||(se(this,Ii).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=se(this,Ii).get(t.queryHash);n&&(t.destroy(),n===t&&se(this,Ii).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ur.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return se(this,Ii).get(t)}getAll(){return[...se(this,Ii).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>AP(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>AP(t,r)):n}notify(t){ur.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ur.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ur.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ii=new WeakMap,pM),Ni,Yh,mo,Iu,Li,ps,gM,pq=(gM=class extends YM{constructor(t){super();Xe(this,Li);Xe(this,Ni,void 0);Xe(this,Yh,void 0);Xe(this,mo,void 0);Xe(this,Iu,void 0);this.mutationId=t.mutationId,Ve(this,Yh,t.defaultOptions),Ve(this,mo,t.mutationCache),Ve(this,Ni,[]),this.state=t.state||gq(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...se(this,Yh),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){se(this,Ni).includes(t)||(se(this,Ni).push(t),this.clearGcTimeout(),se(this,mo).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ve(this,Ni,se(this,Ni).filter(n=>n!==t)),this.scheduleGc(),se(this,mo).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){se(this,Ni).length||(this.state.status==="pending"?this.scheduleGc():se(this,mo).remove(this))}continue(){var t;return((t=se(this,Iu))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,a,s,l,c,u,d,h,p,b,v,x,y,_,S,E,C,$,O;const n=()=>(Ve(this,Iu,qM({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(D,M)=>{$t(this,Li,ps).call(this,{type:"failed",failureCount:D,error:M})},onPause:()=>{$t(this,Li,ps).call(this,{type:"pause"})},onContinue:()=>{$t(this,Li,ps).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),se(this,Iu).promise),r=this.state.status==="pending";try{if(!r){$t(this,Li,ps).call(this,{type:"pending",variables:t}),await((i=(o=se(this,mo).config).onMutate)==null?void 0:i.call(o,t,this));const M=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));M!==this.state.context&&$t(this,Li,ps).call(this,{type:"pending",context:M,variables:t})}const D=await n();return await((c=(l=se(this,mo).config).onSuccess)==null?void 0:c.call(l,D,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,D,t,this.state.context)),await((p=(h=se(this,mo).config).onSettled)==null?void 0:p.call(h,D,null,this.state.variables,this.state.context,this)),await((v=(b=this.options).onSettled)==null?void 0:v.call(b,D,null,t,this.state.context)),$t(this,Li,ps).call(this,{type:"success",data:D}),D}catch(D){try{throw await((y=(x=se(this,mo).config).onError)==null?void 0:y.call(x,D,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,D,t,this.state.context)),await((C=(E=se(this,mo).config).onSettled)==null?void 0:C.call(E,void 0,D,this.state.variables,this.state.context,this)),await((O=($=this.options).onSettled)==null?void 0:O.call($,void 0,D,t,this.state.context)),D}finally{$t(this,Li,ps).call(this,{type:"error",error:D})}}}},Ni=new WeakMap,Yh=new WeakMap,mo=new WeakMap,Iu=new WeakMap,Li=new WeakSet,ps=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:!_b(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),ur.batch(()=>{se(this,Ni).forEach(r=>{r.onMutationUpdate(t)}),se(this,mo).notify({mutation:this,type:"updated",action:t})})},gM);function gq(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Go,Kh,Nl,mM,mq=(mM=class extends ap{constructor(t={}){super();Xe(this,Go,void 0);Xe(this,Kh,void 0);Xe(this,Nl,void 0);this.config=t,Ve(this,Go,[]),Ve(this,Kh,0)}build(t,n,r){const o=new pq({mutationCache:this,mutationId:++Rg(this,Kh)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){se(this,Go).push(t),this.notify({type:"added",mutation:t})}remove(t){Ve(this,Go,se(this,Go).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){ur.batch(()=>{se(this,Go).forEach(t=>{this.remove(t)})})}getAll(){return se(this,Go)}find(t){const n={exact:!0,...t};return se(this,Go).find(r=>MP(n,r))}findAll(t={}){return se(this,Go).filter(n=>MP(t,n))}notify(t){ur.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ve(this,Nl,(se(this,Nl)??Promise.resolve()).then(()=>{const t=se(this,Go).filter(n=>n.state.isPaused);return ur.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(qo)),Promise.resolve()))}).then(()=>{Ve(this,Nl,void 0)})),se(this,Nl)}},Go=new WeakMap,Kh=new WeakMap,Nl=new WeakMap,mM);function bq(e){return{onFetch:(t,n)=>{const r=async()=>{var b,v,x,y,_;const o=t.options,i=(x=(v=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:v.fetchMore)==null?void 0:x.direction,a=((y=t.state.data)==null?void 0:y.pages)||[],s=((_=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)})},d=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 $={queryKey:t.queryKey,pageParam:E,direction:C?"backward":"forward",meta:t.options.meta};u($);const O=await d($),{maxPages:D}=t.options,M=C?sq:aq;return{pages:M(S.pages,O,D),pageParams:M(S.pageParams,E,D)}};let p;if(i&&a.length){const S=i==="backward",E=S?vq:NP,C={pages:a,pageParams:s},$=E(o,C);p=await h(C,$,S)}else{p=await h(l,s[0]??o.initialPageParam);const S=e??a.length;for(let E=1;E<S;E++){const C=NP(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 NP(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function vq(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var Yn,Ss,Cs,Nu,Lu,Es,Fu,ju,bM,yq=(bM=class{constructor(e={}){Xe(this,Yn,void 0);Xe(this,Ss,void 0);Xe(this,Cs,void 0);Xe(this,Nu,void 0);Xe(this,Lu,void 0);Xe(this,Es,void 0);Xe(this,Fu,void 0);Xe(this,ju,void 0);Ve(this,Yn,e.queryCache||new KM),Ve(this,Ss,e.mutationCache||new mq),Ve(this,Cs,e.defaultOptions||{}),Ve(this,Nu,new Map),Ve(this,Lu,new Map),Ve(this,Es,0)}mount(){Rg(this,Es)._++,se(this,Es)===1&&(Ve(this,Fu,h0.subscribe(()=>{h0.isFocused()&&(this.resumePausedMutations(),se(this,Yn).onFocus())})),Ve(this,ju,p0.subscribe(()=>{p0.isOnline()&&(this.resumePausedMutations(),se(this,Yn).onOnline())})))}unmount(){var e,t;Rg(this,Es)._--,se(this,Es)===0&&((e=se(this,Fu))==null||e.call(this),Ve(this,Fu,void 0),(t=se(this,ju))==null||t.call(this),Ve(this,ju,void 0))}isFetching(e){return se(this,Yn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return se(this,Ss).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=se(this,Yn).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=se(this,Yn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=oq(t,o);if(typeof i>"u")return;const a=this.defaultQueryOptions({queryKey:e});return se(this,Yn).build(this,a).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return ur.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=se(this,Yn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=se(this,Yn);ur.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=se(this,Yn),r={type:"active",...e};return ur.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=ur.batch(()=>se(this,Yn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(qo).catch(qo)}invalidateQueries(e={},t={}){return ur.batch(()=>{if(se(this,Yn).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=ur.batch(()=>se(this,Yn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(qo)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(qo)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=se(this,Yn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qo).catch(qo)}fetchInfiniteQuery(e){return e.behavior=bq(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qo).catch(qo)}resumePausedMutations(){return se(this,Ss).resumePausedMutations()}getQueryCache(){return se(this,Yn)}getMutationCache(){return se(this,Ss)}getDefaultOptions(){return se(this,Cs)}setDefaultOptions(e){Ve(this,Cs,e)}setQueryDefaults(e,t){se(this,Nu).set(ih(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...se(this,Nu).values()];let n={};return t.forEach(r=>{ah(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){se(this,Lu).set(ih(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...se(this,Lu).values()];let n={};return t.forEach(r=>{ah(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...se(this,Cs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=AS(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:{...se(this,Cs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){se(this,Yn).clear(),se(this,Ss).clear()}},Yn=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,Nu=new WeakMap,Lu=new WeakMap,Es=new WeakMap,Fu=new WeakMap,ju=new WeakMap,bM),Xr,xn,Xh,Ar,Ll,zu,Fi,Qh,Bu,Vu,Fl,jl,Rs,Hu,zl,wf,Jh,gw,Zh,mw,ep,bw,tp,vw,np,yw,rp,xw,op,ww,hb,XM,vM,xq=(vM=class extends ap{constructor(t,n){super();Xe(this,zl);Xe(this,Jh);Xe(this,Zh);Xe(this,ep);Xe(this,tp);Xe(this,np);Xe(this,rp);Xe(this,op);Xe(this,hb);Xe(this,Xr,void 0);Xe(this,xn,void 0);Xe(this,Xh,void 0);Xe(this,Ar,void 0);Xe(this,Ll,void 0);Xe(this,zu,void 0);Xe(this,Fi,void 0);Xe(this,Qh,void 0);Xe(this,Bu,void 0);Xe(this,Vu,void 0);Xe(this,Fl,void 0);Xe(this,jl,void 0);Xe(this,Rs,void 0);Xe(this,Hu,new Set);this.options=n,Ve(this,Xr,t),Ve(this,Fi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(se(this,xn).addObserver(this),LP(se(this,xn),this.options)?$t(this,zl,wf).call(this):this.updateResult(),$t(this,tp,vw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _w(se(this,xn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _w(se(this,xn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,$t(this,np,yw).call(this),$t(this,rp,xw).call(this),se(this,xn).removeObserver(this)}setOptions(t,n){const r=this.options,o=se(this,xn);if(this.options=se(this,Xr).defaultQueryOptions(t),fw(r,this.options)||se(this,Xr).getQueryCache().notify({type:"observerOptionsUpdated",query:se(this,xn),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),$t(this,op,ww).call(this);const i=this.hasListeners();i&&FP(se(this,xn),o,this.options,r)&&$t(this,zl,wf).call(this),this.updateResult(n),i&&(se(this,xn)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&$t(this,Jh,gw).call(this);const a=$t(this,Zh,mw).call(this);i&&(se(this,xn)!==o||this.options.enabled!==r.enabled||a!==se(this,Rs))&&$t(this,ep,bw).call(this,a)}getOptimisticResult(t){const n=se(this,Xr).getQueryCache().build(se(this,Xr),t),r=this.createResult(n,t);return _q(this,r)&&(Ve(this,Ar,r),Ve(this,zu,this.options),Ve(this,Ll,se(this,xn).state)),r}getCurrentResult(){return se(this,Ar)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(se(this,Hu).add(r),t[r])})}),n}getCurrentQuery(){return se(this,xn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=se(this,Xr).defaultQueryOptions(t),r=se(this,Xr).getQueryCache().build(se(this,Xr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return $t(this,zl,wf).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),se(this,Ar)))}createResult(t,n){var $;const r=se(this,xn),o=this.options,i=se(this,Ar),a=se(this,Ll),s=se(this,zu),c=t!==r?t.state:se(this,Xh),{state:u}=t;let{error:d,errorUpdatedAt:h,fetchStatus:p,status:b}=u,v=!1,x;if(n._optimisticResults){const O=this.hasListeners(),D=!O&&LP(t,n),M=O&&FP(t,r,n,o);(D||M)&&(p=_b(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(b="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(a==null?void 0:a.data)&&n.select===se(this,Qh))x=se(this,Bu);else try{Ve(this,Qh,n.select),x=n.select(u.data),x=pw(i==null?void 0:i.data,x,n),Ve(this,Bu,x),Ve(this,Fi,null)}catch(O){Ve(this,Fi,O)}else x=u.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&b==="pending"){let O;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))O=i.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData(($=se(this,Vu))==null?void 0:$.state.data,se(this,Vu)):n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),Ve(this,Fi,null)}catch(D){Ve(this,Fi,D)}typeof O<"u"&&(b="success",x=pw(i==null?void 0:i.data,O,n),v=!0)}se(this,Fi)&&(d=se(this,Fi),x=se(this,Bu),h=Date.now(),b="error");const y=p==="fetching",_=b==="pending",S=b==="error",E=_&&y;return{status:b,fetchStatus:p,isPending:_,isSuccess:b==="success",isError:S,isInitialLoading:E,isLoading:E,data:x,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:v,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:MS(t,n),refetch:this.refetch}}updateResult(t){const n=se(this,Ar),r=this.createResult(se(this,xn),this.options);if(Ve(this,Ll,se(this,xn).state),Ve(this,zu,this.options),se(this,Ll).data!==void 0&&Ve(this,Vu,se(this,xn)),fw(r,n))return;Ve(this,Ar,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!se(this,Hu).size)return!0;const l=new Set(s??se(this,Hu));return this.options.throwOnError&&l.add("error"),Object.keys(se(this,Ar)).some(c=>{const u=c;return se(this,Ar)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),$t(this,hb,XM).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&$t(this,tp,vw).call(this)}},Xr=new WeakMap,xn=new WeakMap,Xh=new WeakMap,Ar=new WeakMap,Ll=new WeakMap,zu=new WeakMap,Fi=new WeakMap,Qh=new WeakMap,Bu=new WeakMap,Vu=new WeakMap,Fl=new WeakMap,jl=new WeakMap,Rs=new WeakMap,Hu=new WeakMap,zl=new WeakSet,wf=function(t){$t(this,op,ww).call(this);let n=se(this,xn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(qo)),n},Jh=new WeakSet,gw=function(){if($t(this,np,yw).call(this),qu||se(this,Ar).isStale||!dw(this.options.staleTime))return;const n=WM(se(this,Ar).dataUpdatedAt,this.options.staleTime)+1;Ve(this,Fl,setTimeout(()=>{se(this,Ar).isStale||this.updateResult()},n))},Zh=new WeakSet,mw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(se(this,xn)):this.options.refetchInterval)??!1},ep=new WeakSet,bw=function(t){$t(this,rp,xw).call(this),Ve(this,Rs,t),!(qu||this.options.enabled===!1||!dw(se(this,Rs))||se(this,Rs)===0)&&Ve(this,jl,setInterval(()=>{(this.options.refetchIntervalInBackground||h0.isFocused())&&$t(this,zl,wf).call(this)},se(this,Rs)))},tp=new WeakSet,vw=function(){$t(this,Jh,gw).call(this),$t(this,ep,bw).call(this,$t(this,Zh,mw).call(this))},np=new WeakSet,yw=function(){se(this,Fl)&&(clearTimeout(se(this,Fl)),Ve(this,Fl,void 0))},rp=new WeakSet,xw=function(){se(this,jl)&&(clearInterval(se(this,jl)),Ve(this,jl,void 0))},op=new WeakSet,ww=function(){const t=se(this,Xr).getQueryCache().build(se(this,Xr),this.options);if(t===se(this,xn))return;const n=se(this,xn);Ve(this,xn,t),Ve(this,Xh,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},hb=new WeakSet,XM=function(t){ur.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(se(this,Ar))}),se(this,Xr).getQueryCache().notify({query:se(this,xn),type:"observerResultsUpdated"})})},vM);function wq(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function LP(e,t){return wq(e,t)||e.state.dataUpdatedAt>0&&_w(e,t,t.refetchOnMount)}function _w(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&MS(e,t)}return!1}function FP(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&MS(e,n)}function MS(e,t){return e.isStaleByTime(t.staleTime)}function _q(e,t){return!fw(e.getCurrentResult(),t)}var QM=j.createContext(void 0),JM=e=>{const t=j.useContext(QM);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Sq=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),j.createElement(QM.Provider,{value:e},t)),ZM=j.createContext(!1),Cq=()=>j.useContext(ZM);ZM.Provider;function Eq(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Rq=j.createContext(Eq()),Pq=()=>j.useContext(Rq);function $q(e,t){return typeof e=="function"?e(...t):!!e}var Oq=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},Dq=e=>{j.useEffect(()=>{e.clearReset()},[e])},Tq=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&$q(n,[e.error,r]),Aq=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Mq=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,kq=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Iq(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=JM(n),o=Cq(),i=Pq(),a=r.defaultQueryOptions(e);a._optimisticResults=o?"isRestoring":"optimistic",Aq(a),Oq(a,i),Dq(i);const[s]=j.useState(()=>new t(r,a)),l=s.getOptimisticResult(a);if(j.useSyncExternalStore(j.useCallback(c=>{const u=o?()=>{}:s.subscribe(ur.batchCalls(c));return s.updateResult(),u},[s,o]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),j.useEffect(()=>{s.setOptions(a,{listeners:!1})},[a,s]),Mq(a,l))throw kq(a,s,i);if(Tq({result:l,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw l.error;return a.notifyOnChangeProps?l:s.trackResult(l)}function sp(e,t){return Iq(e,xq,t)}function e6({children:e}){const{setIsSessionExpired:t}=Sr(),n=new yq({queryCache:new KM({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return R.jsx(Sq,{client:n,children:e})}const gc=m.forwardRef(({children:e,className:t,...n},r)=>R.jsx("div",{className:we("semaphor-scope",t),ref:r,...n,children:e})),Nq={id:"",authToken:void 0},t6=m.createContext(Nq),n6=({children:e,dashboardProps:t})=>R.jsx(e6,{children:R.jsx(t6.Provider,{value:t,children:R.jsx(gc,{style:{height:"100%"},children:e})})});function _i(){const e=m.useContext(t6);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function Lq(){const{authToken:e,version:t}=_i(),n=xe(s=>s.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:a}=sp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>xG(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:o,isFetching:i,isError:a}}function r6(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function jP(e,t){const n=r6(e);return n==="dark"?Bl.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function Fq({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,onFilterValuesChange:i}){const{authToken:a}=_i(),s=xe(A=>A.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:d}=Lq(),[h,p]=m.useState(o||[]),{theme:b,setTheme:v}=HM(),x=xe(A=>A.dashboard.globalStyle),{setDashboard:y,setDashboardWithFilterValues:_,setSelectedSheetId:S,setStyle:E,setOnSaveFunction:C,setLenses:$,setSelectedLensId:O,setInitStore:D}=xe(A=>A.actions);xe(A=>A.actions.setCustomCards);const M=xe(A=>A.actions.setFilterValues),L=xe(A=>A.filterValues),F=xe(A=>A.actions.setThemeStyle),z=xe(A=>A.actions.setDashboardTheme),X=xe(A=>A.actions.setOnEvent);m.useEffect(()=>{a&&D()},[a,D]),m.useEffect(()=>{if(b){const A=r6(b);z(A)}},[b,z]),m.useEffect(()=>{t&&v(t)},[t,v]);const G=m.useCallback(()=>{const A=Bl.cloneDeep(d0),q=Bl.merge(A,x);if(e){const U=Bl.merge(q,e),K=jP(b,U);F(K),E(U)}else{const U=jP(b,q);F(U),E(d0)}},[b,e,x,F,E]);return m.useEffect(()=>{l&&l.dashboard&&G()},[b,e,x,G,l]),m.useEffect(()=>{var V,Y;function A(I,ne){const ce=I.filters||[],ue=[];for(const he of ne){const Z=ce.find(te=>te.id===he.filterId);Z&&ue.push({filterId:he.filterId,connectionType:Z.database==="NA"?"api":"database",name:Z.column,operation:Z.operation,valueType:bu(Z),values:he.values})}return ue}if(!l||!l.dashboard)return;const{dashboard:q,filterValues:U,defaultLensId:K,lenses:W}=l,T=A(q,h||[]);_(q,U||T||[]),K&&O(K),W&&$(W),S(((Y=(V=q==null?void 0:q.sheets)==null?void 0:V[0])==null?void 0:Y.id)||null)},[l,y,S,M,s,$,_,O,h]),m.useEffect(()=>{i&&L&&i(L)},[L,i]),m.useEffect(()=>{n&&C(n),r&&X(r)},[n,C,r,X]),{isFetching:u,isLoading:c,isError:d}}function Sb({className:e,...t}){return R.jsx("div",{className:we("animate-pulse rounded-md bg-muted",e),...t})}const kS=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:we("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));kS.displayName="Card";const Cb=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:we("flex flex-col space-y-1.5 p-6",e),...t}));Cb.displayName="CardHeader";const gd=j.forwardRef(({className:e,...t},n)=>R.jsx("h3",{ref:n,className:we("text-2xl font-semibold leading-none tracking-tight",e),...t}));gd.displayName="CardTitle";const IS=j.forwardRef(({className:e,...t},n)=>R.jsx("p",{ref:n,className:we("text-sm text-muted-foreground",e),...t}));IS.displayName="CardDescription";const Eb=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:we("px-6 pt-0",e),...t}));Eb.displayName="CardContent";const NS=j.forwardRef(({className:e,...t},n)=>R.jsx("div",{ref:n,className:we("flex items-center p-6 pt-0",e),...t}));NS.displayName="CardFooter";function o6({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:a,id:s,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:h,defaultFilterValues:p,onFilterValuesChange:b,...v}){xe(C=>C.selectedSheetId);const x=xe(C=>C.themeStyle),y=xe(C=>C.isSessionExpired),{isLoading:_,isError:S,isFetching:E}=Fq({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:p,onFilterValuesChange:b});return _||!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(Sb,{className:"h-1 w-full dark:h-[2px]"})})):S?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),R.jsx(i,{})):R.jsx("div",{children:"Error"})):y?(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(gd,{children:"Session Expired"}),R.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):R.jsx("div",{className:we("flex h-full flex-col justify-between",x==null?void 0:x.dashboardPanel,e),style:{},role:"dashboard-panel",...v})}function de(){return de=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},de.apply(this,arguments)}function ke(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 hr(e,t=[]){let n=[];function r(i,a){const s=m.createContext(a),l=n.length;n=[...n,a];function c(d){const{scope:h,children:p,...b}=d,v=(h==null?void 0:h[e][l])||s,x=m.useMemo(()=>b,Object.values(b));return m.createElement(v.Provider,{value:x},p)}function u(d,h){const p=(h==null?void 0:h[e][l])||s,b=m.useContext(p);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>m.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,jq(o,...t)]}function jq(...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 a=r.reduce((s,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...s,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function zq(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function za(...e){return t=>e.forEach(n=>zq(n,t))}function Rt(...e){return m.useCallback(za(...e),e)}const Sw=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Vq);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(Cw,de({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(Cw,de({},r,{ref:t}),n)});Sw.displayName="Slot";const Cw=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Hq(r,n.props),ref:t?za(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Cw.displayName="SlotClone";const Bq=({children:e})=>m.createElement(m.Fragment,null,e);function Vq(e){return m.isValidElement(e)&&e.type===Bq}function Hq(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]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Rb(e){const t=e+"CollectionProvider",[n,r]=hr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:b,children:v}=p,x=m.useRef(null),y=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:y,collectionRef:x},v)},s=e+"CollectionSlot",l=m.forwardRef((p,b)=>{const{scope:v,children:x}=p,y=i(s,v),_=Rt(b,y.collectionRef);return m.createElement(Sw,{ref:_},x)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=m.forwardRef((p,b)=>{const{scope:v,children:x,...y}=p,_=m.useRef(null),S=Rt(b,_),E=i(c,v);return m.useEffect(()=>(E.itemMap.set(_,{ref:_,...y}),()=>void E.itemMap.delete(_))),m.createElement(Sw,{[u]:"",ref:S},x)});function h(p){const b=i(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const y=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((E,C)=>y.indexOf(E.ref.current)-y.indexOf(C.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},h,r]}const Cr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},Wq=j.useId||(()=>{});let Uq=0;function yi(e){const[t,n]=j.useState(Wq());return Cr(()=>{e||n(r=>r??String(Uq++))},[e]),e||(t?`radix-${t}`:"")}const i6=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(qq);if(i){const a=i.props.children,s=o.map(l=>l===i?m.Children.count(a)>1?m.Children.only(null):m.isValidElement(a)?a.props.children:null:l);return m.createElement(Ew,de({},r,{ref:t}),m.isValidElement(a)?m.cloneElement(a,void 0,s):null)}return m.createElement(Ew,de({},r,{ref:t}),n)});i6.displayName="Slot";const Ew=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Yq(r,n.props),ref:t?za(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Ew.displayName="SlotClone";const Gq=({children:e})=>m.createElement(m.Fragment,null,e);function qq(e){return m.isValidElement(e)&&e.type===Gq}function Yq(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]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const Kq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Qe=Kq.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?i6:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(s,de({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function a6(e,t){e&&Er.flushSync(()=>e.dispatchEvent(t))}function Xn(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 Lr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Xq({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=Xn(n),l=m.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&s(d)}else o(c)},[i,e,o,s]);return[a,l]}function Xq({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=Xn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Qq=m.createContext(void 0);function mc(e){const t=m.useContext(Qq);return e||t||"ltr"}const i1="rovingFocusGroup.onEntryFocus",Jq={bubbles:!1,cancelable:!0},LS="RovingFocusGroup",[Rw,s6,Zq]=Rb(LS),[eY,md]=hr(LS,[Zq]),[tY,nY]=eY(LS),rY=m.forwardRef((e,t)=>m.createElement(Rw.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Rw.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(oY,de({},e,{ref:t}))))),oY=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,d=m.useRef(null),h=Rt(t,d),p=mc(i),[b=null,v]=Lr({prop:a,defaultProp:s,onChange:l}),[x,y]=m.useState(!1),_=Xn(c),S=s6(n),E=m.useRef(!1),[C,$]=m.useState(0);return m.useEffect(()=>{const O=d.current;if(O)return O.addEventListener(i1,_),()=>O.removeEventListener(i1,_)},[_]),m.createElement(tY,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(O=>v(O),[v]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>$(O=>O+1),[]),onFocusableItemRemove:m.useCallback(()=>$(O=>O-1),[])},m.createElement(Qe.div,de({tabIndex:x||C===0?-1:0,"data-orientation":r},u,{ref:h,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{E.current=!0}),onFocus:ke(e.onFocus,O=>{const D=!E.current;if(O.target===O.currentTarget&&D&&!x){const M=new CustomEvent(i1,Jq);if(O.currentTarget.dispatchEvent(M),!M.defaultPrevented){const L=S().filter(A=>A.focusable),F=L.find(A=>A.active),z=L.find(A=>A.id===b),G=[F,z,...L].filter(Boolean).map(A=>A.ref.current);l6(G)}}E.current=!1}),onBlur:ke(e.onBlur,()=>y(!1))})))}),iY="RovingFocusGroupItem",aY=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...a}=e,s=yi(),l=i||s,c=nY(iY,n),u=c.currentTabStopId===l,d=s6(n),{onFocusableItemAdd:h,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return h(),()=>p()},[r,h,p]),m.createElement(Rw.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Qe.span,de({tabIndex:u?0:-1,"data-orientation":c.orientation},a,{ref:t,onMouseDown:ke(e.onMouseDown,b=>{r?c.onItemFocus(l):b.preventDefault()}),onFocus:ke(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ke(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){c.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=cY(b,c.orientation,c.dir);if(v!==void 0){b.preventDefault();let y=d().filter(_=>_.focusable).map(_=>_.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const _=y.indexOf(b.currentTarget);y=c.loop?uY(y,_+1):y.slice(_+1)}setTimeout(()=>l6(y))}})})))}),sY={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lY(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cY(e,t,n){const r=lY(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return sY[r]}function l6(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function uY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const FS=rY,jS=aY;function dY(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const pr=e=>{const{present:t,children:n}=e,r=fY(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Rt(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};pr.displayName="Presence";function fY(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),a=e?"mounted":"unmounted",[s,l]=dY(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Dg(r.current);i.current=s==="mounted"?c:"none"},[s]),Cr(()=>{const c=r.current,u=o.current;if(u!==e){const h=i.current,p=Dg(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]),Cr(()=>{if(t){const c=d=>{const p=Dg(r.current).includes(d.animationName);d.target===t&&p&&Er.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Dg(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(s),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Dg(e){return(e==null?void 0:e.animationName)||"none"}const c6="Tabs",[hY,jRe]=hr(c6,[md]),u6=md(),[pY,zS]=hY(c6),gY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:l="automatic",...c}=e,u=mc(s),[d,h]=Lr({prop:r,onChange:o,defaultProp:i});return m.createElement(pY,{scope:n,baseId:yi(),value:d,onValueChange:h,orientation:a,dir:u,activationMode:l},m.createElement(Qe.div,de({dir:u,"data-orientation":a},c,{ref:t})))}),mY="TabsList",bY=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=zS(mY,n),a=u6(n);return m.createElement(FS,de({asChild:!0},a,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Qe.div,de({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),vY="TabsTrigger",yY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,a=zS(vY,n),s=u6(n),l=d6(a.baseId,r),c=f6(a.baseId,r),u=r===a.value;return m.createElement(jS,de({asChild:!0},s,{focusable:!o,active:u}),m.createElement(Qe.button,de({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:ke(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:ke(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:ke(e.onFocus,()=>{const d=a.activationMode!=="manual";!u&&!o&&d&&a.onValueChange(r)})})))}),xY="TabsContent",wY=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...a}=e,s=zS(xY,n),l=d6(s.baseId,r),c=f6(s.baseId,r),u=r===s.value,d=m.useRef(u);return m.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),m.createElement(pr,{present:o||u},({present:h})=>m.createElement(Qe.div,de({"data-state":u?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0},a,{ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0}}),h&&i))});function d6(e,t){return`${e}-trigger-${t}`}function f6(e,t){return`${e}-content-${t}`}const _Y=gY,h6=bY,p6=yY,g6=wY,BS=_Y,Pb=j.forwardRef(({className:e,...t},n)=>R.jsx(h6,{ref:n,className:we("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Pb.displayName=h6.displayName;const $b=j.forwardRef(({className:e,...t},n)=>R.jsx(p6,{ref:n,className:we("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}));$b.displayName=p6.displayName;const VS=j.forwardRef(({className:e,...t},n)=>R.jsx(g6,{ref:n,className:we("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));VS.displayName=g6.displayName;var m6={exports:{}},lp={},Pw={exports:{}};(function(e,t){(function(n,r){r(t)})(vs,function(n){function r(Z){return function(ae,me,ee,ve,Ce,Oe,De){return Z(ae,me,De)}}function o(Z){return function(ae,me,ee,ve){if(!ae||!me||typeof ae!="object"||typeof me!="object")return Z(ae,me,ee,ve);var Ce=ve.get(ae),Oe=ve.get(me);if(Ce&&Oe)return Ce===me&&Oe===ae;ve.set(ae,me),ve.set(me,ae);var De=Z(ae,me,ee,ve);return ve.delete(ae),ve.delete(me),De}}function i(Z,te){var ae={};for(var me in Z)ae[me]=Z[me];for(var me in te)ae[me]=te[me];return ae}function a(Z){return Z.constructor===Object||Z.constructor==null}function s(Z){return typeof Z.then=="function"}function l(Z,te){return Z===te||Z!==Z&&te!==te}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",h="[object RegExp]",p="[object Map]",b="[object Number]",v="[object Object]",x="[object Set]",y="[object String]",_=Object.prototype.toString;function S(Z){var te=Z.areArraysEqual,ae=Z.areDatesEqual,me=Z.areMapsEqual,ee=Z.areObjectsEqual,ve=Z.areRegExpsEqual,Ce=Z.areSetsEqual,Oe=Z.createIsNestedEqual,De=Oe(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(a(Be)&&a(Ie))return ee(Be,Ie,De,Ke);var dt=Array.isArray(Be),zt=Array.isArray(Ie);if(dt||zt)return dt===zt&&te(Be,Ie,De,Ke);var Nt=_.call(Be);return Nt!==_.call(Ie)?!1:Nt===d?ae(Be,Ie,De,Ke):Nt===h?ve(Be,Ie,De,Ke):Nt===p?me(Be,Ie,De,Ke):Nt===x?Ce(Be,Ie,De,Ke):Nt===v||Nt===c?s(Be)||s(Ie)?!1:ee(Be,Ie,De,Ke):Nt===u||Nt===b||Nt===y?l(Be.valueOf(),Ie.valueOf()):!1}return Ue}function E(Z,te,ae,me){var ee=Z.length;if(te.length!==ee)return!1;for(;ee-- >0;)if(!ae(Z[ee],te[ee],ee,ee,Z,te,me))return!1;return!0}var C=o(E);function $(Z,te){return l(Z.valueOf(),te.valueOf())}function O(Z,te,ae,me){var ee=Z.size===te.size;if(!ee)return!1;if(!Z.size)return!0;var ve={},Ce=0;return Z.forEach(function(Oe,De){if(ee){var Ue=!1,Be=0;te.forEach(function(Ie,Ke){!Ue&&!ve[Be]&&(Ue=ae(De,Ke,Ce,Be,Z,te,me)&&ae(Oe,Ie,De,Ke,Z,te,me))&&(ve[Be]=!0),Be++}),Ce++,ee=Ue}}),ee}var D=o(O),M="_owner",L=Object.prototype.hasOwnProperty;function F(Z,te,ae,me){var ee=Object.keys(Z),ve=ee.length;if(Object.keys(te).length!==ve)return!1;for(var Ce;ve-- >0;){if(Ce=ee[ve],Ce===M){var Oe=!!Z.$$typeof,De=!!te.$$typeof;if((Oe||De)&&Oe!==De)return!1}if(!L.call(te,Ce)||!ae(Z[Ce],te[Ce],Ce,Ce,Z,te,me))return!1}return!0}var z=o(F);function X(Z,te){return Z.source===te.source&&Z.flags===te.flags}function G(Z,te,ae,me){var ee=Z.size===te.size;if(!ee)return!1;if(!Z.size)return!0;var ve={};return Z.forEach(function(Ce,Oe){if(ee){var De=!1,Ue=0;te.forEach(function(Be,Ie){!De&&!ve[Ue]&&(De=ae(Ce,Be,Oe,Ie,Z,te,me))&&(ve[Ue]=!0),Ue++}),ee=De}}),ee}var A=o(G),q=Object.freeze({areArraysEqual:E,areDatesEqual:$,areMapsEqual:O,areObjectsEqual:F,areRegExpsEqual:X,areSetsEqual:G,createIsNestedEqual:r}),U=Object.freeze({areArraysEqual:C,areDatesEqual:$,areMapsEqual:D,areObjectsEqual:z,areRegExpsEqual:X,areSetsEqual:A,createIsNestedEqual:r}),K=S(q);function W(Z,te){return K(Z,te,void 0)}var T=S(i(q,{createIsNestedEqual:function(){return l}}));function V(Z,te){return T(Z,te,void 0)}var Y=S(U);function I(Z,te){return Y(Z,te,new WeakMap)}var ne=S(i(U,{createIsNestedEqual:function(){return l}}));function ce(Z,te){return ne(Z,te,new WeakMap)}function ue(Z){return S(i(q,Z(q)))}function he(Z){var te=S(i(U,Z(U)));return function(ae,me,ee){return ee===void 0&&(ee=new WeakMap),te(ae,me,ee)}}n.circularDeepEqual=I,n.circularShallowEqual=ce,n.createCustomCircularEqual=he,n.createCustomEqual=ue,n.deepEqual=W,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(Pw,Pw.exports);var HS=Pw.exports;const WS=SS(AU);var At={},SY=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(At,"__esModule",{value:!0});At.bottom=US;At.childrenEqual=PY;At.cloneLayout=b6;At.cloneLayoutItem=Vl;At.collides=Ob;At.compact=y6;At.compactItem=x6;At.compactType=BY;At.correctBounds=w6;At.fastPositionEqual=OY;At.fastRGLPropsEqual=void 0;At.getAllCollisions=_6;At.getFirstCollision=$l;At.getLayoutItem=GS;At.getStatics=qS;At.modifyLayout=v6;At.moveElement=Sf;At.moveElementAwayFromCollision=Ow;At.noop=void 0;At.perc=TY;At.resizeItemInDirection=LY;At.setTopLeft=jY;At.setTransform=FY;At.sortLayoutItems=ZS;At.sortLayoutItemsByColRow=P6;At.sortLayoutItemsByRowCol=R6;At.synchronizeLayoutWithChildren=zY;At.validateLayout=$6;At.withLayoutItem=RY;var zP=HS,_f=CY(m);function CY(e){return e&&e.__esModule?e:{default:e}}const EY=process.env.NODE_ENV==="production";function US(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 b6(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Vl(e[n]);return t}function v6(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 RY(e,t,n){let r=GS(e,t);return r?(r=n(Vl(r)),e=v6(e,r),[e,r]):[e,null]}function Vl(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 PY(e,t){return(0,zP.deepEqual)(_f.default.Children.map(e,n=>n==null?void 0:n.key),_f.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,zP.deepEqual)(_f.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),_f.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const $Y=SY;At.fastRGLPropsEqual=$Y;function OY(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Ob(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 y6(e,t,n,r){const o=qS(e),i=ZS(e,t),a=Array(e.length);for(let s=0,l=i.length;s<l;s++){let c=Vl(i[s]);c.static||(c=x6(o,c,t,n,i,r),o.push(c)),a[e.indexOf(i[s])]=c,c.moved=!1}return a}const DY={x:"w",y:"h"};function $w(e,t,n,r){const o=DY[r];t[r]+=1;const i=e.map(a=>a.i).indexOf(t.i);for(let a=i+1;a<e.length;a++){const s=e[a];if(!s.static){if(s.y>t.y+t.h)break;Ob(t,s)&&$w(e,s,n+t[o],r)}}t[r]=n}function x6(e,t,n,r,o,i){const a=n==="vertical",s=n==="horizontal";if(a)for(t.y=Math.min(US(e),t.y);t.y>0&&!$l(e,t);)t.y--;else if(s)for(;t.x>0&&!$l(e,t);)t.x--;let l;for(;(l=$l(e,t))&&!(n===null&&i);)if(s?$w(o,t,l.x+l.w,"x"):$w(o,t,l.y+l.h,"y"),s&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!$l(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function w6(e,t){const n=qS(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(;$l(n,i);)i.y++}return e}function GS(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function $l(e,t){for(let n=0,r=e.length;n<r;n++)if(Ob(e[n],t))return e[n]}function _6(e,t){return e.filter(n=>Ob(n,t))}function qS(e){return e.filter(t=>t.static)}function Sf(e,t,n,r,o,i,a,s,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 d=ZS(e,a);(a==="vertical"&&typeof r=="number"?u>=r:a==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const p=_6(d,t),b=p.length>0;if(b&&l)return b6(e);if(b&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let v=0,x=p.length;v<x;v++){const y=p[v];"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=Ow(e,y,t,o,a):e=Ow(e,t,y,o,a))}return e}function Ow(e,t,n,r,o,i){const a=o==="horizontal",s=o==="vertical",l=t.static;if(r){r=!1;const d={x:a?Math.max(t.x-n.w,0):n.x,y:s?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=$l(e,d),p=h&&h.y+h.h>t.y,b=h&&t.x+t.w>h.x;if(h){if(p&&s)return Sf(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(b&&a)return Sf(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(d.x,",").concat(d.y,"]."),Sf(e,n,a?d.x:void 0,s?d.y:void 0,r,l,o)}const c=a?n.x+1:void 0,u=s?n.y+1:void 0;return c==null&&u==null?e:Sf(e,n,a?n.x+1:void 0,s?n.y+1:void 0,r,l,o)}function TY(e){return e*100+"%"}const S6=(e,t,n,r)=>e+n>r?t:n,C6=(e,t,n)=>e<0?t:n,E6=e=>Math.max(0,e),YS=e=>Math.max(0,e),KS=(e,t,n)=>{let{left:r,height:o,width:i}=t;const a=e.top-(o-e.height);return{left:r,width:i,height:C6(a,e.height,o),top:YS(a)}},XS=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{top:r,height:i,width:S6(e.left,e.width,a,n),left:E6(o)}},QS=(e,t,n)=>{let{top:r,height:o,width:i}=t;const a=e.left-(i-e.width);return{height:o,width:a<0?e.width:S6(e.left,e.width,i,n),top:YS(r),left:E6(a)}},JS=(e,t,n)=>{let{top:r,left:o,height:i,width:a}=t;return{width:a,left:o,height:C6(r,e.height,i),top:YS(r)}},AY=function(){return KS(arguments.length<=0?void 0:arguments[0],XS(...arguments))},MY=function(){return KS(arguments.length<=0?void 0:arguments[0],QS(...arguments))},kY=function(){return JS(arguments.length<=0?void 0:arguments[0],XS(...arguments))},IY=function(){return JS(arguments.length<=0?void 0:arguments[0],QS(...arguments))},NY={n:KS,ne:AY,e:XS,se:kY,s:JS,sw:IY,w:QS,nw:MY};function LY(e,t,n,r){const o=NY[e];return o?o(t,{...t,...n},r):n}function FY(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 jY(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 ZS(e,t){return t==="horizontal"?P6(e):t==="vertical"?R6(e):e}function R6(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 P6(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 zY(e,t,n,r,o){e=e||[];const i=[];_f.default.Children.forEach(t,s=>{if((s==null?void 0:s.key)==null)return;const l=GS(e,String(s.key)),c=s.props["data-grid"];l&&c==null?i.push(Vl(l)):c?(EY||$6([c],"ReactGridLayout.children"),i.push(Vl({...c,i:s.key}))):i.push(Vl({w:1,h:1,x:0,y:US(i),i:String(s.key)}))});const a=w6(i,{cols:n});return o?a:y6(a,r,n)}function $6(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 a=0;a<n.length;a++)if(typeof i[n[a]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[a]+" must be a number!")}}function BY(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const VY=()=>{};At.noop=VY;var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.calcGridColWidth=Db;ea.calcGridItemPosition=HY;ea.calcGridItemWHPx=Dw;ea.calcWH=UY;ea.calcXY=WY;ea.clamp=Ol;function Db(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Dw(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function HY(e,t,n,r,o,i){const{margin:a,containerPadding:s,rowHeight:l}=e,c=Db(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=Dw(r,c,a[0]),u.height=Dw(o,l,a[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+a[1])*n+s[1]),u.left=Math.round((c+a[0])*t+s[0])),u}function WY(e,t,n,r,o){const{margin:i,cols:a,rowHeight:s,maxRows:l}=e,c=Db(e);let u=Math.round((n-i[0])/(c+i[0])),d=Math.round((t-i[1])/(s+i[1]));return u=Ol(u,0,a-r),d=Ol(d,0,l-o),{x:u,y:d}}function UY(e,t,n,r,o,i){const{margin:a,maxRows:s,cols:l,rowHeight:c}=e,u=Db(e);let d=Math.round((t+a[0])/(u+a[0])),h=Math.round((n+a[1])/(c+a[1])),p=Ol(d,0,l-r),b=Ol(h,0,s-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Ol(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=Ol(h,0,s)),{w:p,h:b}}function Ol(e,t,n){return Math.max(Math.min(e,n),t)}var Tb={},Tw={exports:{}},a1,BP;function eC(){if(BP)return a1;BP=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return a1=e,a1}var s1,VP;function GY(){if(VP)return s1;VP=1;var e=eC();function t(){}function n(){}return n.resetWarningCache=t,s1=function(){function r(a,s,l,c,u,d){if(d!==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},s1}var Tg={exports:{}},Zt={};/** @license React v16.13.1
|
|
89
89
|
* react-is.development.js
|
|
90
90
|
*
|
|
91
91
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-j6u8TMrb.js"),a=require("./dashboard-plus-oC4vRia7.js");require("react");require("react-dom");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { J as a, ao as e, am as t, aF as c, bU as h, bV as d, bW as o, bl as y, bX as i, bY as s, a7 as n, bZ as r, b_ as k, b$ as p, c0 as l, Q as M, c1 as u, c2 as v, b2 as g, ah as m, c3 as x, bg as L } from "./index-
|
|
2
|
-
import { c4 as Pv } from "./index-
|
|
3
|
-
import { B as w, C, a as f, b as I, d as S, e as q, f as b, h as H, i as A, j as z, E as P, k as V, l as j, m as B, G as F, H as D, n as R, o as T, K as U, p as O, q as Z, r as G, L as W, M as E, s as X, N, P as K, t as J, v as Q, w as Y, x as _, y as $, z as a1, A as e1, T as t1, F as c1, I as h1, U as d1 } from "./dashboard-plus-
|
|
1
|
+
import { J as a, ao as e, am as t, aF as c, bU as h, bV as d, bW as o, bl as y, bX as i, bY as s, a7 as n, bZ as r, b_ as k, b$ as p, c0 as l, Q as M, c1 as u, c2 as v, b2 as g, ah as m, c3 as x, bg as L } from "./index-FhvN1zHF.js";
|
|
2
|
+
import { c4 as Pv } from "./index-FhvN1zHF.js";
|
|
3
|
+
import { B as w, C, a as f, b as I, d as S, e as q, f as b, h as H, i as A, j as z, E as P, k as V, l as j, m as B, G as F, H as D, n as R, o as T, K as U, p as O, q as Z, r as G, L as W, M as E, s as X, N, P as K, t as J, v as Q, w as Y, x as _, y as $, z as a1, A as e1, T as t1, F as c1, I as h1, U as d1 } from "./dashboard-plus-0OULctzd.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
/**
|
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-j6u8TMrb.js");require("react");require("react-dom");exports.Dashboard=e.Dashboard;
|
package/dist/dashboard/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-j6u8TMrb.js"),n=require("./chunks/dashboard-plus-oC4vRia7.js"),_=require("react");require("react-dom");function v({card:t,footer:u,className:h,...m}){var c;const{customCards:o}=e.useSemaphorContext(),p=_.useRef(null),{isError:C,isLoading:i,isFetching:a,cfg:x,visualKey:f,handleDatapointClick:E}=e.useDashboardCard(t),l=e.useDashboardStore(s=>s.themeStyle),d=e.useDashboardStore(s=>s.selectedSheetId),j=e.useDashboardStore(s=>s.selectedCardId),D=e.useDashboardStore(s=>s.isDashboardEditing),g=((c=t.customCardPreferences)==null?void 0:c.showCardHeader)??!0,{setCardTitle:b,setCardDescription:S,setSelectedCardId:T}=e.useDashboardActions();function R(s){s.stopPropagation(),T(d,t.id)}function A(){if(o&&o.length>0){const s=o.find(r=>r.cardId===t.id);if(s&&s.replaceDefault){const r=s.content;if(r)return e.jsxRuntimeExports.jsx(r,{card:t})}}return t.type==="kpi"?t.data&&t.data.length>0&&e.jsxRuntimeExports.jsx(e.KPICard,{isLoading:i||a,card:t}):N}function y(){if(C)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(o&&o.length>0){const s=o.find(r=>r.cardId===t.id);if(s&&s.content){const r=s.content;return e.jsxRuntimeExports.jsx(r,{card:t})}}if(x)return e.jsxRuntimeExports.jsx(e.ChartJsVisual,{cfg:x,onDatapointClick:E},f)}function I(){if(o&&o.length>0){const s=o.find(r=>r.cardId===t.id);if(s&&s.footer){const r=s.footer;if(r)return e.jsxRuntimeExports.jsx(r,{card:t})}}return u||null}if(!t.id)return null;const N=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[g&&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=>b(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=>S(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:y()}),e.jsxRuntimeExports.jsx(e.CardFooter,{children:I()})]});return e.jsxRuntimeExports.jsx(e.Card,{tabIndex:-1,ref:p,role:"dashboard-card",onClick:R,className:e.cn("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":j===t.id&&D},l==null?void 0:l.dashboardCard,h),...m,children:A()})}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=v;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as P, a as F, b as o, c as k, j as s, C as R, E as h, d as L, T as q, e as B, f as C, g as H, h as Y, i as G, k as K, l as O, K as V, S as z, m as Q, n as W, o as J } from "./chunks/index-
|
|
2
|
-
import { B as re, s as oe, D as ne, q as ie, N as le, I as de, r as ue, w as ce, t as fe, y as he, x as Ce, A as me, v as xe, z as pe, F as ge, p as je, H as De, G as be } from "./chunks/index-
|
|
3
|
-
import { L as M } from "./chunks/dashboard-plus-
|
|
4
|
-
import { S as Te, D as Ee, c as Ie, g as Ae, u as ve } from "./chunks/dashboard-plus-
|
|
1
|
+
import { u as P, a as F, b as o, c as k, j as s, C as R, E as h, d as L, T as q, e as B, f as C, g as H, h as Y, i as G, k as K, l as O, K as V, S as z, m as Q, n as W, o as J } from "./chunks/index-FhvN1zHF.js";
|
|
2
|
+
import { B as re, s as oe, D as ne, q as ie, N as le, I as de, r as ue, w as ce, t as fe, y as he, x as Ce, A as me, v as xe, z as pe, F as ge, p as je, H as De, G as be } from "./chunks/index-FhvN1zHF.js";
|
|
3
|
+
import { L as M } from "./chunks/dashboard-plus-0OULctzd.js";
|
|
4
|
+
import { S as Te, D as Ee, c as Ie, g as Ae, u as ve } from "./chunks/dashboard-plus-0OULctzd.js";
|
|
5
5
|
import U from "react";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
function se({
|
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-oC4vRia7.js");require("../chunks/index-j6u8TMrb.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
|
package/dist/surfboard/index.js
CHANGED