"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9e3],{59e3:(B,h,e)=>{e.r(h),e.d(h,{default:()=>y});var a=e(74848),_=e(22803),d=e(96540),E=e(29675),m=e(10247),g=e(88849),v=e(99764),s=e(48583),r=e(40271),c=e(34128),M=e(98349),u=e(44826),x=e(60641),i=e(54594),O=e(14123),D=e(66384),n=e(11817),P=e(2178),p=e(5127);function y({onClear:t=()=>{}}){const l=(0,E.of)(C),[o,j]=(0,d.useState)("custom"),A=(0,d.useMemo)(()=>(0,a.jsx)(P.B,{showOn:"click",placement:"bottom-start",content:(0,a.jsxs)("div",{className:l.content,children:[o==="custom"&&(0,a.jsx)(f,{}),o==="saved"&&(0,a.jsx)(K,{})]}),header:(0,a.jsxs)(m.U,{hideBorder:!0,className:l.fixTabsMargin,children:[(0,a.jsx)(g.o,{active:o==="custom",icon:"filter",label:"Custom filter",onChangeTab:()=>j("custom")}),(0,a.jsx)(g.o,{active:o==="saved",icon:"bookmark",label:"Saved searches",onChangeTab:()=>j("saved")})]}),children:(0,a.jsx)(v.K,{name:"filter","aria-label":"Show filters"})}),[o,l.content,l.fixTabsMargin]);return(0,a.jsxs)(s.B,{direction:"column",gap:0,children:[(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"common.search",children:"Search"})}),(0,a.jsx)(s.B,{direction:"row",children:(0,a.jsx)(c.p,{prefix:A})})]})}const f=()=>(0,a.jsxs)(s.B,{direction:"column",alignItems:"end",gap:2,children:[(0,a.jsxs)(M.x,{columns:2,gap:2,alignItems:"center",children:[(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.namespace",children:"Folder / Namespace"})}),(0,a.jsx)(u.l6,{options:[],onChange:()=>{}}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.rule-name",children:"Alerting rule name"})}),(0,a.jsx)(c.p,{}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.evaluation-group",children:"Evaluation group"})}),(0,a.jsx)(c.p,{}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.labels",children:"Labels"})}),(0,a.jsx)(c.p,{}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.data-source",children:"Data source"})}),(0,a.jsx)(u.l6,{options:[],onChange:()=>{}}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.state",children:"State"})}),(0,a.jsx)(x.z,{value:"*",options:[{label:"All",value:"*"},{label:"Normal",value:"normal"},{label:"Pending",value:"pending"},{label:"Firing",value:"firing"}]}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.rule-type",children:"Type"})}),(0,a.jsx)(x.z,{value:"*",options:[{label:"All",value:"*"},{label:"Alert rule",value:"alerting"},{label:"Recording rule",value:"recording"}]}),(0,a.jsx)(r.J,{children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.property.rule-health",children:"Health"})}),(0,a.jsx)(x.z,{value:"*",options:[{label:"All",value:"*"},{label:"OK",value:"ok"},{label:"No data",value:"no_data"},{label:"Error",value:"error"}]})]}),(0,a.jsxs)(s.B,{direction:"row",alignItems:"center",children:[(0,a.jsx)(i.$n,{variant:"secondary",children:(0,a.jsx)(n.x6,{i18nKey:"common.clear",children:"Clear"})}),(0,a.jsx)(i.$n,{children:(0,a.jsx)(n.x6,{i18nKey:"common.apply",children:"Apply"})})]})]}),K=()=>{const t=(0,d.useCallback)(l=>{},[]);return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(s.B,{direction:"column",gap:2,alignItems:"flex-end",children:[(0,a.jsx)(i.$n,{variant:"secondary",size:"sm",children:(0,a.jsx)(n.x6,{i18nKey:"alerting.search.save-query",children:"Save current search"})}),(0,a.jsx)(O.j,{columns:[{id:"name",header:"Saved search name",cell:({row:l})=>(0,a.jsxs)(s.B,{alignItems:"center",children:[l.original.name,l.original.default?(0,a.jsx)(D.E,{text:"Default",color:"blue"}):null]})},{id:"actions",cell:({row:l})=>(0,a.jsxs)(s.B,{direction:"row",alignItems:"center",children:[(0,a.jsx)(i.$n,{variant:"secondary",fill:"outline",size:"sm",onClick:()=>t(l.original.name),children:(0,a.jsx)(n.x6,{i18nKey:"common.apply",children:"Apply"})}),(0,a.jsx)(p.A,{size:"sm",fill:"outline"})]})}],data:[{name:"My saved search",default:!0},{name:"Another saved search"},{name:"This one has a really long name and some emojis too \u{1F952}"}],getRowId:l=>l.name}),(0,a.jsx)(i.$n,{variant:"secondary",children:(0,a.jsx)(n.x6,{i18nKey:"common.close",children:"Close"})})]})})};function C(t){return{content:(0,_.css)({padding:t.spacing(1),maxWidth:500}),fixTabsMargin:(0,_.css)({marginTop:t.spacing(-1)})}}}}]);

//# sourceMappingURL=9000.793ff7231c0541aee238.js.map