react-semaphor 0.0.115 → 0.0.116

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.
@@ -10280,7 +10280,7 @@ const qa = /* @__PURE__ */ Nd(Ul), EC = ["lg", "md", "sm", "xs", "xxs"], me = WP
10280
10280
  selectedCardId: null,
10281
10281
  selectedFrameId: null,
10282
10282
  selectedCard: null,
10283
- showFilters: !0,
10283
+ showFilters: !1,
10284
10284
  //This shpu;d be false by default
10285
10285
  isDashboardEditing: !1,
10286
10286
  // This should be false by defaultdashboard.
@@ -82,7 +82,7 @@ __p += '`),Ot&&(_e+=`' +
82
82
  function print() { __p += __j.call(arguments, '') }
83
83
  `:`;
84
84
  `)+_e+`return __p
85
- }`;var mt=I3(function(){return At(L,$e+"return "+_e).apply(n,B)});if(mt.source=_e,Q1(mt))throw mt;return mt}function Nde(d){return Lt(d).toLowerCase()}function Rde(d){return Lt(d).toUpperCase()}function Lde(d,h,b){if(d=Lt(d),d&&(b||h===n))return VA(d);if(!d||!(h=Xr(h)))return d;var E=Ni(d),A=Ni(h),L=HA(E,A),B=WA(E,A)+1;return $s(E,L,B).join("")}function Fde(d,h,b){if(d=Lt(d),d&&(b||h===n))return d.slice(0,qA(d)+1);if(!d||!(h=Xr(h)))return d;var E=Ni(d),A=WA(E,Ni(h))+1;return $s(E,0,A).join("")}function $de(d,h,b){if(d=Lt(d),d&&(b||h===n))return d.replace(Xa,"");if(!d||!(h=Xr(h)))return d;var E=Ni(d),A=HA(E,Ni(h));return $s(E,A).join("")}function jde(d,h){var b=j,E=z;if(dn(h)){var A="separator"in h?h.separator:A;b="length"in h?ut(h.length):b,E="omission"in h?Xr(h.omission):E}d=Lt(d);var L=d.length;if(Ec(d)){var B=Ni(d);L=B.length}if(b>=L)return d;var q=b-Oc(E);if(q<1)return E;var ne=B?$s(B,0,q).join(""):d.slice(0,q);if(A===n)return ne+E;if(B&&(q+=ne.length-q),Z1(A)){if(d.slice(q).search(A)){var be,ye=ne;for(A.global||(A=p1(A.source,Lt(Be.exec(A))+"g")),A.lastIndex=0;be=A.exec(ye);)var _e=be.index;ne=ne.slice(0,_e===n?q:_e)}}else if(d.indexOf(Xr(A),q)!=q){var De=ne.lastIndexOf(A);De>-1&&(ne=ne.slice(0,De))}return ne+E}function zde(d){return d=Lt(d),d&&No.test(d)?d.replace(jn,gse):d}var Bde=Ic(function(d,h,b){return d+(b?" ":"")+h.toUpperCase()}),tw=NI("toUpperCase");function A3(d,h,b){return d=Lt(d),h=b?n:h,h===n?use(d)?bse(d):tse(d):d.match(h)||[]}var I3=bt(function(d,h){try{return Yr(d,n,h)}catch(b){return Q1(b)?b:new nt(b)}}),Vde=jo(function(d,h){return hi(h,function(b){b=uo(b),Fo(d,b,K1(d[b],d))}),d});function Hde(d){var h=d==null?0:d.length,b=qe();return d=h?an(d,function(E){if(typeof E[1]!="function")throw new pi(s);return[b(E[0]),E[1]]}):[],bt(function(E){for(var A=-1;++A<h;){var L=d[A];if(Yr(L[0],this,E))return Yr(L[1],this,E)}})}function Wde(d){return gae(mi(d,f))}function nw(d){return function(){return d}}function Ude(d,h){return d==null||d!==d?h:d}var qde=LI(),Gde=LI(!0);function kr(d){return d}function rw(d){return fI(typeof d=="function"?d:mi(d,f))}function Yde(d){return pI(mi(d,f))}function Kde(d,h){return gI(d,mi(h,f))}var Xde=bt(function(d,h){return function(b){return Qd(b,d,h)}}),Qde=bt(function(d,h){return function(b){return Qd(d,b,h)}});function iw(d,h,b){var E=Bn(h),A=qg(h,E);b==null&&!(dn(h)&&(A.length||!E.length))&&(b=h,h=d,d=this,A=qg(h,Bn(h)));var L=!(dn(b)&&"chain"in b)||!!b.chain,B=Bo(d);return hi(A,function(q){var ne=h[q];d[q]=ne,B&&(d.prototype[q]=function(){var be=this.__chain__;if(L||be){var ye=d(this.__wrapped__),_e=ye.__actions__=Er(this.__actions__);return _e.push({func:ne,args:arguments,thisArg:d}),ye.__chain__=be,ye}return ne.apply(d,As([this.value()],arguments))})}),d}function Zde(){return Gn._===this&&(Gn._=Cse),this}function ow(){}function Jde(d){return d=ut(d),bt(function(h){return mI(h,d)})}var efe=L1(an),tfe=L1(FA),nfe=L1(a1);function N3(d){return H1(d)?l1(uo(d)):Aae(d)}function rfe(d){return function(h){return d==null?n:rl(d,h)}}var ife=$I(),ofe=$I(!0);function sw(){return[]}function aw(){return!1}function sfe(){return{}}function afe(){return""}function lfe(){return!0}function cfe(d,h){if(d=ut(d),d<1||d>X)return[];var b=H,E=rr(d,H);h=qe(h),d-=H;for(var A=d1(E,h);++b<d;)h(b);return A}function ufe(d){return st(d)?an(d,uo):Qr(d)?[d]:Er(e3(Lt(d)))}function dfe(d){var h=++_se;return Lt(d)+h}var ffe=Zg(function(d,h){return d+h},0),hfe=F1("ceil"),pfe=Zg(function(d,h){return d/h},1),gfe=F1("floor");function mfe(d){return d&&d.length?Ug(d,kr,_1):n}function vfe(d,h){return d&&d.length?Ug(d,qe(h,2),_1):n}function bfe(d){return zA(d,kr)}function yfe(d,h){return zA(d,qe(h,2))}function xfe(d){return d&&d.length?Ug(d,kr,O1):n}function wfe(d,h){return d&&d.length?Ug(d,qe(h,2),O1):n}var _fe=Zg(function(d,h){return d*h},1),Sfe=F1("round"),Cfe=Zg(function(d,h){return d-h},0);function Efe(d){return d&&d.length?u1(d,kr):0}function Ofe(d,h){return d&&d.length?u1(d,qe(h,2)):0}return I.after=Yce,I.ary=d3,I.assign=Rue,I.assignIn=E3,I.assignInWith=dm,I.assignWith=Lue,I.at=Fue,I.before=f3,I.bind=K1,I.bindAll=Vde,I.bindKey=h3,I.castArray=sue,I.chain=l3,I.chunk=gle,I.compact=mle,I.concat=vle,I.cond=Hde,I.conforms=Wde,I.constant=nw,I.countBy=Ece,I.create=$ue,I.curry=p3,I.curryRight=g3,I.debounce=m3,I.defaults=jue,I.defaultsDeep=zue,I.defer=Kce,I.delay=Xce,I.difference=ble,I.differenceBy=yle,I.differenceWith=xle,I.drop=wle,I.dropRight=_le,I.dropRightWhile=Sle,I.dropWhile=Cle,I.fill=Ele,I.filter=Pce,I.flatMap=Dce,I.flatMapDeep=Tce,I.flatMapDepth=Ace,I.flatten=i3,I.flattenDeep=Ole,I.flattenDepth=Ple,I.flip=Qce,I.flow=qde,I.flowRight=Gde,I.fromPairs=kle,I.functions=Gue,I.functionsIn=Yue,I.groupBy=Ice,I.initial=Dle,I.intersection=Tle,I.intersectionBy=Ale,I.intersectionWith=Ile,I.invert=Xue,I.invertBy=Que,I.invokeMap=Rce,I.iteratee=rw,I.keyBy=Lce,I.keys=Bn,I.keysIn=Pr,I.map=om,I.mapKeys=Jue,I.mapValues=ede,I.matches=Yde,I.matchesProperty=Kde,I.memoize=am,I.merge=tde,I.mergeWith=O3,I.method=Xde,I.methodOf=Qde,I.mixin=iw,I.negate=lm,I.nthArg=Jde,I.omit=nde,I.omitBy=rde,I.once=Zce,I.orderBy=Fce,I.over=efe,I.overArgs=Jce,I.overEvery=tfe,I.overSome=nfe,I.partial=X1,I.partialRight=v3,I.partition=$ce,I.pick=ide,I.pickBy=P3,I.property=N3,I.propertyOf=rfe,I.pull=Fle,I.pullAll=s3,I.pullAllBy=$le,I.pullAllWith=jle,I.pullAt=zle,I.range=ife,I.rangeRight=ofe,I.rearg=eue,I.reject=Bce,I.remove=Ble,I.rest=tue,I.reverse=G1,I.sampleSize=Hce,I.set=sde,I.setWith=ade,I.shuffle=Wce,I.slice=Vle,I.sortBy=Gce,I.sortedUniq=Kle,I.sortedUniqBy=Xle,I.split=Dde,I.spread=nue,I.tail=Qle,I.take=Zle,I.takeRight=Jle,I.takeRightWhile=ece,I.takeWhile=tce,I.tap=mce,I.throttle=rue,I.thru=im,I.toArray=_3,I.toPairs=k3,I.toPairsIn=M3,I.toPath=ufe,I.toPlainObject=C3,I.transform=lde,I.unary=iue,I.union=nce,I.unionBy=rce,I.unionWith=ice,I.uniq=oce,I.uniqBy=sce,I.uniqWith=ace,I.unset=cde,I.unzip=Y1,I.unzipWith=a3,I.update=ude,I.updateWith=dde,I.values=Lc,I.valuesIn=fde,I.without=lce,I.words=A3,I.wrap=oue,I.xor=cce,I.xorBy=uce,I.xorWith=dce,I.zip=fce,I.zipObject=hce,I.zipObjectDeep=pce,I.zipWith=gce,I.entries=k3,I.entriesIn=M3,I.extend=E3,I.extendWith=dm,iw(I,I),I.add=ffe,I.attempt=I3,I.camelCase=mde,I.capitalize=D3,I.ceil=hfe,I.clamp=hde,I.clone=aue,I.cloneDeep=cue,I.cloneDeepWith=uue,I.cloneWith=lue,I.conformsTo=due,I.deburr=T3,I.defaultTo=Ude,I.divide=pfe,I.endsWith=vde,I.eq=Li,I.escape=bde,I.escapeRegExp=yde,I.every=Oce,I.find=kce,I.findIndex=n3,I.findKey=Bue,I.findLast=Mce,I.findLastIndex=r3,I.findLastKey=Vue,I.floor=gfe,I.forEach=c3,I.forEachRight=u3,I.forIn=Hue,I.forInRight=Wue,I.forOwn=Uue,I.forOwnRight=que,I.get=J1,I.gt=fue,I.gte=hue,I.has=Kue,I.hasIn=ew,I.head=o3,I.identity=kr,I.includes=Nce,I.indexOf=Mle,I.inRange=pde,I.invoke=Zue,I.isArguments=sl,I.isArray=st,I.isArrayBuffer=pue,I.isArrayLike=Or,I.isArrayLikeObject=yn,I.isBoolean=gue,I.isBuffer=js,I.isDate=mue,I.isElement=vue,I.isEmpty=bue,I.isEqual=yue,I.isEqualWith=xue,I.isError=Q1,I.isFinite=wue,I.isFunction=Bo,I.isInteger=b3,I.isLength=cm,I.isMap=y3,I.isMatch=_ue,I.isMatchWith=Sue,I.isNaN=Cue,I.isNative=Eue,I.isNil=Pue,I.isNull=Oue,I.isNumber=x3,I.isObject=dn,I.isObjectLike=gn,I.isPlainObject=rf,I.isRegExp=Z1,I.isSafeInteger=kue,I.isSet=w3,I.isString=um,I.isSymbol=Qr,I.isTypedArray=Rc,I.isUndefined=Mue,I.isWeakMap=Due,I.isWeakSet=Tue,I.join=Nle,I.kebabCase=xde,I.last=bi,I.lastIndexOf=Rle,I.lowerCase=wde,I.lowerFirst=_de,I.lt=Aue,I.lte=Iue,I.max=mfe,I.maxBy=vfe,I.mean=bfe,I.meanBy=yfe,I.min=xfe,I.minBy=wfe,I.stubArray=sw,I.stubFalse=aw,I.stubObject=sfe,I.stubString=afe,I.stubTrue=lfe,I.multiply=_fe,I.nth=Lle,I.noConflict=Zde,I.noop=ow,I.now=sm,I.pad=Sde,I.padEnd=Cde,I.padStart=Ede,I.parseInt=Ode,I.random=gde,I.reduce=jce,I.reduceRight=zce,I.repeat=Pde,I.replace=kde,I.result=ode,I.round=Sfe,I.runInContext=Q,I.sample=Vce,I.size=Uce,I.snakeCase=Mde,I.some=qce,I.sortedIndex=Hle,I.sortedIndexBy=Wle,I.sortedIndexOf=Ule,I.sortedLastIndex=qle,I.sortedLastIndexBy=Gle,I.sortedLastIndexOf=Yle,I.startCase=Tde,I.startsWith=Ade,I.subtract=Cfe,I.sum=Efe,I.sumBy=Ofe,I.template=Ide,I.times=cfe,I.toFinite=Vo,I.toInteger=ut,I.toLength=S3,I.toLower=Nde,I.toNumber=yi,I.toSafeInteger=Nue,I.toString=Lt,I.toUpper=Rde,I.trim=Lde,I.trimEnd=Fde,I.trimStart=$de,I.truncate=jde,I.unescape=zde,I.uniqueId=dfe,I.upperCase=Bde,I.upperFirst=tw,I.each=c3,I.eachRight=u3,I.first=o3,iw(I,function(){var d={};return lo(I,function(h,b){$t.call(I.prototype,b)||(d[b]=h)}),d}(),{chain:!1}),I.VERSION=r,hi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){I[d].placeholder=I}),hi(["drop","take"],function(d,h){Et.prototype[d]=function(b){b=b===n?1:Nn(ut(b),0);var E=this.__filtered__&&!h?new Et(this):this.clone();return E.__filtered__?E.__takeCount__=rr(b,E.__takeCount__):E.__views__.push({size:rr(b,H),type:d+(E.__dir__<0?"Right":"")}),E},Et.prototype[d+"Right"]=function(b){return this.reverse()[d](b).reverse()}}),hi(["filter","map","takeWhile"],function(d,h){var b=h+1,E=b==te||b==ee;Et.prototype[d]=function(A){var L=this.clone();return L.__iteratees__.push({iteratee:qe(A,3),type:b}),L.__filtered__=L.__filtered__||E,L}}),hi(["head","last"],function(d,h){var b="take"+(h?"Right":"");Et.prototype[d]=function(){return this[b](1).value()[0]}}),hi(["initial","tail"],function(d,h){var b="drop"+(h?"":"Right");Et.prototype[d]=function(){return this.__filtered__?new Et(this):this[b](1)}}),Et.prototype.compact=function(){return this.filter(kr)},Et.prototype.find=function(d){return this.filter(d).head()},Et.prototype.findLast=function(d){return this.reverse().find(d)},Et.prototype.invokeMap=bt(function(d,h){return typeof d=="function"?new Et(this):this.map(function(b){return Qd(b,d,h)})}),Et.prototype.reject=function(d){return this.filter(lm(qe(d)))},Et.prototype.slice=function(d,h){d=ut(d);var b=this;return b.__filtered__&&(d>0||h<0)?new Et(b):(d<0?b=b.takeRight(-d):d&&(b=b.drop(d)),h!==n&&(h=ut(h),b=h<0?b.dropRight(-h):b.take(h-d)),b)},Et.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},Et.prototype.toArray=function(){return this.take(H)},lo(Et.prototype,function(d,h){var b=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),A=I[E?"take"+(h=="last"?"Right":""):h],L=E||/^find/.test(h);A&&(I.prototype[h]=function(){var B=this.__wrapped__,q=E?[1]:arguments,ne=B instanceof Et,be=q[0],ye=ne||st(B),_e=function(Ct){var Ot=A.apply(I,As([Ct],q));return E&&De?Ot[0]:Ot};ye&&b&&typeof be=="function"&&be.length!=1&&(ne=ye=!1);var De=this.__chain__,$e=!!this.__actions__.length,Ge=L&&!De,mt=ne&&!$e;if(!L&&ye){B=mt?B:new Et(this);var Ye=d.apply(B,q);return Ye.__actions__.push({func:im,args:[_e],thisArg:n}),new gi(Ye,De)}return Ge&&mt?d.apply(this,q):(Ye=this.thru(_e),Ge?E?Ye.value()[0]:Ye.value():Ye)})}),hi(["pop","push","shift","sort","splice","unshift"],function(d){var h=Dg[d],b=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",E=/^(?:pop|shift)$/.test(d);I.prototype[d]=function(){var A=arguments;if(E&&!this.__chain__){var L=this.value();return h.apply(st(L)?L:[],A)}return this[b](function(B){return h.apply(st(B)?B:[],A)})}}),lo(Et.prototype,function(d,h){var b=I[h];if(b){var E=b.name+"";$t.call(Dc,E)||(Dc[E]=[]),Dc[E].push({name:h,func:b})}}),Dc[Qg(n,_).name]=[{name:"wrapper",func:n}],Et.prototype.clone=zse,Et.prototype.reverse=Bse,Et.prototype.value=Vse,I.prototype.at=vce,I.prototype.chain=bce,I.prototype.commit=yce,I.prototype.next=xce,I.prototype.plant=_ce,I.prototype.reverse=Sce,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Cce,I.prototype.first=I.prototype.head,Wd&&(I.prototype[Wd]=wce),I},Pc=yse();Za?((Za.exports=Pc)._=Pc,r1._=Pc):Gn._=Pc}).call(Uo)}(_f,_f.exports);var fl=_f.exports;const qs=Fc(fl),w_=["lg","md","sm","xs","xxs"],he=Fw()(Kw((e,t)=>({currentBreakpoint:"lg",dashboard:{id:"",style:Lm},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!0,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setCardPython:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&fl.forEach(o.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var i;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(i=r.dashboard.baseQueries)==null||i.push(n)})},removeBaseQuery:n=>{e(r=>{var o,s;const i=(o=r.dashboard.baseQueries)==null?void 0:o.findIndex(a=>a.id===n);i!=null&&i>-1&&((s=r.dashboard.baseQueries)==null||s.splice(i,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var i;(i=r.filteringCards)==null||i.push(n)})},removeFilteringCard:n=>{e(r=>{var o,s;const i=(o=r.filteringCards)==null?void 0:o.findIndex(a=>a.id===n.id);i!==void 0&&i>-1&&((s=r.filteringCards)==null||s.splice(i,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&fl.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(g=>g.id===r);u&&(u.title=i)})})},setCardInfo:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&fl.forEach(o.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&fl.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(g=>g.id===r);u&&(u.description=i)})})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,u;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.sql=i,(u=o.onUpdateCard)==null||u.call(o,f,n))}})},setFrameCardData:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&fl.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(g=>g.id===r);u&&(u.data=i)})})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setSheetLayouts:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.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 i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(i=>{var s,a,l;const o=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===i.filterId);o&&o>-1?(a=r.filterValues)==null||a.splice(o,1,i):(l=r.filterValues)==null||l.push(i)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.filter(o=>o.filterId!==n&&!o.filterId.startsWith(n));r.filterValues=i}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1&&r.filterValues.splice(i,1,n)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFrameCard:(n,r,i)=>{e(o=>{var l,c,u,f,g;const s=(c=(l=o.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===i.id);p>-1&&((g=a.cards)==null||g.splice(p,1,i))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{e(i=>{var s,a,l,c,u;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){o.frames||(o.frames=[]),(l=o.frames)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(c=o.layout)==null||c.push(f),o!=null&&o.layouts||(o.layouts={}),w_.forEach(g=>{o.layouts[g]||(o.layouts[g]=[]),o.layouts[g].push(f)}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(i=>{var s,a,l,c,u;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){const f=(l=o.frames)==null?void 0:l.findIndex(g=>g.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=o.frames)==null||c.splice(f,1),(u=o.layout)==null||u.splice(f,1),o.layouts=w_.reduce((g,p)=>{if(g&&g[p]){const v=g[p].findIndex(y=>y.i===r);typeof v=="number"&&v>-1&&g[p].splice(v,1)}return g},o.layouts))}})},updateFrame:(n,r)=>{e(i=>{var a,l,c,u;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=o==null?void 0:o.frames)==null?void 0:c.findIndex(f=>f.id===r.id);o&&((u=o.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(i=>{var a,l,c,u,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((u=o.cards)==null||u.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,u,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((u=o.cards)==null||u.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(u=>u.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(i=>i.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.frames)==null?void 0:o.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(o=a[l].cards)==null?void 0:o.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{N4({card:n,dataPoint:r,set:e,get:t})}}}))),Kc=()=>he(e=>e.actions);process.env.NODE_ENV==="development"&&Qw("DashboardStore",he);const R4={theme:"system",setTheme:()=>null},__=m.createContext(R4);function L4({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return x.jsx(__.Provider,{...r,value:s,children:e})}const Um=()=>{const e=m.useContext(__);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function F4(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function S_(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function C_(e,t){const n=S_(e);return n==="dark"?qs.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function E_({id:e,version:t,authToken:n,customStyle:r,currentTheme:i,onSave:o,onEvent:s}){const{data:a,refetch:l,isLoading:c,isError:u}=wi({queryKey:[e],queryFn:()=>F4(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:f,setTheme:g}=Um(),{setDashboard:p,setSelectedSheetId:v,setStyle:y,setOnSaveFunction:w}=he(T=>T.actions);he(T=>T.actions.setCustomCards);const _=he(T=>T.actions.setFilterValues),S=he(T=>T.actions.setBookmarkKey),C=he(T=>T.actions.setAuthToken),P=he(T=>T.actions.setThemeStyle),O=he(T=>T.actions.setDashboardTheme),k=he(T=>T.actions.setOnEvent);return m.useEffect(()=>{if(f){const T=S_(f);O(T)}},[f,O]),m.useEffect(()=>{i&&g(i)},[i,g]),m.useEffect(()=>{const T=qs.cloneDeep(Lm);if(r){const R=qs.merge(T,r),F=C_(f,R);P(F),y(R)}else{const R=C_(f,T);P(R),y(Lm)}},[f,r,y,P]),m.useEffect(()=>{var z;if(!a||!a.dashboard)return;const T=a.dashboard,R=bs(T.id),F=JSON.parse(localStorage.getItem(R)||"[]"),j=F.find(V=>V.default===!0);if(j)p(j.template),S(j.name),j.filterValues&&_(j.filterValues);else{p(T);const V=F.find(se=>(se==null?void 0:se.name)==="Original");V?V.template=T:F.push({name:"Original",template:T,default:!1}),localStorage.setItem(R,JSON.stringify(F))}v((z=T.sheets)==null?void 0:z[0].id)},[a,p,v,_,S]),m.useEffect(()=>{o&&w(o),s&&k(s)},[o,w,s,k]),m.useEffect(()=>{n&&n.accessToken&&(C(n),l())},[n,l,C]),{isLoading:c,isError:u}}function qm({className:e,...t}){return x.jsx("div",{className:Oe("animate-pulse rounded-md bg-muted",e),...t})}function O_({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,...g}){he(_=>_.selectedSheetId);const p=he(_=>_.themeStyle),v=he(_=>_.onEvent),{isLoading:y,isError:w}=E_({id:a,version:u,authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return y||!l?(v==null||v({type:"info",message:`isLoading: ${y}, accessToken: ${l==null?void 0:l.accessToken}`}),i?x.jsx(i,{message:"loading"}):x.jsx("div",{className:" flex items-center gap-3",children:x.jsx(qm,{className:"dark:h-[2px] h-1 w-full"})})):w?(v==null||v({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),x.jsx(o,{})):x.jsx("div",{children:"Error"})):x.jsx("div",{className:Oe(" grow h-full flex flex-col justify-between",p==null?void 0:p.dashboardPanel,e),role:"dashboard-panel",...g})}function ae(){return ae=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},ae.apply(this,arguments)}function Ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Rn(e,t=[]){let n=[];function r(o,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:g,children:p,...v}=f,y=(g==null?void 0:g[e][l])||a,w=m.useMemo(()=>v,Object.values(v));return m.createElement(y.Provider,{value:w},p)}function u(f,g){const p=(g==null?void 0:g[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}const i=()=>{const o=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,$4(i,...t)]}function $4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function j4(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Sf(...e){return t=>e.forEach(n=>j4(n,t))}function rt(...e){return m.useCallback(Sf(...e),e)}const ho=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),o=i.find(z4);if(o){const s=o.props.children,a=i.map(l=>l===o?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Gm,ae({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Gm,ae({},r,{ref:t}),n)});ho.displayName="Slot";const Gm=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...B4(r,n.props),ref:t?Sf(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Gm.displayName="SlotClone";const P_=({children:e})=>m.createElement(m.Fragment,null,e);function z4(e){return m.isValidElement(e)&&e.type===P_}function B4(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Cf(e){const t=e+"CollectionProvider",[n,r]=Rn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:y}=p,w=m.useRef(null),_=m.useRef(new Map).current;return m.createElement(i,{scope:v,itemMap:_,collectionRef:w},y)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:y,children:w}=p,_=o(a,y),S=rt(v,_.collectionRef);return m.createElement(ho,{ref:S},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:y,children:w,..._}=p,S=m.useRef(null),C=rt(v,S),P=o(c,y);return m.useEffect(()=>(P.itemMap.set(S,{ref:S,..._}),()=>void P.itemMap.delete(S))),m.createElement(ho,{[u]:"",ref:C},w)});function g(p){const v=o(e+"CollectionConsumer",p);return m.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const _=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((P,O)=>_.indexOf(P.ref.current)-_.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Kn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},V4=de.useId||(()=>{});let H4=0;function hr(e){const[t,n]=de.useState(V4());return Kn(()=>{e||n(r=>r??String(H4++))},[e]),e||(t?`radix-${t}`:"")}const ze=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=m.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?ho:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ae({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function k_(e,t){e&&Mt.flushSync(()=>e.dispatchEvent(t))}function Pn(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 Xn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=W4({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=Pn(n),l=m.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function W4({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),o=Pn(t);return m.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const U4=m.createContext(void 0);function Gs(e){const t=m.useContext(U4);return e||t||"ltr"}const Ym="rovingFocusGroup.onEntryFocus",q4={bubbles:!1,cancelable:!0},Km="RovingFocusGroup",[Xm,M_,G4]=Cf(Km),[Y4,hl]=Rn(Km,[G4]),[K4,X4]=Y4(Km),Q4=m.forwardRef((e,t)=>m.createElement(Xm.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Xm.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(Z4,ae({},e,{ref:t}))))),Z4=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),g=rt(t,f),p=Gs(o),[v=null,y]=Xn({prop:s,defaultProp:a,onChange:l}),[w,_]=m.useState(!1),S=Pn(c),C=M_(n),P=m.useRef(!1),[O,k]=m.useState(0);return m.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(Ym,S),()=>T.removeEventListener(Ym,S)},[S]),m.createElement(K4,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(T=>y(T),[y]),onItemShiftTab:m.useCallback(()=>_(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>k(T=>T-1),[])},m.createElement(ze.div,ae({tabIndex:w||O===0?-1:0,"data-orientation":r},u,{ref:g,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{P.current=!0}),onFocus:Ee(e.onFocus,T=>{const R=!P.current;if(T.target===T.currentTarget&&R&&!w){const F=new CustomEvent(Ym,q4);if(T.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=C().filter($=>$.focusable),z=j.find($=>$.active),V=j.find($=>$.id===v),te=[z,V,...j].filter(Boolean).map($=>$.ref.current);D_(te)}}P.current=!1}),onBlur:Ee(e.onBlur,()=>_(!1))})))}),J4="RovingFocusGroupItem",e7=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=hr(),l=o||a,c=X4(J4,n),u=c.currentTabStopId===l,f=M_(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(Xm.ItemSlot,{scope:n,id:l,focusable:r,active:i},m.createElement(ze.span,ae({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Ee(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Ee(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ee(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=r7(v,c.orientation,c.dir);if(y!==void 0){v.preventDefault();let _=f().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")_.reverse();else if(y==="prev"||y==="next"){y==="prev"&&_.reverse();const S=_.indexOf(v.currentTarget);_=c.loop?i7(_,S+1):_.slice(S+1)}setTimeout(()=>D_(_))}})})))}),t7={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function n7(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function r7(e,t,n){const r=n7(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return t7[r]}function D_(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function i7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Qm=Q4,Zm=e7;function o7(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const wn=e=>{const{present:t,children:n}=e,r=s7(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=rt(r.ref,i.ref);return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:o}):null};wn.displayName="Presence";function s7(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),o=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=o7(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Ef(r.current);o.current=a==="mounted"?c:"none"},[a]),Kn(()=>{const c=r.current,u=i.current;if(u!==e){const g=o.current,p=Ef(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&g!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Kn(()=>{if(t){const c=f=>{const p=Ef(r.current).includes(f.animationName);f.target===t&&p&&Mt.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(o.current=Ef(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ef(e){return(e==null?void 0:e.animationName)||"none"}const T_="Tabs",[a7,Afe]=Rn(T_,[hl]),A_=hl(),[l7,Jm]=a7(T_),c7=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Gs(a),[f,g]=Xn({prop:r,onChange:i,defaultProp:o});return m.createElement(l7,{scope:n,baseId:hr(),value:f,onValueChange:g,orientation:s,dir:u,activationMode:l},m.createElement(ze.div,ae({dir:u,"data-orientation":s},c,{ref:t})))}),u7="TabsList",d7=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Jm(u7,n),s=A_(n);return m.createElement(Qm,ae({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),m.createElement(ze.div,ae({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),f7="TabsTrigger",h7=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Jm(f7,n),a=A_(n),l=I_(s.baseId,r),c=N_(s.baseId,r),u=r===s.value;return m.createElement(Zm,ae({asChild:!0},a,{focusable:!i,active:u}),m.createElement(ze.button,ae({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:Ee(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Ee(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!i&&f&&s.onValueChange(r)})})))}),p7="TabsContent",g7=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Jm(p7,n),l=I_(a.baseId,r),c=N_(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),m.createElement(wn,{present:i||u},({present:g})=>m.createElement(ze.div,ae({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),g&&o))});function I_(e,t){return`${e}-trigger-${t}`}function N_(e,t){return`${e}-content-${t}`}const m7=c7,R_=d7,L_=h7,F_=g7,$_=m7,j_=de.forwardRef(({className:e,...t},n)=>x.jsx(R_,{ref:n,className:Oe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));j_.displayName=R_.displayName;const ev=de.forwardRef(({className:e,...t},n)=>x.jsx(L_,{ref:n,className:Oe("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}));ev.displayName=L_.displayName;const Of=de.forwardRef(({className:e,...t},n)=>x.jsx(F_,{ref:n,className:Oe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Of.displayName=F_.displayName;var z_={exports:{}},Xc={},tv={exports:{}};(function(e,t){(function(n,r){r(t)})(Uo,function(n){function r(re){return function(oe,xe,U,Te,je,He,Xe){return re(oe,xe,Xe)}}function i(re){return function(oe,xe,U,Te){if(!oe||!xe||typeof oe!="object"||typeof xe!="object")return re(oe,xe,U,Te);var je=Te.get(oe),He=Te.get(xe);if(je&&He)return je===xe&&He===oe;Te.set(oe,xe),Te.set(xe,oe);var Xe=re(oe,xe,U,Te);return Te.delete(oe),Te.delete(xe),Xe}}function o(re,Z){var oe={};for(var xe in re)oe[xe]=re[xe];for(var xe in Z)oe[xe]=Z[xe];return oe}function s(re){return re.constructor===Object||re.constructor==null}function a(re){return typeof re.then=="function"}function l(re,Z){return re===Z||re!==re&&Z!==Z}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",g="[object RegExp]",p="[object Map]",v="[object Number]",y="[object Object]",w="[object Set]",_="[object String]",S=Object.prototype.toString;function C(re){var Z=re.areArraysEqual,oe=re.areDatesEqual,xe=re.areMapsEqual,U=re.areObjectsEqual,Te=re.areRegExpsEqual,je=re.areSetsEqual,He=re.createIsNestedEqual,Xe=He(vt);function vt(pt,gt,Kt){if(pt===gt)return!0;if(!pt||!gt||typeof pt!="object"||typeof gt!="object")return pt!==pt&&gt!==gt;if(s(pt)&&s(gt))return U(pt,gt,Xe,Kt);var Bt=Array.isArray(pt),vn=Array.isArray(gt);if(Bt||vn)return Bt===vn&&Z(pt,gt,Xe,Kt);var cn=S.call(pt);return cn!==S.call(gt)?!1:cn===f?oe(pt,gt,Xe,Kt):cn===g?Te(pt,gt,Xe,Kt):cn===p?xe(pt,gt,Xe,Kt):cn===w?je(pt,gt,Xe,Kt):cn===y||cn===c?a(pt)||a(gt)?!1:U(pt,gt,Xe,Kt):cn===u||cn===v||cn===_?l(pt.valueOf(),gt.valueOf()):!1}return vt}function P(re,Z,oe,xe){var U=re.length;if(Z.length!==U)return!1;for(;U-- >0;)if(!oe(re[U],Z[U],U,U,re,Z,xe))return!1;return!0}var O=i(P);function k(re,Z){return l(re.valueOf(),Z.valueOf())}function T(re,Z,oe,xe){var U=re.size===Z.size;if(!U)return!1;if(!re.size)return!0;var Te={},je=0;return re.forEach(function(He,Xe){if(U){var vt=!1,pt=0;Z.forEach(function(gt,Kt){!vt&&!Te[pt]&&(vt=oe(Xe,Kt,je,pt,re,Z,xe)&&oe(He,gt,Xe,Kt,re,Z,xe))&&(Te[pt]=!0),pt++}),je++,U=vt}}),U}var R=i(T),F="_owner",j=Object.prototype.hasOwnProperty;function z(re,Z,oe,xe){var U=Object.keys(re),Te=U.length;if(Object.keys(Z).length!==Te)return!1;for(var je;Te-- >0;){if(je=U[Te],je===F){var He=!!re.$$typeof,Xe=!!Z.$$typeof;if((He||Xe)&&He!==Xe)return!1}if(!j.call(Z,je)||!oe(re[je],Z[je],je,je,re,Z,xe))return!1}return!0}var V=i(z);function se(re,Z){return re.source===Z.source&&re.flags===Z.flags}function te(re,Z,oe,xe){var U=re.size===Z.size;if(!U)return!1;if(!re.size)return!0;var Te={};return re.forEach(function(je,He){if(U){var Xe=!1,vt=0;Z.forEach(function(pt,gt){!Xe&&!Te[vt]&&(Xe=oe(je,pt,He,gt,re,Z,xe))&&(Te[vt]=!0),vt++}),U=Xe}}),U}var $=i(te),ee=Object.freeze({areArraysEqual:P,areDatesEqual:k,areMapsEqual:T,areObjectsEqual:z,areRegExpsEqual:se,areSetsEqual:te,createIsNestedEqual:r}),Y=Object.freeze({areArraysEqual:O,areDatesEqual:k,areMapsEqual:R,areObjectsEqual:V,areRegExpsEqual:se,areSetsEqual:$,createIsNestedEqual:r}),X=C(ee);function G(re,Z){return X(re,Z,void 0)}var D=C(o(ee,{createIsNestedEqual:function(){return l}}));function H(re,Z){return D(re,Z,void 0)}var ie=C(Y);function N(re,Z){return ie(re,Z,new WeakMap)}var ce=C(o(Y,{createIsNestedEqual:function(){return l}}));function me(re,Z){return ce(re,Z,new WeakMap)}function pe(re){return C(o(ee,re(ee)))}function fe(re){var Z=C(o(Y,re(Y)));return function(oe,xe,U){return U===void 0&&(U=new WeakMap),Z(oe,xe,U)}}n.circularDeepEqual=N,n.circularShallowEqual=me,n.createCustomCircularEqual=fe,n.createCustomEqual=pe,n.deepEqual=G,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(tv,tv.exports);var nv=tv.exports;const rv=pm(z3);var yt={},v7=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(yt,"__esModule",{value:!0}),yt.bottom=iv,yt.childrenEqual=w7,yt.cloneLayout=V_,yt.cloneLayoutItem=Ys,yt.collides=Pf,yt.compact=W_,yt.compactItem=U_,yt.compactType=T7,yt.correctBounds=q_,yt.fastPositionEqual=S7,yt.fastRGLPropsEqual=void 0,yt.getAllCollisions=G_,yt.getFirstCollision=Ks,yt.getLayoutItem=sv,yt.getStatics=av,yt.modifyLayout=H_,yt.moveElement=Zc,yt.moveElementAwayFromCollision=lv,yt.noop=void 0,yt.perc=E7,yt.resizeItemInDirection=P7,yt.setTopLeft=M7,yt.setTransform=k7,yt.sortLayoutItems=pv,yt.sortLayoutItemsByColRow=Z_,yt.sortLayoutItemsByRowCol=Q_,yt.synchronizeLayoutWithChildren=D7,yt.validateLayout=J_,yt.withLayoutItem=x7;var B_=nv,Qc=b7(m);function b7(e){return e&&e.__esModule?e:{default:e}}const y7=process.env.NODE_ENV==="production";function iv(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function V_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Ys(e[n]);return t}function H_(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function x7(e,t,n){let r=sv(e,t);return r?(r=n(Ys(r)),e=H_(e,r),[e,r]):[e,null]}function Ys(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 w7(e,t){return(0,B_.deepEqual)(Qc.default.Children.map(e,n=>n==null?void 0:n.key),Qc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,B_.deepEqual)(Qc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Qc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const _7=v7;yt.fastRGLPropsEqual=_7;function S7(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Pf(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 W_(e,t,n,r){const i=av(e),o=pv(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=Ys(o[a]);c.static||(c=U_(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const C7={x:"w",y:"h"};function ov(e,t,n,r){const i=C7[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Pf(t,a)&&ov(e,a,n+t[i],r)}}t[r]=n}function U_(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(iv(e),t.y);t.y>0&&!Ks(e,t);)t.y--;else if(a)for(;t.x>0&&!Ks(e,t);)t.x--;let l;for(;(l=Ks(e,t))&&!(n===null&&o);)if(a?ov(i,t,l.x+l.w,"x"):ov(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ks(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function q_(e,t){const n=av(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Ks(n,o);)o.y++}return e}function sv(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ks(e,t){for(let n=0,r=e.length;n<r;n++)if(Pf(e[n],t))return e[n]}function G_(e,t){return e.filter(n=>Pf(n,t))}function av(e){return e.filter(t=>t.static)}function Zc(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=pv(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=G_(f,t),v=p.length>0;if(v&&l)return V_(e);if(v&&o)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let y=0,w=p.length;y<w;y++){const _=p[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(_.i," at [").concat(_.x,",").concat(_.y,"]"),!_.moved&&(_.static?e=lv(e,_,t,i,s):e=lv(e,t,_,i,s))}return e}function lv(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},g=Ks(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return Zc(e,n,void 0,t.y+1,r,l,i);if(p&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return Zc(e,t,n.x,void 0,r,l,i)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),Zc(e,n,s?f.x:void 0,a?f.y:void 0,r,l,i)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:Zc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function E7(e){return e*100+"%"}const Y_=(e,t,n,r)=>e+n>r?t:n,K_=(e,t,n)=>e<0?t:n,X_=e=>Math.max(0,e),cv=e=>Math.max(0,e),uv=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:K_(s,e.height,i),top:cv(s)}},dv=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:Y_(e.left,e.width,s,n),left:X_(i)}},fv=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:Y_(e.left,e.width,o,n),top:cv(r),left:X_(s)}},hv=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:K_(r,e.height,o),top:cv(r)}},O7={n:uv,ne:function(){return uv(arguments.length<=0?void 0:arguments[0],dv(...arguments))},e:dv,se:function(){return hv(arguments.length<=0?void 0:arguments[0],dv(...arguments))},s:hv,sw:function(){return hv(arguments.length<=0?void 0:arguments[0],fv(...arguments))},w:fv,nw:function(){return uv(arguments.length<=0?void 0:arguments[0],fv(...arguments))}};function P7(e,t,n,r){const i=O7[e];return i?i(t,{...t,...n},r):n}function k7(e){let{top:t,left:n,width:r,height:i}=e;const o="translate(".concat(n,"px,").concat(t,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function M7(e){let{top:t,left:n,width:r,height:i}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function pv(e,t){return t==="horizontal"?Z_(e):t==="vertical"?Q_(e):e}function Q_(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 Z_(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 D7(e,t,n,r,i){e=e||[];const o=[];Qc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=sv(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(Ys(l)):c?(y7||J_([c],"ReactGridLayout.children"),o.push(Ys({...c,i:a.key}))):o.push(Ys({w:1,h:1,x:0,y:iv(o),i:String(a.key)}))});const s=q_(o,{cols:n});return i?s:W_(s,r,n)}function J_(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,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++)if(typeof o[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function T7(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Ffe(){}const A7=()=>{};yt.noop=A7;var $i={};Object.defineProperty($i,"__esModule",{value:!0}),$i.calcGridColWidth=kf,$i.calcGridItemPosition=I7,$i.calcGridItemWHPx=gv,$i.calcWH=R7,$i.calcXY=N7,$i.clamp=Xs;function kf(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function gv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function I7(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=kf(e),u={};return o&&o.resizing?(u.width=Math.round(o.resizing.width),u.height=Math.round(o.resizing.height)):(u.width=gv(r,c,s[0]),u.height=gv(i,l,s[1])),o&&o.dragging?(u.top=Math.round(o.dragging.top),u.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(u.top=Math.round(o.resizing.top),u.left=Math.round(o.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function N7(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=kf(e);let u=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return u=Xs(u,0,s-r),f=Xs(f,0,l-i),{x:u,y:f}}function R7(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=kf(e);let f=Math.round((t+s[0])/(u+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=Xs(f,0,l-r),v=Xs(g,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(p=Xs(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(v=Xs(g,0,a)),{w:p,h:v}}function Xs(e,t,n){return Math.max(Math.min(e,n),t)}var Mf={},mv={exports:{}},vv,eS;function bv(){if(eS)return vv;eS=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return vv=e,vv}var yv,tS;function L7(){if(tS)return yv;tS=1;var e=bv();function t(){}function n(){}return n.resetWarningCache=t,yv=function(){function r(s,a,l,c,u,f){if(f!==e){var g=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 g.name="Invariant Violation",g}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},yv}var Df={exports:{}},It={};/** @license React v16.13.1
85
+ }`;var mt=I3(function(){return At(L,$e+"return "+_e).apply(n,B)});if(mt.source=_e,Q1(mt))throw mt;return mt}function Nde(d){return Lt(d).toLowerCase()}function Rde(d){return Lt(d).toUpperCase()}function Lde(d,h,b){if(d=Lt(d),d&&(b||h===n))return VA(d);if(!d||!(h=Xr(h)))return d;var E=Ni(d),A=Ni(h),L=HA(E,A),B=WA(E,A)+1;return $s(E,L,B).join("")}function Fde(d,h,b){if(d=Lt(d),d&&(b||h===n))return d.slice(0,qA(d)+1);if(!d||!(h=Xr(h)))return d;var E=Ni(d),A=WA(E,Ni(h))+1;return $s(E,0,A).join("")}function $de(d,h,b){if(d=Lt(d),d&&(b||h===n))return d.replace(Xa,"");if(!d||!(h=Xr(h)))return d;var E=Ni(d),A=HA(E,Ni(h));return $s(E,A).join("")}function jde(d,h){var b=j,E=z;if(dn(h)){var A="separator"in h?h.separator:A;b="length"in h?ut(h.length):b,E="omission"in h?Xr(h.omission):E}d=Lt(d);var L=d.length;if(Ec(d)){var B=Ni(d);L=B.length}if(b>=L)return d;var q=b-Oc(E);if(q<1)return E;var ne=B?$s(B,0,q).join(""):d.slice(0,q);if(A===n)return ne+E;if(B&&(q+=ne.length-q),Z1(A)){if(d.slice(q).search(A)){var be,ye=ne;for(A.global||(A=p1(A.source,Lt(Be.exec(A))+"g")),A.lastIndex=0;be=A.exec(ye);)var _e=be.index;ne=ne.slice(0,_e===n?q:_e)}}else if(d.indexOf(Xr(A),q)!=q){var De=ne.lastIndexOf(A);De>-1&&(ne=ne.slice(0,De))}return ne+E}function zde(d){return d=Lt(d),d&&No.test(d)?d.replace(jn,gse):d}var Bde=Ic(function(d,h,b){return d+(b?" ":"")+h.toUpperCase()}),tw=NI("toUpperCase");function A3(d,h,b){return d=Lt(d),h=b?n:h,h===n?use(d)?bse(d):tse(d):d.match(h)||[]}var I3=bt(function(d,h){try{return Yr(d,n,h)}catch(b){return Q1(b)?b:new nt(b)}}),Vde=jo(function(d,h){return hi(h,function(b){b=uo(b),Fo(d,b,K1(d[b],d))}),d});function Hde(d){var h=d==null?0:d.length,b=qe();return d=h?an(d,function(E){if(typeof E[1]!="function")throw new pi(s);return[b(E[0]),E[1]]}):[],bt(function(E){for(var A=-1;++A<h;){var L=d[A];if(Yr(L[0],this,E))return Yr(L[1],this,E)}})}function Wde(d){return gae(mi(d,f))}function nw(d){return function(){return d}}function Ude(d,h){return d==null||d!==d?h:d}var qde=LI(),Gde=LI(!0);function kr(d){return d}function rw(d){return fI(typeof d=="function"?d:mi(d,f))}function Yde(d){return pI(mi(d,f))}function Kde(d,h){return gI(d,mi(h,f))}var Xde=bt(function(d,h){return function(b){return Qd(b,d,h)}}),Qde=bt(function(d,h){return function(b){return Qd(d,b,h)}});function iw(d,h,b){var E=Bn(h),A=qg(h,E);b==null&&!(dn(h)&&(A.length||!E.length))&&(b=h,h=d,d=this,A=qg(h,Bn(h)));var L=!(dn(b)&&"chain"in b)||!!b.chain,B=Bo(d);return hi(A,function(q){var ne=h[q];d[q]=ne,B&&(d.prototype[q]=function(){var be=this.__chain__;if(L||be){var ye=d(this.__wrapped__),_e=ye.__actions__=Er(this.__actions__);return _e.push({func:ne,args:arguments,thisArg:d}),ye.__chain__=be,ye}return ne.apply(d,As([this.value()],arguments))})}),d}function Zde(){return Gn._===this&&(Gn._=Cse),this}function ow(){}function Jde(d){return d=ut(d),bt(function(h){return mI(h,d)})}var efe=L1(an),tfe=L1(FA),nfe=L1(a1);function N3(d){return H1(d)?l1(uo(d)):Aae(d)}function rfe(d){return function(h){return d==null?n:rl(d,h)}}var ife=$I(),ofe=$I(!0);function sw(){return[]}function aw(){return!1}function sfe(){return{}}function afe(){return""}function lfe(){return!0}function cfe(d,h){if(d=ut(d),d<1||d>X)return[];var b=H,E=rr(d,H);h=qe(h),d-=H;for(var A=d1(E,h);++b<d;)h(b);return A}function ufe(d){return st(d)?an(d,uo):Qr(d)?[d]:Er(e3(Lt(d)))}function dfe(d){var h=++_se;return Lt(d)+h}var ffe=Zg(function(d,h){return d+h},0),hfe=F1("ceil"),pfe=Zg(function(d,h){return d/h},1),gfe=F1("floor");function mfe(d){return d&&d.length?Ug(d,kr,_1):n}function vfe(d,h){return d&&d.length?Ug(d,qe(h,2),_1):n}function bfe(d){return zA(d,kr)}function yfe(d,h){return zA(d,qe(h,2))}function xfe(d){return d&&d.length?Ug(d,kr,O1):n}function wfe(d,h){return d&&d.length?Ug(d,qe(h,2),O1):n}var _fe=Zg(function(d,h){return d*h},1),Sfe=F1("round"),Cfe=Zg(function(d,h){return d-h},0);function Efe(d){return d&&d.length?u1(d,kr):0}function Ofe(d,h){return d&&d.length?u1(d,qe(h,2)):0}return I.after=Yce,I.ary=d3,I.assign=Rue,I.assignIn=E3,I.assignInWith=dm,I.assignWith=Lue,I.at=Fue,I.before=f3,I.bind=K1,I.bindAll=Vde,I.bindKey=h3,I.castArray=sue,I.chain=l3,I.chunk=gle,I.compact=mle,I.concat=vle,I.cond=Hde,I.conforms=Wde,I.constant=nw,I.countBy=Ece,I.create=$ue,I.curry=p3,I.curryRight=g3,I.debounce=m3,I.defaults=jue,I.defaultsDeep=zue,I.defer=Kce,I.delay=Xce,I.difference=ble,I.differenceBy=yle,I.differenceWith=xle,I.drop=wle,I.dropRight=_le,I.dropRightWhile=Sle,I.dropWhile=Cle,I.fill=Ele,I.filter=Pce,I.flatMap=Dce,I.flatMapDeep=Tce,I.flatMapDepth=Ace,I.flatten=i3,I.flattenDeep=Ole,I.flattenDepth=Ple,I.flip=Qce,I.flow=qde,I.flowRight=Gde,I.fromPairs=kle,I.functions=Gue,I.functionsIn=Yue,I.groupBy=Ice,I.initial=Dle,I.intersection=Tle,I.intersectionBy=Ale,I.intersectionWith=Ile,I.invert=Xue,I.invertBy=Que,I.invokeMap=Rce,I.iteratee=rw,I.keyBy=Lce,I.keys=Bn,I.keysIn=Pr,I.map=om,I.mapKeys=Jue,I.mapValues=ede,I.matches=Yde,I.matchesProperty=Kde,I.memoize=am,I.merge=tde,I.mergeWith=O3,I.method=Xde,I.methodOf=Qde,I.mixin=iw,I.negate=lm,I.nthArg=Jde,I.omit=nde,I.omitBy=rde,I.once=Zce,I.orderBy=Fce,I.over=efe,I.overArgs=Jce,I.overEvery=tfe,I.overSome=nfe,I.partial=X1,I.partialRight=v3,I.partition=$ce,I.pick=ide,I.pickBy=P3,I.property=N3,I.propertyOf=rfe,I.pull=Fle,I.pullAll=s3,I.pullAllBy=$le,I.pullAllWith=jle,I.pullAt=zle,I.range=ife,I.rangeRight=ofe,I.rearg=eue,I.reject=Bce,I.remove=Ble,I.rest=tue,I.reverse=G1,I.sampleSize=Hce,I.set=sde,I.setWith=ade,I.shuffle=Wce,I.slice=Vle,I.sortBy=Gce,I.sortedUniq=Kle,I.sortedUniqBy=Xle,I.split=Dde,I.spread=nue,I.tail=Qle,I.take=Zle,I.takeRight=Jle,I.takeRightWhile=ece,I.takeWhile=tce,I.tap=mce,I.throttle=rue,I.thru=im,I.toArray=_3,I.toPairs=k3,I.toPairsIn=M3,I.toPath=ufe,I.toPlainObject=C3,I.transform=lde,I.unary=iue,I.union=nce,I.unionBy=rce,I.unionWith=ice,I.uniq=oce,I.uniqBy=sce,I.uniqWith=ace,I.unset=cde,I.unzip=Y1,I.unzipWith=a3,I.update=ude,I.updateWith=dde,I.values=Lc,I.valuesIn=fde,I.without=lce,I.words=A3,I.wrap=oue,I.xor=cce,I.xorBy=uce,I.xorWith=dce,I.zip=fce,I.zipObject=hce,I.zipObjectDeep=pce,I.zipWith=gce,I.entries=k3,I.entriesIn=M3,I.extend=E3,I.extendWith=dm,iw(I,I),I.add=ffe,I.attempt=I3,I.camelCase=mde,I.capitalize=D3,I.ceil=hfe,I.clamp=hde,I.clone=aue,I.cloneDeep=cue,I.cloneDeepWith=uue,I.cloneWith=lue,I.conformsTo=due,I.deburr=T3,I.defaultTo=Ude,I.divide=pfe,I.endsWith=vde,I.eq=Li,I.escape=bde,I.escapeRegExp=yde,I.every=Oce,I.find=kce,I.findIndex=n3,I.findKey=Bue,I.findLast=Mce,I.findLastIndex=r3,I.findLastKey=Vue,I.floor=gfe,I.forEach=c3,I.forEachRight=u3,I.forIn=Hue,I.forInRight=Wue,I.forOwn=Uue,I.forOwnRight=que,I.get=J1,I.gt=fue,I.gte=hue,I.has=Kue,I.hasIn=ew,I.head=o3,I.identity=kr,I.includes=Nce,I.indexOf=Mle,I.inRange=pde,I.invoke=Zue,I.isArguments=sl,I.isArray=st,I.isArrayBuffer=pue,I.isArrayLike=Or,I.isArrayLikeObject=yn,I.isBoolean=gue,I.isBuffer=js,I.isDate=mue,I.isElement=vue,I.isEmpty=bue,I.isEqual=yue,I.isEqualWith=xue,I.isError=Q1,I.isFinite=wue,I.isFunction=Bo,I.isInteger=b3,I.isLength=cm,I.isMap=y3,I.isMatch=_ue,I.isMatchWith=Sue,I.isNaN=Cue,I.isNative=Eue,I.isNil=Pue,I.isNull=Oue,I.isNumber=x3,I.isObject=dn,I.isObjectLike=gn,I.isPlainObject=rf,I.isRegExp=Z1,I.isSafeInteger=kue,I.isSet=w3,I.isString=um,I.isSymbol=Qr,I.isTypedArray=Rc,I.isUndefined=Mue,I.isWeakMap=Due,I.isWeakSet=Tue,I.join=Nle,I.kebabCase=xde,I.last=bi,I.lastIndexOf=Rle,I.lowerCase=wde,I.lowerFirst=_de,I.lt=Aue,I.lte=Iue,I.max=mfe,I.maxBy=vfe,I.mean=bfe,I.meanBy=yfe,I.min=xfe,I.minBy=wfe,I.stubArray=sw,I.stubFalse=aw,I.stubObject=sfe,I.stubString=afe,I.stubTrue=lfe,I.multiply=_fe,I.nth=Lle,I.noConflict=Zde,I.noop=ow,I.now=sm,I.pad=Sde,I.padEnd=Cde,I.padStart=Ede,I.parseInt=Ode,I.random=gde,I.reduce=jce,I.reduceRight=zce,I.repeat=Pde,I.replace=kde,I.result=ode,I.round=Sfe,I.runInContext=Q,I.sample=Vce,I.size=Uce,I.snakeCase=Mde,I.some=qce,I.sortedIndex=Hle,I.sortedIndexBy=Wle,I.sortedIndexOf=Ule,I.sortedLastIndex=qle,I.sortedLastIndexBy=Gle,I.sortedLastIndexOf=Yle,I.startCase=Tde,I.startsWith=Ade,I.subtract=Cfe,I.sum=Efe,I.sumBy=Ofe,I.template=Ide,I.times=cfe,I.toFinite=Vo,I.toInteger=ut,I.toLength=S3,I.toLower=Nde,I.toNumber=yi,I.toSafeInteger=Nue,I.toString=Lt,I.toUpper=Rde,I.trim=Lde,I.trimEnd=Fde,I.trimStart=$de,I.truncate=jde,I.unescape=zde,I.uniqueId=dfe,I.upperCase=Bde,I.upperFirst=tw,I.each=c3,I.eachRight=u3,I.first=o3,iw(I,function(){var d={};return lo(I,function(h,b){$t.call(I.prototype,b)||(d[b]=h)}),d}(),{chain:!1}),I.VERSION=r,hi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){I[d].placeholder=I}),hi(["drop","take"],function(d,h){Et.prototype[d]=function(b){b=b===n?1:Nn(ut(b),0);var E=this.__filtered__&&!h?new Et(this):this.clone();return E.__filtered__?E.__takeCount__=rr(b,E.__takeCount__):E.__views__.push({size:rr(b,H),type:d+(E.__dir__<0?"Right":"")}),E},Et.prototype[d+"Right"]=function(b){return this.reverse()[d](b).reverse()}}),hi(["filter","map","takeWhile"],function(d,h){var b=h+1,E=b==te||b==ee;Et.prototype[d]=function(A){var L=this.clone();return L.__iteratees__.push({iteratee:qe(A,3),type:b}),L.__filtered__=L.__filtered__||E,L}}),hi(["head","last"],function(d,h){var b="take"+(h?"Right":"");Et.prototype[d]=function(){return this[b](1).value()[0]}}),hi(["initial","tail"],function(d,h){var b="drop"+(h?"":"Right");Et.prototype[d]=function(){return this.__filtered__?new Et(this):this[b](1)}}),Et.prototype.compact=function(){return this.filter(kr)},Et.prototype.find=function(d){return this.filter(d).head()},Et.prototype.findLast=function(d){return this.reverse().find(d)},Et.prototype.invokeMap=bt(function(d,h){return typeof d=="function"?new Et(this):this.map(function(b){return Qd(b,d,h)})}),Et.prototype.reject=function(d){return this.filter(lm(qe(d)))},Et.prototype.slice=function(d,h){d=ut(d);var b=this;return b.__filtered__&&(d>0||h<0)?new Et(b):(d<0?b=b.takeRight(-d):d&&(b=b.drop(d)),h!==n&&(h=ut(h),b=h<0?b.dropRight(-h):b.take(h-d)),b)},Et.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},Et.prototype.toArray=function(){return this.take(H)},lo(Et.prototype,function(d,h){var b=/^(?:filter|find|map|reject)|While$/.test(h),E=/^(?:head|last)$/.test(h),A=I[E?"take"+(h=="last"?"Right":""):h],L=E||/^find/.test(h);A&&(I.prototype[h]=function(){var B=this.__wrapped__,q=E?[1]:arguments,ne=B instanceof Et,be=q[0],ye=ne||st(B),_e=function(Ct){var Ot=A.apply(I,As([Ct],q));return E&&De?Ot[0]:Ot};ye&&b&&typeof be=="function"&&be.length!=1&&(ne=ye=!1);var De=this.__chain__,$e=!!this.__actions__.length,Ge=L&&!De,mt=ne&&!$e;if(!L&&ye){B=mt?B:new Et(this);var Ye=d.apply(B,q);return Ye.__actions__.push({func:im,args:[_e],thisArg:n}),new gi(Ye,De)}return Ge&&mt?d.apply(this,q):(Ye=this.thru(_e),Ge?E?Ye.value()[0]:Ye.value():Ye)})}),hi(["pop","push","shift","sort","splice","unshift"],function(d){var h=Dg[d],b=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",E=/^(?:pop|shift)$/.test(d);I.prototype[d]=function(){var A=arguments;if(E&&!this.__chain__){var L=this.value();return h.apply(st(L)?L:[],A)}return this[b](function(B){return h.apply(st(B)?B:[],A)})}}),lo(Et.prototype,function(d,h){var b=I[h];if(b){var E=b.name+"";$t.call(Dc,E)||(Dc[E]=[]),Dc[E].push({name:h,func:b})}}),Dc[Qg(n,_).name]=[{name:"wrapper",func:n}],Et.prototype.clone=zse,Et.prototype.reverse=Bse,Et.prototype.value=Vse,I.prototype.at=vce,I.prototype.chain=bce,I.prototype.commit=yce,I.prototype.next=xce,I.prototype.plant=_ce,I.prototype.reverse=Sce,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=Cce,I.prototype.first=I.prototype.head,Wd&&(I.prototype[Wd]=wce),I},Pc=yse();Za?((Za.exports=Pc)._=Pc,r1._=Pc):Gn._=Pc}).call(Uo)}(_f,_f.exports);var fl=_f.exports;const qs=Fc(fl),w_=["lg","md","sm","xs","xxs"],he=Fw()(Kw((e,t)=>({currentBreakpoint:"lg",dashboard:{id:"",style:Lm},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setCardPython:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&fl.forEach(o.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var i;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(i=r.dashboard.baseQueries)==null||i.push(n)})},removeBaseQuery:n=>{e(r=>{var o,s;const i=(o=r.dashboard.baseQueries)==null?void 0:o.findIndex(a=>a.id===n);i!=null&&i>-1&&((s=r.dashboard.baseQueries)==null||s.splice(i,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var i;(i=r.filteringCards)==null||i.push(n)})},removeFilteringCard:n=>{e(r=>{var o,s;const i=(o=r.filteringCards)==null?void 0:o.findIndex(a=>a.id===n.id);i!==void 0&&i>-1&&((s=r.filteringCards)==null||s.splice(i,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&fl.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(g=>g.id===r);u&&(u.title=i)})})},setCardInfo:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===i.selectedSheetId);o&&fl.forEach(o.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&fl.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(g=>g.id===r);u&&(u.description=i)})})},setCardSql:(n,r,i)=>{e(o=>{var a,l,c,u;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.sql=i,(u=o.onUpdateCard)==null||u.call(o,f,n))}})},setFrameCardData:(n,r,i)=>{e(o=>{var a,l;const s=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&fl.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(g=>g.id===r);u&&(u.data=i)})})},setSheetLayout:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.layout=r)})},setSheetLayouts:(n,r)=>{e(i=>{var s,a;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);o&&(o.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 i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1?r.filterValues.splice(i,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(i=>{var s,a,l;const o=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===i.filterId);o&&o>-1?(a=r.filterValues)==null||a.splice(o,1,i):(l=r.filterValues)==null||l.push(i)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.filter(o=>o.filterId!==n&&!o.filterId.startsWith(n));r.filterValues=i}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const i=r.filterValues.findIndex(o=>o.filterId===n.filterId);i>-1&&r.filterValues.splice(i,1,n)}})},addFilter:n=>{e(r=>{var i;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n]})},removeFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n);console.log("index",s),s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1))}})},updateFrameCard:(n,r,i)=>{e(o=>{var l,c,u,f,g;const s=(c=(l=o.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===i.id);p>-1&&((g=a.cards)==null||g.splice(p,1,i))}})},updateFilter:n=>{e(r=>{var i,o;if(r.dashboard.filters){const s=(i=r.dashboard.filters)==null?void 0:i.findIndex(a=>a.id===n.id);s>-1&&((o=r.dashboard.filters)==null||o.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{e(i=>{var s,a,l,c,u;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){o.frames||(o.frames=[]),(l=o.frames)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(c=o.layout)==null||c.push(f),o!=null&&o.layouts||(o.layouts={}),w_.forEach(g=>{o.layouts[g]||(o.layouts[g]=[]),o.layouts[g].push(f)}),(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(i=>{var s,a,l,c,u;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(o){const f=(l=o.frames)==null?void 0:l.findIndex(g=>g.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=o.frames)==null||c.splice(f,1),(u=o.layout)==null||u.splice(f,1),o.layouts=w_.reduce((g,p)=>{if(g&&g[p]){const v=g[p].findIndex(y=>y.i===r);typeof v=="number"&&v>-1&&g[p].splice(v,1)}return g},o.layouts))}})},updateFrame:(n,r)=>{e(i=>{var a,l,c,u;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=o==null?void 0:o.frames)==null?void 0:c.findIndex(f=>f.id===r.id);o&&((u=o.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(i=>{var a,l,c,u,f;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(g=>g.id===r.id);o&&((u=o.cards)==null||u.splice(s,1,r),(f=i.onUpdateCard)==null||f.call(i,r,n))})},removeCard:(n,r)=>{e(i=>{var a,l,c,u,f,g;const o=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=o==null?void 0:o.cards)==null?void 0:c.findIndex(p=>p.id===r.id);o&&((u=o.cards)==null||u.splice(s,1),(f=o.layout)==null||f.splice(s,1),(g=i.onRemoveCard)==null||g.call(i,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(i=>{var s,a,l;const o=(a=(s=i.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);o&&(((l=o.cards)==null?void 0:l.find(u=>u.id===r))?i.selectedCardId=r:i.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var o,s;((s=(o=r.dashboard)==null?void 0:o.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(i=>i.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,i,o;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(s=>s.id===t().selectedSheetId);return(o=n==null?void 0:n.frames)==null?void 0:o.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var i,o;const r=(i=t().dashboard)==null?void 0:i.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(o=a[l].cards)==null?void 0:o.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,i;const n=(i=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:i.find(o=>o.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{N4({card:n,dataPoint:r,set:e,get:t})}}}))),Kc=()=>he(e=>e.actions);process.env.NODE_ENV==="development"&&Qw("DashboardStore",he);const R4={theme:"system",setTheme:()=>null},__=m.createContext(R4);function L4({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),i==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(i)},[i]);const s={theme:i,setTheme:a=>{localStorage.setItem(n,a),o(a)}};return x.jsx(__.Provider,{...r,value:s,children:e})}const Um=()=>{const e=m.useContext(__);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function F4(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function S_(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function C_(e,t){const n=S_(e);return n==="dark"?qs.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function E_({id:e,version:t,authToken:n,customStyle:r,currentTheme:i,onSave:o,onEvent:s}){const{data:a,refetch:l,isLoading:c,isError:u}=wi({queryKey:[e],queryFn:()=>F4(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:f,setTheme:g}=Um(),{setDashboard:p,setSelectedSheetId:v,setStyle:y,setOnSaveFunction:w}=he(T=>T.actions);he(T=>T.actions.setCustomCards);const _=he(T=>T.actions.setFilterValues),S=he(T=>T.actions.setBookmarkKey),C=he(T=>T.actions.setAuthToken),P=he(T=>T.actions.setThemeStyle),O=he(T=>T.actions.setDashboardTheme),k=he(T=>T.actions.setOnEvent);return m.useEffect(()=>{if(f){const T=S_(f);O(T)}},[f,O]),m.useEffect(()=>{i&&g(i)},[i,g]),m.useEffect(()=>{const T=qs.cloneDeep(Lm);if(r){const R=qs.merge(T,r),F=C_(f,R);P(F),y(R)}else{const R=C_(f,T);P(R),y(Lm)}},[f,r,y,P]),m.useEffect(()=>{var z;if(!a||!a.dashboard)return;const T=a.dashboard,R=bs(T.id),F=JSON.parse(localStorage.getItem(R)||"[]"),j=F.find(V=>V.default===!0);if(j)p(j.template),S(j.name),j.filterValues&&_(j.filterValues);else{p(T);const V=F.find(se=>(se==null?void 0:se.name)==="Original");V?V.template=T:F.push({name:"Original",template:T,default:!1}),localStorage.setItem(R,JSON.stringify(F))}v((z=T.sheets)==null?void 0:z[0].id)},[a,p,v,_,S]),m.useEffect(()=>{o&&w(o),s&&k(s)},[o,w,s,k]),m.useEffect(()=>{n&&n.accessToken&&(C(n),l())},[n,l,C]),{isLoading:c,isError:u}}function qm({className:e,...t}){return x.jsx("div",{className:Oe("animate-pulse rounded-md bg-muted",e),...t})}function O_({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:i,ErrorComponent:o,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,...g}){he(_=>_.selectedSheetId);const p=he(_=>_.themeStyle),v=he(_=>_.onEvent),{isLoading:y,isError:w}=E_({id:a,version:u,authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return y||!l?(v==null||v({type:"info",message:`isLoading: ${y}, accessToken: ${l==null?void 0:l.accessToken}`}),i?x.jsx(i,{message:"loading"}):x.jsx("div",{className:" flex items-center gap-3",children:x.jsx(qm,{className:"dark:h-[2px] h-1 w-full"})})):w?(v==null||v({type:"error",message:"Error fetching dashboard"}),o?(console.log("Error fetching dashboard"),x.jsx(o,{})):x.jsx("div",{children:"Error"})):x.jsx("div",{className:Oe(" grow h-full flex flex-col justify-between",p==null?void 0:p.dashboardPanel,e),role:"dashboard-panel",...g})}function ae(){return ae=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},ae.apply(this,arguments)}function Ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Rn(e,t=[]){let n=[];function r(o,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:g,children:p,...v}=f,y=(g==null?void 0:g[e][l])||a,w=m.useMemo(()=>v,Object.values(v));return m.createElement(y.Provider,{value:w},p)}function u(f,g){const p=(g==null?void 0:g[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}const i=()=>{const o=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,$4(i,...t)]}function $4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function j4(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Sf(...e){return t=>e.forEach(n=>j4(n,t))}function rt(...e){return m.useCallback(Sf(...e),e)}const ho=m.forwardRef((e,t)=>{const{children:n,...r}=e,i=m.Children.toArray(n),o=i.find(z4);if(o){const s=o.props.children,a=i.map(l=>l===o?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(Gm,ae({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Gm,ae({},r,{ref:t}),n)});ho.displayName="Slot";const Gm=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...B4(r,n.props),ref:t?Sf(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Gm.displayName="SlotClone";const P_=({children:e})=>m.createElement(m.Fragment,null,e);function z4(e){return m.isValidElement(e)&&e.type===P_}function B4(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{o(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Cf(e){const t=e+"CollectionProvider",[n,r]=Rn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:y}=p,w=m.useRef(null),_=m.useRef(new Map).current;return m.createElement(i,{scope:v,itemMap:_,collectionRef:w},y)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:y,children:w}=p,_=o(a,y),S=rt(v,_.collectionRef);return m.createElement(ho,{ref:S},w)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:y,children:w,..._}=p,S=m.useRef(null),C=rt(v,S),P=o(c,y);return m.useEffect(()=>(P.itemMap.set(S,{ref:S,..._}),()=>void P.itemMap.delete(S))),m.createElement(ho,{[u]:"",ref:C},w)});function g(p){const v=o(e+"CollectionConsumer",p);return m.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const _=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((P,O)=>_.indexOf(P.ref.current)-_.indexOf(O.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Kn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},V4=de.useId||(()=>{});let H4=0;function hr(e){const[t,n]=de.useState(V4());return Kn(()=>{e||n(r=>r??String(H4++))},[e]),e||(t?`radix-${t}`:"")}const ze=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=m.forwardRef((r,i)=>{const{asChild:o,...s}=r,a=o?ho:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ae({},s,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function k_(e,t){e&&Mt.flushSync(()=>e.dispatchEvent(t))}function Pn(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 Xn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=W4({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,a=Pn(n),l=m.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else i(c)},[o,e,i,a]);return[s,l]}function W4({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,i=m.useRef(r),o=Pn(t);return m.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const U4=m.createContext(void 0);function Gs(e){const t=m.useContext(U4);return e||t||"ltr"}const Ym="rovingFocusGroup.onEntryFocus",q4={bubbles:!1,cancelable:!0},Km="RovingFocusGroup",[Xm,M_,G4]=Cf(Km),[Y4,hl]=Rn(Km,[G4]),[K4,X4]=Y4(Km),Q4=m.forwardRef((e,t)=>m.createElement(Xm.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Xm.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(Z4,ae({},e,{ref:t}))))),Z4=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),g=rt(t,f),p=Gs(o),[v=null,y]=Xn({prop:s,defaultProp:a,onChange:l}),[w,_]=m.useState(!1),S=Pn(c),C=M_(n),P=m.useRef(!1),[O,k]=m.useState(0);return m.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(Ym,S),()=>T.removeEventListener(Ym,S)},[S]),m.createElement(K4,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(T=>y(T),[y]),onItemShiftTab:m.useCallback(()=>_(!0),[]),onFocusableItemAdd:m.useCallback(()=>k(T=>T+1),[]),onFocusableItemRemove:m.useCallback(()=>k(T=>T-1),[])},m.createElement(ze.div,ae({tabIndex:w||O===0?-1:0,"data-orientation":r},u,{ref:g,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{P.current=!0}),onFocus:Ee(e.onFocus,T=>{const R=!P.current;if(T.target===T.currentTarget&&R&&!w){const F=new CustomEvent(Ym,q4);if(T.currentTarget.dispatchEvent(F),!F.defaultPrevented){const j=C().filter($=>$.focusable),z=j.find($=>$.active),V=j.find($=>$.id===v),te=[z,V,...j].filter(Boolean).map($=>$.ref.current);D_(te)}}P.current=!1}),onBlur:Ee(e.onBlur,()=>_(!1))})))}),J4="RovingFocusGroupItem",e7=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...s}=e,a=hr(),l=o||a,c=X4(J4,n),u=c.currentTabStopId===l,f=M_(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(Xm.ItemSlot,{scope:n,id:l,focusable:r,active:i},m.createElement(ze.span,ae({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Ee(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Ee(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ee(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=r7(v,c.orientation,c.dir);if(y!==void 0){v.preventDefault();let _=f().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")_.reverse();else if(y==="prev"||y==="next"){y==="prev"&&_.reverse();const S=_.indexOf(v.currentTarget);_=c.loop?i7(_,S+1):_.slice(S+1)}setTimeout(()=>D_(_))}})})))}),t7={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function n7(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function r7(e,t,n){const r=n7(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return t7[r]}function D_(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function i7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Qm=Q4,Zm=e7;function o7(e,t){return m.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const wn=e=>{const{present:t,children:n}=e,r=s7(t),i=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),o=rt(r.ref,i.ref);return typeof n=="function"||r.isPresent?m.cloneElement(i,{ref:o}):null};wn.displayName="Presence";function s7(e){const[t,n]=m.useState(),r=m.useRef({}),i=m.useRef(e),o=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=o7(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Ef(r.current);o.current=a==="mounted"?c:"none"},[a]),Kn(()=>{const c=r.current,u=i.current;if(u!==e){const g=o.current,p=Ef(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&g!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Kn(()=>{if(t){const c=f=>{const p=Ef(r.current).includes(f.animationName);f.target===t&&p&&Mt.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(o.current=Ef(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ef(e){return(e==null?void 0:e.animationName)||"none"}const T_="Tabs",[a7,Afe]=Rn(T_,[hl]),A_=hl(),[l7,Jm]=a7(T_),c7=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Gs(a),[f,g]=Xn({prop:r,onChange:i,defaultProp:o});return m.createElement(l7,{scope:n,baseId:hr(),value:f,onValueChange:g,orientation:s,dir:u,activationMode:l},m.createElement(ze.div,ae({dir:u,"data-orientation":s},c,{ref:t})))}),u7="TabsList",d7=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=Jm(u7,n),s=A_(n);return m.createElement(Qm,ae({asChild:!0},s,{orientation:o.orientation,dir:o.dir,loop:r}),m.createElement(ze.div,ae({role:"tablist","aria-orientation":o.orientation},i,{ref:t})))}),f7="TabsTrigger",h7=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,s=Jm(f7,n),a=A_(n),l=I_(s.baseId,r),c=N_(s.baseId,r),u=r===s.value;return m.createElement(Zm,ae({asChild:!0},a,{focusable:!i,active:u}),m.createElement(ze.button,ae({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l},o,{ref:t,onMouseDown:Ee(e.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Ee(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!i&&f&&s.onValueChange(r)})})))}),p7="TabsContent",g7=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...s}=e,a=Jm(p7,n),l=I_(a.baseId,r),c=N_(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),m.createElement(wn,{present:i||u},({present:g})=>m.createElement(ze.div,ae({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),g&&o))});function I_(e,t){return`${e}-trigger-${t}`}function N_(e,t){return`${e}-content-${t}`}const m7=c7,R_=d7,L_=h7,F_=g7,$_=m7,j_=de.forwardRef(({className:e,...t},n)=>x.jsx(R_,{ref:n,className:Oe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));j_.displayName=R_.displayName;const ev=de.forwardRef(({className:e,...t},n)=>x.jsx(L_,{ref:n,className:Oe("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}));ev.displayName=L_.displayName;const Of=de.forwardRef(({className:e,...t},n)=>x.jsx(F_,{ref:n,className:Oe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Of.displayName=F_.displayName;var z_={exports:{}},Xc={},tv={exports:{}};(function(e,t){(function(n,r){r(t)})(Uo,function(n){function r(re){return function(oe,xe,U,Te,je,He,Xe){return re(oe,xe,Xe)}}function i(re){return function(oe,xe,U,Te){if(!oe||!xe||typeof oe!="object"||typeof xe!="object")return re(oe,xe,U,Te);var je=Te.get(oe),He=Te.get(xe);if(je&&He)return je===xe&&He===oe;Te.set(oe,xe),Te.set(xe,oe);var Xe=re(oe,xe,U,Te);return Te.delete(oe),Te.delete(xe),Xe}}function o(re,Z){var oe={};for(var xe in re)oe[xe]=re[xe];for(var xe in Z)oe[xe]=Z[xe];return oe}function s(re){return re.constructor===Object||re.constructor==null}function a(re){return typeof re.then=="function"}function l(re,Z){return re===Z||re!==re&&Z!==Z}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",g="[object RegExp]",p="[object Map]",v="[object Number]",y="[object Object]",w="[object Set]",_="[object String]",S=Object.prototype.toString;function C(re){var Z=re.areArraysEqual,oe=re.areDatesEqual,xe=re.areMapsEqual,U=re.areObjectsEqual,Te=re.areRegExpsEqual,je=re.areSetsEqual,He=re.createIsNestedEqual,Xe=He(vt);function vt(pt,gt,Kt){if(pt===gt)return!0;if(!pt||!gt||typeof pt!="object"||typeof gt!="object")return pt!==pt&&gt!==gt;if(s(pt)&&s(gt))return U(pt,gt,Xe,Kt);var Bt=Array.isArray(pt),vn=Array.isArray(gt);if(Bt||vn)return Bt===vn&&Z(pt,gt,Xe,Kt);var cn=S.call(pt);return cn!==S.call(gt)?!1:cn===f?oe(pt,gt,Xe,Kt):cn===g?Te(pt,gt,Xe,Kt):cn===p?xe(pt,gt,Xe,Kt):cn===w?je(pt,gt,Xe,Kt):cn===y||cn===c?a(pt)||a(gt)?!1:U(pt,gt,Xe,Kt):cn===u||cn===v||cn===_?l(pt.valueOf(),gt.valueOf()):!1}return vt}function P(re,Z,oe,xe){var U=re.length;if(Z.length!==U)return!1;for(;U-- >0;)if(!oe(re[U],Z[U],U,U,re,Z,xe))return!1;return!0}var O=i(P);function k(re,Z){return l(re.valueOf(),Z.valueOf())}function T(re,Z,oe,xe){var U=re.size===Z.size;if(!U)return!1;if(!re.size)return!0;var Te={},je=0;return re.forEach(function(He,Xe){if(U){var vt=!1,pt=0;Z.forEach(function(gt,Kt){!vt&&!Te[pt]&&(vt=oe(Xe,Kt,je,pt,re,Z,xe)&&oe(He,gt,Xe,Kt,re,Z,xe))&&(Te[pt]=!0),pt++}),je++,U=vt}}),U}var R=i(T),F="_owner",j=Object.prototype.hasOwnProperty;function z(re,Z,oe,xe){var U=Object.keys(re),Te=U.length;if(Object.keys(Z).length!==Te)return!1;for(var je;Te-- >0;){if(je=U[Te],je===F){var He=!!re.$$typeof,Xe=!!Z.$$typeof;if((He||Xe)&&He!==Xe)return!1}if(!j.call(Z,je)||!oe(re[je],Z[je],je,je,re,Z,xe))return!1}return!0}var V=i(z);function se(re,Z){return re.source===Z.source&&re.flags===Z.flags}function te(re,Z,oe,xe){var U=re.size===Z.size;if(!U)return!1;if(!re.size)return!0;var Te={};return re.forEach(function(je,He){if(U){var Xe=!1,vt=0;Z.forEach(function(pt,gt){!Xe&&!Te[vt]&&(Xe=oe(je,pt,He,gt,re,Z,xe))&&(Te[vt]=!0),vt++}),U=Xe}}),U}var $=i(te),ee=Object.freeze({areArraysEqual:P,areDatesEqual:k,areMapsEqual:T,areObjectsEqual:z,areRegExpsEqual:se,areSetsEqual:te,createIsNestedEqual:r}),Y=Object.freeze({areArraysEqual:O,areDatesEqual:k,areMapsEqual:R,areObjectsEqual:V,areRegExpsEqual:se,areSetsEqual:$,createIsNestedEqual:r}),X=C(ee);function G(re,Z){return X(re,Z,void 0)}var D=C(o(ee,{createIsNestedEqual:function(){return l}}));function H(re,Z){return D(re,Z,void 0)}var ie=C(Y);function N(re,Z){return ie(re,Z,new WeakMap)}var ce=C(o(Y,{createIsNestedEqual:function(){return l}}));function me(re,Z){return ce(re,Z,new WeakMap)}function pe(re){return C(o(ee,re(ee)))}function fe(re){var Z=C(o(Y,re(Y)));return function(oe,xe,U){return U===void 0&&(U=new WeakMap),Z(oe,xe,U)}}n.circularDeepEqual=N,n.circularShallowEqual=me,n.createCustomCircularEqual=fe,n.createCustomEqual=pe,n.deepEqual=G,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(tv,tv.exports);var nv=tv.exports;const rv=pm(z3);var yt={},v7=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(yt,"__esModule",{value:!0}),yt.bottom=iv,yt.childrenEqual=w7,yt.cloneLayout=V_,yt.cloneLayoutItem=Ys,yt.collides=Pf,yt.compact=W_,yt.compactItem=U_,yt.compactType=T7,yt.correctBounds=q_,yt.fastPositionEqual=S7,yt.fastRGLPropsEqual=void 0,yt.getAllCollisions=G_,yt.getFirstCollision=Ks,yt.getLayoutItem=sv,yt.getStatics=av,yt.modifyLayout=H_,yt.moveElement=Zc,yt.moveElementAwayFromCollision=lv,yt.noop=void 0,yt.perc=E7,yt.resizeItemInDirection=P7,yt.setTopLeft=M7,yt.setTransform=k7,yt.sortLayoutItems=pv,yt.sortLayoutItemsByColRow=Z_,yt.sortLayoutItemsByRowCol=Q_,yt.synchronizeLayoutWithChildren=D7,yt.validateLayout=J_,yt.withLayoutItem=x7;var B_=nv,Qc=b7(m);function b7(e){return e&&e.__esModule?e:{default:e}}const y7=process.env.NODE_ENV==="production";function iv(e){let t=0,n;for(let r=0,i=e.length;r<i;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function V_(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Ys(e[n]);return t}function H_(e,t){const n=Array(e.length);for(let r=0,i=e.length;r<i;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function x7(e,t,n){let r=sv(e,t);return r?(r=n(Ys(r)),e=H_(e,r),[e,r]):[e,null]}function Ys(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 w7(e,t){return(0,B_.deepEqual)(Qc.default.Children.map(e,n=>n==null?void 0:n.key),Qc.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,B_.deepEqual)(Qc.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Qc.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const _7=v7;yt.fastRGLPropsEqual=_7;function S7(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Pf(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 W_(e,t,n,r){const i=av(e),o=pv(e,t),s=Array(e.length);for(let a=0,l=o.length;a<l;a++){let c=Ys(o[a]);c.static||(c=U_(i,c,t,n,o,r),i.push(c)),s[e.indexOf(o[a])]=c,c.moved=!1}return s}const C7={x:"w",y:"h"};function ov(e,t,n,r){const i=C7[r];t[r]+=1;const o=e.map(s=>s.i).indexOf(t.i);for(let s=o+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;Pf(t,a)&&ov(e,a,n+t[i],r)}}t[r]=n}function U_(e,t,n,r,i,o){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(iv(e),t.y);t.y>0&&!Ks(e,t);)t.y--;else if(a)for(;t.x>0&&!Ks(e,t);)t.x--;let l;for(;(l=Ks(e,t))&&!(n===null&&o);)if(a?ov(i,t,l.x+l.w,"x"):ov(i,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ks(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function q_(e,t){const n=av(e);for(let r=0,i=e.length;r<i;r++){const o=e[r];if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)n.push(o);else for(;Ks(n,o);)o.y++}return e}function sv(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Ks(e,t){for(let n=0,r=e.length;n<r;n++)if(Pf(e[n],t))return e[n]}function G_(e,t){return e.filter(n=>Pf(n,t))}function av(e){return e.filter(t=>t.static)}function Zc(e,t,n,r,i,o,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=pv(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=G_(f,t),v=p.length>0;if(v&&l)return V_(e);if(v&&o)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let y=0,w=p.length;y<w;y++){const _=p[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(_.i," at [").concat(_.x,",").concat(_.y,"]"),!_.moved&&(_.static?e=lv(e,_,t,i,s):e=lv(e,t,_,i,s))}return e}function lv(e,t,n,r,i,o){const s=i==="horizontal",a=i==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},g=Ks(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return Zc(e,n,void 0,t.y+1,r,l,i);if(p&&i==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return Zc(e,t,n.x,void 0,r,l,i)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),Zc(e,n,s?f.x:void 0,a?f.y:void 0,r,l,i)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:Zc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,i)}function E7(e){return e*100+"%"}const Y_=(e,t,n,r)=>e+n>r?t:n,K_=(e,t,n)=>e<0?t:n,X_=e=>Math.max(0,e),cv=e=>Math.max(0,e),uv=(e,t,n)=>{let{left:r,height:i,width:o}=t;const s=e.top-(i-e.height);return{left:r,width:o,height:K_(s,e.height,i),top:cv(s)}},dv=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{top:r,height:o,width:Y_(e.left,e.width,s,n),left:X_(i)}},fv=(e,t,n)=>{let{top:r,height:i,width:o}=t;const s=e.left-(o-e.width);return{height:i,width:s<0?e.width:Y_(e.left,e.width,o,n),top:cv(r),left:X_(s)}},hv=(e,t,n)=>{let{top:r,left:i,height:o,width:s}=t;return{width:s,left:i,height:K_(r,e.height,o),top:cv(r)}},O7={n:uv,ne:function(){return uv(arguments.length<=0?void 0:arguments[0],dv(...arguments))},e:dv,se:function(){return hv(arguments.length<=0?void 0:arguments[0],dv(...arguments))},s:hv,sw:function(){return hv(arguments.length<=0?void 0:arguments[0],fv(...arguments))},w:fv,nw:function(){return uv(arguments.length<=0?void 0:arguments[0],fv(...arguments))}};function P7(e,t,n,r){const i=O7[e];return i?i(t,{...t,...n},r):n}function k7(e){let{top:t,left:n,width:r,height:i}=e;const o="translate(".concat(n,"px,").concat(t,"px)");return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function M7(e){let{top:t,left:n,width:r,height:i}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(i,"px"),position:"absolute"}}function pv(e,t){return t==="horizontal"?Z_(e):t==="vertical"?Q_(e):e}function Q_(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 Z_(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 D7(e,t,n,r,i){e=e||[];const o=[];Qc.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=sv(e,String(a.key)),c=a.props["data-grid"];l&&c==null?o.push(Ys(l)):c?(y7||J_([c],"ReactGridLayout.children"),o.push(Ys({...c,i:a.key}))):o.push(Ys({w:1,h:1,x:0,y:iv(o),i:String(a.key)}))});const s=q_(o,{cols:n});return i?s:W_(s,r,n)}function J_(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,i=e.length;r<i;r++){const o=e[r];for(let s=0;s<n.length;s++)if(typeof o[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function T7(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}function Ffe(){}const A7=()=>{};yt.noop=A7;var $i={};Object.defineProperty($i,"__esModule",{value:!0}),$i.calcGridColWidth=kf,$i.calcGridItemPosition=I7,$i.calcGridItemWHPx=gv,$i.calcWH=R7,$i.calcXY=N7,$i.clamp=Xs;function kf(e){const{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function gv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function I7(e,t,n,r,i,o){const{margin:s,containerPadding:a,rowHeight:l}=e,c=kf(e),u={};return o&&o.resizing?(u.width=Math.round(o.resizing.width),u.height=Math.round(o.resizing.height)):(u.width=gv(r,c,s[0]),u.height=gv(i,l,s[1])),o&&o.dragging?(u.top=Math.round(o.dragging.top),u.left=Math.round(o.dragging.left)):o&&o.resizing&&typeof o.resizing.top=="number"&&typeof o.resizing.left=="number"?(u.top=Math.round(o.resizing.top),u.left=Math.round(o.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function N7(e,t,n,r,i){const{margin:o,cols:s,rowHeight:a,maxRows:l}=e,c=kf(e);let u=Math.round((n-o[0])/(c+o[0])),f=Math.round((t-o[1])/(a+o[1]));return u=Xs(u,0,s-r),f=Xs(f,0,l-i),{x:u,y:f}}function R7(e,t,n,r,i,o){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=kf(e);let f=Math.round((t+s[0])/(u+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=Xs(f,0,l-r),v=Xs(g,0,a-i);return["sw","w","nw"].indexOf(o)!==-1&&(p=Xs(f,0,l)),["nw","n","ne"].indexOf(o)!==-1&&(v=Xs(g,0,a)),{w:p,h:v}}function Xs(e,t,n){return Math.max(Math.min(e,n),t)}var Mf={},mv={exports:{}},vv,eS;function bv(){if(eS)return vv;eS=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return vv=e,vv}var yv,tS;function L7(){if(tS)return yv;tS=1;var e=bv();function t(){}function n(){}return n.resetWarningCache=t,yv=function(){function r(s,a,l,c,u,f){if(f!==e){var g=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 g.name="Invariant Violation",g}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},yv}var Df={exports:{}},It={};/** @license React v16.13.1
86
86
  * react-is.development.js
87
87
  *
88
88
  * Copyright (c) Facebook, Inc. and its affiliates.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.0.115",
8
+ "version": "0.0.116",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",