(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9978],{74526:()=>{(function(){"use strict";/**
 * Bindonce - Zero watches binding for AngularJs
 * @version v0.3.1
 * @link https://github.com/Pasvaz/bindonce
 * @author Pasquale Vazzana <pasqualevazzana@gmail.com>
 * @license MIT License, http://www.opensource.org/licenses/MIT
 */var u=angular.module("pasvaz.bindonce",[]);u.directive("bindonce",function(){var A=function(l){if(l&&l.length!==0){var f=angular.lowercase(""+l);l=!(f==="f"||f==="0"||f==="false"||f==="no"||f==="n"||f==="[]")}else l=!1;return l},a=parseInt((/msie (\d+)/.exec(angular.lowercase(navigator.userAgent))||[])[1],10);isNaN(a)&&(a=parseInt((/trident\/.*; rv:(\d+)/.exec(angular.lowercase(navigator.userAgent))||[])[1],10));var s={restrict:"AM",controller:["$scope","$element","$attrs","$interpolate",function(l,f,g,C){var o=function(p,S,w){var te=S==="show"?"":"none",ne=S==="hide"?"":"none";p.css("display",A(w)?te:ne)},h=function(p,S){if(angular.isObject(S)&&!angular.isArray(S)){var w=[];angular.forEach(S,function(te,ne){te&&w.push(ne)}),S=w}S&&p.addClass(angular.isArray(S)?S.join(" "):S)},E={watcherRemover:void 0,binders:[],group:g.boName,element:f,ran:!1,addBinder:function(p){this.binders.push(p),this.ran&&this.runBinders()},setupWatcher:function(p){var S=this;this.watcherRemover=l.$watch(p,function(w){w!==void 0&&(S.removeWatcher(),S.runBinders())},!0)},removeWatcher:function(){this.watcherRemover!==void 0&&(this.watcherRemover(),this.watcherRemover=void 0)},runBinders:function(){for(;this.binders.length>0;){var p=this.binders.shift();if(!(this.group&&this.group!=p.group)){var S=p.scope.$eval(p.interpolate?C(p.value):p.value);switch(p.attr){case"boIf":A(S)&&p.transclude(p.scope.$new(),function(Z){var ee=p.element.parent(),B=p.element&&p.element[p.element.length-1],K=ee&&ee[0]||B&&B.parentNode,T=B&&B.nextSibling||null;angular.forEach(Z,function(ae){K.insertBefore(ae,T)})});break;case"boSwitch":var w,te=p.controller[0];(w=te.cases["!"+S]||te.cases["?"])&&(p.scope.$eval(p.attrs.change),angular.forEach(w,function(Z){Z.transclude(p.scope.$new(),function(ee){var B=Z.element.parent(),K=Z.element&&Z.element[Z.element.length-1],T=B&&B[0]||K&&K.parentNode,ae=K&&K.nextSibling||null;angular.forEach(ee,function(ge){T.insertBefore(ge,ae)})})}));break;case"boSwitchWhen":var ne=p.controller[0];ne.cases["!"+p.attrs.boSwitchWhen]=ne.cases["!"+p.attrs.boSwitchWhen]||[],ne.cases["!"+p.attrs.boSwitchWhen].push({transclude:p.transclude,element:p.element});break;case"boSwitchDefault":var ne=p.controller[0];ne.cases["?"]=ne.cases["?"]||[],ne.cases["?"].push({transclude:p.transclude,element:p.element});break;case"hide":case"show":o(p.element,p.attr,S);break;case"class":h(p.element,S);break;case"text":p.element.text(S);break;case"html":p.element.html(S);break;case"style":p.element.css(S);break;case"src":p.element.attr(p.attr,S),a&&p.element.prop("src",S);break;case"attr":angular.forEach(p.attrs,function(Z,ee){var B,K;ee.match(/^boAttr./)&&p.attrs[ee]&&(B=ee.replace(/^boAttr/,"").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),K=p.scope.$eval(p.attrs[ee]),p.element.attr(B,K))});break;case"href":case"alt":case"title":case"id":case"value":p.element.attr(p.attr,S);break}}}this.ran=!0}};return E}],link:function(l,f,g,C){var o=g.bindonce?l.$eval(g.bindonce):!0;o!==void 0?C.runBinders():(C.setupWatcher(g.bindonce),f.bind("$destroy",C.removeWatcher))}};return s}),angular.forEach([{directiveName:"boShow",attribute:"show"},{directiveName:"boHide",attribute:"hide"},{directiveName:"boClass",attribute:"class"},{directiveName:"boText",attribute:"text"},{directiveName:"boBind",attribute:"text"},{directiveName:"boHtml",attribute:"html"},{directiveName:"boSrcI",attribute:"src",interpolate:!0},{directiveName:"boSrc",attribute:"src"},{directiveName:"boHrefI",attribute:"href",interpolate:!0},{directiveName:"boHref",attribute:"href"},{directiveName:"boAlt",attribute:"alt"},{directiveName:"boTitle",attribute:"title"},{directiveName:"boId",attribute:"id"},{directiveName:"boStyle",attribute:"style"},{directiveName:"boValue",attribute:"value"},{directiveName:"boAttr",attribute:"attr"},{directiveName:"boIf",transclude:"element",terminal:!0,priority:1e3},{directiveName:"boSwitch",require:"boSwitch",controller:function(){this.cases={}}},{directiveName:"boSwitchWhen",transclude:"element",priority:800,require:"^boSwitch"},{directiveName:"boSwitchDefault",transclude:"element",priority:800,require:"^boSwitch"}],function(A){var a=200;return u.directive(A.directiveName,function(){var s={priority:A.priority||a,transclude:A.transclude||!1,terminal:A.terminal||!1,require:["^bindonce"].concat(A.require||[]),controller:A.controller,compile:function(l,f,g){return function(C,o,h,E){var p=E[0],S=h.boParent;if(S&&p.group!==S){var w=p.element.parent();p=void 0;for(var te;w[0].nodeType!==9&&w.length;){if((te=w.data("$bindonceController"))&&te.group===S){p=te;break}w=w.parent()}if(!p)throw new Error("No bindonce controller: "+S)}p.addBinder({element:o,attr:A.attribute||A.directiveName,attrs:h,value:h[A.directiveName],interpolate:A.interpolate,group:S,transclude:g,controller:E.slice(1),scope:C})}}};return s})})})()},32747:()=>{/**
 * @license AngularJS v1.8.3
 * (c) 2010-2020 Google LLC. http://angularjs.org
 * License: MIT
 */(function(u,A){"use strict";function a(Z,ee){if(l(Z)){ee=ee||[];for(var B=0,K=Z.length;B<K;B++)ee[B]=Z[B]}else if(f(Z)){ee=ee||{};for(var T in Z)T.charAt(0)==="$"&&T.charAt(1)==="$"||(ee[T]=Z[T])}return ee||Z}function s(Z,ee){var B=[],K=Z.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[?*])?/g,function(T,ae,ge,X){var ce=X==="?"||X==="*?",pe=X==="*"||X==="*?";return B.push({name:ge,optional:ce}),ae=ae||"",(ce?"(?:"+ae:ae+"(?:")+(pe?"(.+?)":"([^/]+)")+(ce?"?)?":")")}).replace(/([/$*])/g,"\\$1");return ee.ignoreTrailingSlashes&&(K=K.replace(/\/+$/,"")+"/*"),{keys:B,regexp:new RegExp("^"+K+"(?:[?#]|$)",ee.caseInsensitiveMatch?"i":"")}}var l,f,g,C,o=A.module("ngRoute",[]).info({angularVersion:"1.8.3"}).provider("$route",p).run(S),h=A.$$minErr("ngRoute"),E;function p(){l=A.isArray,f=A.isObject,g=A.isDefined,C=A.noop;function Z(B,K){return A.extend(Object.create(B),K)}var ee={};this.when=function(B,K){var T=a(K);if(A.isUndefined(T.reloadOnUrl)&&(T.reloadOnUrl=!0),A.isUndefined(T.reloadOnSearch)&&(T.reloadOnSearch=!0),A.isUndefined(T.caseInsensitiveMatch)&&(T.caseInsensitiveMatch=this.caseInsensitiveMatch),ee[B]=A.extend(T,{originalPath:B},B&&s(B,T)),B){var ae=B[B.length-1]==="/"?B.substr(0,B.length-1):B+"/";ee[ae]=A.extend({originalPath:B,redirectTo:B},s(ae,T))}return this},this.caseInsensitiveMatch=!1,this.otherwise=function(B){return typeof B=="string"&&(B={redirectTo:B}),this.when(null,B),this},E=!0,this.eagerInstantiationEnabled=function(K){return g(K)?(E=K,this):E},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce","$browser",function(B,K,T,ae,ge,X,ce,pe){var N=!1,ue,F,me={routes:ee,reload:function(){N=!0;var V={defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0,N=!1}};B.$evalAsync(function(){le(V),V.defaultPrevented||re()})},updateParams:function(V){if(this.current&&this.current.$$route)V=A.extend({},this.current.params,V),K.path(ke(this.current.$$route.originalPath,V)),K.search(V);else throw h("norout","Tried updating route with no current route")}};return B.$on("$locationChangeStart",le),B.$on("$locationChangeSuccess",re),me;function O(V,W){var P=W.keys,H={};if(!W.regexp)return null;var J=W.regexp.exec(V);if(!J)return null;for(var se=1,ie=J.length;se<ie;++se){var be=P[se-1],j=J[se];be&&j&&(H[be.name]=j)}return H}function le(V){var W=me.current;ue=De(),F=Ne(ue,W),!F&&(W||ue)&&B.$broadcast("$routeChangeStart",ue,W).defaultPrevented&&V&&V.preventDefault()}function re(){var V=me.current,W=ue;if(F)V.params=W.params,A.copy(V.params,T),B.$broadcast("$routeUpdate",V);else if(W||V){N=!1,me.current=W;var P=ae.resolve(W);pe.$$incOutstandingRequestCount("$route"),P.then(z).then(q).then(function(H){return H&&P.then(Ce).then(function(J){W===me.current&&(W&&(W.locals=J,A.copy(W.params,T)),B.$broadcast("$routeChangeSuccess",W,V))})}).catch(function(H){W===me.current&&B.$broadcast("$routeChangeError",W,V,H)}).finally(function(){pe.$$completeOutstandingRequest(C,"$route")})}}function z(V){var W={route:V,hasRedirection:!1};if(V){if(V.redirectTo)if(A.isString(V.redirectTo))W.path=ke(V.redirectTo,V.params),W.search=V.params,W.hasRedirection=!0;else{var P=K.path(),H=K.search(),J=V.redirectTo(V.pathParams,P,H);A.isDefined(J)&&(W.url=J,W.hasRedirection=!0)}else if(V.resolveRedirectTo)return ae.resolve(ge.invoke(V.resolveRedirectTo)).then(function(se){return A.isDefined(se)&&(W.url=se,W.hasRedirection=!0),W})}return W}function q(V){var W=!0;if(V.route!==me.current)W=!1;else if(V.hasRedirection){var P=K.url(),H=V.url;H?K.url(H).replace():H=K.path(V.path).search(V.search).replace().url(),H!==P&&(W=!1)}return W}function Ce(V){if(V){var W=A.extend({},V.resolve);A.forEach(W,function(H,J){W[J]=A.isString(H)?ge.get(H):ge.invoke(H,null,null,J)});var P=ve(V);return A.isDefined(P)&&(W.$template=P),ae.all(W)}}function ve(V){var W,P;return A.isDefined(W=V.template)?A.isFunction(W)&&(W=W(V.params)):A.isDefined(P=V.templateUrl)&&(A.isFunction(P)&&(P=P(V.params)),A.isDefined(P)&&(V.loadedTemplateUrl=ce.valueOf(P),W=X(P))),W}function De(){var V,W;return A.forEach(ee,function(P,H){!W&&(V=O(K.path(),P))&&(W=Z(P,{params:A.extend({},K.search(),V),pathParams:V}),W.$$route=P)}),W||ee[null]&&Z(ee[null],{params:{},pathParams:{}})}function Ne(V,W){return!N&&V&&W&&V.$$route===W.$$route&&(!V.reloadOnUrl||!V.reloadOnSearch&&A.equals(V.pathParams,W.pathParams))}function ke(V,W){var P=[];return A.forEach((V||"").split(":"),function(H,J){if(J===0)P.push(H);else{var se=H.match(/(\w+)(?:[?*])?(.*)/),ie=se[1];P.push(W[ie]),P.push(se[2]||""),delete W[ie]}}),P.join("")}}]}S.$inject=["$injector"];function S(Z){E&&Z.get("$route")}o.provider("$routeParams",w);function w(){this.$get=function(){return{}}}o.directive("ngView",te),o.directive("ngView",ne),te.$inject=["$route","$anchorScroll","$animate"];function te(Z,ee,B){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(K,T,ae,ge,X){var ce,pe,N,ue=ae.autoscroll,F=ae.onload||"";K.$on("$routeChangeSuccess",O),O();function me(){N&&(B.cancel(N),N=null),ce&&(ce.$destroy(),ce=null),pe&&(N=B.leave(pe),N.done(function(le){le!==!1&&(N=null)}),pe=null)}function O(){var le=Z.current&&Z.current.locals,re=le&&le.$template;if(A.isDefined(re)){var z=K.$new(),q=Z.current,Ce=X(z,function(ve){B.enter(ve,null,pe||T).done(function(Ne){Ne!==!1&&A.isDefined(ue)&&(!ue||K.$eval(ue))&&ee()}),me()});pe=Ce,ce=q.scope=z,ce.$emit("$viewContentLoaded"),ce.$eval(F)}else me()}}}}ne.$inject=["$compile","$controller","$route"];function ne(Z,ee,B){return{restrict:"ECA",priority:-400,link:function(K,T){var ae=B.current,ge=ae.locals;T.html(ge.$template);var X=Z(T.contents());if(ae.controller){ge.$scope=K;var ce=ee(ae.controller,ge);ae.controllerAs&&(K[ae.controllerAs]=ce),T.data("$ngControllerController",ce),T.children().data("$ngControllerController",ce)}K[ae.resolveAs||"$resolve"]=ge,X(K)}}}})(window,window.angular)},23345:(u,A,a)=>{a(32747),u.exports="ngRoute"},81221:()=>{/**
 * @license AngularJS v1.8.3
 * (c) 2010-2020 Google LLC. http://angularjs.org
 * License: MIT
 */(function(u,A){"use strict";var a=A.$$minErr("$sanitize"),s,l,f,g,C,o,h,E,p,S;function w(){var ne=!1,Z=!1;this.$get=["$$sanitizeUri",function(P){return ne=!0,Z&&l(ue,pe),function(H){var J=[];return p(H,S(J,function(se,ie){return!/^unsafe:/.test(P(se,ie))})),J.join("")}}],this.enableSvg=function(P){return C(P)?(Z=P,this):Z},this.addValidElements=function(P){return ne||(g(P)&&(P={htmlElements:P}),q(pe,P.svgElements),q(K,P.htmlVoidElements),q(ue,P.htmlVoidElements),q(ue,P.htmlElements)),this},this.addValidAttrs=function(P){return ne||l(le,z(P,!0)),this},s=A.bind,l=A.extend,f=A.forEach,g=A.isArray,C=A.isDefined,o=A.$$lowercase,h=A.noop,p=ve,S=ke,E=u.Node.prototype.contains||function(P){return!!(this.compareDocumentPosition(P)&16)};var ee=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,B=/([^#-~ |!])/g,K=re("area,br,col,hr,img,wbr"),T=re("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),ae=re("rp,rt"),ge=l({},ae,T),X=l({},T,re("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul")),ce=l({},ae,re("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var")),pe=re("circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,stop,svg,switch,text,title,tspan"),N=re("script,style"),ue=l({},K,X,ce,ge),F=re("background,cite,href,longdesc,src,xlink:href,xml:base"),me=re("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,valign,value,vspace,width"),O=re("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan",!0),le=l({},F,O,me);function re(P,H){return z(P.split(","),H)}function z(P,H){var J={},se;for(se=0;se<P.length;se++)J[H?o(P[se]):P[se]]=!0;return J}function q(P,H){H&&H.length&&l(P,z(H))}var Ce=function(P,H){if(ie())return be;if(!H||!H.implementation)throw a("noinert","Can't create an inert html document");var J=H.implementation.createHTMLDocument("inert"),se=(J.documentElement||J.getDocumentElement()).querySelector("body");return j;function ie(){try{return!!be("")}catch{return!1}}function be(he){he="<remove></remove>"+he;try{var U=new P.DOMParser().parseFromString(he,"text/html").body;return U.firstChild.remove(),U}catch{return}}function j(he){return se.innerHTML=he,H.documentMode&&V(se),se}}(u,u.document);function ve(P,H){P==null?P="":typeof P!="string"&&(P=""+P);var J=Ce(P);if(!J)return"";var se=5;do{if(se===0)throw a("uinput","Failed to sanitize html because the input is unstable");se--,P=J.innerHTML,J=Ce(P)}while(P!==J.innerHTML);for(var ie=J.firstChild;ie;){switch(ie.nodeType){case 1:H.start(ie.nodeName.toLowerCase(),De(ie.attributes));break;case 3:H.chars(ie.textContent);break}var be;if(!(be=ie.firstChild)&&(ie.nodeType===1&&H.end(ie.nodeName.toLowerCase()),be=W("nextSibling",ie),!be))for(;be==null&&(ie=W("parentNode",ie),ie!==J);)be=W("nextSibling",ie),ie.nodeType===1&&H.end(ie.nodeName.toLowerCase());ie=be}for(;ie=J.firstChild;)J.removeChild(ie)}function De(P){for(var H={},J=0,se=P.length;J<se;J++){var ie=P[J];H[ie.name]=ie.value}return H}function Ne(P){return P.replace(/&/g,"&amp;").replace(ee,function(H){var J=H.charCodeAt(0),se=H.charCodeAt(1);return"&#"+((J-55296)*1024+(se-56320)+65536)+";"}).replace(B,function(H){return"&#"+H.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ke(P,H){var J=!1,se=s(P,P.push);return{start:function(ie,be){ie=o(ie),!J&&N[ie]&&(J=ie),!J&&ue[ie]===!0&&(se("<"),se(ie),f(be,function(j,he){var U=o(he),Ue=ie==="img"&&U==="src"||U==="background";le[U]===!0&&(F[U]!==!0||H(j,Ue))&&(se(" "),se(he),se('="'),se(Ne(j)),se('"'))}),se(">"))},end:function(ie){ie=o(ie),!J&&ue[ie]===!0&&K[ie]!==!0&&(se("</"),se(ie),se(">")),ie==J&&(J=!1)},chars:function(ie){J||se(Ne(ie))}}}function V(P){for(;P;){if(P.nodeType===u.Node.ELEMENT_NODE)for(var H=P.attributes,J=0,se=H.length;J<se;J++){var ie=H[J],be=ie.name.toLowerCase();(be==="xmlns:ns1"||be.lastIndexOf("ns1:",0)===0)&&(P.removeAttributeNode(ie),J--,se--)}var j=P.firstChild;j&&V(j),P=W("nextSibling",P)}}function W(P,H){var J=H[P];if(J&&E.call(H,J))throw a("elclob","Failed to sanitize html because the element is clobbered: {0}",H.outerHTML||H.outerText);return J}}function te(ne){var Z=[],ee=S(Z,h);return ee.chars(ne),Z.join("")}A.module("ngSanitize",[]).provider("$sanitize",w).info({angularVersion:"1.8.3"}),A.module("ngSanitize").filter("linky",["$sanitize",function(ne){var Z=/((s?ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i,ee=/^mailto:/i,B=A.$$minErr("linky"),K=A.isDefined,T=A.isFunction,ae=A.isObject,ge=A.isString;return function(X,ce,pe){if(X==null||X==="")return X;if(!ge(X))throw B("notstring","Expected string but received: {0}",X);for(var N=T(pe)?pe:ae(pe)?function(){return pe}:function(){return{}},ue,F=X,me=[],O,le;ue=F.match(Z);)O=ue[0],!ue[2]&&!ue[4]&&(O=(ue[3]?"http://":"mailto:")+O),le=ue.index,re(F.substr(0,le)),z(O,ue[0].replace(ee,"")),F=F.substring(le+ue[0].length);return re(F),ne(me.join(""));function re(q){q&&me.push(te(q))}function z(q,Ce){var ve,De=N(q);me.push("<a ");for(ve in De)me.push(ve+'="'+De[ve]+'" ');K(ce)&&!("target"in De)&&me.push('target="',ce,'" '),me.push('href="',q.replace(/"/g,"&quot;"),'">'),re(Ce),me.push("</a>")}}}])})(window,window.angular)},26415:(u,A,a)=>{a(81221),u.exports="ngSanitize"},12582:u=>{"use strict";function A(a){var s=this,l;if(this._au)return;function f(){s.root[s.origin.offset]?C():g()}function g(){l||(l=setInterval(function(){s.root[s.origin.offset]&&(C(),s.update())},300))}function C(){clearInterval(l),l=null}var o=s._debounce(function(){s.update()},300);this._observer=new a(function(){f(),s.update(),o()}),this.on("init",function(){s._observer.observe(s.root,{childList:!0,subtree:!0,characterData:!0}),f()}),this.on("dispose",function(){s._observer.disconnect(),C(),delete s._observer}),this._au=!0}u.exports=function(s){var l=s.MutationObserver||s.WebKitMutationObserver||s.MozMutationObserver||null;return function(){return l?(A.call(this,l),this):this}}},69786:(u,A,a)=>{"use strict";var s=a(69079).qs;u.exports=function(f){var g,C,o,h,E=this,p;h=f.screen||.9,f.forward&&(g=s(f.forward,this.clipper),p={element:g,handler:function(){var S=E.pos()+(f.delta||30);E.pos(S)},type:"click"},this._eventHandlers.push(p),this.event(p.element,p.type,p.handler,"on")),f.backward&&(C=s(f.backward,this.clipper),p={element:C,handler:function(){var S=E.pos()-(f.delta||30);E.pos(S)},type:"click"},this._eventHandlers.push(p),this.event(p.element,p.type,p.handler,"on")),f.track&&(f.track===!0?o=this.track:o=s(f.track,this.clipper),o&&(p={element:o,handler:function(S){if(S.target==o){var w=S["offset"+E.origin.x],te=E.bar[E.origin.offsetPos],ne=0;w<te?ne=-1:w>te+E.bar[E.origin.offset]&&(ne=1);var Z=E.pos()+ne*h*E.scroller[E.origin.client];E.pos(Z)}},type:"mousedown"},this._eventHandlers.push(p),this.event(p.element,p.type,p.handler,"on")))}},92747:(u,A,a)=>{"use strict";var s=function(){return this||(0,eval)("this")}(),l=s&&s.window||s,f=a(69079).f0,g=a(69079).AH,C=a(69079).WQ,o=a(69079).zy,h=a(69079).rm,E=a(69079).o8,p=a(69079).qs,S=X,w=["left","top","right","bottom","width","height"],te=[],ne={v:{x:"Y",pos:w[1],oppos:w[3],crossPos:w[0],crossOpPos:w[2],size:w[5],crossSize:w[4],crossMinSize:"min-"+w[4],crossMaxSize:"max-"+w[4],client:"clientHeight",crossClient:"clientWidth",scrollEdge:"scrollLeft",offset:"offsetHeight",crossOffset:"offsetWidth",offsetPos:"offsetTop",scroll:"scrollTop",scrollSize:"scrollHeight"},h:{x:"X",pos:w[0],oppos:w[2],crossPos:w[1],crossOpPos:w[3],size:w[4],crossSize:w[5],crossMinSize:"min-"+w[5],crossMaxSize:"max-"+w[5],client:"clientWidth",crossClient:"clientHeight",scrollEdge:"scrollTop",offset:"offsetWidth",crossOffset:"offsetHeight",offsetPos:"offsetLeft",scroll:"scrollLeft",scrollSize:"scrollWidth"}},Z=17,ee=15,B=/[\s\S]*Macintosh[\s\S]*\) Gecko[\s\S]*/,K=B.test(l.navigator&&l.navigator.userAgent),T,ae,ge;function X(O){var le=!!O,re=O&&O[0]||O,z=typeof O=="string"||re instanceof HTMLElement,q=z?{root:O}:E(O),Ce,ve,De={direction:"v",barOnCls:"_scrollbar",resizeDebounce:0,event:f,cssGuru:!1,impact:"scroller",position:"static"};q=q||{};for(var Ne in De)q[Ne]==null&&(q[Ne]=De[Ne]);Ce=this&&this instanceof l.jQuery,q._chain?ve=q.root:Ce?q.root=ve=this[0]:ve=p(q.root||q.scroller);var ke=ue(ve,q.direction),V=+ke;if(q.index=V,V==V&&ke!==null&&te[V])return te[V];q.root&&q.scroller?q.scroller=p(q.scroller,ve):q.scroller=ve,q.root=ve;var W=F(q);return W.autoUpdate&&W.autoUpdate(),W}function ce(O,le){var re=0,z=O;for((z.length===void 0||z===l)&&(z=[z]);z[re];)le.call(this,z[re],re),re++}function pe(){return new Date().getTime()}function N(O,le,re){O._eventHandlers=O._eventHandlers||[{element:O.scroller,handler:function(z){O.scroll(z)},type:"scroll"},{element:O.root,handler:function(){O.update()},type:"transitionend animationend"},{element:O.scroller,handler:function(){O.update()},type:"keyup"},{element:O.bar,handler:function(z){z.preventDefault(),O.selection(),O.drag.now=1,O.draggingCls&&C(O.root,O.draggingCls)},type:"touchstart mousedown"},{element:document,handler:function(){O.selection(1),O.drag.now=0,O.draggingCls&&h(O.root,O.draggingCls)},type:"mouseup blur touchend"},{element:document,handler:function(z){z.button!=2&&O._pos0(z)},type:"touchstart mousedown"},{element:document,handler:function(z){O.drag.now&&O.drag(z)},type:"mousemove touchmove"},{element:l,handler:function(){O.update()},type:"resize"},{element:O.root,handler:function(){O.update()},type:"sizeChange"},{element:O.clipper,handler:function(){O.clipperOnScroll()},type:"scroll"}],ce(O._eventHandlers,function(z){if(z.element)if(z.element.length&&z.element!==l)for(var q=0;q<z.element.length;q++)le(z.element[q],z.type,z.handler,re);else le(z.element,z.type,z.handler,re)})}function ue(O,le,re,z){var q="data-baron-"+le+"-id";return re=="on"?O.setAttribute(q,z):re=="off"&&O.removeAttribute(q),O.getAttribute(q)}function F(O){var le=new X.prototype.constructor(O);return N(le,O.event,"on"),ue(le.root,O.direction,"on",te.length),te.push(le),le.update(),le}function me(O){if(this.events&&this.events[O])for(var le=0;le<this.events[O].length;le++){var re=Array.prototype.slice.call(arguments,1);this.events[O][le].apply(this,re)}}X.prototype={_debounce:function(O,le){var re=this,z,q,Ce=function(){if(re._disposed){clearTimeout(z),z=re=null;return}var ve=pe()-q;ve<le&&ve>=0?z=setTimeout(Ce,le-ve):(z=null,O())};return function(){q=pe(),z||(z=setTimeout(Ce,le))}},constructor:function(O){var le,re,z,q,Ce,ve,De;ve=pe(),this.params=O,this.event=O.event,this.events={},this.root=O.root,this.scroller=p(O.scroller),this.bar=p(O.bar,this.root),z=this.track=p(O.track,this.root),!this.track&&this.bar&&(z=this.bar.parentNode),this.clipper=this.scroller.parentNode,this.direction=O.direction,this.rtl=O.rtl,this.origin=ne[this.direction],this.barOnCls=O.barOnCls,this.scrollingCls=O.scrollingCls,this.draggingCls=O.draggingCls,this.impact=O.impact,this.position=O.position,this.rtl=O.rtl,this.barTopLimit=0,this.resizeDebounce=O.resizeDebounce;function Ne(j){var he=this.barMinSize||20,U=j;U>0&&U<he&&(U=he),this.bar&&g(this.bar,this.origin.size,parseInt(U,10)+"px")}function ke(j){if(this.bar){var he=g(this.bar,this.origin.pos),U=+j+"px";U&&U!=he&&g(this.bar,this.origin.pos,U)}}function V(){return z[this.origin.client]-this.barTopLimit-this.bar[this.origin.offset]}function W(j){return j*V.call(this)+this.barTopLimit}function P(j){return(j-this.barTopLimit)/V.call(this)}this.cursor=function(j){return j["client"+this.origin.x]||(((j.originalEvent||j).touches||{})[0]||{})["page"+this.origin.x]};function H(){return!1}if(this.pos=function(j){var he="page"+this.origin.x+"Offset",U=this.scroller[he]?he:this.origin.scroll;return j!==void 0&&(this.scroller[U]=j),this.scroller[U]},this.rpos=function(j){var he=this.scroller[this.origin.scrollSize]-this.scroller[this.origin.client],U;return j?U=this.pos(j*he):U=this.pos(),U/(he||1)},this.barOn=function(j){if(this.barOnCls){var he=this.scroller[this.origin.client]>=this.scroller[this.origin.scrollSize];j||he?o(this.root,this.barOnCls)&&h(this.root,this.barOnCls):o(this.root,this.barOnCls)||C(this.root,this.barOnCls)}},this._pos0=function(j){re=this.cursor(j)-le},this.drag=function(j){var he=P.call(this,this.cursor(j)-re),U=this.scroller[this.origin.scrollSize]-this.scroller[this.origin.client];this.scroller[this.origin.scroll]=he*U},this.selection=function(j){this.event(document,"selectpos selectstart",H,j?"off":"on")},this.resize=function(){var j=this,he=j.resizeDebounce===void 0?300:j.resizeDebounce,U=0;pe()-ve<he&&(clearTimeout(q),U=he);function Ue(){var Ge=j.scroller[j.origin.crossOffset],Se=j.scroller[j.origin.crossClient],et=0,He,Fe;if(K?et=ee:Se>0&&Ge===0&&(Ge=Se+Z),Ge)if(j.barOn(),j.impact=="scroller"){var tt=Ge-Se+et;if(j.position=="static")He=g(j.scroller,j.origin.crossSize),Fe=j.clipper[j.origin.crossClient]+tt+"px",He!=Fe&&j._setCrossSizes(j.scroller,Fe);else{var nt={},it=j.rtl?"Left":"Right";j.direction=="h"&&(it="Bottom"),nt["padding"+it]=tt+"px",g(j.scroller,nt)}}else He=g(j.clipper,j.origin.crossSize),Fe=Se+"px",He!=Fe&&j._setCrossSizes(j.clipper,Fe);Array.prototype.unshift.call(arguments,"resize"),me.apply(j,arguments),ve=pe()}U?q=setTimeout(Ue,U):Ue()},this.updatePositions=function(j){var he,U=this;U.bar&&(he=(z[U.origin.client]-U.barTopLimit)*U.scroller[U.origin.client]/U.scroller[U.origin.scrollSize],(j||parseInt(De,10)!=parseInt(he,10))&&(Ne.call(U,he),De=he),le=W.call(U,U.rpos()),ke.call(U,le)),Array.prototype.unshift.call(arguments,"scroll"),me.apply(U,arguments)},this.scroll=function(){var j=this;j.updatePositions(),j.scrollingCls&&(Ce||C(j.root,j.scrollingCls),clearTimeout(Ce),Ce=setTimeout(function(){h(j.root,j.scrollingCls),Ce=void 0},300))},this.clipperOnScroll=function(){this.rtl?this.clipper[this.origin.scrollEdge]=this.clipper[this.origin.scrollSize]:this.clipper[this.origin.scrollEdge]=0},this._setCrossSizes=function(j,he){var U={};U[this.origin.crossSize]=he,U[this.origin.crossMinSize]=he,U[this.origin.crossMaxSize]=he,g(j,U)},this._dumbCss=function(j){if(!O.cssGuru){var he=j?"hidden":null,U=j?"none":null;g(this.clipper,{overflow:he,msOverflowStyle:U,position:this.position=="static"?"":"relative"});var Ue=j?"scroll":null,Ge=this.direction=="v"?"y":"x",Se={};Se["overflow-"+Ge]=Ue,Se["box-sizing"]="border-box",Se.margin="0",Se.border="0",this.position=="absolute"&&(Se.position="absolute",Se.top="0",this.direction=="h"?Se.left=Se.right="0":(Se.bottom="0",Se.right=this.rtl?"0":"",Se.left=this.rtl?"":"0")),g(this.scroller,Se)}},this._dumbCss(!0),K){var J="paddingRight",se={},ie=l.getComputedStyle(this.scroller)[[J]];O.direction=="h"?J="paddingBottom":O.rtl&&(J="paddingLeft");var be=parseInt(ie,10);be!=be&&(be=0),se[J]=ee+be+"px",g(this.scroller,se)}return this},update:function(O){return me.call(this,"upd",O),this.resize(1),this.updatePositions(1),this},dispose:function(){N(this,this.event,"off"),ue(this.root,this.params.direction,"off"),this.params.direction=="v"?this._setCrossSizes(this.scroller,""):this._setCrossSizes(this.clipper,""),this._dumbCss(!1),this.barOn(!0),me.call(this,"dispose"),te[this.params.index]=null,this.params=null,this._disposed=!0},on:function(O,le,re){for(var z=O.split(" "),q=0;q<z.length;q++)z[q]=="init"?le.call(this,re):(this.events[z[q]]=this.events[z[q]]||[],this.events[z[q]].push(function(Ce){le.call(this,Ce||re)}))},baron:function(O){return O.root=this.params.root,O.scroller=this.params.scroller,O.direction=this.params.direction=="v"?"h":"v",O._chain=!0,X(O)}},X.prototype.constructor.prototype=X.prototype,X.noConflict=function(){return l.baron=S,X},X.version="3.0.1",X.prototype.autoUpdate=a(12582)(l),X.prototype.fix=a(41197),X.prototype.controls=a(69786),u.exports=X},41197:(u,A,a)=>{"use strict";var s=a(37420),l=a(69079).AH,f=a(69079).WQ,g=a(69079).rm;u.exports=function(o){var h,E,p={outside:"",inside:"",before:"",after:"",past:"",future:"",radius:0,minView:0},S=[],w=[],te=[],ne=this.scroller,Z=this.event,ee=this;function B(X,ce,pe){var N=ce,ue=pe==1?"pos":"oppos";E<(p.minView||0)&&(N=void 0),l(h[X],this.origin.pos,""),l(h[X],this.origin.oppos,""),g(h[X],p.outside),N!==void 0&&(N+="px",l(h[X],this.origin[ue],N),f(h[X],p.outside))}function K(X){try{var ce=document.createEvent("WheelEvent");ce.initWebKitWheelEvent(X.originalEvent.wheelDeltaX,X.originalEvent.wheelDeltaY),ne.dispatchEvent(ce),X.preventDefault()}catch{}}function T(X){var ce;for(var pe in X)p[pe]=X[pe];if(p.elements instanceof HTMLElement?h=[p.elements]:typeof p.elements=="string"?h=this.scroller.querySelectorAll(p.elements):p.elements&&p.elements[0]instanceof HTMLElement&&(h=p.elements),h){E=this.scroller[this.origin.client];for(var N=0;N<h.length;N++)ce={},ce[this.origin.size]=h[N][this.origin.offset]+"px",h[N].parentNode!==this.scroller&&l(h[N].parentNode,ce),ce={},ce[this.origin.crossSize]=h[N].parentNode[this.origin.crossClient]+"px",l(h[N],ce),E-=h[N][this.origin.offset],te[N]=h[N].parentNode[this.origin.offsetPos],S[N]=S[N-1]||0,w[N]=w[N-1]||Math.min(te[N],0),h[N-1]&&(S[N]+=h[N-1][this.origin.offset],w[N]+=h[N-1][this.origin.offset]),N==0&&te[N]==0||(this.event(h[N],"mousewheel",K,"off"),this.event(h[N],"mousewheel",K));p.limiter&&h[0]&&(this.track&&this.track!=this.scroller?(ce={},ce[this.origin.pos]=h[0].parentNode[this.origin.offset]+"px",l(this.track,ce)):this.barTopLimit=h[0].parentNode[this.origin.offset],this.scroll()),p.limiter===!1&&(this.barTopLimit=0)}var ue={element:h,handler:function(){for(var me=this.parentNode,O=me.offsetTop,le,re=0;re<h.length;re++)h[re]===this&&(le=re);var z=O-S[le];p.scroll?p.scroll({x1:ee.scroller.scrollTop,x2:z}):ee.scroller.scrollTop=z},type:"click"};if(p.clickable){this._eventHandlers.push(ue);for(var F=0;F<ue.element.length;F++)Z(ue.element[F],ue.type,ue.handler,"on")}}this.on("init",T,o);var ae=[],ge=[];return this.on("init scroll",function(){var X,ce,pe,N;if(h){var ue;for(N=0;N<h.length;N++)X=0,te[N]-this.pos()<w[N]+p.radius?(X=1,ce=S[N]):te[N]-this.pos()>w[N]+E-p.radius?(X=2,ce=this.scroller[this.origin.client]-h[N][this.origin.offset]-S[N]-E):(X=3,ce=void 0),pe=!1,(te[N]-this.pos()<w[N]||te[N]-this.pos()>w[N]+E)&&(pe=!0),(X!=ae[N]||pe!=ge[N])&&(B.call(this,N,ce,X),ae[N]=X,ge[N]=pe,ue=!0);if(ue)for(N=0;N<h.length;N++)ae[N]==1&&p.past&&(f(h[N],p.past),g(h[N],p.future)),ae[N]==2&&p.future&&(f(h[N],p.future),g(h[N],p.past)),ae[N]==3&&(g(h[N],p.past),g(h[N],p.future),f(h[N],p.inside)),ae[N]!=ae[N+1]&&ae[N]==1?(f(h[N],p.before),g(h[N],p.after)):ae[N]!=ae[N-1]&&ae[N]==2?(f(h[N],p.after),g(h[N],p.before)):(g(h[N],p.before),g(h[N],p.after)),p.grad&&(ge[N]?f(h[N],p.grad):g(h[N],p.grad))}}),this.on("resize upd",function(X){T.call(this,X&&X.fix)}),this}},37420:u=>{u.exports=function(a,s,l){var f=console[a]||console.log,g=["Baron: "+s,l];Function.prototype.apply.call(f,console,g)}},69079:u=>{"use strict";var A,a=!1;try{var s=Object.defineProperty({},"passive",{get:function(){a=!0}});window.addEventListener("test",null,s)}catch{}u.exports.f0=function(g,C,o,h){var E=C.split(" "),p=h=="on"?"add":"remove";E.forEach(function(S){var w=!1;["scroll","touchstart","touchmove"].indexOf(S)!=-1&&a&&(w={passive:!0}),g[p+"EventListener"](S,o,w)})};function l(f,g){for(var C in f)f.hasOwnProperty(C)&&g(C,f[C])}u.exports.AH=function(g,C,o){var h;if(o===void 0){if(typeof C=="string")return g.style[C];h=C}else h={},h[C]=o;l(h,function(E,p){g.style[E]=p})},u.exports.WQ=function(g,C){C&&g.classList.add(C)},u.exports.rm=function(g,C){C&&g.classList.remove(C)},u.exports.zy=function(g,C){return C?g.classList.contains(C):!1},u.exports.o8=function(g){var C={},o=g||{};return l(o,function(h,E){C[h]=E}),C},u.exports.qs=function(g,C){if(g instanceof HTMLElement)return g;var o=C||document;return o.querySelector(g)},A=l},29978:(u,A,a)=>{"use strict";a.d(A,{AngularApp:()=>Zr});var s=a(92747),l=a.n(s),f=a(64423),g=a(52718),C=a(86833),o=a(66308),h=a(91830);const E=`
  <ng-transclude class="panel-height-helper"></ng-transclude>
`;o.m7.directive("grafanaPanel",["$timeout",t=>({restrict:"E",template:E,transclude:!0,scope:{ctrl:"="},link:(e,i)=>{const n=e.ctrl,r=e.ctrl.panel,c=new f.yU;let d;function m(){d&&d.update()}n.events.on(g.ee.componentDidMount,()=>{if(n.__proto__.constructor.scrollable){const b="baron baron__root baron__clipper panel-content--scrollable",D="baron__scroller",v=`
            <div class="baron__track">
              <div class="baron__bar"></div>
            </div>
          `,M=i,L=i.find(":first").find(":first");M.addClass(b),$(v).appendTo(M),L.addClass(D),d=l()({root:M[0],scroller:L[0],bar:".baron__bar",barOnCls:"_scrollbar",scrollingCls:"_scrolling"}),d.scroll()}});function y(){n.height=e.$parent.$parent.size.height,n.width=e.$parent.$parent.size.width}y(),c.add(r.events.subscribe(C._,()=>{y(),n.events.emit("refresh")})),c.add(r.events.subscribe(h.XM,b=>{b.payload?.fromAngular||(y(),t(()=>{m(),n.events.emit("render")}))})),c.add(n.events.subscribe(h.XM,b=>{b.payload&&(b.payload.fromAngular=!0,r.events.publish(b))})),e.$on("$destroy",()=>{i.off(),c.unsubscribe(),n.events.emit(g.ee.panelTeardown),n.events.removeAllListeners(),d&&d.dispose()}),r.events.publish(h.vk)}})]);var p=a(34757),S=a(7025),w=a.n(S);const te=w().module("grafana.directives"),ne={};te.directive("panelEditorTab",["dynamicDirectiveSrv",Z]);function Z(t){return t.create({scope:{ctrl:"=",editorTab:"="},directive:e=>{const i=e.ctrl.pluginId,n=e.editorTab.title.toLowerCase().replace(" ","-").replace("&","").replace(" ","").replace(" ","-");if(ne[i]){if(ne[i][n])return ne[i][n]}else ne[i]=[];const r={fn:()=>e.editorTab.directiveFn(),name:`panel-editor-tab-${i}${n}`};return ne[i][n]=r,r}})}class ee{constructor(){this.hasTextEditMode=!1}$onInit(){this.panelCtrl=this.queryCtrl.panelCtrl,this.target=this.queryCtrl.target,this.panel=this.panelCtrl.panel,this.hasTextEditMode&&this.queryCtrl.toggleEditorMode&&(this.panelCtrl.toggleEditorMode=this.queryCtrl.toggleEditorMode.bind(this.queryCtrl)),this.queryCtrl.getCollapsedText&&(this.panelCtrl.getCollapsedText=this.queryCtrl.getCollapsedText.bind(this.queryCtrl))}}o.m7.directive("queryEditorRow",B);function B(){return{restrict:"E",controller:ee,bindToController:!0,controllerAs:"ctrl",templateUrl:"public/app/angular/panel/partials/query_editor_row.html",transclude:!0,scope:{queryCtrl:"=",canCollapse:"=",hasTextEditMode:"="}}}var K=a(96320),T=a(2543),ae=a.n(T),ge=a(3202),X=a(84395);o.Ay.filter("stringSort",()=>t=>t.sort()),o.Ay.filter("slice",()=>(t,e,i)=>(0,T.isUndefined)(t)?t:t.slice(e,i)),o.Ay.filter("stringify",()=>t=>(0,T.isObject)(t)&&!(0,T.isArray)(t)?w().toJson(t):(0,T.isNull)(t)?null:t.toString()),o.Ay.filter("moment",()=>(t,e)=>{switch(e){case"ago":return(0,ge.KQ)(t).fromNow()}return(0,ge.KQ)(t).fromNow()});function ce(t=(0,X.w)()){const e=(i,n)=>{let r;return n.ctrl?r=(n.ctrl.panel||n.ctrl.row).scopedVars:r=n.row.scopedVars,t.replaceWithText(i,r)};return e.$stateful=!0,e}o.Ay.filter("interpolateTemplateVars",ce);const pe={};class N{constructor(){}set(){console.warn("old deprecated alert srv being used")}}o.Ay.service("alertSrv",N);class ue{constructor(e){this.$compile=e}static{this.$inject=["$compile"]}addDirective(e,i,n){const r=w().element(document.createElement(i));this.$compile(r)(n),e.empty(),e.append(r)}link(e,i,n,r){const c=r.directive(e);if(!c||!c.fn){i.empty();return}c.fn.registered||(o.Ay.directive(n.$normalize(c.name),c.fn),c.fn.registered=!0),this.addDirective(i,c.name,e)}create(e){return{restrict:"E",scope:e.scope,link:(n,r,c)=>{if(e.watchPath){let d=null;n.$watch(e.watchPath,()=>{d&&d.$destroy(),d=n.$new(),this.link(d,r,c,e)})}else this.link(n,r,c,e)}}}}o.Ay.service("dynamicDirectiveSrv",ue);var F=a(96540),me=a(5338);function O(t,e){if(w().isFunction(t))return t;if(!t)throw new Error("ReactComponent name attribute must be specified");let i;try{i=e.get(t)}catch{}if(!i)try{i=t.split(".").reduce((n,r)=>n[r],window)}catch{}if(!i)throw Error("Cannot find react component "+t);return i}function le(t,e){if(t.wrappedInApply)return t;const i=function(){const n=arguments,r=e.$root.$$phase;return r==="$apply"||r==="$digest"?t.apply(null,n):e.$apply(()=>t.apply(null,n))};return i.wrappedInApply=!0,i}function re(t,e,i){return Object.keys(t||{}).reduce((n,r)=>{const c=t[r],d=(i||{})[r]||{};return n[r]=w().isFunction(c)&&d.wrapApply!==!1?le(c,e):c,n},{})}function z(t,e,i,n){const r=w().isFunction(e.$watchCollection),c=w().isFunction(e.$watchGroup),d=[];for(const m of i){const y=De(m),b=ke(t,m);!y||y.match(/\(.*\)/)||b==="one-time"||(b==="collection"&&r?e.$watchCollection(y,n):b==="reference"&&c?d.push(y):e.$watch(y,n,b!=="reference"))}t==="one-time"&&n(),d.length&&e.$watchGroup(d,n)}function q(t,e,i,n){i.$evalAsync(()=>{n.render(F.createElement(t,e))})}function Ce(t){return Array.isArray(t)?t[0]:t}function ve(t){return Array.isArray(t)?t[1]:{}}function De(t){return Array.isArray(t)?t[0]:t}function Ne(t,e){const i=Object.keys(t).find(n=>n.toLowerCase()===e.toLowerCase()||(0,T.kebabCase)(n)===(0,T.kebabCase)(e));return t[i]}function ke(t,e){return Array.isArray(e)&&w().isObject(e[1])&&e[1].watchDepth||t}const V=t=>({restrict:"E",replace:!0,link:function(e,i,n){const r=O(n.name,t),c=(0,me.H)(i[0]),d=()=>{const m=e.$eval(n.props),y=re(m,e);q(r,y,e,c)};n.props?z(n.watchDepth,e,[n.props],d):d(),e.$on("$destroy",()=>{n.onScopeDestroy?e.$eval(n.onScopeDestroy,{unmountComponent:c.unmount.bind(this)}):c.unmount()})}}),W=t=>(e,i,n,r)=>{const c={restrict:"E",replace:!0,link:function(d,m,y){const b=O(e,t),D=(0,me.H)(m[0]);i=i||Object.keys(b.propTypes||{});const v=()=>{let L={};const G={};i.forEach(de=>{const k=Ce(de);L[k]=d.$eval(Ne(y,k)),G[k]=ve(de)}),L=re(L,d,G),L=w().extend({},L,r),q(b,L,d,D)},M=i.map(L=>Array.isArray(L)?[Ne(y,L[0]),ve(L)]:Ne(y,L));i.length?z(y.watchDepth,d,M,v):v(),d.$on("$destroy",()=>{y.onScopeDestroy?d.$eval(y.onScopeDestroy,{unmountComponent:D.unmount.bind(this)}):D.unmount()})}};return w().extend(c,n)},P=w().module("react",[]);P.directive("reactComponent",["$injector",V]),P.factory("reactDirective",["$injector",W]),o.Ay.service("uiSegmentSrv",["$sce","templateSrv",H]);function H(t,e){const i=this;class n{constructor(c){if(c==="*"||c.value==="*"){this.value="*",this.html=t.trustAsHtml('<i class="fa fa-asterisk"><i>'),this.type=c.type,this.expandable=!0;return}if((0,T.isString)(c)){this.value=c,this.html=t.trustAsHtml(e.highlightVariablesAsHtml(this.value));return}this.text=c.value,this.cssClass=c.cssClass,this.custom=c.custom,this.type=c.type,this.fake=c.fake,this.value=c.value,this.selectMode=c.selectMode,this.expandable=c.expandable,this.html=c.html||t.trustAsHtml(e.highlightVariablesAsHtml(this.value))}}this.getSegmentForValue=function(r,c){return r?this.newSegment(r):this.newSegment({value:c,fake:!0})},this.newSelectMeasurement=()=>new n({value:"select measurement",fake:!0}),this.newFake=(r,c,d)=>new n({value:r,fake:!0,type:c,cssClass:d}),this.newSegment=r=>new n(r),this.newKey=r=>new n({value:r,type:"key",cssClass:"query-segment-key"}),this.newKeyValue=r=>new n({value:r,type:"value",cssClass:"query-segment-value"}),this.newCondition=r=>new n({value:r,type:"condition",cssClass:"query-keyword"}),this.newOperator=r=>new n({value:r,type:"operator",cssClass:"query-segment-operator"}),this.newOperators=r=>(0,T.map)(r,c=>new n({value:c,type:"operator",cssClass:"query-segment-operator"})),this.transformToSegments=(r,c)=>d=>{const m=(0,T.map)(d,y=>i.newSegment({value:y.text,expandable:y.expandable}));return r&&(0,T.each)(e.getVariables(),y=>{(c===void 0||c===y.type)&&m.unshift(i.newSegment({type:"value",value:"$"+y.name,expandable:!0}))}),m},this.newSelectMetric=()=>new n({value:"select metric",fake:!0}),this.newPlusButton=()=>new n({fake:!0,html:'<i class="fa fa-plus "></i>',type:"plus-button",cssClass:"query-part"})}var J=a(66899),se=a.n(J);o.Ay.service("popoverSrv",["$compile","$rootScope","$timeout",ie]);function ie(t,e,i){let n=null;this.close=()=>{n&&n.close()},this.show=r=>{n&&(n.close(),n=null);const c=(0,T.extend)(e.$new(!0),r.model);let d;const m=()=>{setTimeout(()=>{c.$destroy(),d.tether&&d.destroy(),r.onClose&&r.onClose()}),n=null};c.dismiss=()=>{d.close()};const y=document.createElement("div");return y.innerHTML=r.template,t(y)(c),i(()=>{d=new(se())({target:r.element,content:y,position:r.position,classes:r.classNames||"drop-popover",openOn:r.openOn,hoverCloseDelay:200,tetherOptions:{constraints:[{to:"scrollParent",attachment:"together"}]}}),d.on("close",()=>{m()}),n=d,n.open()},100),()=>{d&&d.close()}}}class be{constructor(e){this.$timeout=e,this.timers=[]}static{this.$inject=["$timeout"]}register(e){return this.timers.push(e),e}cancel(e){this.timers=(0,T.without)(this.timers,e),this.$timeout.cancel(e)}cancelAll(){(0,T.each)(this.timers,e=>{this.$timeout.cancel(e)}),this.timers=[]}}o.Ay.service("timer",be);class j{constructor(e,i){this.$compile=e,this.$rootScope=i}static{this.$inject=["$compile","$rootScope"]}load(e,i,n){const r=this.$rootScope.$new();(0,T.assign)(r,i);const c=this.$compile(n)(r);return w().element(e).append(c),{destroy:()=>{r.$destroy(),c.remove()},digest:()=>{r.$$phase||r.$digest()},getScope:()=>r}}}o.Ay.service("angularLoader",j);var he=a(34796),U=a.n(he);const Ue=U()(window);U().fn.place_tt=(()=>{const t={offset:5};return function(e,i,n){return n=U().extend(!0,{},t,n),this.each(()=>{const r=U()(this);let c,d;r.addClass("grafana-tooltip"),U()("#tooltip").remove(),r.appendTo(document.body),n.compile&&w().element(document).injector().invoke(["$compile","$rootScope",(b,D)=>{const v=D.$new(!0);(0,T.extend)(v,n.scopeData),b(r)(v),v.$digest(),v.$destroy()}]),c=r.outerWidth(!0),d=r.outerHeight(!0);const m=e+n.offset+c>Ue.width()?e-n.offset-c:e+n.offset,y=i+n.offset+d>Ue.height()?i-n.offset-d:i+n.offset;r.css("left",m>0?m:0),r.css("top",y>0?y:0)})}})();function Ge(t){const e='<input type="text" class="gf-form-input input-medium tight-form-input" spellcheck="false" style="display:none"></input>',i='<a class="gf-form-label tight-form-func dropdown-toggle" tabindex="1" gf-dropdown="menuItems" data-toggle="dropdown" ><i class="fa fa-plus"></i></a>';return{scope:{menuItems:"=dropdownTypeahead",dropdownTypeaheadOnSelect:"&dropdownTypeaheadOnSelect",model:"=ngModel"},link:(n,r,c)=>{const d=U()(e),m=U()(i);d.appendTo(r),m.appendTo(r),c.linkText&&m.html(c.linkText),c.ngModel&&n.$watch("model",D=>{(0,T.each)(n.menuItems,v=>{(0,T.each)(v.submenu,M=>{M.value===D&&m.html(M.text)})})});const y=(0,T.reduce)(n.menuItems,(D,v,M)=>(v.submenu?(0,T.each)(v.submenu,(L,G)=>{L.click="menuItemSelected("+M+","+G+")",D.push(v.text+" "+L.text)}):(v.click="menuItemSelected("+M+")",D.push(v.text)),D),[]),b=()=>{d.hide(),d.val(""),m.show(),m.focus(),r.removeClass("open")};n.menuItemSelected=(D,v)=>{const M=n.menuItems[D],L={$item:M};M.submenu&&v!==void 0&&(L.$subItem=M.submenu[v]),n.dropdownTypeaheadOnSelect(L),b()},d.attr("data-provide","typeahead"),d.typeahead({source:y,minLength:1,items:10,updater:D=>{const v={};return(0,T.each)(n.menuItems,M=>{(0,T.each)(M.submenu,L=>{D===M.text+" "+L.text&&(v.$subItem=L,v.$item=M)})}),v.$item&&n.$apply(()=>{n.dropdownTypeaheadOnSelect(v)}),d.trigger("blur"),""}}),m.click(()=>{m.hide(),d.show(),d.focus()}),d.keyup(()=>{r.toggleClass("open",d.val()==="")}),r.mousedown(D=>{D.preventDefault()}),d.blur(()=>{d.hide(),d.val(""),m.show(),m.focus(),setTimeout(()=>{r.removeClass("open")},200)}),t(r.contents())(n)}}}function Se(t){const e='<input type="text" class="gf-form-input" spellcheck="false" style="display:none"></input>',i='<a class="{{buttonTemplateClass}} dropdown-toggle" tabindex="1" gf-dropdown="menuItems" data-toggle="dropdown" ><i class="fa fa-plus"></i></a>';return{scope:{menuItems:"=dropdownTypeahead2",dropdownTypeaheadOnSelect:"&dropdownTypeaheadOnSelect",model:"=ngModel",buttonTemplateClass:"@"},link:(n,r,c)=>{const d=U()(e);n.buttonTemplateClass||(n.buttonTemplateClass="gf-form-input");const m=U()(i),y={blur:null};d.appendTo(r),m.appendTo(r),c.linkText&&m.html(c.linkText),c.ngModel&&n.$watch("model",v=>{(0,T.each)(n.menuItems,M=>{(0,T.each)(M.submenu,L=>{L.value===v&&m.html(L.text)})})});const b=(0,T.reduce)(n.menuItems,(v,M,L)=>(M.submenu?(0,T.each)(M.submenu,(G,de)=>{G.click="menuItemSelected("+L+","+de+")",v.push(M.text+" "+G.text)}):(M.click="menuItemSelected("+L+")",v.push(M.text)),v),[]),D=()=>{d.hide(),d.val(""),m.show(),m.focus(),r.removeClass("open")};n.menuItemSelected=(v,M)=>{const L=n.menuItems[v],G={$item:L};L.submenu&&M!==void 0&&(G.$subItem=L.submenu[M]),n.dropdownTypeaheadOnSelect(G),D()},d.attr("data-provide","typeahead"),d.typeahead({source:b,minLength:1,items:10,updater:v=>{const M={};return(0,T.each)(n.menuItems,L=>{(0,T.each)(L.submenu,G=>{v===L.text+" "+G.text&&(M.$subItem=G,M.$item=L)})}),M.$item&&n.$apply(()=>{n.dropdownTypeaheadOnSelect(M)}),d.trigger("blur"),""}}),m.click(()=>{m.hide(),d.show(),d.focus()}),d.keyup(()=>{r.toggleClass("open",d.val()==="")}),r.mousedown(v=>{v.preventDefault(),y.blur=null}),d.blur(()=>{y.blur=setTimeout(()=>{D()},1)}),t(r.contents())(n)}}}o.Ay.directive("dropdownTypeahead",["$compile",Ge]),o.Ay.directive("dropdownTypeahead2",["$compile",Se]);function et(t){return{link:(e,i)=>{const n=i[0],r=()=>{const d=new Event("change");return n.dispatchEvent(d)},c=({animationName:d})=>{switch(d){case"onAutoFillStart":return r();case"onAutoFillCancel":return r()}return null};n.addEventListener("animationstart",c),e.$on("$destroy",()=>{n.removeEventListener("animationstart",c)})}}}o.Ay.directive("autofillEventFix",["$compile",et]);function He(t,e,i){const n='<input type="text" data-provide="typeahead"  class="gf-form-input input-medium" spellcheck="false" style="display:none"></input>',r='<a class="gf-form-label" ng-class="segment.cssClass" tabindex="1" give-focus="segment.focus" ng-bind-html="segment.html"></a>',c='<a class="gf-form-input gf-form-input--dropdown" ng-class="segment.cssClass" tabindex="1" give-focus="segment.focus" ng-bind-html="segment.html"></a>';return{scope:{segment:"=",getOptions:"&",onChange:"&",debounce:"@"},link:(d,m)=>{const y=U()(n),b=d.segment,D=U()(b.selectMode?c:r);let v=null,M=null,L=!0;const G=d.debounce;y.appendTo(m),D.appendTo(m),d.updateVariableValue=k=>{k===""||b.value===k||d.$apply(()=>{const Q=(0,T.find)(d.altSegments,{value:k});Q?(b.value=Q.value,b.html=Q.html||e.trustAsHtml(i.highlightVariablesAsHtml(Q.value)),b.fake=!1,b.expandable=Q.expandable,Q.type&&(b.type=Q.type)):b.custom!=="false"&&(b.value=k,b.html=e.trustAsHtml(i.highlightVariablesAsHtml(k)),b.expandable=!0,b.fake=!1),d.onChange()})},d.switchToLink=k=>{L&&!k||(clearTimeout(M),M=null,L=!0,y.hide(),D.show(),d.updateVariableValue(y.val()))},d.inputBlur=()=>{M=setTimeout(d.switchToLink,200)},d.source=(k,Q)=>{d.$apply(()=>{d.getOptions({$query:k}).then(Y=>{d.altSegments=Y,v=(0,T.map)(d.altSegments,_=>(0,T.escape)(_.value)),b.custom!=="false"&&!b.fake&&(0,T.indexOf)(v,b.value)===-1&&v.unshift((0,T.escape)(b.value)),Q(v)})})},d.updater=k=>(k=(0,T.unescape)(k),k===b.value?(clearTimeout(M),y.focus(),k):(y.val(k),d.switchToLink(!0),k)),d.matcher=function(k){if(L)return!1;let Q=this.query;Q[0]==="/"&&(Q=Q.substring(1)),Q[Q.length-1]==="/"&&(Q=Q.substring(0,Q.length-1));try{return k.toLowerCase().match(Q.toLowerCase())}catch{return!1}},y.attr("data-provide","typeahead"),y.typeahead({source:d.source,minLength:0,items:1e4,updater:d.updater,matcher:d.matcher});const de=y.data("typeahead");de.lookup=function(){this.query=this.$element.val()||"";const k=this.source(this.query,U().proxy(this.process,this));return k&&this.process(k)},G&&(de.lookup=(0,T.debounce)(de.lookup,500,{leading:!0})),D.keydown(k=>{(k.keyCode===40||k.keyCode===13)&&D.click()}),D.click(()=>{v=null,y.css("width",Math.max(D.width(),80)+16+"px"),D.hide(),y.show(),y.focus(),L=!1;const k=y.data("typeahead");k&&(y.val(""),k.lookup())}),y.blur(d.inputBlur),t(m.contents())(d)}}}function Fe(t){return{template:'<metric-segment segment="segment" get-options="getOptionsInternal()" on-change="onSegmentChange()"></metric-segment>',restrict:"E",scope:{property:"=",options:"=",getOptions:"&",onChange:"&"},link:{pre:function(i,n,r){let c;i.valueToSegment=d=>{const m=(0,T.find)(i.options,{value:d}),y={cssClass:r.cssClass,custom:r.custom,value:m?m.text:d,selectMode:r.selectMode};return t.newSegment(y)},i.getOptionsInternal=()=>i.options?(c=i.options,Promise.resolve((0,T.map)(i.options,d=>({value:d.text})))):i.getOptions().then(d=>(c=d,(0,T.map)(d,m=>m.html?m:{value:m.text}))),i.onSegmentChange=()=>{if(c){const d=(0,T.find)(c,{text:i.segment.value});d&&d.value!==i.property?i.property=d.value:r.custom!=="false"&&(i.property=i.segment.value)}else i.property=i.segment.value;i.$$postDigest(()=>{i.$apply(()=>{i.onChange()})})},i.segment=i.valueToSegment(i.property)}}}}o.Ay.directive("metricSegment",["$compile","$sce","templateSrv",He]),o.Ay.directive("metricSegmentModel",["uiSegmentSrv",Fe]),o.Ay.directive("tip",["$compile",tt]);function tt(t){return{restrict:"E",link:(e,i,n)=>{let r='<i class="grafana-tip fa fa-'+(n.icon||"question-circle")+`" bs-tooltip="'`+i.text().replace(/[\'\"\\{}<>&]/g,c=>"&amp;#"+c.charCodeAt(0)+";")+`'"></i>`;i.replaceWith(t(w().element(r))(e))}}}o.Ay.directive("compile",["$compile",nt]);function nt(t){return{restrict:"A",link:(e,i,n)=>{e.$watch(r=>r.$eval(n.compile),r=>{i.html(r),t(i.contents())(e)})}}}o.Ay.directive("watchChange",it);function it(){return{scope:{onchange:"&watchChange"},link:(t,e)=>{e.on("input",()=>{t.$apply(()=>{t.onchange({inputValue:e.val()})})})}}}o.Ay.directive("editorOptBool",["$compile",Ht]);function Ht(t){return{restrict:"E",link:(e,i,n)=>{const r=n.change?' ng-change="'+n.change+'"':"",c=n.tip?" <tip>"+n.tip+"</tip>":"",m='<div class="editor-option gf-form-checkbox text-center"'+(n.showIf?' ng-show="'+n.showIf+'" ':"")+'> <label for="'+n.model+'" class="small">'+n.text+c+'</label><input class="cr1" id="'+n.model+'" type="checkbox"        ng-model="'+n.model+'"'+r+'       ng-checked="'+n.model+'"></input> <label for="'+n.model+'" class="cr1"></label>';i.replaceWith(t(w().element(m))(e))}}}o.Ay.directive("editorCheckbox",["$compile, $interpolate",Qt]);function Qt(t,e){return{restrict:"E",link:(i,n,r)=>{const c=e(r.text)(i),d=e(r.model)(i),m=r.change?' ng-change="'+r.change+'"':"",y=r.tip?" <tip>"+r.tip+"</tip>":"",b='<label for="'+i.$id+d+'" class="checkbox-label">'+c+y+"</label>";let D='<input class="cr1" id="'+i.$id+d+'" type="checkbox"        ng-model="'+d+'"'+m+'       ng-checked="'+d+'"></input> <label for="'+i.$id+d+'" class="cr1"></label>';D=D+b,n.addClass("gf-form-checkbox"),n.html(t(w().element(D))(i))}}}o.Ay.directive("gfDropdown",["$parse","$compile","$timeout",Yt]);function Yt(t,e,i){function n(r,c){const m=['<ul class="dropdown-menu '+(c==="top"?"dropup":"")+'" role="menu" aria-labelledby="drop1">',"</ul>"];for(let y=0;y<r.length;y++){const b=r[y];if(b.divider){m.splice(y+1,0,'<li class="divider"></li>');continue}let D="<li"+(b.submenu&&b.submenu.length?' class="dropdown-submenu"':"")+'><a tabindex="-1" ng-href="'+(b.href||"")+'"'+(b.click?' ng-click="'+b.click+'"':"")+(b.target?' target="'+b.target+'"':"")+(b.method?' data-method="'+b.method+'"':"")+">"+(b.text||"")+"</a>";b.submenu&&b.submenu.length&&(D+=n(b.submenu).join(`
`)),D+="</li>",m.splice(y+1,0,D)}return m}return{restrict:"EA",scope:!0,link:function(c,d,m){const y=t(m.gfDropdown),b=y(c);i(()=>{const D=d.data("placement");w().element(n(b,D).join("")).insertAfter(d),e(d.next("ul.dropdown-menu"))(c)}),d.addClass("dropdown-toggle").attr("data-toggle","dropdown")}}}o.Ay.directive("bsTooltip",["$parse","$compile",function(t,e){return{restrict:"A",scope:!0,link:function(n,r,c){let d=t(c.bsTooltip),m=d(n);n.$watch(c.bsTooltip,function(b,D){b!==D&&(m=b)}),r.on("show",function(b){U()(".tooltip.in").each(function(){const D=U()(this),v=D.data("tooltip");v&&!v.$element.is(r)&&D.tooltip("hide")})}),r.tooltip({title:function(){return w().isFunction(m)?m.apply(null,arguments):m},html:!0,container:"body"});const y=r.data("tooltip");y.show=function(){const b=U().fn.tooltip.Constructor.prototype.show.apply(this,arguments);return this.tip().data("tooltip",this),b},n._tooltip=function(b){r.tooltip(b)},n.hide=function(){r.tooltip("hide")},n.show=function(){r.tooltip("show")},n.dismiss=n.hide}}}]),o.Ay.directive("bsTypeahead",["$parse",function(t){return{restrict:"A",require:"?ngModel",link:function(i,n,r,c){let d=t(r.bsTypeahead),m=d(i);i.$watch(r.bsTypeahead,function(b,D){b!==D&&(m=b)}),n.attr("data-provide","typeahead"),n.typeahead({source:function(){return w().isFunction(m)?m.apply(null,arguments):m},minLength:r.minLength||1,items:r.item,updater:function(b){return c&&i.$apply(function(){c.$setViewValue(b)}),i.$emit("typeahead-updated",b),b}});const y=n.data("typeahead");y.lookup=function(){let b;return this.query=this.$element.val()||"",this.query.length<this.options.minLength?this.shown?this.hide():this:(b=(0,T.isFunction)(this.source)?this.source(this.query,U().proxy(this.process,this)):this.source,b?this.process(b):this)},r.matchAll&&(y.matcher=function(){return!0}),r.minLength==="0"&&setTimeout(function(){n.on("focus",function(){n.val().length===0&&setTimeout(n.typeahead.bind(n,"lookup"),200)})})}}}]);var Et=a(59577);function Xt(){return{restrict:"A",priority:1,require:"ngModel",link:(t,e,i,n)=>{i.type==="radio"||i.type==="checkbox"||(e.off("input keydown change"),e.bind("blur",()=>{t.$apply(()=>{n.$setViewValue(e.val())})}))}}}function Jt(){return{restrict:"A",require:"ngModel",link:(t,e,i,n)=>{n.$parsers.push(r=>r===""?null:r)}}}function Zt(){return{require:"ngModel",link:(t,e,i,n)=>{n.$validators.integer=(r,c)=>n.$isEmpty(r)||c.indexOf("$")===0||c.indexOf("+$")===0?!0:Et.describeTextRange(c).invalid!==!0}}}o.Ay.directive("ngModelOnblur",Xt),o.Ay.directive("emptyToNull",Jt),o.Ay.directive("validTimeSpan",Zt);var qt=a(27671),ns=a(42346);function bt(t,e){const{color:i,borderColor:n}=(0,qt.MC)(t);e.css("background-color",i),e.css("border-color",n)}function _t(){return{scope:{tagColorFromName:"="},link:(t,e)=>{bt(t.tagColorFromName,e)}}}function en(){function t(e,i){if(i)return w().isFunction(e.$parent[i])?e.$parent[i]:n=>n[i]}return{restrict:"EA",scope:{model:"=ngModel",onTagsUpdated:"&"},template:"<select multiple></select>",replace:!1,link:function(e,i,n){w().isArray(e.model)||(e.model=[]);const r=U()("select",i);n.placeholder&&r.attr("placeholder",n.placeholder),r.tagsinput({typeahead:{source:w().isFunction(e.$parent[n.typeaheadSource])?e.$parent[n.typeaheadSource]:null},widthClass:n.widthClass,itemValue:t(e,n.itemvalue),itemText:t(e,n.itemtext),tagClass:w().isFunction(e.$parent[n.tagclass])?e.$parent[n.tagclass]:()=>n.tagclass}),r.on("itemAdded",c=>{e.model.indexOf(c.item)===-1&&(e.model.push(c.item),e.onTagsUpdated&&e.onTagsUpdated());const d=r.next().children("span").filter(()=>U()(this).text()===c.item);bt(c.item,d)}),r.on("itemRemoved",c=>{const d=e.model.indexOf(c.item);d!==-1&&(e.model.splice(d,1),e.onTagsUpdated&&e.onTagsUpdated())}),e.$watch("model",()=>{w().isArray(e.model)||(e.model=[]),r.tagsinput("removeAll");for(let c=0;c<e.model.length;c++)r.tagsinput("add",e.model[c])},!0)}}}o.Ay.directive("tagColorFromName",_t),o.Ay.directive("bootstrapTagsinput",en);function tn(t){let e=t[0];const i=t[t.length-1];let n;e=e.nextSibling;for(let r=1;e!==i&&e;r++)(n||t[r]!==e)&&(n||(n=U()([].slice.call(t,0,r))),n.push(e)),e=e.nextSibling;return n||t}o.Ay.directive("rebuildOnChange",["$animate",nn]);function nn(t){return{multiElement:!0,terminal:!0,transclude:!0,priority:600,restrict:"E",link:(e,i,n,r,c)=>{let d,m,y;function b(){y&&(y.remove(),y=null),m&&(m.$destroy(),m=null),d&&(y=tn(d.clone),t.leave(y).then(()=>{y=null}),d=null)}e.$watch(n.property,function(v,M){m&&v!==M&&b(),!m&&(v||n.showNull)?c((L,G)=>{m=G,L[L.length++]=document.createComment(" end rebuild on change "),d={clone:L},t.enter(L,i.parent(),i)}):b()})}}}o.Ay.directive("giveFocus",()=>(t,e,i)=>{e.click(n=>{n.stopPropagation()}),t.$watch(i.giveFocus,n=>{n&&setTimeout(()=>{e.focus();const r=e[0];if(r.setSelectionRange){const c=e.val().length*2;r.setSelectionRange(c,c)}},200)},!0)});const is={};class rn{constructor(){const e=()=>{};this.observer=new MutationObserver(e);const i={attributes:!0,attributeFilter:["class"],characterData:!1,childList:!0,subtree:!1};this.observer.observe(w().element(".delta-html")[0],i)}$onDestroy(){this.observer.disconnect()}}function sn(){return{controller:rn,replace:!1,restrict:"A"}}o.Ay.directive("diffDelta",sn);class on{constructor(e,i,n){this.$scope=e,this.$rootScope=i,this.$anchorScroll=n}static{this.$inject=["$scope","$rootScope","$anchorScroll"]}goToLine(e){let i;const n=()=>{this.$anchorScroll(`l${e}`),i()};this.$scope.switchView().then(()=>{i=this.$rootScope.$on("json-diff-ready",n.bind(this))})}}function an(){return{controller:on,controllerAs:"ctrl",replace:!0,restrict:"E",scope:{line:"@lineDisplay",link:"@lineLink",switchView:"&"},template:'<a class="diff-linenum btn btn-inverse btn-small" ng-click="ctrl.goToLine(link)">Line {{ line }}</a>'}}o.Ay.directive("diffLinkJson",an);function ln(){"use strict";return{restrict:"A",require:"ngModel",link:(t,e,i,n)=>{function r(d){return(d||"").split(",")}function c(d){return(0,T.isArray)(d)?(d||"").join(","):d}n.$parsers.push(r),n.$formatters.push(c)}}}o.Ay.directive("arrayJoin",ln);var cn=a(63492),Je=a(79784),un=a(20968),dn=a(57836),hn=a(30446),pn=a(69942),fn=a(30665),mn=a(99153),gn=a(98378),vn=a(93604),yn=a(32370),En=a(77188);function we(t,e,i){o.Ay.directive(t,["reactDirective",n=>n((0,En.e)(e,yn.$.theme2),i)])}var bn=a(96843),xn=a(15832),x=a(74848),Cn=a(32017),Tn=a.n(Cn),ut=a(35095),An=a(55801),xt=a(1667),Sn=a(65164);const Ze={components:{queryEditor:{container:"data-testid cloud-monitoring-query-editor",header:{select:"data-testid cloud-monitoring-header"},visualMetricsQueryEditor:{container:{input:"data-testid cloud-monitoring-visual-metrics-query-editor"}},mqlMetricsQueryEditor:{container:{input:"data-testid cloud-monitoring-mql-query-editor"}},sloQueryEditor:{container:{input:"data-testid cloud-monitoring-slo-query-editor"}},promQlQueryEditor:{container:{input:"data-testid cloud-monitoring-prom-ql-query-editor"}}}}};var Ae=(t=>(t.ANNOTATION="annotation",t.PROMQL="promQL",t.SLO="slo",t.TIME_SERIES_LIST="timeSeriesList",t.TIME_SERIES_QUERY="timeSeriesQuery",t))(Ae||{});const ss={filters:[],groupBys:[],secondaryGroupBys:[]};var Ve=(t=>(t.Delta="delta",t.None="none",t.Rate="rate",t))(Ve||{});const os={filters:[],groupBys:[]};var R=(t=>(t.CUMULATIVE="CUMULATIVE",t.DELTA="DELTA",t.GAUGE="GAUGE",t.METRIC_KIND_UNSPECIFIED="METRIC_KIND_UNSPECIFIED",t))(R||{}),I=(t=>(t.BOOL="BOOL",t.DISTRIBUTION="DISTRIBUTION",t.DOUBLE="DOUBLE",t.INT64="INT64",t.MONEY="MONEY",t.STRING="STRING",t.VALUE_TYPE_UNSPECIFIED="VALUE_TYPE_UNSPECIFIED",t))(I||{}),qe=(t=>(t.ALIGN_COUNT="ALIGN_COUNT",t.ALIGN_COUNT_FALSE="ALIGN_COUNT_FALSE",t.ALIGN_COUNT_TRUE="ALIGN_COUNT_TRUE",t.ALIGN_DELTA="ALIGN_DELTA",t.ALIGN_FRACTION_TRUE="ALIGN_FRACTION_TRUE",t.ALIGN_INTERPOLATE="ALIGN_INTERPOLATE",t.ALIGN_MAX="ALIGN_MAX",t.ALIGN_MEAN="ALIGN_MEAN",t.ALIGN_MIN="ALIGN_MIN",t.ALIGN_NEXT_OLDER="ALIGN_NEXT_OLDER",t.ALIGN_NONE="ALIGN_NONE",t.ALIGN_PERCENTILE_05="ALIGN_PERCENTILE_05",t.ALIGN_PERCENTILE_50="ALIGN_PERCENTILE_50",t.ALIGN_PERCENTILE_95="ALIGN_PERCENTILE_95",t.ALIGN_PERCENTILE_99="ALIGN_PERCENTILE_99",t.ALIGN_PERCENT_CHANGE="ALIGN_PERCENT_CHANGE",t.ALIGN_RATE="ALIGN_RATE",t.ALIGN_STDDEV="ALIGN_STDDEV",t.ALIGN_SUM="ALIGN_SUM",t))(qe||{});const as={filters:[]};var wn=(t=>(t.Aggregations="aggregations",t.Aligners="aligners",t.AlignmentPeriods="alignmentPeriods",t.DefaultProject="defaultProject",t.LabelKeys="labelKeys",t.LabelValues="labelValues",t.MetricTypes="metricTypes",t.Projects="projects",t.ResourceTypes="resourceTypes",t.SLO="slo",t.SLOServices="sloServices",t.Selectors="selectors",t.Services="services",t))(wn||{}),In=a(48583),Ie=a(30048),Ct=a(34128);const dt=({refId:t,value:e="",onChange:i})=>{const[n,r]=(0,F.useState)(e??""),c=(0,T.debounce)(i,1e3),d=m=>{r(m.currentTarget.value),c(m.currentTarget.value)};return(0,x.jsx)(Ie.c,{label:"Alias by",children:(0,x.jsx)(Ct.p,{id:`${t}-alias-by`,value:n,onChange:d})})};var Qe=a(32300),Tt=a(19550),Ln=a(29010);const ls=71,cs=19,us=14,ds=28,At=[{text:"none",value:"ALIGN_NONE",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION,I.STRING,I.VALUE_TYPE_UNSPECIFIED,I.BOOL],metricKinds:[R.GAUGE]},{text:"delta",value:"ALIGN_DELTA",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION],metricKinds:[R.CUMULATIVE,R.DELTA]},{text:"rate",value:"ALIGN_RATE",valueTypes:[I.INT64,I.DOUBLE,I.MONEY],metricKinds:[R.CUMULATIVE,R.DELTA]},{text:"interpolate",value:"ALIGN_INTERPOLATE",valueTypes:[I.INT64,I.DOUBLE,I.MONEY],metricKinds:[R.GAUGE]},{text:"next older",value:"ALIGN_NEXT_OLDER",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION,I.STRING,I.VALUE_TYPE_UNSPECIFIED,I.BOOL],metricKinds:[R.GAUGE]},{text:"min",value:"ALIGN_MIN",valueTypes:[I.INT64,I.DOUBLE,I.MONEY],metricKinds:[R.GAUGE,R.DELTA]},{text:"max",value:"ALIGN_MAX",valueTypes:[I.INT64,I.DOUBLE,I.MONEY],metricKinds:[R.GAUGE,R.DELTA]},{text:"mean",value:"ALIGN_MEAN",valueTypes:[I.INT64,I.DOUBLE,I.MONEY],metricKinds:[R.GAUGE,R.DELTA]},{text:"count",value:"ALIGN_COUNT",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.BOOL],metricKinds:[R.GAUGE,R.DELTA]},{text:"sum",value:"ALIGN_SUM",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA]},{text:"stddev",value:"ALIGN_STDDEV",valueTypes:[I.INT64,I.DOUBLE,I.MONEY],metricKinds:[R.GAUGE,R.DELTA]},{text:"count true",value:"ALIGN_COUNT_TRUE",valueTypes:[I.BOOL],metricKinds:[R.GAUGE]},{text:"count false",value:"ALIGN_COUNT_FALSE",valueTypes:[I.BOOL],metricKinds:[R.GAUGE]},{text:"fraction true",value:"ALIGN_FRACTION_TRUE",valueTypes:[I.BOOL],metricKinds:[R.GAUGE]},{text:"percentile 99",value:"ALIGN_PERCENTILE_99",valueTypes:[I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA]},{text:"percentile 95",value:"ALIGN_PERCENTILE_95",valueTypes:[I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA]},{text:"percentile 50",value:"ALIGN_PERCENTILE_50",valueTypes:[I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA]},{text:"percentile 05",value:"ALIGN_PERCENTILE_05",valueTypes:[I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA]},{text:"percent change",value:"ALIGN_PERCENT_CHANGE",valueTypes:[I.INT64,I.DOUBLE,I.MONEY],metricKinds:[R.GAUGE,R.DELTA]}],Dn=[{text:"none",value:"REDUCE_NONE",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION,I.BOOL,I.STRING],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE,R.METRIC_KIND_UNSPECIFIED]},{text:"mean",value:"REDUCE_MEAN",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE]},{text:"min",value:"REDUCE_MIN",valueTypes:[I.INT64,I.DOUBLE,I.MONEY],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE,R.METRIC_KIND_UNSPECIFIED]},{text:"max",value:"REDUCE_MAX",valueTypes:[I.INT64,I.DOUBLE,I.MONEY],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE,R.METRIC_KIND_UNSPECIFIED]},{text:"sum",value:"REDUCE_SUM",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE,R.METRIC_KIND_UNSPECIFIED]},{text:"std. dev.",value:"REDUCE_STDDEV",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE,R.METRIC_KIND_UNSPECIFIED]},{text:"count",value:"REDUCE_COUNT",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION,I.BOOL,I.STRING],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE]},{text:"count true",value:"REDUCE_COUNT_TRUE",valueTypes:[I.BOOL],metricKinds:[R.GAUGE,R.DELTA]},{text:"count false",value:"REDUCE_COUNT_FALSE",valueTypes:[I.BOOL],metricKinds:[R.GAUGE,R.DELTA]},{text:"99th percentile",value:"REDUCE_PERCENTILE_99",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE]},{text:"95th percentile",value:"REDUCE_PERCENTILE_95",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE]},{text:"50th percentile",value:"REDUCE_PERCENTILE_50",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE]},{text:"5th percentile",value:"REDUCE_PERCENTILE_05",valueTypes:[I.INT64,I.DOUBLE,I.MONEY,I.DISTRIBUTION],metricKinds:[R.GAUGE,R.DELTA,R.CUMULATIVE]}],St=[{text:"grafana auto",value:"grafana-auto"},{text:"stackdriver auto",value:"stackdriver-auto",hidden:!0},{text:"cloud monitoring auto",value:"cloud-monitoring-auto"},{text:"1m",value:"+60s"},{text:"2m",value:"+120s"},{text:"5m",value:"+300s"},{text:"10m",value:"+600s"},{text:"30m",value:"+1800s"},{text:"1h",value:"+3600s"},{text:"3h",value:"+7200s"},{text:"6h",value:"+21600s"},{text:"1d",value:"+86400s"},{text:"3d",value:"+259200s"},{text:"1w",value:"+604800s"}],Nn=[{text:"auto",value:"auto"},{text:"1m",value:"1m"},{text:"2m",value:"2m"},{text:"5m",value:"5m"},{text:"10m",value:"10m"},{text:"30m",value:"30m"},{text:"1h",value:"1h"},{text:"3h",value:"3h"},{text:"6h",value:"6h"},{text:"1d",value:"1d"},{text:"3d",value:"3d"},{text:"1w",value:"1w"}],On=[{text:"1m",value:"1m"},{text:"2m",value:"2m"},{text:"5m",value:"5m"},{text:"10m",value:"10m"},{text:"30m",value:"30m"},{text:"1h",value:"1h"},{text:"3h",value:"3h"},{text:"6h",value:"6h"},{text:"24h",value:"24h"},{text:"72h",value:"72h"}],Mn=["metadata.system_labels.cloud_account","metadata.system_labels.name","metadata.system_labels.region","metadata.system_labels.state","metadata.system_labels.instance_group","metadata.system_labels.node_name","metadata.system_labels.service_name","metadata.system_labels.top_level_controller_type","metadata.system_labels.top_level_controller_name","metadata.system_labels.container_image"],wt="select_slo_burn_rate",It=[{label:"SLI Value",value:"select_slo_health"},{label:"SLO Compliance",value:"select_slo_compliance"},{label:"SLO Error Budget Remaining",value:"select_slo_budget_fraction"},{label:"SLO Burn Rate",value:wt}],Pn=[{label:"Builder",value:Ae.TIME_SERIES_LIST},{label:"MQL",value:Ae.TIME_SERIES_QUERY},{label:"Service Level Objectives (SLO)",value:Ae.SLO},{label:"PromQL",value:Ae.PROMQL}];var Oe=a(44826);function rt({refId:t,projectName:e,datasource:i,onChange:n,templateVariableOptions:r}){const[c,d]=(0,F.useState)([]);(0,F.useEffect)(()=>{i.getProjects().then(y=>d(y))},[i]);const m=(0,F.useMemo)(()=>[{label:"Template Variables",options:r},...c],[c,r]);return(0,x.jsx)(Ie.c,{label:"Project",children:(0,x.jsx)(Oe.l6,{width:"auto",allowCustomValue:!0,formatCreateLabel:y=>`Use project: ${y}`,onChange:({value:y})=>n(y),options:m,value:{value:e,label:e},placeholder:"Select Project",inputId:`${t}-project`})})}var st=a(75349),Lt=a(39736);const hs=t=>uniqBy(t,"service"),kn=(t,e)=>t.filter(i=>i.service===e),ps=(t,e,i,n)=>{const r=kn(t,n).map(y=>({value:y.type,name:y.displayName})),c=r.some(y=>y.value===i),d=r.length?r[0].value:"";return{metricTypes:r,selectedMetricType:c?e:d}},Un=(t,e,i)=>(i&&i===Ve.Rate&&(e=R.GAUGE),t?At.filter(n=>n.valueTypes.indexOf(t)!==-1&&n.metricKinds.indexOf(e)!==-1):[]),Rn=(t,e)=>e?Dn.filter(i=>i.valueTypes.indexOf(t)!==-1&&i.metricKinds.indexOf(e)!==-1):[],fs=async(t,e,i)=>{const r=await t.getLabels(e,"handleLabelKeysQuery",i);return[...Object.keys(r),...SYSTEM_LABELS]},ht=(t=I.DOUBLE,e=R.GAUGE,i=qe.ALIGN_MEAN,n)=>{const r=(0,Lt.w)(),c=Un(t,e,n).map(d=>({...d,label:d.text}));return c.some(d=>d.value===r.replace(i))||(i=c.length>0?c[0].value:qe.ALIGN_MEAN),{alignOptions:c,perSeriesAligner:i}},Dt=t=>{const e=t.reduce((i,n)=>{const r=n.split(".").map(T.startCase),c=(r.length===2?r:(0,T.initial)(r)).join(" "),d={value:n,label:n};return i[c]?i[c]=[...i[c],d]:i[c]=[d],i},{});return Object.entries(e).map(([i,n])=>({label:i,options:n,expanded:!0}),[])},jn=t=>(0,T.chunk)(t,4).map(([e,i,n,r="AND"])=>({key:e,operator:i,value:n,condition:r})),Nt=(t,e)=>{const{perSeriesAligner:i,alignmentPeriod:n}=t;if(!n||!i)return"";const r=At.find(m=>m.value===e.templateSrv.replace(i)),c=parseInt(n,10);return`${Et.secondsToHms(c)} interval (${r?.text??""})`},$n=t=>{const e=t?.filters?.findIndex(n=>n==="metric.type");return t?.filters?.[e+2]||""},Bn=(t,e)=>{if(!t.filters)return t.filters=["metric.type","=",e],t;const i=t?.filters?.findIndex(n=>n==="metric.type");return i===-1?t.filters.push("metric.type","=",e):t.filters[i+2]=e,t},Gn=t=>{const e=Fn(t),i=Vn(e,t);return(0,x.jsx)(Ie.c,{label:"Group by function","data-testid":"cloud-monitoring-aggregation",tooltip:"Aggregation function used on the metric data. Defaults to none for scalar data and mean for distribution data. Not applying an aggregation to distribution data may lead to performance issues.",children:(0,x.jsx)(Oe.l6,{width:"auto",onChange:({value:n})=>t.onChange(n),value:i,options:[{label:"Template Variables",options:t.templateVariableOptions},{label:"Aggregations",expanded:!0,options:e}],placeholder:"Select Reducer",inputId:`${t.refId}-group-by-function`,menuPlacement:"top"})})},Fn=({metricDescriptor:t})=>{const e=t?.valueType,i=t?.metricKind;return(0,F.useMemo)(()=>!e||!i?[]:Rn(e,i).map(n=>({...n,label:n.text})),[e,i])},Vn=(t,e)=>(0,F.useMemo)(()=>[...t,...e.templateVariableOptions].find(n=>n.value===e.crossSeriesReducer),[t,e.crossSeriesReducer,e.templateVariableOptions]),Wn=({refId:t,labels:e=[],query:i,onChange:n,variableOptionGroup:r,metricDescriptor:c})=>{const d=(0,F.useMemo)(()=>[r,...Dt([...e,...Mn])],[e,r]);return(0,x.jsxs)(st.B,{children:[(0,x.jsx)(Ie.c,{label:"Group by",tooltip:"You can reduce the amount of data returned for a metric by combining different time series. To combine multiple time series, you can specify a grouping and a function. Grouping is done on the basis of labels. The grouping function is used to combine the time series in the group into a single time series.",children:(0,x.jsx)(Oe.KF,{allowCustomValue:!0,inputId:`${t}-group-by`,width:"auto",placeholder:"Choose label",options:d,value:i.groupBys??[],onChange:m=>{n({...i,groupBys:m.map(y=>y.value)})},menuPlacement:"top"})}),(0,x.jsx)(Gn,{metricDescriptor:c,templateVariableOptions:r.options,crossSeriesReducer:i.crossSeriesReducer,groupBys:i.groupBys??[],onChange:m=>n({...i,crossSeriesReducer:m}),refId:t})]})},zn=({inputId:t,query:e,templateVariableOptions:i,onChange:n,metricDescriptor:r,preprocessor:c})=>{const{perSeriesAligner:d}=e;let{valueType:m,metricKind:y}=r||{};const{perSeriesAligner:b,alignOptions:D}=(0,F.useMemo)(()=>ht(m,y,d,c),[m,y,d,c]);return(0,x.jsx)(Oe.l6,{onChange:({value:v})=>n({...e,perSeriesAligner:v}),value:[...D,...i].find(v=>v.value===b),options:[{label:"Template Variables",options:i},{label:"Alignment options",expanded:!0,options:D}],placeholder:"Select Alignment",inputId:t,menuPlacement:"top"})};function pt({inputId:t,templateVariableOptions:e,onChange:i,current:n,disabled:r,aligmentPeriods:c}){const d=(0,F.useMemo)(()=>c.map(y=>({...y,label:y.text})),[c]),m=(0,F.useMemo)(()=>d.filter(y=>!y.hidden),[d]);return(0,x.jsx)(Oe.l6,{width:"auto",onChange:({value:y})=>i(y),value:[...d,...e].find(y=>y.value===n),options:[{label:"Template Variables",options:e},{label:"Aggregations",expanded:!0,options:m}],placeholder:"Select Period",inputId:t,disabled:r,allowCustomValue:!0,menuPlacement:"top"})}const Kn=({refId:t,templateVariableOptions:e,onChange:i,query:n,customMetaData:r,datasource:c,metricDescriptor:d,preprocessor:m})=>{const y=(0,F.useMemo)(()=>Nt(r,c),[r,c]);return(0,x.jsxs)(st.B,{children:[(0,x.jsx)(Ie.c,{label:"Alignment function",tooltip:"The process of alignment consists of collecting all data points received in a fixed length of time, applying a function to combine those data points, and assigning a timestamp to the result.",children:(0,x.jsx)(zn,{inputId:`${t}-alignment-function`,templateVariableOptions:e,query:n,onChange:b=>i({...n,...b}),metricDescriptor:d,preprocessor:m})}),(0,x.jsx)(Ie.c,{label:"Alignment period",tooltip:y,children:(0,x.jsx)(pt,{inputId:`${t}-alignment-period`,templateVariableOptions:e,current:n.alignmentPeriod,onChange:b=>i({...n,alignmentPeriod:b}),aligmentPeriods:St})})]})};var Hn=a(20301),Qn=a(26774);const ft="=",Ot="AND",Yn=t=>t.flatMap(({key:e,operator:i,value:n,condition:r})=>[e,i,n,r]).slice(0,-1),Xn=["=","!=","=~","!=~"].map(ut.z),Mt=["metric.type"],Jn=({labels:t={},filters:e,onChange:i,variableOptionGroup:n})=>{const r=jn(e),c=r.filter(({key:v})=>!Mt.includes(v)),d=r.filter(({key:v})=>Mt.includes(v)),m=(0,F.useMemo)(()=>[n,...Dt(Object.keys(t))],[t,n]),y=({key:v="",value:M=""})=>{m.some(k=>k.options?m.some(Q=>Q.label===v):k.label===v)||m.push({label:v,value:v});const G=t.hasOwnProperty(v)?[n,...t[v].map(ut.z)]:[n];return G.some(k=>k.label===M)||G.push({label:M,value:M}),{options:m,valueOptions:G}},b=v=>{const M=v.concat(d).map(({key:L,operator:G,value:de,condition:k})=>({key:L||"",operator:G||ft,value:de||"",condition:k||Ot}));i(Yn(M))},D=(v,M,L)=>{const{key:G="",operator:de=ft,value:k="",condition:Q=Ot}=v,{options:Y,valueOptions:_}=y(v);return(0,x.jsxs)(Tt.Gy,{spacing:"xs",width:"auto",children:[(0,x.jsx)(Oe.l6,{"aria-label":"Filter label key",formatCreateLabel:oe=>`Use label key: ${oe}`,allowCustomValue:!0,value:G,options:Y,onChange:({value:oe=""})=>M({key:oe,operator:de,value:k,condition:Q})}),(0,x.jsx)(Oe.l6,{value:de,options:Xn,onChange:({value:oe=ft})=>M({key:G,operator:oe,value:k,condition:Q})}),(0,x.jsx)(Oe.l6,{"aria-label":"Filter label value",placeholder:"add filter value",formatCreateLabel:oe=>`Use label value: ${oe}`,allowCustomValue:!0,value:k,options:_,onChange:({value:oe=""})=>M({key:G,operator:de,value:oe,condition:Q})}),(0,x.jsx)(Hn.Z,{"aria-label":"Remove",icon:"times",variant:"secondary",onClick:L,type:"button"})]})};return(0,x.jsx)(Qe.U,{children:(0,x.jsx)(Ie.c,{label:"Filter",tooltip:"To reduce the amount of data charted, apply a filter. A filter has three components: a label, a comparison, and a value. The comparison can be an equality, inequality, or regular expression.",children:(0,x.jsx)(Qn.o,{items:c,renderItem:D,onChange:b})})})},ms=()=>jsx(Alert,{severity:"info",title:"Annotation Query Format",children:jsxs("div",{children:[jsxs("p",{children:["An annotation is an event that is overlaid on top of graphs. Annotation rendering is expensive so it is important to limit the number of rows returned."," "]}),jsx("p",{children:"The Title and Text fields support templating and can use data returned from the query. For example, the Title field could have the following text:"}),jsxs("code",{children:["{{metric.type}}"," has value: ","{{metric.value}}"]}),jsxs("p",{children:["Example Result: ",jsx("code",{children:"monitoring.googleapis.com/uptime_check/http_status has this value: 502"})]}),jsx("span",{children:"Patterns:"}),jsxs("p",{children:[jsx("code",{children:"{{metric.value}}"})," = value of the metric/point"]}),jsxs("p",{children:[jsx("code",{children:"{{metric.type}}"})," = metric type e.g. compute.googleapis.com/instance/cpu/usage_time"]}),jsxs("p",{children:[jsx("code",{children:"{{metric.name}}"})," = name part of metric e.g. instance/cpu/usage_time"]}),jsxs("p",{children:[jsx("code",{children:"{{metric.service}}"})," = service part of metric e.g. compute"]}),jsxs("p",{children:[jsx("code",{children:"{{metric.label.label_name}}"})," = Metric label metadata e.g. metric.label.instance_name"]}),jsxs("p",{children:[jsx("code",{children:"{{resource.label.label_name}}"})," = Resource label metadata e.g. resource.label.zone"]})]})}),Zn=({refId:t,current:e,templateVariableOptions:i,onChange:n})=>{const r=On.map(d=>({...d,label:d.text}));e&&!r.find(d=>d.value===e)&&r.push({label:e,text:e,value:e,hidden:!1});const c=r.filter(d=>!d.hidden);return(0,x.jsx)(Ie.c,{label:"Lookback period",htmlFor:`${t}-lookback-period`,children:(0,x.jsx)(Oe.l6,{inputId:`${t}-lookback-period`,width:"auto",allowCustomValue:!0,value:[...r,...i].find(d=>d.value===e),options:[{label:"Template Variables",options:i},{label:"Predefined periods",expanded:!0,options:c}],onChange:({value:d})=>n(d)})})},qn=({refId:t,query:e,templateVariableOptions:i,onChange:n,datasource:r})=>{const[c,d]=(0,F.useState)([]),{projectName:m,serviceId:y}=e;return(0,F.useEffect)(()=>{!m||!y||r.getServiceLevelObjectives(m,y).then(b=>{d([{label:"Template Variables",options:i},...b])})},[r,m,y,i]),(0,x.jsx)(Ie.c,{label:"SLO",children:(0,x.jsx)(Oe.l6,{inputId:`${t}-slo`,width:"auto",allowCustomValue:!0,value:e?.sloId&&{value:e?.sloId,label:e?.sloName||e?.sloId},placeholder:"Select SLO",options:c,onChange:async({value:b="",label:D=""})=>{const M=(await r.getServiceLevelObjectives(m,y)).find(({value:L})=>L===r.templateSrv.replace(b));n({...e,sloId:b,sloName:D,goal:M?.goal})}})})},_n=({refId:t,query:e,templateVariableOptions:i,onChange:n,datasource:r})=>(0,x.jsx)(Ie.c,{label:"Selector",htmlFor:`${t}-slo-selector`,children:(0,x.jsx)(Oe.l6,{inputId:`${t}-slo-selector`,width:"auto",allowCustomValue:!0,value:[...It,...i].find(c=>c.value===e?.selectorName),options:[{label:"Template Variables",options:i},...It],onChange:({value:c})=>n({...e,selectorName:c??""})})}),ei=({refId:t,query:e,templateVariableOptions:i,onChange:n,datasource:r})=>{const[c,d]=(0,F.useState)([]),{projectName:m}=e;return(0,F.useEffect)(()=>{m&&r.getSLOServices(m).then(y=>{d([{label:"Template Variables",options:i},...y])})},[r,m,i]),(0,x.jsx)(Ie.c,{label:"Service",children:(0,x.jsx)(Oe.l6,{inputId:`${t}-slo-service`,width:"auto",allowCustomValue:!0,value:e?.serviceId&&{value:e?.serviceId,label:e?.serviceName||e?.serviceId},placeholder:"Select service",options:c,onChange:({value:y="",label:b=""})=>n({...e,serviceId:y,serviceName:b,sloId:""})})})},ti=t=>({projectName:t.getDefaultProject(),alignmentPeriod:"cloud-monitoring-auto",perSeriesAligner:qe.ALIGN_MEAN,aliasBy:"",selectorName:"select_slo_health",serviceId:"",serviceName:"",sloId:"",sloName:"",lookbackPeriod:""});function ni({refId:t,query:e,datasource:i,onChange:n,variableOptionGroup:r,customMetaData:c,aliasBy:d,onChangeAliasBy:m}){const y=(0,F.useMemo)(()=>Nt(c,i),[c,i]);return(0,x.jsx)("span",{"data-testid":Ze.components.queryEditor.sloQueryEditor.container.input,children:(0,x.jsxs)(Qe.U,{children:[(0,x.jsx)(rt,{refId:t,templateVariableOptions:r.options,projectName:e.projectName,datasource:i,onChange:b=>n({...e,projectName:b})}),(0,x.jsx)(ei,{refId:t,datasource:i,templateVariableOptions:r.options,query:e,onChange:n}),(0,x.jsx)(qn,{refId:t,datasource:i,templateVariableOptions:r.options,query:e,onChange:n}),(0,x.jsx)(_n,{refId:t,datasource:i,templateVariableOptions:r.options,query:e,onChange:n}),e.selectorName===wt&&(0,x.jsx)(Zn,{refId:t,onChange:b=>n({...e,lookbackPeriod:b}),current:e.lookbackPeriod,templateVariableOptions:r.options}),(0,x.jsx)(st.B,{children:(0,x.jsx)(Ie.c,{label:"Alignment period",tooltip:y,children:(0,x.jsx)(pt,{inputId:`${t}-alignment-period`,templateVariableOptions:r.options,current:e.alignmentPeriod,onChange:b=>n({...e,alignmentPeriod:b}),aligmentPeriods:St})})}),(0,x.jsx)(dt,{refId:t,value:d,onChange:m})]})})}var Pt=a(50926);function ii({query:t,onChange:e,onRunQuery:i}){const n=r=>{r.key==="Enter"&&(r.shiftKey||r.ctrlKey)&&(r.preventDefault(),i())};return(0,x.jsx)("span",{"data-testid":Ze.components.queryEditor.mqlMetricsQueryEditor.container.input,children:(0,x.jsx)(Pt.f,{name:"Query",className:"slate-query-field",value:t,rows:10,placeholder:"Enter a Cloud Monitoring MQL query (Run with Shift+Enter)",onBlur:i,onChange:r=>e(r.currentTarget.value),onKeyDown:n})})}const gs=({label:t,onChange:e,value:i,options:n,allowCustomValue:r=!1})=>jsx(Field,{label:t,children:jsx(Select,{width:25,allowCustomValue:r,value:i,onChange:({value:c})=>e(c),options:n})});var Be=a(22803),ri=a(76459),si=a.n(ri),oi=a(56276),ot=a(29675),ai=a(74162),li=a(60641);const kt={label:"None",value:Ve.None},ci=({query:t,metricDescriptor:e,onChange:i})=>{const n=ui(e);return(0,x.jsx)(Ie.c,{label:"Pre-processing",tooltip:"Preprocessing options are displayed when the selected metric has a metric kind of delta or cumulative. The specific options available are determined by the metric's value type. If you select 'Rate', data points are aligned and converted to a rate per time series. If you select 'Delta', data points are aligned by their delta (difference) per time series",children:(0,x.jsx)(li.z,{onChange:r=>{const{perSeriesAligner:c}=t,{valueType:d,metricKind:m}=e??{},{perSeriesAligner:y}=ht(d,m,c,r);i({...t,preprocessor:r,perSeriesAligner:y})},value:t.preprocessor??Ve.None,options:n})})},ui=t=>{const e=t?.metricKind,i=t?.valueType;return(0,F.useMemo)(()=>{if(!e||e===R.GAUGE||i===I.DISTRIBUTION)return[kt];const n=[kt,{label:"Rate",value:Ve.Rate,description:"Data points are aligned and converted to a rate per time series"}];return e===R.CUMULATIVE?[...n,{label:"Delta",value:Ve.Delta,description:"Data points are aligned by their delta (difference) per time series"}]:n},[e,i])};function di({refId:t,onChange:e,datasource:i,query:n,variableOptionGroup:r,customMetaData:c,aliasBy:d,onChangeAliasBy:m,range:y}){const[b,D]=(0,F.useState)({}),[v,M]=(0,F.useState)([]),[L,G]=(0,F.useState)(),[de,k]=(0,F.useState)([]),[Q,Y]=(0,F.useState)([]),[_,oe]=(0,F.useState)(""),[Ee,fe]=(0,F.useState)({...y});(ye=>{Ee!==null&&(Ee.raw.from.toString()!==ye.raw.from.toString()||Ee.raw.to.toString()!==ye.raw.to.toString())&&fe({...ye})})(y);const ze=(0,ot.$j)(),Me=(0,ai.J)(ze),je=(0,ot.of)(hi),{projectName:$e,groupBys:Wt,crossSeriesReducer:zt}=n,We=$n(n),{templateSrv:at}=i,lt=(0,F.useCallback)((ye,Te)=>ye.find(xe=>xe.type===at.replace(Te)),[at]);(0,F.useEffect)(()=>{$e&&We&&i.getLabels(We,t,$e,{groupBys:Wt,crossSeriesReducer:zt},Ee).then(ye=>D(ye))},[i,Wt,We,$e,t,zt,Ee]),(0,F.useEffect)(()=>{(async()=>{if($e){const Te=await i.getMetricTypes($e);(0,oi.rR)("cloud-monitoring-metric-descriptors-loaded",{count:Te.length});const xe=_r(Te);M(Te),Y(xe)}})()},[i,$e,je,Me.optionDescription]),(0,F.useEffect)(()=>{const Te=(Xe=>{const ct=lt(Xe,We);return ct?Xe.filter(Ke=>Ke.service===ct.service).map(Ke=>({service:Ke.service,value:Ke.type,label:Ke.displayName,component:function(){return(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:je,children:Ke.type}),(0,x.jsx)("div",{className:Me.optionDescription,children:Ke.description})]})}})):[]})(v),xe=Te.length>0?Te[0].service:"",Pe=lt(v,We);G(Pe),k(Te),oe(xe)},[v,lt,We,je,Me.optionDescription]);const qr=({value:ye})=>{const Te=v.filter(xe=>xe.service===at.replace(ye)).map(xe=>({service:xe.service,value:xe.type,label:xe.displayName,description:xe.description}));n.filters=[],Te.length>0&&!Te.some(xe=>xe.value===at.replace(We))?(Kt(Te[0]),oe(ye),k(Te)):(oe(ye),k(Te))},_r=ye=>{const Te=ye.map(xe=>({value:xe.service,label:(0,T.startCase)(xe.serviceShortName)}));return Te.length>0?(0,T.uniqBy)(Te,xe=>xe.value):[]},es=async ye=>{const xe=(await i.filterMetricsByType($e,_)).filter(Pe=>Pe.type.includes(ye.toLowerCase())).map(Pe=>({value:Pe.type,label:Pe.displayName,component:function(){return(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:je,children:Pe.type}),(0,x.jsx)("div",{className:Me.optionDescription,children:Pe.description})]})}}));return[{label:"Template Variables",options:r.options},...xe]},ts=si()(es,400),Kt=({value:ye})=>{const Te=lt(v,ye);G(Te);const{metricKind:xe,valueType:Pe}=Te,Xe=xe===R.GAUGE||Pe===I.DISTRIBUTION?Ve.None:Ve.Rate,{perSeriesAligner:ct}=ht(Pe,xe,n.perSeriesAligner,Xe);Object.assign(n,{...mt(i),crossSeriesReducer:Pe===I.DISTRIBUTION?"REDUCE_MEAN":"REDUCE_NONE",projectName:n.projectName,filters:n.filters}),e({...Bn({...n,perSeriesAligner:ct},ye),preprocessor:Xe})};return(0,x.jsxs)("span",{"data-testid":Ze.components.queryEditor.visualMetricsQueryEditor.container.input,children:[(0,x.jsx)(Qe.U,{children:(0,x.jsxs)(st.B,{children:[(0,x.jsx)(rt,{refId:t,templateVariableOptions:r.options,projectName:$e,datasource:i,onChange:ye=>{e({...n,projectName:ye})}}),(0,x.jsx)(Ie.c,{label:"Service",width:"auto",children:(0,x.jsx)(Oe.l6,{width:"auto",onChange:qr,isLoading:Q.length===0,value:[...Q,...r.options].find(ye=>ye.value===_),options:[{label:"Template Variables",options:r.options},...Q],placeholder:"Select Services",inputId:`${t}-service`})}),(0,x.jsx)(Ie.c,{label:"Metric name",width:"auto",htmlFor:`${t}-select-metric`,children:(0,x.jsx)("span",{title:_===""?"Select a service first":"Type to search metrics",children:(0,x.jsx)(Oe.DW,{width:"auto",onChange:Kt,value:[...de,...r.options].find(ye=>ye.value===We),loadOptions:ts,defaultOptions:[{label:"Template Variables",options:r.options},...de.slice(0,100)],placeholder:"Select Metric",inputId:`${t}-select-metric`,disabled:_===""})})})]})}),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Jn,{labels:b,filters:n.filters,onChange:ye=>e({...n,filters:ye}),variableOptionGroup:r}),(0,x.jsxs)(Qe.U,{children:[(0,x.jsx)(ci,{metricDescriptor:L,query:n,onChange:e}),(0,x.jsx)(Wn,{refId:t,labels:Object.keys(b),query:n,onChange:e,variableOptionGroup:r,metricDescriptor:L}),(0,x.jsx)(Kn,{refId:t,datasource:i,templateVariableOptions:r.options,query:n,customMetaData:c,onChange:e,metricDescriptor:L,preprocessor:n.preprocessor}),(0,x.jsx)(dt,{refId:t,value:d,onChange:m})]})]})]})}const hi=t=>(0,Be.css)({label:"grafana-select-option-description",fontWeight:"normal",fontStyle:"italic",color:t.colors.text.secondary}),pi=F.memo(di),fi=({refId:t,onChange:e,graphPeriod:i,variableOptionGroup:n})=>(0,x.jsx)(Qe.U,{children:(0,x.jsx)(Ie.c,{label:"Graph period",htmlFor:`${t}-graph-period`,tooltip:(0,x.jsxs)(x.Fragment,{children:["Set ",(0,x.jsx)("code",{children:"graph_period"})," which forces a preferred period between points. Automatically set to the current interval if left blank."]}),children:(0,x.jsxs)(Tt.Gy,{children:[(0,x.jsx)(Ln.d,{"data-testid":`${t}-switch-graph-period`,value:i!=="disabled",onChange:r=>e(r.currentTarget.checked?"":"disabled")}),(0,x.jsx)(pt,{inputId:`${t}-graph-period`,templateVariableOptions:n.options,current:i,onChange:e,disabled:i==="disabled",aligmentPeriods:Nn})]})})}),mt=t=>({projectName:t.getDefaultProject(),crossSeriesReducer:"REDUCE_NONE",alignmentPeriod:"cloud-monitoring-auto",perSeriesAligner:qe.ALIGN_MEAN,groupBys:[],filters:[]}),Ut=t=>({projectName:t.getDefaultProject(),query:""});function mi({refId:t,query:e,datasource:i,onChange:n,onRunQuery:r,customMetaData:c,variableOptionGroup:d,range:m}){const y=(0,F.useCallback)(D=>{let v=!0;if(D?.filters&&D.filters.length>0){for(const M of D.filters)if(M===""){v=!1;break}}n({...e,timeSeriesList:D}),v&&r()},[n,r,e]),b=(0,F.useCallback)(D=>{n({...e,timeSeriesQuery:D}),r()},[n,r,e]);return(0,F.useEffect)(()=>{e.queryType===Ae.TIME_SERIES_LIST&&!e.timeSeriesList&&n({refId:e.refId,datasource:e.datasource,queryType:Ae.TIME_SERIES_LIST,timeSeriesList:mt(i),aliasBy:e.aliasBy}),e.queryType===Ae.TIME_SERIES_QUERY&&!e.timeSeriesQuery&&n({refId:e.refId,datasource:e.datasource,queryType:Ae.TIME_SERIES_QUERY,timeSeriesQuery:Ut(i),aliasBy:e.aliasBy})},[n,e,i]),(0,x.jsxs)(xt.D,{children:[(e.queryType===Ae.ANNOTATION||e.queryType===Ae.TIME_SERIES_LIST)&&e.timeSeriesList&&(0,x.jsx)(pi,{refId:t,variableOptionGroup:d,customMetaData:c,onChange:y,datasource:i,query:e.timeSeriesList,aliasBy:e.aliasBy,onChangeAliasBy:D=>n({...e,aliasBy:D}),range:m}),e.queryType===Ae.TIME_SERIES_QUERY&&e.timeSeriesQuery&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(In.B,{gap:1,direction:"row",children:[(0,x.jsx)(rt,{refId:t,datasource:i,onChange:D=>b({...e.timeSeriesQuery,projectName:D}),templateVariableOptions:d.options,projectName:e.timeSeriesQuery.projectName}),(0,x.jsx)(dt,{refId:t,value:e.aliasBy,onChange:D=>n({...e,aliasBy:D})})]}),(0,x.jsx)(ii,{onChange:D=>b({...e.timeSeriesQuery,query:D}),onRunQuery:r,query:e.timeSeriesQuery.query}),(0,x.jsx)(fi,{onChange:D=>b({...e.timeSeriesQuery,graphPeriod:D}),graphPeriod:e.timeSeriesQuery.graphPeriod,refId:t,variableOptionGroup:d})]})]})}const gi=F.memo(mi),vs=t=>({projectName:t.getDefaultProject(),expr:"",step:"10s"});function vi({refId:t,query:e,datasource:i,onChange:n,variableOptionGroup:r,onRunQuery:c}){function d(m){m.key==="Enter"&&m.shiftKey&&(c(),m.preventDefault(),m.stopPropagation())}return(0,x.jsx)("span",{"data-testid":Ze.components.queryEditor.promQlQueryEditor.container.input,children:(0,x.jsxs)(Qe.U,{children:[(0,x.jsx)(rt,{refId:t,templateVariableOptions:r.options,projectName:e.projectName,datasource:i,onChange:m=>n({...e,projectName:m})}),(0,x.jsx)(Pt.f,{name:"Query",className:"slate-query-field",value:e.expr,rows:10,placeholder:"Enter a Cloud Monitoring Prometheus query (Run with Shift+Enter)",onBlur:c,onKeyDown:d,onChange:m=>n({...e,expr:m.currentTarget.value})}),(0,x.jsx)(Ie.c,{label:"Min step",tooltip:"Time units and built-in variables can be used here, for example: $__interval, $__rate_interval, 5s, 1m, 3h, 1d, 1y (Default if no unit is specified: 10s)",children:(0,x.jsx)(Ct.p,{type:"string",placeholder:"auto",onChange:m=>n({...e,step:m.currentTarget.value}),onKeyDown:d,value:e.step??""})})]})})}var yi=a(84523),Ei=a(75686),bi=a(40263);const xi=t=>{const{query:e,onChange:i,onRunQuery:n}=t,{queryType:r}=e;return(0,x.jsxs)(yi.X,{children:[(0,x.jsx)(Ei.W,{label:"Query type",options:Pn,value:r,onChange:({value:c})=>{i({...e,queryType:c}),n()}}),(0,x.jsx)(bi.Z,{grow:1})]})},Ci=t=>{const{datasource:e,query:i,onRunQuery:n,onChange:r,range:c}=t,[d,m]=(0,F.useState)(!1);(0,F.useEffect)(()=>{const fe=e.migrateQuery(i);Tn()(fe,i)||r({...fe})},[i,e,r]);const[y,b]=(0,F.useState)(i),[D,v]=(0,F.useState)(!1),M={...ti(e),...i.sloQuery},L=fe=>{r({...i,sloQuery:fe}),n()},G={projectName:e.getDefaultProject(),expr:"",step:"10s",...i.promQLQuery},de=fe=>{r({...i,promQLQuery:fe})},k=fe=>{(fe.queryType===Ae.TIME_SERIES_LIST&&!(0,T.isEqual)(fe.timeSeriesList,mt(e))||fe.queryType===Ae.TIME_SERIES_QUERY&&!(0,T.isEqual)(fe.timeSeriesQuery,Ut(e)))&&v(!0),r(fe)},Y=(t.data?.series.length?t.data?.series[0].meta:{})?.custom??{},_={label:"Template Variables",expanded:!1,options:e.getVariables().map(ut.z)};(0,F.useEffect)(()=>{(!i.queryType||!Object.values(Ae).includes(i.queryType))&&r({...i,queryType:Ae.TIME_SERIES_LIST})});const oe=i.queryType,Ee=fe=>{D&&(y.queryType===Ae.TIME_SERIES_LIST||y.queryType===Ae.TIME_SERIES_QUERY)?y.queryType!==fe.queryType&&m(!0):r(fe),b(fe)};return(0,x.jsx)("span",{"data-testid":Ze.components.queryEditor.container,children:(0,x.jsxs)(xt.D,{children:[(0,x.jsx)(Sn.u,{"data-testid":"switch-query-type-modal",title:"Warning",body:"By switching your query type, your current query will be lost.",isOpen:d,onConfirm:()=>{m(!1),r(y),v(!1)},confirmText:"Confirm",onDismiss:()=>{m(!1),b(i)}}),(0,x.jsx)(xi,{query:i,onChange:Ee,onRunQuery:n}),oe===Ae.PROMQL&&(0,x.jsx)(vi,{refId:i.refId,variableOptionGroup:_,onChange:de,onRunQuery:n,datasource:e,query:G}),oe!==Ae.SLO&&(0,x.jsx)(gi,{refId:i.refId,variableOptionGroup:_,customMetaData:Y,onChange:k,onRunQuery:n,datasource:e,query:i,range:c||(0,An.E2)()}),oe===Ae.SLO&&(0,x.jsx)(ni,{refId:i.refId,variableOptionGroup:_,customMetaData:Y,onChange:L,onRunQuery:n,datasource:e,query:M,aliasBy:i.aliasBy,onChangeAliasBy:fe=>r({...i,aliasBy:fe})})]})})};var Ti=a(88159),Ai=a(50363);const Si=t=>{const{value:e,placeholder:i,className:n,isSearchable:r,onChange:c}=t,d=wi(t),m=Ii(d,e),y=(0,F.useCallback)(b=>c(b.value),[c]);return(0,x.jsx)(Oe.l6,{className:n,isMulti:!1,isClearable:!1,backspaceRemovesValue:!1,onChange:y,options:d,isSearchable:r,maxMenuHeight:500,placeholder:i,noOptionsMessage:"No options found",value:m})},wi=({variables:t=[],options:e})=>(0,F.useMemo)(()=>!Array.isArray(t)||t.length===0?e:[{label:"Template Variables",options:t.map(({name:i})=>({label:`$${i}`,value:`$${i}`}))},...e],[t,e]),Ii=(t,e)=>(0,F.useMemo)(()=>(t.every(n=>n.options)?(0,T.flatten)(t.map(n=>n.options)):t).find(n=>n.value===e),[t,e]);var Li=a(96601),Di=a(74064),Ni=a(10247),Oi=a(88849),Rt=a(5005),Mi=a(18899),Pi=a(76917),jt=a(58779);const ki=t=>{const[e,i]=(0,F.useState)(null),n=t.type==="submenu",r=(0,ot.of)(Ri),c=t.iconClassName?(0,Rt.Uo)(t.iconClassName):void 0;switch(t.type){case"divider":return(0,x.jsx)("li",{className:"divider"});case"group":return(0,x.jsx)("li",{children:(0,x.jsx)("span",{className:r.groupLabel,children:t.text})});default:return(0,x.jsxs)("li",{className:n?`dropdown-submenu ${Ui(e)}`:void 0,ref:i,"data-testid":jt.Tp.components.Panels.Panel.menuItems(t.text),children:[(0,x.jsxs)("a",{onClick:t.onClick,href:t.href,role:"menuitem",children:[c&&(0,x.jsx)(Je.I,{name:c,className:r.menuIconClassName}),(0,x.jsxs)("span",{className:"dropdown-item-text","data-testid":jt.Tp.components.Panels.Panel.headerItems(t.text),children:[t.text,n&&(0,x.jsx)(Je.I,{name:"angle-right",className:r.shortcutIconClassName})]}),t.shortcut&&(0,x.jsxs)("span",{className:"dropdown-menu-item-shortcut",children:[(0,x.jsx)(Je.I,{name:"keyboard",className:r.menuIconClassName})," ",t.shortcut]})]}),t.children]})}};function Ui(t){if(!t)return"invisible";const e=t.parentElement.getBoundingClientRect(),i=t.getBoundingClientRect();return i.width===0?"invisible":e.right+i.width+10>window.innerWidth?"pull-left":"pull-right"}function Ri(t){return{menuIconClassName:(0,Be.css)({marginRight:t.spacing(1),"a::after":{display:"none"}}),shortcutIconClassName:(0,Be.css)({position:"absolute",top:"7px",right:t.spacing(.5),color:t.colors.text.secondary}),groupLabel:(0,Be.css)({color:t.colors.text.secondary,fontSize:t.typography.size.sm,padding:t.spacing(.5,1)})}}const ji=({children:t,customCss:e})=>{if(!t||t.length===0)return null;const i=t.find(n=>n.active===!0);return(0,x.jsx)("div",{className:`gf-form-select-wrapper width-20 ${e}`,children:(0,x.jsxs)("div",{className:"dropdown",children:[(0,x.jsx)("button",{type:"button",className:"gf-form-input dropdown-toggle","data-toggle":"dropdown",style:{textAlign:"left"},children:i?.text}),(0,x.jsx)("ul",{role:"menu",className:"dropdown-menu dropdown-menu--menu",children:t.map(n=>n.hideFromTabs?null:(0,x.jsx)(ki,{iconClassName:n.icon,text:n.text,href:n.url},n.url))})]})})},$i=({children:t})=>!t||t.length===0?null:(0,x.jsxs)("nav",{children:[(0,x.jsx)(ji,{customCss:"page-header__select-nav",children:t}),(0,x.jsx)(Ni.U,{className:"page-header__tabs",hideBorder:!0,children:t.map((e,i)=>!e.hideFromTabs&&(0,x.jsx)(Oi.o,{label:e.text,active:e.active,icon:e.icon,href:e.url,suffix:e.tabSuffix},`${e.url}-${i}`))})]}),Bi=({navItem:t,renderTitle:e,actions:i,info:n,subTitle:r})=>{const c=(0,ot.of)(Fi);if(!t)return null;const d=m=>{const y=m.icon==="grafana"?12:14,b=m.icon&&(0,Rt.Uo)(m.icon),D=r??m.subTitle;return(0,x.jsxs)("div",{className:"page-header__inner",children:[(0,x.jsxs)("span",{className:"page-header__logo",children:[b&&(0,x.jsx)(Je.I,{name:b,size:"xxxl",style:{marginTop:y}}),m.img&&(0,x.jsx)("img",{className:"page-header__img",src:m.img,alt:""})]}),(0,x.jsxs)("div",{className:(0,Be.cx)("page-header__info-block",c.headerText),children:[e?e(m.text):Gi(m.text,m.highlightText),n&&(0,x.jsx)(Mi.Q,{info:n}),D&&(0,x.jsx)("div",{className:"page-header__sub-title",children:D}),i&&(0,x.jsx)("div",{className:c.actions,children:i})]})]})};return(0,x.jsx)("div",{className:c.headerCanvas,children:(0,x.jsx)("div",{className:"page-container",children:(0,x.jsxs)("div",{className:"page-header",children:[d(t),t.children&&t.children.length>0&&(0,x.jsx)($i,{children:t.children})]})})})};function Gi(t,e){return t?(0,x.jsxs)("h1",{className:"page-header__title",children:[t,e&&(0,x.jsx)(Pi.J,{text:e,className:(0,Be.css)({verticalAlign:"middle"})})]}):null}const Fi=t=>({actions:(0,Be.css)({display:"flex",flexDirection:"row",gap:t.spacing(1)}),headerText:(0,Be.css)({display:"flex",flexDirection:"column",gap:t.spacing(1)}),headerCanvas:(0,Be.css)({background:t.colors.background.canvas})}),{SecretFormField:Vi}=cn.rRI;function Wi(){we("footer",Ai.wi,[]),we("icon",Je.I,["name","size","type",["onClick",{watchDepth:"reference",wrapApply:!0}]]),we("spinner",un.y,["inline"]),we("helpModal",Di.N,[]),we("pageHeader",Bi,["model","noTabs"]),we("emptyListCta",Ti.A,["title","buttonIcon","buttonLink","buttonTitle",["onClick",{watchDepth:"reference",wrapApply:!0}],"proTip","proTipLink","proTipLinkTitle","proTipTarget","infoBox","infoBoxTitle"]),we("tagFilter",Li.$,["tags",["onChange",{watchDepth:"reference"}],["tagOptions",{watchDepth:"reference"}]]),we("colorPicker",dn.sk,["color",["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("seriesColorPickerPopover",hn.t,["color","series","onColorChange","onToggleAxis"]),we("unitPicker",pn.p,["value","width",["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("metricSelect",Si,["options","onChange","value","isSearchable","className","placeholder",["variables",{watchDepth:"reference"}]]),we("cloudMonitoringQueryEditor",Ci,["target","onQueryChange","onExecuteQuery",["events",{watchDepth:"reference"}],["datasource",{watchDepth:"reference"}],["templateSrv",{watchDepth:"reference"}]]),we("secretFormField",Vi,["value","isConfigured","inputWidth","labelWidth","aria-label",["onReset",{watchDepth:"reference",wrapApply:!0}],["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("graphContextMenu",fn.H,["x","y","itemsGroup",["onClose",{watchDepth:"reference",wrapApply:!0}],["getContextMenuSource",{watchDepth:"reference",wrapApply:!0}],["timeZone",{watchDepth:"reference",wrapApply:!0}]]),we("drilldownLinksEditor",mn.e,["value","links","suggestions",["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("datasourceHttpSettingsNext",gn.t,["defaultUrl","showAccessOptions","dataSourceConfig","showForwardOAuthIdentityOption",["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("folderPicker",bn.sR,["labelClass","rootName","enableCreateNew","enableReset","initialTitle","initialFolderId","dashboardId","onCreateFolder",["enterFolderCreation",{watchDepth:"reference",wrapApply:!0}],["exitFolderCreation",{watchDepth:"reference",wrapApply:!0}],["onLoad",{watchDepth:"reference",wrapApply:!0}],["onChange",{watchDepth:"reference",wrapApply:!0}]]),we("timePickerSettings",xn.p,["renderCount","refreshIntervals","timePickerHidden","nowDelay","timezone",["onTimeZoneChange",{watchDepth:"reference",wrapApply:!0}],["onRefreshIntervalChange",{watchDepth:"reference",wrapApply:!0}],["onNowDelayChange",{watchDepth:"reference",wrapApply:!0}],["onHideTimePickerChange",{watchDepth:"reference",wrapApply:!0}]]),we("clipboardButton",vn.b,[["getText",{watchDepth:"reference",wrapApply:!0}]])}const gt=t=>e=>e.finally(t.$evalAsync),zi=`
<div class="dropdown cascade-open">
<a ng-click="showActionsMenu()" class="query-part-name pointer dropdown-toggle" data-toggle="dropdown">{{part.def.type}}</a>
<span>(</span><span class="query-part-parameters"></span><span>)</span>
<ul class="dropdown-menu">
  <li ng-repeat="action in partActions">
    <a ng-click="triggerPartAction(action)">{{action.text}}</a>
  </li>
</ul>
`;o.Ay.directive("queryPartEditor",["templateSrv",Ki]);function Ki(t){const e='<input type="text" class="hide input-mini tight-form-func-param"></input>';return{restrict:"E",template:zi,scope:{part:"=",handleEvent:"&",debounce:"@"},link:function(n,r){const c=n.part,d=c.def,m=r.find(".query-part-parameters"),y=n.debounce;n.partActions=[];function b(k){const Q=U()(this),Y=Q.next();Y.val(c.params[k]),Y.css("width",Q.width()+16+"px"),Q.hide(),Y.show(),Y.focus(),Y.select();const _=Y.data("typeahead");_&&(Y.val(""),_.lookup())}function D(k){const Q=U()(this),Y=Q.prev(),_=Q.val();(_!==""||c.def.params[k].optional)&&(Y.html(t.highlightVariablesAsHtml(_)),c.updateParam(Q.val(),k),n.$apply(()=>{n.handleEvent({$event:{name:"part-param-changed"}})})),Q.hide(),Y.show()}function v(k,Q){Q.which===13&&D.call(this,k)}function M(){this.style.width=(3+this.value.length)*8+"px"}function L(k,Q,Y){if(!Q.options&&!Q.dynamicLookup)return;const _=(Ee,fe)=>{if(Q.options){let Le=Q.options;return Q.type==="int"&&(Le=(0,T.map)(Le,ze=>ze.toString())),Le}n.$apply(()=>{n.handleEvent({$event:{name:"get-param-options"}}).then(Le=>{const ze=(0,T.map)(Le,Me=>(0,T.escape)(Me.value));fe(ze)})})};k.attr("data-provide","typeahead"),k.typeahead({source:_,minLength:0,items:1e3,updater:Ee=>(Ee=(0,T.unescape)(Ee),setTimeout(()=>{D.call(k[0],Y)},0),Ee)});const oe=k.data("typeahead");oe.lookup=function(){this.query=this.$element.val()||"";const Ee=this.source(this.query,U().proxy(this.process,this));return Ee&&this.process(Ee)},y&&(oe.lookup=(0,T.debounce)(oe.lookup,500,{leading:!0}))}n.showActionsMenu=()=>{gt(n)(n.handleEvent({$event:{name:"get-part-actions"}}).then(k=>{n.partActions=k}))},n.triggerPartAction=k=>{n.handleEvent({$event:{name:"action",action:k}})};function G(){(0,T.each)(d.params,(k,Q)=>{if(k.optional&&c.params.length<=Q)return;Q>0&&U()("<span>, </span>").appendTo(m);const Y=t.highlightVariablesAsHtml(c.params[Q]),_=U()('<a class="graphite-func-param-link pointer">'+Y+"</a>"),oe=U()(e);_.appendTo(m),oe.appendTo(m),oe.blur((0,T.partial)(D,Q)),oe.keyup(M),oe.keypress((0,T.partial)(v,Q)),_.click((0,T.partial)(b,Q)),L(oe,k,Q)})}function de(){m.empty(),G()}de()}}}function Hi(t){let e=this.query;return e===""?!0:(e[0]==="/"&&(e=e.substring(1)),e[e.length-1]==="/"&&(e=e.substring(0,e.length-1)),t.toLowerCase().match(e.toLowerCase()))}class Qi{constructor(e,i,n,r){this.$scope=e,this.$sce=n,this.templateSrv=r,this.inputElement=i.find("input").first(),this.linkElement=i.find("a").first(),this.linkMode=!0,this.cancelBlur=null,this.labelMode=!1,this.lookupText=!1,this.debounce=!1,e.$watch("ctrl.model",this.modelChanged.bind(this))}static{this.$inject=["$scope","$element","$sce","templateSrv"]}$onInit(){this.labelMode?this.cssClasses="gf-form-label "+this.cssClass:this.cssClasses="gf-form-input gf-form-input--dropdown "+this.cssClass,this.placeholder&&this.inputElement.attr("placeholder",this.placeholder),this.inputElement.attr("data-provide","typeahead"),this.inputElement.typeahead({source:this.typeaheadSource.bind(this),minLength:0,items:1e4,updater:this.typeaheadUpdater.bind(this),matcher:Hi});const e=this.inputElement.data("typeahead");e.lookup=function(){this.query=this.$element.val()||"",this.source(this.query,this.process.bind(this))},this.debounce&&(e.lookup=(0,T.debounce)(e.lookup,500,{leading:!0})),this.linkElement.keydown(i=>{(i.keyCode===40||i.keyCode===13)&&this.linkElement.click()}),this.inputElement.keydown(i=>{i.keyCode===13&&setTimeout(()=>{this.inputElement.blur()},300)}),this.inputElement.blur(this.inputBlur.bind(this)),this.startOpen&&setTimeout(this.open.bind(this),0)}getOptionsInternal(e){return gt(this.$scope)(Promise.resolve(this.getOptions({$query:e})))}isPromiseLike(e){return e&&typeof e.then=="function"}modelChanged(){(0,T.isObject)(this.model)?this.updateDisplay(this.model.text):this.lookupText?this.getOptionsInternal("").then(e=>{const i=(0,T.find)(e,{value:this.model});this.updateDisplay(i?i.text:this.model)}):this.updateDisplay(this.model)}typeaheadSource(e,i){this.getOptionsInternal(e).then(n=>{this.optionCache=n;const r=(0,T.map)(n,c=>(0,T.escape)(c.text));this.allowCustom&&this.text!==""&&(0,T.indexOf)(r,this.text)===-1&&r.unshift(this.text),i(r)})}typeaheadUpdater(e){return e===this.text?(clearTimeout(this.cancelBlur),this.inputElement.focus(),e):(this.inputElement.val(e),this.switchToLink(!0),e)}switchToLink(e){this.linkMode&&!e||(clearTimeout(this.cancelBlur),this.cancelBlur=null,this.linkMode=!0,this.inputElement.hide(),this.linkElement.show(),this.updateValue(this.inputElement.val()))}inputBlur(){this.cancelBlur=setTimeout(this.switchToLink.bind(this),200)}updateValue(e){e=(0,T.unescape)(e),!(e===""||this.text===e)&&this.$scope.$apply(()=>{const i=(0,T.find)(this.optionCache,{text:e});i?((0,T.isObject)(this.model)?this.model=i:this.model=i.value,this.text=i.text):this.allowCustom&&((0,T.isObject)(this.model)?this.model.text=this.model.value=e:this.model=e,this.text=e),this.$scope.$$postDigest(()=>{this.$scope.$apply(()=>{this.onChange({$option:i})})})})}updateDisplay(e){this.text=e,this.display=this.$sce.trustAsHtml(this.templateSrv.highlightVariablesAsHtml(e))}open(){this.inputElement.css("width",Math.max(this.linkElement.width(),80)+16+"px"),this.inputElement.show(),this.inputElement.focus(),this.linkElement.hide(),this.linkMode=!1;const e=this.inputElement.data("typeahead");e&&(this.inputElement.val(""),e.lookup())}}const Yi=`
<input type="text"
  data-provide="typeahead"
  class="gf-form-input"
  spellcheck="false"
  style="display:none">
</input>
<a ng-class="ctrl.cssClasses"
   tabindex="1"
   ng-click="ctrl.open()"
   give-focus="ctrl.focus"
   ng-bind-html="ctrl.display || '&nbsp;'">
</a>
`;function Xi(){return{restrict:"E",template:Yi,controller:Qi,bindToController:!0,controllerAs:"ctrl",scope:{model:"=",getOptions:"&",onChange:"&",cssClass:"@",allowCustom:"@",labelMode:"@",lookupText:"@",placeholder:"@",startOpen:"@",debounce:"@"}}}o.Ay.directive("gfFormDropdown",Xi);const Ji=`
<div class="baron__track">
  <div class="baron__bar"></div>
</div>
`,Zi="baron baron__root",qi="baron__scroller";function _i(){return{restrict:"A",link:(t,e,i)=>{let n=e.parent();const r=e;i.grafanaScrollbar&&i.grafanaScrollbar==="scrollonroot"&&(n=r),n.addClass(Zi),U()(Ji).appendTo(n),e.addClass(qi);const c={root:n[0],scroller:r[0],bar:".baron__bar",barOnCls:"_scrollbar",scrollingCls:"_scrolling",track:".baron__track",direction:"v"},d=l()(c);t.$on("$destroy",()=>{d.dispose()})}}}o.Ay.directive("grafanaScrollbar",_i);var er=a(16703);o.Ay.directive("jsonTree",[function(){return{restrict:"E",scope:{object:"=",startExpanded:"@",rootName:"@"},link:(e,i)=>{let n=e.startExpanded;e.startExpanded==="true"?n=2:e.startExpanded==="false"&&(n=1);const r={[e.rootName]:e.object},d=new er.O(r,n,{animateOpen:!0}).render(!0);i.append(d)}}}]);const tr=`
<label for="check-{{ctrl.id}}" class="gf-form-switch-container">
  <div class="gf-form-label {{ctrl.labelClass}}" ng-show="ctrl.label">
    {{ctrl.label}}
    <info-popover mode="right-normal" ng-if="ctrl.tooltip" position="top center">
      {{ctrl.tooltip}}
    </info-popover>
  </div>
  <div class="gf-form-switch {{ctrl.switchClass}}" ng-if="ctrl.show">
    <input id="check-{{ctrl.id}}" type="checkbox" ng-model="ctrl.checked" ng-change="ctrl.internalOnChange()">
    <span class="gf-form-switch__slider"></span>
  </div>
</label>
`,nr=`
<label for="check-{{ctrl.id}}" class="gf-form-switch-container">
   <div class="gf-form-label {{ctrl.labelClass}}" ng-show="ctrl.label">
    {{ctrl.label}}
    <info-popover mode="right-normal" ng-if="ctrl.tooltip" position="top center">
      {{ctrl.tooltip}}
    </info-popover>
  </div>
  <div class="gf-form-checkbox {{ctrl.switchClass}}" ng-if="ctrl.show">
    <input id="check-{{ctrl.id}}" type="checkbox" ng-model="ctrl.checked" ng-change="ctrl.internalOnChange()">
    <span class="gf-form-switch__checkbox"></span>
  </div>
</label>
`;class $t{constructor(e,i){this.$timeout=i,this.show=!0,this.id=e.$id}static{this.$inject=["$scope","$timeout"]}internalOnChange(){return this.$timeout(()=>this.onChange())}}function ir(){return{restrict:"E",controller:$t,controllerAs:"ctrl",bindToController:!0,scope:{checked:"=",label:"@",labelClass:"@",tooltip:"@",switchClass:"@",onChange:"&"},template:tr}}function rr(){return{restrict:"E",controller:$t,controllerAs:"ctrl",bindToController:!0,scope:{checked:"=",label:"@",labelClass:"@",tooltip:"@",switchClass:"@",onChange:"&"},template:nr}}o.Ay.directive("gfFormSwitch",ir),o.Ay.directive("gfFormCheckbox",rr);function sr(){return{restrict:"E",template:`<icon name="'info-circle'" style="margin-left: 10px;" size="'xs'"></icon>`,transclude:!0,link:(t,e,i,n,r)=>{const c=i.offset||"0 -10px",d=i.position||"right middle";let m="drop-help drop-hide-out-of-bounds";const y="hover";e.addClass("gf-form-help-icon"),i.wide&&(m+=" drop-wide"),i.mode&&e.addClass("gf-form-help-icon--"+i.mode),r((b,D)=>{const v=document.createElement("div");v.className="markdown-html",(0,T.each)(b,L=>{v.appendChild(L)});const M={target:e[0],content:v,position:d,classes:m,openOn:y,hoverOpenDelay:400,tetherOptions:{offset:c,constraints:[{to:"window",attachment:"together",pin:!0}]}};t.$applyAsync(()=>{const L=new(se())(M),G=t.$on("$destroy",()=>{L.destroy(),G()})})})}}}o.Ay.directive("infoPopover",sr),o.Ay.directive("spectrumPicker",or);function or(){return{restrict:"E",require:"ngModel",scope:!0,replace:!0,template:'<color-picker color="ngModel.$viewValue" on-change="onColorChange"></color-picker>',link:(t,e,i,n)=>{t.ngModel=n,t.onColorChange=r=>{n.$setViewValue(r)}}}}var Ye=a(88023);const ar="ace/theme/grafana-dark",lr="ace/theme/textmate",cr="text",ur=10,dr=2,hr=!0,pr=!0,fr="<div></div>";async function mr(t,e,i){const n=i.mode||cr,r=i.maxLines||ur,c=i.showGutter!==void 0,d=i.tabSize||dr,m=i.behavioursEnabled?i.behavioursEnabled==="true":hr,y=i.snippetsEnabled?i.snippetsEnabled==="true":pr,b=e.get(0),{default:D}=await a.e(3832).then(a.t.bind(a,47496,23));await a.e(6464).then(a.t.bind(a,6464,23)),await a.e(2694).then(a.t.bind(a,52694,23)),await a.e(7391).then(a.t.bind(a,57391,23)),await a.e(2228).then(a.t.bind(a,32228,23)),await a.e(2514).then(a.t.bind(a,32514,23)),await a.e(7515).then(a.t.bind(a,17515,23)),await a.e(4289).then(a.t.bind(a,54289,23)),await a.e(1708).then(a.t.bind(a,11708,23)),await a.e(7613).then(a.t.bind(a,7613,23)),await a.e(8730).then(a.t.bind(a,98730,23)),await a.e(9118).then(a.t.bind(a,59118,23)),await a.e(5277).then(a.t.bind(a,45277,23)),await a.e(9384).then(a.t.bind(a,47003,23));const v=D.edit(b),M=v.getSession(),L={maxLines:r,showGutter:c,tabSize:d,behavioursEnabled:m,highlightActiveLine:!1,showPrintMargin:!1,autoScrollEditorIntoView:!0};v.setOptions(L),v.$blockScrolling=1/0,v.renderer.setScrollMargin(10,10),v.renderer.setPadding(10),k(),de(n),Q(t.content),e.addClass("gf-code-editor");const G=e.find("textarea");G.addClass("gf-form-input"),G.attr("aria-label",i.textareaLabel),t.codeEditorFocus&&setTimeout(()=>{G.focus();const Y=G[0];if(Y.setSelectionRange){const _=G.val().length*2;Y.setSelectionRange(_,_)}},100),M.on("change",Y=>{t.$apply(()=>{const _=v.getValue();t.content=_})}),t.$watch("content",(Y,_)=>{const oe=v.getValue();Y!==oe&&Y!==_&&t.$$postDigest(()=>{Q(Y)})}),v.on("blur",()=>{t.onChange()}),t.$on("$destroy",()=>{v.destroy()}),v.commands.addCommand({name:"executeQuery",bindKey:{win:"Ctrl-Enter",mac:"Command-Enter"},exec:()=>{t.onChange()}});function de(Y){if(D.acequire("ace/ext/language_tools"),v.setOptions({enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:y}),t.getCompleter()){const oe=v;oe.completers=oe.completers.slice(),oe.completers.push(t.getCompleter())}const _=`ace/mode/${Y}`;M.setMode(_)}function k(){let Y=ar;Ye.Ay.bootData.user.lightTheme&&(Y=lr),v.setTheme(Y)}function Q(Y){v.setValue(Y),v.clearSelection()}}function gr(){return{restrict:"E",template:fr,scope:{content:"=",datasource:"=",codeEditorFocus:"<",onChange:"&",getCompleter:"&"},link:mr}}o.Ay.directive("codeEditor",gr);const vr=`
<div class="dropdown cascade-open">
<a ng-click="showActionsMenu()" class="query-part-name pointer dropdown-toggle" data-toggle="dropdown">{{part.label}}</a>
<span>{{part.def.wrapOpen}}</span><span class="query-part-parameters"></span><span>{{part.def.wrapClose}}</span>
<ul class="dropdown-menu">
  <li ng-repeat="action in partActions">
    <a ng-click="triggerPartAction(action)">{{action.text}}</a>
  </li>
</ul>
`;o.Ay.directive("sqlPartEditor",["templateSrv",yr]);function yr(t){const e='<input type="text" class="hide input-mini"></input>';return{restrict:"E",template:vr,scope:{part:"=",handleEvent:"&",debounce:"@"},link:function(n,r){const c=n.part,d=c.def,m=r.find(".query-part-parameters"),y=n.debounce;let b=null;n.partActions=[];function D(Y){const _=U()(this),oe=_.next();oe.val(c.params[Y]),oe.css("width",_.width()+16+"px"),_.hide(),oe.show(),oe.focus(),oe.select();const Ee=oe.data("typeahead");Ee&&(oe.val(""),Ee.lookup())}function v(Y,_){b=setTimeout(()=>{M(Y,_)},200)}function M(Y,_){const oe=Y.prev(),Ee=Y.val();(Ee!==""||c.def.params[_].optional)&&(oe.html(t.highlightVariablesAsHtml(Ee)),c.updateParam(Y.val(),_),n.$apply(()=>{n.handleEvent({$event:{name:"part-param-changed"}})})),Y.hide(),oe.show()}function L(Y,_){_.which===13&&M(U()(this),Y)}function G(){this.style.width=(3+this.value.length)*8+"px"}function de(Y,_,oe){if(!_.options&&!_.dynamicLookup)return;const Ee=(Le,ze)=>{if(_.options){let Me=_.options;return _.type==="int"&&(Me=(0,T.map)(Me,je=>je.toString())),Me}n.$apply(()=>{n.handleEvent({$event:{name:"get-param-options",param:_}}).then(Me=>{const je=(0,T.map)(Me,$e=>(0,T.escape)($e.value));(0,T.indexOf)(je,c.params[oe])===-1&&je.unshift((0,T.escape)(c.params[oe])),ze(je)})})};Y.attr("data-provide","typeahead"),Y.typeahead({source:Ee,minLength:0,items:1e3,updater:Le=>(Le=(0,T.unescape)(Le),Le===c.params[oe]&&(clearTimeout(b),Y.focus()),Le)});const fe=Y.data("typeahead");fe.lookup=function(){this.query=this.$element.val()||"";const Le=this.source(this.query,U().proxy(this.process,this));return Le&&this.process(Le)},y&&(fe.lookup=(0,T.debounce)(fe.lookup,500,{leading:!0}))}n.showActionsMenu=()=>{n.handleEvent({$event:{name:"get-part-actions"}}).then(Y=>{n.partActions=Y})},n.triggerPartAction=Y=>{n.handleEvent({$event:{name:"action",action:Y}})};function k(){(0,T.each)(d.params,(Y,_)=>{if(Y.optional&&c.params.length<=_)return;_>0&&U()("<span>"+d.separator+"</span>").appendTo(m);const oe=t.highlightVariablesAsHtml(c.params[_]),Ee=U()('<a class="query-part__link">'+oe+"</a>"),fe=U()(e);Ee.appendTo(m),fe.appendTo(m),fe.blur((0,T.partial)(v,fe,_)),fe.keyup(G),fe.keypress((0,T.partial)(L,_)),Ee.click((0,T.partial)(D,_)),de(fe,Y,_)})}function Q(){m.empty(),k()}Q()}}}o.m7.directive("datasourceHttpSettings",()=>({scope:{current:"=",suggestUrl:"@",noDirectAccess:"@",showForwardOAuthIdentityOption:"@"},templateUrl:"public/app/angular/partials/http_settings_next.html",link:{pre:t=>{t.showAccessOption=t.noDirectAccess!=="true",t.onChange=e=>{t.current=e}}}})),o.m7.directive("datasourceTlsAuthSettings",()=>({scope:{current:"="},templateUrl:"public/app/angular/partials/tls_auth_settings.html"}));var Bt=a(43956),vt=a(45251);o.Ay.directive("pluginComponent",["$compile","$http","$templateCache","$location",Er]);function Er(t,e,i,n){function r(v){if(v.template)return Promise.resolve(v.template);const M=i.get(v.templateUrl);return M?Promise.resolve(M):e.get(v.templateUrl).then(L=>L.data)}function c(v,M){if(v)return v.indexOf("public")===0?v:M+"/"+v}function d(v){return v.Component.templateUrl=c(v.Component.templateUrl,v.baseUrl),()=>({templateUrl:v.Component.templateUrl,template:v.Component.template,restrict:"E",controller:v.Component,controllerAs:"ctrl",bindToController:!0,scope:v.bindings,link:(M,L,G,de)=>{de.link&&de.link(M,L,G,de),de.init&&de.init()}})}function m(v,M){const L={name:"panel-plugin-"+v.panel.type,bindings:{dashboard:"=",panel:"=",row:"="},attrs:{dashboard:"dashboard",panel:"panel",class:"panel-height-helper"}},G=Ye.Ay.panels[v.panel.type];return(0,Bt.TV)(G.id).then(de=>{const k=de.angularPanelCtrl;return L.Component=k,!k||k.registered?L:k.templatePromise?k.templatePromise.then(Q=>L):(G&&(k.templateUrl=c(k.templateUrl,G.baseUrl)),k.templatePromise=r(k).then(Q=>(k.templateUrl=null,k.template=`<grafana-panel ctrl="ctrl" class="panel-height-helper">${Q}</grafana-panel>`,{...L,baseUrl:G.baseUrl})),k.templatePromise)})}function y(v,M){switch(M.type){case"query-ctrl":{const L=v.ctrl.datasource;return Promise.resolve({baseUrl:L.meta.baseUrl,name:"query-ctrl-"+L.meta.id,bindings:{target:"=",panelCtrl:"=",datasource:"="},attrs:{target:"ctrl.target","panel-ctrl":"ctrl",datasource:"ctrl.datasource"},Component:L.components.QueryCtrl})}case"annotations-query-ctrl":{const L=v.ctrl.currentDatasource.meta.baseUrl,G=v.ctrl.currentDatasource.meta.id;return(0,vt.cS)(v.ctrl.currentDatasource.meta).then(de=>({baseUrl:L,name:"annotations-query-ctrl-"+G,bindings:{annotation:"=",datasource:"="},attrs:{annotation:"ctrl.currentAnnotation",datasource:"ctrl.currentDatasource"},Component:de.components.AnnotationsQueryCtrl}))}case"datasource-config-ctrl":{const L=v.ctrl.datasourceMeta,G=n.url();return(0,vt.cS)(L).then(de=>(v.$watch("ctrl.current",()=>{G===n.url()&&v.onModelChanged(v.ctrl.current)},!0),{baseUrl:L.baseUrl,name:"ds-config-"+L.id,bindings:{meta:"=",current:"="},attrs:{meta:"ctrl.datasourceMeta",current:"ctrl.current"},Component:de.angularConfigCtrl}))}case"app-config-ctrl":{const L=v.ctrl.model;return(0,vt.ui)(L).then(G=>({baseUrl:L.baseUrl,name:"app-config-"+L.id,bindings:{appModel:"=",appEditCtrl:"="},attrs:{"app-model":"ctrl.model","app-edit-ctrl":"ctrl"},Component:G.angularConfigCtrl}))}case"panel":return m(v,M);default:return Promise.reject({message:"Could not find component type: "+M.type})}}function b(v,M,L){const G=w().element(document.createElement(L.name));(0,T.each)(L.attrs,(de,k)=>{G.attr(k,de)}),t(G)(v),M.empty(),setTimeout(()=>{v.$applyAsync(()=>{M.append(G),setTimeout(()=>{v.$applyAsync(()=>{v.$broadcast(g.ee.componentDidMount.name)})})})})}function D(v,M,L,G){if(G.notFound){M.empty();return}if(!G.Component)throw{message:"Failed to find exported plugin component for "+G.name};if(!G.Component.registered){const de=L.$normalize(G.name),k=d(G);o.Ay.directive(de,k),G.Component.registered=!0}b(v,M,G)}return{restrict:"E",link:(v,M,L)=>{y(v,L).then(G=>{D(v,M,L,G)}).catch(G=>{console.error("Plugin component error",G)})}}}var Gt=a(4050),br=a(94888),xr=a(41090),_e=a(22492);class Cr{static{this.$inject=["$scope","utilSrv","$rootScope","contextSrv","angularLoader","$injector"]}constructor(e,i,n,r,c,d){(0,Gt.w)(c),(0,br.j)(d),e.init=()=>{e.contextSrv=r,e.appSubUrl=Ye.Ay.appSubUrl,e._=ae(),i.init()},n.colors=xr.Tj,n.onAppEvent=function(m,y,b){let D;typeof m=="string"?D=n.$on(m,y):D=n.$on(m.name,y);let v=this;v.$id===1&&!b&&console.warn("warning rootScope onAppEvent called without localscope"),b&&(v=b),v.$on("$destroy",D)},n.appEvent=(m,y)=>{typeof m=="string"?(n.$emit(m,y),_e.A.emit(m,y)):(n.$emit(m.name,y),_e.A.emit(m,y))},e.init()}}function Tr(){return{restrict:"E",controller:Cr,link:(t,e)=>{const i=U()("body");U().fn.modal.Constructor.prototype.enforceFocus=()=>{};let n=new Date().getTime(),r=!0;const c=60*5e3;function d(){r&&i.hasClass("page-dashboard")&&new Date().getTime()-n>c&&(r=!1,i.addClass("view-mode--inactive"))}function m(){n=new Date().getTime(),r||(r=!0,i.removeClass("view-mode--inactive"))}i.mousemove(m),i.keydown(m),document.addEventListener("wheel",m,{capture:!0,passive:!0}),document.addEventListener("visibilitychange",m),setInterval(d,2e3),i.click(y=>{const b=U()(y.target);if(b.parents().length===0)return;i.find(".dropdown-menu-open").removeClass("dropdown-menu-open");const D=b.closest("[data-click-hide]");if(D.length){const M=D.parent();D.detach(),setTimeout(()=>{M.append(D)},100)}const v=e.find(".popover");v.length>0&&b.parents(".graph-legend").length===0&&v.hide()})}}}o.Ay.directive("grafanaApp",Tr);var ys=a(23345),Es=a(26415),bs=a(74526),xs=a(13609),Ar=a(61351),Sr=a(55227),wr=a(80757),Ir=a(70092),Lr=a(25713),Dr=a(64570),Ft=a(53027);class Nr{constructor(){this.$get=()=>{},(0,Ft.Lc)("Patch angular",!1,"RouteParamsProvider")}}class Or{constructor(){(0,Ft.Lc)("Patch angular",!1,"RouteProvider")}$get(){return this}}var Mr=a(85050);const Pr=()=>{o.m7.config(["$provide",t=>{t.decorator("$browser",["$delegate",e=>(e.onUrlChange=()=>{},e.url=()=>"",e)])}])},kr=()=>{o.m7.config(["$provide",t=>{t.decorator("$location",["$delegate",e=>(e=new Mr.b,e)])}]),o.m7.provider("$route",Or),o.m7.provider("$routeParams",Nr)};function Ur(){Pr(),kr()}function Rr(t){t.oldInvoke=t.invoke,t.invoke=(e,i,n,r)=>{const c=n?.$scope?.$parent;return c&&(c.panel&&(i.panel=c.panel),c.dashboard&&(i.dashboard=c.dashboard),c.ctrl?.target&&(i.panelCtrl=c.ctrl,i.datasource=c.ctrl.datasource,i.target=c.ctrl.target),c.ctrl?.datasourceMeta&&(i.meta=c.ctrl.datasourceMeta,i.current=c.ctrl.current),c.ctrl?.currentAnnotation&&(i.annotation=c.ctrl.currentAnnotation,i.datasource=c.ctrl.currentDatasource),c.isAppConfigCtrl&&(i.appEditCtrl=c.ctrl,i.appModel=c.ctrl.model),c.$parent?.$parent?.ctrl?.appModel&&(i.appModel=c.$parent?.$parent?.ctrl?.appModel)),t.oldInvoke(e,i,n,r)}}var jr=a(39741),$r=a(10112),Vt=a(16910);function Br(t){return function(i){const n=(0,F.useRef)(null),r=(0,F.useRef)(),c=(0,F.useRef)();return(0,F.useEffect)(()=>{if(!n.current)return;const d=(0,Gt.E)(),m='<plugin-component type="panel" class="panel-height-helper"></plugin-component>',y=new Fr,b=new Gr(t,i,y);r.current={panel:b,dashboard:(0,Vt.UA)().getCurrent(),size:{width:i.width,height:i.height},queryRunner:y},c.current=d.load(n.current,r.current,m)},[]),(0,F.useEffect)(()=>{c.current&&(r.current.size.height=i.height,r.current.size.width=i.width,r.current.panel.events.publish(new h.XM))},[i.width,i.height]),(0,F.useEffect)(()=>{r.current?.panel&&r.current.queryRunner.forwardNewData(i.data)},[i.data]),(0,x.jsx)("div",{ref:n,className:"panel-height-helper"})}}class Gr{constructor(e,i,n){i.options.angularOptions&&Object.assign(this,i.options.angularOptions),this.id=i.id,this.type=e.meta.id,this.title=i.title,this.fieldConfig=i.fieldConfig,this.options=i.options,this.plugin=e,this.events=new $r.o,this.queryRunner=n}refresh(){this.events.publish(new C._)}render(){this.events.publish(new h.XM)}getQueryRunner(){return this.queryRunner}}class Fr{constructor(){this.subject=new jr.m(1)}getData(e){return this.subject}forwardNewData(e){this.subject.next(e)}run(){}}var Vr=a(28082),Wr=a(98437),zr=a(87638),Kr=a(3142),Hr=a(89146),Re=a(33262);class Qr{constructor(){}init(){_e.l.subscribe(h.Ps,e=>this.showModal(e.payload)),_e.l.subscribe(h.aP,this.hideModal.bind(this))}hideModal(){(0,Re.l)("UtilSrv","hideModal",""),this.modalScope&&this.modalScope.dismiss&&this.modalScope.dismiss()}showModal(e){(0,Re.l)("UtilSrv","showModal","publish ShowModalReactEvent")}}var yt=a(65596);class Yr{clearPromiseCaches(){(0,Re.l)("annotations_srv.ts","clearPromiseCaches","DashboardQueryRunner")}getAnnotations(e){return(0,Re.l)("annotations_srv.ts","getAnnotations","DashboardQueryRunner.getResult"),Promise.resolve({annotations:[],alertState:void 0})}getAlertStates(e){return(0,Re.l)("annotations_srv.ts","getAlertStates","DashboardQueryRunner.getResult"),Promise.resolve(void 0)}getGlobalAnnotations(e){return(0,Re.l)("annotations_srv.ts","getGlobalAnnotations","DashboardQueryRunner.getResult"),Promise.resolve([])}saveAnnotationEvent(e){return(0,Re.l)("annotations_srv.ts","saveAnnotationEvent","api/saveAnnotation"),(0,yt.vJ)(e)}updateAnnotationEvent(e){return(0,Re.l)("annotations_srv.ts","updateAnnotationEvent","api/updateAnnotation"),(0,yt.rJ)(e)}deleteAnnotationEvent(e){return(0,Re.l)("annotations_srv.ts","deleteAnnotationEvent","api/deleteAnnotation"),(0,yt.Xm)(e)}translateQueryResult(e,i){(0,Re.l)("annotations_srv.ts","translateQueryResult","DashboardQueryRunner/utils/translateQueryResult"),e.snapshotData&&(e=(0,T.cloneDeep)(e),delete e.snapshotData);for(const n of i)n.source=e,n.color=e.iconColor,n.type=e.name,n.isRegion=n.timeEnd&&n.time!==n.timeEnd;return i}}function Xr(){o.Ay.factory("backendSrv",()=>(0,Vr.AI)()),o.Ay.factory("contextSrv",()=>zr.TP),o.Ay.factory("dashboardSrv",()=>(0,Vt.UA)()),o.Ay.factory("datasourceSrv",()=>(0,Wr.l)()),o.Ay.factory("linkSrv",()=>(0,Hr.mQ)()),o.Ay.factory("validationSrv",()=>Kr.P),o.Ay.service("annotationsSrv",Yr),o.Ay.service("utilSrv",Qr)}const Jr={angular:{...w(),default:w()},"app/core/core_module":{default:o.m7,__useDefault:!0},"app/core/core":{appEvents:_e.A,contextSrv:Ar.TP,coreModule:o.m7},"app/plugins/sdk":Dr,"app/core/utils/promiseToDigest":{promiseToDigest:gt}};class Zr{constructor(){this.preBootModules=[],this.ngModuleDependencies=[],this.registerFunctions={}}init(){const e=w().module("grafana",[]);(0,Bt.f7)(Br),e.config(["$controllerProvider","$compileProvider","$filterProvider","$httpProvider","$provide","$sceDelegateProvider",(n,r,c,d,m,y)=>{Ye.$W.buildInfo.env!=="development"&&r.debugInfoEnabled(!1),d.useApplyAsync(!0),Ye.$W.pluginsCDNBaseURL&&y.trustedResourceUrlList(["self",`${Ye.$W.pluginsCDNBaseURL}/**`]),this.registerFunctions.controller=n.register,this.registerFunctions.directive=r.directive,this.registerFunctions.factory=m.factory,this.registerFunctions.service=m.service,this.registerFunctions.filter=c.register,m.decorator("$http",["$delegate","$templateCache",(b,D)=>{const v=b.get;return b.get=(M,L)=>(M.match(/\.html$/)&&(D.get(M)||(M+="?v="+new Date().getTime())),v(M,L)),b}])}]),this.ngModuleDependencies=["grafana.core","ngSanitize","grafana","pasvaz.bindonce","react"],o.yF.forEach(n=>{this.useModule(n)}),w().module("grafana.services").service("dashboardLoaderSrv",Sr.Fu),o.m7.factory("timeSrv",()=>(0,wr.jG)()),o.m7.factory("templateSrv",()=>(0,Lt.w)()),Wi(),Xr(),Ur();const i=(0,Lr.kB)(Jr);Ir.z.addImportMap({imports:i}),$.fn.tooltip.defaults.animation=!1}useModule(e){return this.preBootModules?this.preBootModules.push(e):(0,T.extend)(e,this.registerFunctions),this.ngModuleDependencies.push(e.name),e}bootstrap(){const e=w().bootstrap(document.getElementById("ngRoot"),this.ngModuleDependencies);return Rr(e),e.invoke(()=>(this.preBootModules.forEach(i=>{(0,T.extend)(i,this.registerFunctions)}),()=>{})),e}}},34757:(u,A,a)=>{"use strict";a.d(A,{a:()=>f});var s=a(2543),l=a.n(s);class f{constructor(C,o){this.$scope=C,this.$injector=o,this.panelCtrl=this.panelCtrl??C.ctrl.panelCtrl,this.target=this.target??C.ctrl.target,this.datasource=this.datasource??C.ctrl.datasource,this.panel=this.panelCtrl?.panel??C.ctrl.panelCtrl.panel,this.isLastQuery=(0,s.indexOf)(this.panel.targets,this.target)===this.panel.targets.length-1}refresh(){this.panelCtrl.refresh()}}},96320:(u,A,a)=>{"use strict";let s=a(12631);s.keys().forEach(l=>{s(l)})},88159:(u,A,a)=>{"use strict";a.d(A,{A:()=>te});var s=a(74848),l=a(22803),f=a(58779),g=a(79784),C=a(37e3),o=a(54594),h=a(78464),E=a(11817);const p=(0,l.css)({textAlign:"center"}),S=(0,l.css)({maxWidth:"700px",margin:"0 auto"}),te=({title:ne,buttonIcon:Z,buttonLink:ee,buttonTitle:B,buttonDisabled:K,onClick:T,proTip:ae,proTipLink:ge,proTipLinkTitle:X,proTipTarget:ce,infoBox:pe,infoBoxTitle:N})=>{const ue=()=>(0,s.jsxs)(s.Fragment,{children:[ae?(0,s.jsxs)("span",{children:[(0,s.jsx)(g.I,{name:"rocket"}),(0,s.jsxs)(E.x6,{i18nKey:"empty-list-cta.pro-tip",children:["ProTip: ",{proTip:ae}]}),ge&&(0,s.jsx)("a",{href:ge,target:ce,className:"text-link",children:X})]},"proTipFooter"):"",pe?(0,s.jsx)(C.F,{severity:"info",title:N??"",className:S,children:(0,s.jsx)("div",{dangerouslySetInnerHTML:pe})}):""]}),F=ue()?"":(0,l.css)({marginBottom:"20px"}),me=ee?o.z9:o.$n,O=(0,s.jsx)(me,{size:"lg",onClick:T,href:ee,icon:Z,className:F,"data-testid":f.Tp.components.CallToActionCard.buttonV2(B),disabled:K,children:B});return(0,s.jsx)(h.c,{className:p,message:ne,footer:ue(),callToActionElement:O})}},76917:(u,A,a)=>{"use strict";a.d(A,{J:()=>o});var s=a(74848),l=a(22803),f=a(96540),g=a(56276),C=a(29675);const o=({text:E="PRO",className:p,experimentId:S,eventVariant:w="",...te})=>{const ne=(0,C.of)(h);return(0,f.useEffect)(()=>{S&&(0,g.Xp)(S,"test",w)},[S,w]),(0,s.jsx)("span",{className:(0,l.cx)(ne.badge,p),...te,children:E})},h=E=>({badge:(0,l.css)({marginLeft:E.spacing(1.25),borderRadius:E.shape.borderRadius(5),backgroundColor:E.colors.success.main,padding:E.spacing(.25,.75),color:"white",fontWeight:E.typography.fontWeightMedium,fontSize:E.typography.pxToRem(10)})})},64570:(u,A,a)=>{"use strict";a.r(A),a.d(A,{MetricsPanelCtrl:()=>h,PanelCtrl:()=>o,QueryCtrl:()=>E,loadPluginCss:()=>l.PL});var s=a(26023),l=a(5885),f=a(8069),g=a(80759),C=a(34757);const o=(0,s.Y)(g.y),h=(0,s.Y)(f.F),E=(0,s.Y)(C.a)},13609:()=>{(function(u){"use strict";u(function(){u.support.transition=function(){var A=function(){var a=document.createElement("bootstrap"),s={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},l;for(l in s)if(a.style[l]!==void 0)return s[l]}();return A&&{end:A}}()})})(window.jQuery),function(u){"use strict";var A="[data-toggle=dropdown]",a=function(g){var C=u(g).on("click.dropdown.data-api",this.toggle);u("html").on("click.dropdown.data-api",function(){C.parent().removeClass("open")})};a.prototype={constructor:a,toggle:function(g){var C=u(this),o,h;if(!C.is(".disabled, :disabled"))return o=l(C),h=o.hasClass("open"),s(),h||("ontouchstart"in document.documentElement&&u('<div class="dropdown-backdrop"/>').insertBefore(u(this)).on("click",s),o.toggleClass("open")),C.focus(),!1},keydown:function(g){var C,o,h,E,p,S;if(/(38|40|27)/.test(g.keyCode)&&(C=u(this),g.preventDefault(),g.stopPropagation(),!C.is(".disabled, :disabled"))){if(E=l(C),p=E.hasClass("open"),!p||p&&g.keyCode==27)return g.which==27&&E.find(A).focus(),C.click();o=u("[role=menu] li:not(.divider):visible a",E),o.length&&(S=o.index(o.filter(":focus")),g.keyCode==38&&S>0&&S--,g.keyCode==40&&S<o.length-1&&S++,~S||(S=0),o.eq(S).focus())}}};function s(){u(".dropdown-backdrop").remove(),u(A).each(function(){l(u(this)).removeClass("open")})}function l(g){var C=g.attr("data-target"),o;return C||(C=g.attr("href"),C=C&&/#[A-Za-z]/.test(C)&&C.replace(/.*(?=#[^\s]*$)/,"")),o=C&&u.find(C),(!o||!o.length)&&(o=g.parent()),o}var f=u.fn.dropdown;u.fn.dropdown=function(g){return this.each(function(){var C=u(this),o=C.data("dropdown");o||C.data("dropdown",o=new a(this)),typeof g=="string"&&o[g].call(C)})},u.fn.dropdown.Constructor=a,u.fn.dropdown.noConflict=function(){return u.fn.dropdown=f,this},u(document).on("click.dropdown.data-api",s).on("click.dropdown.data-api",".dropdown form",function(g){g.stopPropagation()}).on("click.dropdown.data-api",A,a.prototype.toggle).on("keydown.dropdown.data-api",A+", [role=menu]",a.prototype.keydown)}(window.jQuery),function(u){"use strict";var A=function(s,l){this.options=l,this.$element=u(s).delegate('[data-dismiss="modal"]',"click.dismiss.modal",u.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};A.prototype={constructor:A,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var s=this,l=u.Event("show");this.$element.trigger(l),!(this.isShown||l.isDefaultPrevented())&&(this.isShown=!0,this.escape(),this.backdrop(function(){var f=u.support.transition&&s.$element.hasClass("fade");s.$element.parent().length||s.$element.appendTo(document.body),s.$element.show(),f&&s.$element[0].offsetWidth,s.$element.addClass("in").attr("aria-hidden",!1),s.enforceFocus(),f?s.$element.one(u.support.transition.end,function(){s.$element.focus().trigger("shown")}):s.$element.focus().trigger("shown")}))},hide:function(s){s&&s.preventDefault();var l=this;s=u.Event("hide"),this.$element.trigger(s),!(!this.isShown||s.isDefaultPrevented())&&(this.isShown=!1,this.escape(),u(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),u.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var s=this;u(document).on("focusin.modal",function(l){s.$element[0]!==l.target&&!s.$element.has(l.target).length&&s.$element.focus()})},escape:function(){var s=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(l){l.which==27&&s.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var s=this,l=setTimeout(function(){s.$element.off(u.support.transition.end),s.hideModal()},500);this.$element.one(u.support.transition.end,function(){clearTimeout(l),s.hideModal()})},hideModal:function(){var s=this;this.$element.hide(),this.backdrop(function(){s.removeBackdrop(),s.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(s){var l=this,f=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var g=u.support.transition&&f;if(this.$backdrop=u('<div class="modal-backdrop '+f+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?u.proxy(this.$element[0].focus,this.$element[0]):u.proxy(this.hide,this)),g&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!s)return;g?this.$backdrop.one(u.support.transition.end,s):s()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),u.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(u.support.transition.end,s):s()):s&&s()}};var a=u.fn.modal;u.fn.modal=function(s){return this.each(function(){var l=u(this),f=l.data("modal"),g=u.extend({},u.fn.modal.defaults,l.data(),typeof s=="object"&&s);f||l.data("modal",f=new A(this,g)),typeof s=="string"?f[s]():g.show&&f.show()})},u.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},u.fn.modal.Constructor=A,u.fn.modal.noConflict=function(){return u.fn.modal=a,this},u(document).on("click.modal.data-api",'[data-toggle="modal"]',function(s){var l=u(this),f=l.attr("href"),g=u.find(l.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,"")),C=g.data("modal")?"toggle":u.extend({remote:!/#/.test(f)&&f},g.data(),l.data());s.preventDefault(),g.modal(C).one("hide",function(){l.focus()})})}(window.jQuery),function(u){"use strict";var A=function(s,l){this.init("tooltip",s,l)};A.prototype={constructor:A,init:function(s,l,f){var g,C,o,h,E;for(this.type=s,this.$element=u(l),this.options=this.getOptions(f),this.enabled=!0,o=this.options.trigger.split(" "),E=o.length;E--;)h=o[E],h=="click"?this.$element.on("click."+this.type,this.options.selector,u.proxy(this.toggle,this)):h!="manual"&&(g=h=="hover"?"mouseenter":"focus",C=h=="hover"?"mouseleave":"blur",this.$element.on(g+"."+this.type,this.options.selector,u.proxy(this.enter,this)),this.$element.on(C+"."+this.type,this.options.selector,u.proxy(this.leave,this)));this.options.selector?this._options=u.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(s){return s=u.extend({},u.fn[this.type].defaults,this.$element.data(),s),s.delay&&typeof s.delay=="number"&&(s.delay={show:s.delay,hide:s.delay}),s},enter:function(s){var l=u.fn[this.type].defaults,f={},g;if(this._options&&u.each(this._options,function(C,o){l[C]!=o&&(f[C]=o)},this),g=u(s.currentTarget)[this.type](f).data(this.type),!g.options.delay||!g.options.delay.show)return g.show();clearTimeout(this.timeout),g.hoverState="in",this.timeout=setTimeout(function(){g.hoverState=="in"&&g.show()},g.options.delay.show)},leave:function(s){var l=u(s.currentTarget)[this.type](this._options).data(this.type);if(this.timeout&&clearTimeout(this.timeout),!l.options.delay||!l.options.delay.hide)return l.hide();l.hoverState="out",this.timeout=setTimeout(function(){l.hoverState=="out"&&l.hide()},l.options.delay.hide)},show:function(){var s,l,f,g,C,o,h=u.Event("show");if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),h.isDefaultPrevented())return;switch(s=this.tip(),this.setContent(),this.options.animation&&s.addClass("fade"),C=typeof this.options.placement=="function"?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,s.detach().css({top:0,left:0,display:"block"}),this.options.container?s.appendTo(u.find(this.options.container)):s.insertAfter(this.$element),l=this.getPosition(),f=s[0].offsetWidth,g=s[0].offsetHeight,C){case"bottom":o={top:l.top+l.height,left:l.left+l.width/2-f/2};break;case"top":o={top:l.top-g,left:l.left+l.width/2-f/2};break;case"left":o={top:l.top+l.height/2-g/2,left:l.left-f};break;case"right":o={top:l.top+l.height/2-g/2,left:l.left+l.width};break;case"topLeft":o={top:l.top-g,left:l.left+l.width/2-f*.1};break;case"topRight":o={top:l.top-g,left:l.left+l.width/2-f*.9};break;case"rightTop":o={top:l.top+l.height/2-g*.1,left:l.left+l.width};break;case"rightBottom":o={top:l.top+l.height/2-g*.9,left:l.left+l.width};break;case"bottomLeft":o={top:l.top+l.height,left:l.left+l.width/2-f*.1};break;case"bottomRight":o={top:l.top+l.height,left:l.left+l.width/2-f*.9};break;case"leftTop":o={top:l.top+l.height/2-g*.1,left:l.left-f};break;case"leftBottom":o={top:l.top+l.height/2-g*.9,left:l.left-f};break}this.applyPlacement(o,C),this.$element.trigger("shown")}},applyPlacement:function(s,l){var f=this.tip(),g=f[0].offsetWidth,C=f[0].offsetHeight,o,h,E,p;f.offset(s).addClass(l).addClass("in"),o=f[0].offsetWidth,h=f[0].offsetHeight,l=="top"&&h!=C&&(s.top=s.top+C-h,p=!0),l=="bottom"||l=="top"?(E=0,s.left<0&&(E=s.left*-2,s.left=0,f.offset(s),o=f[0].offsetWidth,h=f[0].offsetHeight),this.replaceArrow(E-g+o,o,"left")):this.replaceArrow(h-C,h,"top"),p&&f.offset(s)},replaceArrow:function(s,l,f){this.arrow().css(f,s?50*(1-s/l)+"%":"")},setContent:function(){var s=this.tip(),l=this.getTitle();s.find(".tooltip-inner").text(l),s.removeClass("fade in top bottom left right")},hide:function(){var s=this,l=this.tip(),f=u.Event("hide");if(this.$element.trigger(f),f.isDefaultPrevented())return;l.removeClass("in");function g(){var C=setTimeout(function(){l.off(u.support.transition.end).detach()},500);l.one(u.support.transition.end,function(){clearTimeout(C),l.detach()})}return u.support.transition&&this.$tip.hasClass("fade")?g():l.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var s=this.$element;(s.attr("title")||typeof s.attr("data-original-title")!="string")&&s.attr("data-original-title",s.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var s=this.$element[0];return u.extend({},typeof s.getBoundingClientRect=="function"?s.getBoundingClientRect():{width:s.offsetWidth,height:s.offsetHeight},this.$element.offset())},getTitle:function(){var s,l=this.$element,f=this.options;return s=l.attr("data-original-title")||(typeof f.title=="function"?f.title.call(l[0]):f.title),s},tip:function(){return this.$tip=this.$tip||u(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(s){var l=s?u(s.currentTarget)[this.type](this._options).data(this.type):this;l.tip().hasClass("in")?l.hide():l.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var a=u.fn.tooltip;u.fn.tooltip=function(s){return this.each(function(){var l=u(this),f=l.data("tooltip"),g=typeof s=="object"&&s;f||l.data("tooltip",f=new A(this,g)),typeof s=="string"&&f[s]()})},u.fn.tooltip.Constructor=A,u.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},u.fn.tooltip.noConflict=function(){return u.fn.tooltip=a,this}}(window.jQuery),function(u){"use strict";var A=function(s){this.element=u(s)};A.prototype={constructor:A,show:function(){var s=this.element,l=s.closest("ul:not(.dropdown-menu)"),f=s.attr("data-target"),g,C,o;f||(f=s.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,"")),!s.parent("li").hasClass("active")&&(g=l.find(".active:last a")[0],o=u.Event("show",{relatedTarget:g}),s.trigger(o),!o.isDefaultPrevented()&&(C=u.find(f),this.activate(s.parent("li"),l),this.activate(C,C.parent(),function(){s.trigger({type:"shown",relatedTarget:g})})))},activate:function(s,l,f){var g=l.find("> .active"),C=f&&u.support.transition&&g.hasClass("fade");function o(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),s.addClass("active"),C?(s[0].offsetWidth,s.addClass("in")):s.removeClass("fade"),s.parent(".dropdown-menu")&&s.closest("li.dropdown").addClass("active"),f&&f()}C?g.one(u.support.transition.end,o):o(),g.removeClass("in")}};var a=u.fn.tab;u.fn.tab=function(s){return this.each(function(){var l=u(this),f=l.data("tab");f||l.data("tab",f=new A(this)),typeof s=="string"&&f[s]()})},u.fn.tab.Constructor=A,u.fn.tab.noConflict=function(){return u.fn.tab=a,this},u(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(s){s.preventDefault(),u(this).tab("show")})}(window.jQuery),function(u){"use strict";var A=function(s,l){this.$element=u(s),this.options=u.extend({},u.fn.typeahead.defaults,l),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=u(this.options.menu),this.shown=!1,this.listen()};A.prototype={constructor:A,select:function(){var s=this.$menu.find(".active").attr("data-value")||this.$element.val();return this.$element.val(this.updater(s)).change(),this.hide()},updater:function(s){return s},show:function(){var s=u.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:s.top+s.height,left:s.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(s){var l;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(l=u.isFunction(this.source)?this.source(this.query,u.proxy(this.process,this)):this.source,l?this.process(l):this)},process:function(s){var l=this;return s=u.grep(s,function(f){return l.matcher(f)}),s=this.sorter(s),s.length?this.render(s.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(s){return~s.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(s){for(var l=[],f=[],g=[],C;C=s.shift();)C.toLowerCase().indexOf(this.query.toLowerCase())?~C.indexOf(this.query)?f.push(C):g.push(C):l.push(C);return l.concat(f,g)},highlighter:function(s){var l=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return l?s.replace(new RegExp("("+l+")","ig"),function(f,g){return"<strong>"+g+"</strong>"}):s},render:function(s){var l=this;return s=u(s).map(function(f,g){return f=u(l.options.item).attr("data-value",g),f.find("a").html(l.highlighter(g)),f[0]}),this.$menu.html(s),this},next:function(s){var l=this.$menu.find(".active").removeClass("active"),f=l.next();f.length||(f=u(this.$menu.find("li")[0])),f.addClass("active")},prev:function(s){var l=this.$menu.find(".active").removeClass("active"),f=l.prev();f.length||(f=this.$menu.find("li").last()),f.addClass("active")},listen:function(){this.$element.on("focus",u.proxy(this.focus,this)).on("blur",u.proxy(this.blur,this)).on("keypress",u.proxy(this.keypress,this)).on("keyup",u.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",u.proxy(this.keydown,this)),this.$menu.on("click",u.proxy(this.click,this)).on("mouseenter","li",u.proxy(this.mouseenter,this)).on("mouseleave","li",u.proxy(this.mouseleave,this))},destroy:function(){this.$element.off().removeData("typeahead"),this.$menu.off()},eventSupported:function(s){var l=s in this.$element;return l||(this.$element.setAttribute(s,"return;"),l=typeof this.$element[s]=="function"),l},move:function(s){if(this.shown&&!(s.shiftKey&&s.keyCode===40)){switch(s.keyCode){case 9:case 13:case 27:s.preventDefault();break;case 38:s.preventDefault(),this.prev();break;case 40:s.preventDefault(),this.next();break}s.stopPropagation()}},keydown:function(s){this.suppressKeyPressRepeat=~u.inArray(s.keyCode,[40,38,9,13,27,57]),this.move(s)},keypress:function(s){this.suppressKeyPressRepeat||this.move(s)},keyup:function(s){switch(s.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}s.keyCode===13&&typeof this.$menu.find(".active").attr("data-value")>"u"?this.$element.submit():(s.stopPropagation(),s.preventDefault())},focus:function(s){this.focused=!0},blur:function(s){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(s){s.stopPropagation(),s.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(s){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),u(s.currentTarget).addClass("active")},mouseleave:function(s){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var a=u.fn.typeahead;u.fn.typeahead=function(s){return this.each(function(){var l=u(this),f=l.data("typeahead"),g=typeof s=="object"&&s;f||l.data("typeahead",f=new A(this,g)),typeof s=="string"&&f[s]()})},u.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},u.fn.typeahead.Constructor=A,u.fn.typeahead.noConflict=function(){return u.fn.typeahead=a,this},u(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(s){var l=u(this);l.data("typeahead")||l.typeahead(l.data())})}(window.jQuery),function(u){"use strict";var A=function(s,l){this.options=u.extend({},u.fn.affix.defaults,l),this.$window=u(window).on("scroll.affix.data-api",u.proxy(this.checkPosition,this)).on("click.affix.data-api",u.proxy(function(){setTimeout(u.proxy(this.checkPosition,this),1)},this)),this.$element=u(s),this.checkPosition()};A.prototype.checkPosition=function(){if(this.$element.is(":visible")){var s=u(document).height(),l=this.$window.scrollTop(),f=this.$element.offset(),g=this.options.offset,C=g.bottom,o=g.top,h="affix affix-top affix-bottom",E;typeof g!="object"&&(C=o=g),typeof o=="function"&&(o=g.top()),typeof C=="function"&&(C=g.bottom()),E=this.unpin!=null&&l+this.unpin<=f.top?!1:C!=null&&f.top+this.$element.height()>=s-C?"bottom":o!=null&&l<=o?"top":!1,this.affixed!==E&&(this.affixed=E,this.unpin=E=="bottom"?f.top-l:null,this.$element.removeClass(h).addClass("affix"+(E?"-"+E:"")))}};var a=u.fn.affix;u.fn.affix=function(s){return this.each(function(){var l=u(this),f=l.data("affix"),g=typeof s=="object"&&s;f||l.data("affix",f=new A(this,g)),typeof s=="string"&&f[s]()})},u.fn.affix.Constructor=A,u.fn.affix.defaults={offset:0},u.fn.affix.noConflict=function(){return u.fn.affix=a,this},u(window).on("load",function(){u('[data-spy="affix"]').each(function(){var s=u(this),l=s.data();l.offset=l.offset||{},l.offsetBottom&&(l.offset.bottom=l.offsetBottom),l.offsetTop&&(l.offset.top=l.offsetTop),s.affix(l)})})}(window.jQuery)},42346:()=>{(function(u){"use strict";var A={tagClass:function(o){return"label label-info"},itemValue:function(o){return o&&o.toString()},itemText:function(o){return this.itemValue(o)},freeInput:!0,maxTags:void 0,confirmKeys:[13],onTagExists:function(o,h){h.hide().fadeIn()}};function a(o,h){this.itemsArray=[],this.$element=u(o),this.$element.hide(),this.widthClass=h.widthClass||"width-9",this.isSelect=o.tagName==="SELECT",this.multiple=this.isSelect&&o.hasAttribute("multiple"),this.objectItems=h&&h.itemValue,this.placeholderText=o.hasAttribute("placeholder")?this.$element.attr("placeholder"):"",this.$container=u('<div class="bootstrap-tagsinput"></div>'),this.$input=u('<input class="gf-form-input '+this.widthClass+'" type="text" placeholder="'+this.placeholderText+'"/>').appendTo(this.$container),this.$element.after(this.$container),this.build(h)}a.prototype={constructor:a,add:function(o,h){var E=this;if(!(E.options.maxTags&&E.itemsArray.length>=E.options.maxTags)&&!(o!==!1&&!o)){if(typeof o=="object"&&!E.objectItems)throw"Can't add objects when itemValue option is not set";if(!o.toString().match(/^\s*$/)){if(E.isSelect&&!E.multiple&&E.itemsArray.length>0&&E.remove(E.itemsArray[0]),typeof o=="string"&&this.$element[0].tagName==="INPUT"){var p=o.split(",");if(p.length>1){for(var S=0;S<p.length;S++)this.add(p[S],!0);h||E.pushVal();return}}var w=E.options.itemValue(o),te=E.options.itemText(o),ne=E.options.tagClass(o),Z=u.grep(E.itemsArray,function(T){return E.options.itemValue(T)===w})[0];if(Z){if(E.options.onTagExists){var ee=u(".tag",E.$container).filter(function(){return u(this).data("item")===Z});E.options.onTagExists(o,ee)}return}E.itemsArray.push(o);var B=u('<span class="tag '+g(ne)+'">'+g(te)+'<span data-role="remove"></span></span>');if(B.data("item",o),E.findInputWrapper().before(B),B.after(" "),E.isSelect&&!u('option[value="'+escape(w)+'"]',E.$element)[0]){var K=u("<option selected>"+g(te)+"</option>");K.data("item",o),K.attr("value",w),E.$element.append(K)}h||E.pushVal(),E.options.maxTags===E.itemsArray.length&&E.$container.addClass("bootstrap-tagsinput-max"),E.$element.trigger(u.Event("itemAdded",{item:o}))}}},remove:function(o,h){var E=this;E.objectItems&&(typeof o=="object"?o=u.grep(E.itemsArray,function(p){return E.options.itemValue(p)==E.options.itemValue(o)})[0]:o=u.grep(E.itemsArray,function(p){return E.options.itemValue(p)==o})[0]),o&&(u(".tag",E.$container).filter(function(){return u(this).data("item")===o}).remove(),u("option",E.$element).filter(function(){return u(this).data("item")===o}).remove(),E.itemsArray.splice(u.inArray(o,E.itemsArray),1)),h||E.pushVal(),E.options.maxTags>E.itemsArray.length&&E.$container.removeClass("bootstrap-tagsinput-max"),E.$element.trigger(u.Event("itemRemoved",{item:o}))},removeAll:function(){var o=this;for(u(".tag",o.$container).remove(),u("option",o.$element).remove();o.itemsArray.length>0;)o.itemsArray.pop();o.pushVal(),o.options.maxTags&&!this.isEnabled()&&this.enable()},refresh:function(){var o=this;u(".tag",o.$container).each(function(){var h=u(this),E=h.data("item"),p=o.options.itemValue(E),S=o.options.itemText(E),w=o.options.tagClass(E);if(h.attr("class",null),h.addClass("tag "+g(w)),h.contents().filter(function(){return this.nodeType==3})[0].nodeValue=g(S),o.isSelect){var te=u("option",o.$element).filter(function(){return u(this).data("item")===E});te.attr("value",p)}})},items:function(){return this.itemsArray},pushVal:function(){var o=this,h=u.map(o.items(),function(E){return o.options.itemValue(E).toString()});o.$element.val(h,!0).trigger("change")},build:function(o){var h=this;h.options=u.extend({},A,o);var E=h.options.typeahead||{};h.objectItems&&(h.options.freeInput=!1),s(h.options,"itemValue"),s(h.options,"itemText"),s(h.options,"tagClass"),h.options.source&&(E.source=h.options.source),E.source&&u.fn.typeahead&&(l(E,"source"),h.$input.typeahead({source:function(p,S){function w(Z){for(var ee=[],B=0;B<Z.length;B++){var K=h.options.itemText(Z[B]);te[K]=Z[B],ee.push(K)}S(ee)}this.map={};var te=this.map,ne=E.source(p);u.isFunction(ne.success)?ne.success(w):u.when(ne).then(w)},updater:function(p){h.add(this.map[p])},matcher:function(p){return p.toLowerCase().indexOf(this.query.trim().toLowerCase())!==-1},sorter:function(p){return p.sort()},highlighter:function(p){var S=new RegExp("("+this.query+")","gi");return p.replace(S,"<strong>$1</strong>")}})),h.$container.on("click",u.proxy(function(p){h.$input.focus()},h)),h.$container.on("blur","input",u.proxy(function(p){var S=u(p.target);h.add(S.val()),S.val(""),p.preventDefault()},h)),h.$container.on("keydown","input",u.proxy(function(p){var S=u(p.target),w=h.findInputWrapper();switch(p.which){case 8:if(C(S[0])===0){var te=w.prev();te&&h.remove(te.data("item"))}break;case 46:if(C(S[0])===0){var ne=w.next();ne&&h.remove(ne.data("item"))}break;case 37:var Z=w.prev();S.val().length===0&&Z[0]&&(Z.before(w),S.focus());break;case 39:var ee=w.next();S.val().length===0&&ee[0]&&(ee.after(w),S.focus());break;default:h.options.freeInput&&u.inArray(p.which,h.options.confirmKeys)>=0&&(h.add(S.val()),S.val(""),p.preventDefault())}S.attr("size",Math.max(this.inputSize,S.val().length))},h)),h.$container.on("click","[data-role=remove]",u.proxy(function(p){h.remove(u(p.target).closest(".tag").data("item")),p.stopPropagation()},h)),h.options.itemValue===A.itemValue&&(h.$element[0].tagName==="INPUT"?h.add(h.$element.val()):u("option",h.$element).each(function(){h.add(u(this).attr("value"),!0)}))},destroy:function(){var o=this;o.$container.off("keypress","input"),o.$container.off("click","[role=remove]"),o.$container.remove(),o.$element.removeData("tagsinput"),o.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findInputWrapper:function(){for(var o=this.$input[0],h=this.$container[0];o&&o.parentNode!==h;)o=o.parentNode;return u(o)}},u.fn.tagsinput=function(o,h){var E=[];return this.each(function(){var p=u(this).data("tagsinput");if(!p)p=new a(this,o),u(this).data("tagsinput",p),E.push(p),this.tagName==="SELECT"&&u("option",u(this)).attr("selected","selected"),u(this).val(u(this).val());else{var S=p[o](h);S!==void 0&&E.push(S)}}),typeof o=="string"?E.length>1?E:E[0]:E},u.fn.tagsinput.Constructor=a;function s(o,h){if(typeof o[h]!="function"){var E=o[h];o[h]=function(p){return p[E]}}}function l(o,h){if(typeof o[h]!="function"){var E=o[h];o[h]=function(){return E}}}var f=u("<div />");function g(o){return o?f.text(o).html():""}function C(o){var h=0;if(document.selection){o.focus();var E=document.selection.createRange();E.moveStart("character",-o.value.length),h=E.text.length}else(o.selectionStart||o.selectionStart=="0")&&(h=o.selectionStart);return h}u(function(){u("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})})(window.jQuery)},84523:(u,A,a)=>{"use strict";a.d(A,{X:()=>g});var s=a(22803),l=a(96540),f=a(29675);const g=({children:o})=>{const h=(0,f.of)(C);return l.createElement("div",{className:h.root},o)},C=o=>({root:(0,s.css)({display:"flex",flexWrap:"wrap",alignItems:"center",gap:o.spacing(3),minHeight:o.spacing(4)})})},40263:(u,A,a)=>{"use strict";a.d(A,{Z:()=>l});var s=a(96540);const l=({grow:f,shrink:g})=>s.createElement("div",{style:{display:"block",flexGrow:f,flexShrink:g}})},75686:(u,A,a)=>{"use strict";a.d(A,{W:()=>o});var s=a(22803),l=a(96540),f=a(29675),g=a(44826),C=a(69145);function o({label:S,...w}){const[te]=(0,l.useState)(()=>Math.random().toString(16).slice(2)),ne=(0,f.of)(p),Z={SelectContainer:h,ValueContainer:E,SingleValue:E};return l.createElement("div",{className:ne.root},S&&l.createElement("label",{className:ne.label,htmlFor:te},S,":","\xA0"),l.createElement(g.l6,{openMenuOnFocus:!0,inputId:te,...w,components:Z}))}const h=S=>{const{children:w}=S,te=(0,f.of)(p);return l.createElement(C.K,{...S,className:(0,s.cx)(S.className,te.container)},w)},E=S=>{const{className:w,children:te}=S,ne=(0,f.of)(p);return l.createElement("div",{className:(0,s.cx)(w,ne.valueContainer)},te)},p=S=>({root:(0,s.css)({display:"flex",fontSize:12,alignItems:"center"}),label:(0,s.css)({color:S.colors.text.secondary,whiteSpace:"nowrap"}),container:(0,s.css)({background:"none",borderColor:"transparent"}),valueContainer:(0,s.css)({display:"flex",alignItems:"center",flex:"initial",color:S.colors.text.secondary,fontSize:12})})}}]);

//# sourceMappingURL=9978.791c66edd35eb8192d46.js.map