p3x-redis-ui-material
Version:
💿 P3X Redis UI triple frontend — Angular + React/MUI + Vue/Vuetify with 54 languages, 7 themes, Socket.IO, desktop notifications, and full feature parity
2 lines • 7.99 kB
JavaScript
import"./main-OCJB5534.js";import{Bi as ym,Di as wf,Dn as _y,Dr as lo,Dt as Qe,F as HY,Gn as dT,In as by,It as Sn,Kr as oT,Lt as Sy,P as HT,Pn as bm,Pr as mc,Qr as qC,Rn as co,T as Ee,Xt as Uy,ei as qT,er as gT,ii as rT,in as Wa,k as G0,mn as YQ,pt as Nf,rn as WC,s as $y,t as $Y,ur as iT,vr as jy,w as Eb}from"./chunk-CHqDEyfr.js";import{t as Q}from"./chunk-CyniViPG.js";import{a as jt,i as Vt,o as z,s as zt,t as Bt}from"./chunk-CyaMV1f5.js";import{C as xn,a as He,i as Gn,y as on}from"./chunk-B_FU7ynV.js";import{a as se$1,n as ae,t as Qt}from"./chunk-CNSP-oVC.js";import{n as wt,r as yt}from"./chunk-CGgWGJ3E.js";import"./chunk-CFyh5uM7.js";import{c as _t,d as qe,i as Qt$1}from"./chunk-CLjqwtZV.js";import{i as ze,t as Oe}from"./chunk-BYtjyP-K.js";var se=(t,c)=>c.key;function le(t,c){if(t&1&&(Wa(0,`div`,6),HT(1),wf()),t&2){let e=gT();Sn(),Nf(` `,e.strings().label?.cheatsheet?.subtitle,` `)}}function pe(t,c){if(t&1&&(Wa(0,`div`,7),HT(1),wf()),t&2){let e=gT();Sn(),Nf(` `,e.strings().label?.cheatsheet?.footerHint,` `)}}function ce(t,c){if(t&1&&(Wa(0,`div`,19),HT(1),wf()),t&2){let e=gT().$implicit;Sn(),jy(e.description)}}function me(t,c){if(t&1){let e=dT();Wa(0,`button`,22),Sy(`click`,function(){let i=ym(e).$implicit;return bm(gT(2).pick(i))}),HT(1),wf()}if(t&2){let e=c.$implicit;Sn(),Nf(` `,e,` `)}}function de(t,c){if(t&1&&(Wa(0,`div`,13)(1,`div`,18),HT(2),wf(),co(3,ce,2,1,`div`,19),Wa(4,`div`,20),oT(5,me,2,1,`button`,21,rT),wf()()),t&2){let e=c.$implicit,n=gT();Sn(2),jy(e.name),Sn(),lo(e.description?3:-1),Sn(2),iT(n.filteredPrompts(e.prompts))}}function he(t,c){if(t&1&&(Wa(0,`div`,14),HT(1),wf()),t&2){let e=gT();Sn(),Nf(` `,e.strings().label?.cheatsheet?.empty,` `)}}var Ne=(()=>{class t{i18n;state;cdr;dialogRef;strings;filter=``;constructor(e,n,i,p){this.i18n=e,this.state=n,this.cdr=i,this.dialogRef=p,this.strings=this.i18n.strings}visibleGroups(){let e=this.strings()?.label?.cheatsheet?.groups;if(!e)return[];let n=(this.state.modules()||[]).map(h=>(h?.name||``).toLowerCase()),i=h=>{let m=this.state.redisVersion?.();return m?.isAtLeast?m.isAtLeast(h,0):!1},p=this.state.info()?.server?.redis_mode===`cluster`,d=[],s=(h,m)=>{!m||!Array.isArray(m.prompts)||m.prompts.length===0||d.push({key:h,name:m.name,description:m.description,prompts:m.prompts})};if(s(`diagnostics`,e.diagnostics),s(`keys`,e.keys),s(`dataTypes`,e.dataTypes),(n.includes(`rejson`)||n.includes(`rejson-rl`)||n.includes(`json`))&&s(`json`,e.json),(n.includes(`search`)||n.includes(`searchlight`))&&s(`search`,e.search),n.includes(`timeseries`)&&s(`timeseries`,e.timeseries),n.includes(`bf`)&&s(`bloom`,e.bloom),i(8)){s(`vectorSet`,e.vectorSet),s(`redis8`,e.redis8);let h=this.state.redisVersion?.();h?.isAtLeast&&h.isAtLeast(8,8)&&s(`array`,e.array)}return s(`scripting`,e.scripting),p&&s(`cluster`,e.cluster),i(6)&&s(`acl`,e.acl),s(`qna`,e.qna),s(`translate`,e.translate),d}filteredPrompts(e){let n=this.filter.trim().toLowerCase();return n?e.filter(i=>i.toLowerCase().includes(n)):e}emptyResults(){return this.visibleGroups().every(e=>this.filteredPrompts(e.prompts).length===0)}pick(e){this.dialogRef.close(`ai: `+e)}openOfficialDocs(){window.open(`https://redis.io/docs/latest/commands/`,`_blank`)}close(){this.dialogRef.close(void 0)}static ɵfac=function(n){return new(n||t)(Qe(YQ),Qe(Q),Qe(mc),Qe(z))};static ɵcmp=Ee({type:t,selectors:[[`p3xr-ai-cheatsheet-dialog`]],decls:32,vars:8,consts:[[1,`p3xr-dialog-toolbar`,`p3xr-mat-layout-strong`],[`mat-dialog-title`,``,1,`p3xr-dialog-title`],[2,`flex`,`1 1 auto`],[`mat-icon-button`,``,`type`,`button`,3,`click`],[1,`p3xr-dialog-content`,`p3xr-cheatsheet-content`],[1,`p3xr-cheatsheet-sticky`],[1,`p3xr-cheatsheet-sub`],[1,`p3xr-cheatsheet-tip`],[1,`p3xr-cheatsheet-search`],[`subscriptSizing`,`dynamic`,`appearance`,`fill`,2,`width`,`100%`],[`matPrefix`,``],[`matInput`,``,3,`ngModelChange`,`keydown`,`ngModel`,`placeholder`],[1,`p3xr-cheatsheet-groups`],[1,`p3xr-cheatsheet-group`],[1,`p3xr-cheatsheet-empty`],[1,`p3xr-dialog-actions`,`p3xr-cheatsheet-footer`],[`mat-raised-button`,``,`type`,`button`,1,`btn-primary`,3,`click`],[`mat-flat-button`,``,`type`,`button`,1,`btn-primary`,3,`click`],[1,`p3xr-cheatsheet-group-name`],[1,`p3xr-cheatsheet-group-desc`],[1,`p3xr-cheatsheet-prompts`],[`type`,`button`,1,`p3xr-cheatsheet-prompt`],[`type`,`button`,1,`p3xr-cheatsheet-prompt`,3,`click`]],template:function(n,i){n&1&&(Wa(0,`mat-toolbar`,0)(1,`span`,1),HT(2),wf(),_y(3,`span`,2),Wa(4,`button`,3),Sy(`click`,function(){return i.close()}),Wa(5,`mat-icon`),HT(6,`close`),wf()()(),Wa(7,`mat-dialog-content`,4)(8,`div`,5),co(9,le,2,1,`div`,6),co(10,pe,2,1,`div`,7),Wa(11,`div`,8)(12,`mat-form-field`,9)(13,`mat-icon`,10),HT(14,`search`),wf(),Wa(15,`input`,11),$y(`ngModelChange`,function(d){return qT(i.filter,d)||(i.filter=d),d}),Sy(`keydown`,function(d){return d.stopPropagation()}),wf(),WC(),wf()()(),Wa(16,`div`,12),oT(17,de,7,2,`div`,13,se),co(19,he,2,1,`div`,14),wf()(),Wa(20,`mat-dialog-actions`,15),_y(21,`span`,2),Wa(22,`button`,16),Sy(`click`,function(){return i.openOfficialDocs()}),Wa(23,`mat-icon`),HT(24,`menu_book`),wf(),Wa(25,`span`),HT(26),wf()(),Wa(27,`button`,17),Sy(`click`,function(){return i.close()}),Wa(28,`mat-icon`),HT(29,`close`),wf(),Wa(30,`span`),HT(31),wf()()()),n&2&&(Sn(2),Nf(` `,i.strings().label?.cheatsheet?.title,` `),Sn(7),lo(i.strings().label?.cheatsheet?.subtitle?9:-1),Sn(),lo(i.strings().label?.cheatsheet?.footerHint?10:-1),Sn(5),Uy(`ngModel`,i.filter),by(`placeholder`,i.strings().label?.cheatsheet?.searchPlaceholder??``),qC(),Sn(2),iT(i.visibleGroups()),Sn(2),lo(i.emptyResults()?19:-1),Sn(7),jy(i.strings().label?.cheatsheet?.openOfficialDocs),Sn(5),jy(i.strings().intention?.close))},dependencies:[Eb,Gn,He,xn,on,zt,Bt,Vt,jt,Qt$1,qe,_t,Oe,ze,$Y,HY,G0,yt,wt,ae,se$1,Qt],styles:[`.p3xr-cheatsheet-content.mat-mdc-dialog-content{padding:0!important}.p3xr-cheatsheet-sticky{position:sticky;top:0;z-index:2;background:var(--%NS%mat-app-background-color, inherit);border-bottom:1px solid var(--%NS%p3xr-content-border-color, rgba(255, 255, 255, .08));padding:12px 16px}.p3xr-cheatsheet-sub,.p3xr-cheatsheet-tip{font-size:13px;opacity:.8;line-height:1.4;padding-bottom:4px}.p3xr-cheatsheet-search{margin:0;padding:4px 0 0}.p3xr-cheatsheet-search .mat-mdc-form-field-subscript-wrapper,.p3xr-cheatsheet-search .mat-mdc-form-field-bottom-align{display:none!important;height:0!important;min-height:0!important}.p3xr-cheatsheet-search .mat-mdc-text-field-wrapper,.p3xr-cheatsheet-search .mat-mdc-form-field{margin:0!important}.p3xr-cheatsheet-groups{padding:12px 16px}.p3xr-cheatsheet-group:first-child .p3xr-cheatsheet-group-name{margin-top:0}.p3xr-cheatsheet-groups{padding:0 16px 16px}.p3xr-cheatsheet-group{margin-bottom:18px}.p3xr-cheatsheet-group-name{font-size:14px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;margin-top:6px;margin-bottom:4px;opacity:.85}.p3xr-cheatsheet-group-desc{font-size:12px;opacity:.65;margin-bottom:8px}.p3xr-cheatsheet-prompts{display:flex;flex-direction:column;gap:4px}.p3xr-cheatsheet-prompt{display:block;width:100%;text-align:left;font-family:Roboto Mono,monospace;font-size:12px;line-height:1.5;padding:8px 12px;border:1px solid var(--%NS%p3xr-content-border-color, rgba(127, 127, 127, .3));border-radius:4px;background:transparent;color:inherit;cursor:pointer;white-space:normal;word-break:break-word;overflow-wrap:anywhere;transition:background .1s ease,border-color .1s ease}.p3xr-cheatsheet-prompt:hover{background:var(--%NS%p3xr-accordion-bg, rgba(127, 127, 127, .12));border-color:var(--%NS%mat-sys-primary, currentColor)}.p3xr-cheatsheet-prompt:focus-visible{outline:2px solid var(--%NS%mat-sys-primary, currentColor);outline-offset:-1px}.p3xr-cheatsheet-empty{padding:24px;text-align:center;opacity:.6;font-size:13px}.p3xr-cheatsheet-footer{padding:10px 16px!important;min-height:auto!important}.p3xr-cheatsheet-footer-hint{font-size:11px;opacity:.7;line-height:1.4}
`],encapsulation:2})}return t})();export{Ne as AiCheatsheetDialogComponent};