(function(B,a){typeof exports=="object"&&typeof module!="undefined"?a(require("buildbot-plugin-support"),require("react"),require("mobx-react"),require("react-router-dom"),require("buildbot-data-js"),require("buildbot-ui")):typeof define=="function"&&define.amd?define(["buildbot-plugin-support","react","mobx-react","react-router-dom","buildbot-data-js","buildbot-ui"],a):(B=typeof globalThis!="undefined"?globalThis:B||self,a(B.BuildbotPluginSupport,B.React,B.mobxReact,B.ReactRouterDOM,B.BuildbotDataJs,B.BuildbotUi))})(this,function(B,a,Be,ce,T,K){"use strict";function ue(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var de={exports:{}},X={};/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var je=a,qe=Symbol.for("react.element"),Ae=Symbol.for("react.fragment"),Me=Object.prototype.hasOwnProperty,ze=je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0};function me(e,r,t){var s,i={},n=null,o=null;t!==void 0&&(n=""+t),r.key!==void 0&&(n=""+r.key),r.ref!==void 0&&(o=r.ref);for(s in r)Me.call(r,s)&&!Ge.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps)for(s in r=e.defaultProps,r)i[s]===void 0&&(i[s]=r[s]);return{$$typeof:qe,type:e,key:n,ref:o,props:i,_owner:ze.current}}X.Fragment=Ae,X.jsx=me,X.jsxs=me,de.exports=X;var fe=de.exports;const C=fe.jsx,W=fe.jsxs;var pe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ve=a.createContext&&a.createContext(pe),z=globalThis&&globalThis.__assign||function(){return z=Object.assign||function(e){for(var r,t=1,s=arguments.length;t<s;t++){r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},z.apply(this,arguments)},We=globalThis&&globalThis.__rest||function(e,r){var t={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(t[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)r.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(t[s[i]]=e[s[i]]);return t};function he(e){return e&&e.map(function(r,t){return a.createElement(r.tag,z({key:t},r.attr),he(r.child))})}function Qe(e){return function(r){return a.createElement(Ue,z({attr:z({},e.attr)},r),he(e.child))}}function Ue(e){var r=function(t){var s=e.attr,i=e.size,n=e.title,o=We(e,["attr","size","title"]),c=i||t.size||"1em",l;return t.className&&(l=t.className),e.className&&(l=(l?l+" ":"")+e.className),a.createElement("svg",z({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,s,o,{className:l,style:z(z({color:e.color||t.color},t.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),n&&a.createElement("title",null,n),e.children)};return ve!==void 0?a.createElement(ve.Consumer,null,function(t){return r(t)}):r(pe)}function De(e){return Qe({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z"}}]})(e)}function F(){return F=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},F.apply(this,arguments)}function E(e,r){if(e==null)return{};var t={},s=Object.keys(e),i,n;for(n=0;n<s.length;n++)i=s[n],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}var be={exports:{}};/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var s=[],i=0;i<arguments.length;i++){var n=arguments[i];if(n){var o=typeof n;if(o==="string"||o==="number")s.push(n);else if(Array.isArray(n)){if(n.length){var c=t.apply(null,n);c&&s.push(c)}}else if(o==="object"){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){s.push(n.toString());continue}for(var l in n)r.call(n,l)&&n[l]&&s.push(l)}}}return s.join(" ")}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(be);var He=be.exports;const $=ue(He);var te=a.createContext({});te.Consumer,te.Provider;function O(e,r){var t=a.useContext(te);return e||t[r]||r}var ge={exports:{}},Ke="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Xe=Ke,Ye=Xe;function ye(){}function xe(){}xe.resetWarningCache=ye;var Ze=function(){function e(s,i,n,o,c,l){if(l!==Ye){var m=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw m.name="Invariant Violation",m}}e.isRequired=e;function r(){return e}var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:xe,resetWarningCache:ye};return t.PropTypes=t,t};ge.exports=Ze();var _e=ge.exports;const re=ue(_e);var Je=/-(.)/g;function Re(e){return e.replace(Je,function(r,t){return t.toUpperCase()})}var et=["className","bsPrefix","as"],tt=function(r){return r[0].toUpperCase()+Re(r).slice(1)};function rt(e,r){var t=r===void 0?{}:r,s=t.displayName,i=s===void 0?tt(e):s,n=t.Component,o=t.defaultProps,c=a.forwardRef(function(l,m){var f=l.className,v=l.bsPrefix,d=l.as,p=d===void 0?n||"div":d,y=E(l,et),x=O(v,e);return a.createElement(p,F({ref:m,className:$(f,x)},y))});return c.defaultProps=o,c.displayName=i,c}var st=["bsPrefix","className","as"],at=["xl","lg","md","sm","xs"],Ce=a.forwardRef(function(e,r){var t=e.bsPrefix,s=e.className,i=e.as,n=i===void 0?"div":i,o=E(e,st),c=O(t,"col"),l=[],m=[];return at.forEach(function(f){var v=o[f];delete o[f];var d,p,y;if(typeof v=="object"&&v!=null){var x=v.span;d=x===void 0?!0:x,p=v.offset,y=v.order}else d=v;var h=f!=="xs"?"-"+f:"";d&&l.push(d===!0?""+c+h:""+c+h+"-"+d),y!=null&&m.push("order"+h+"-"+y),p!=null&&m.push("offset"+h+"-"+p)}),l.length||l.push(c),a.createElement(n,F({},o,{ref:r,className:$.apply(void 0,[s].concat(l,m))}))});Ce.displayName="Col";const nt=Ce;var Ne={exports:{}},se={exports:{}};(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=t;function t(s){function i(o,c,l,m,f,v){var d=m||"<<anonymous>>",p=v||l;if(c[l]==null)return o?new Error("Required "+f+" `"+p+"` was not specified "+("in `"+d+"`.")):null;for(var y=arguments.length,x=Array(y>6?y-6:0),h=6;h<y;h++)x[h-6]=arguments[h];return s.apply(void 0,[c,l,d,f,p].concat(x))}var n=i.bind(null,!1);return n.isRequired=i.bind(null,!0),n}e.exports=r.default})(se,se.exports);var it=se.exports;(function(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=n;var t=it,s=i(t);function i(o){return o&&o.__esModule?o:{default:o}}function n(){for(var o=arguments.length,c=Array(o),l=0;l<o;l++)c[l]=arguments[l];function m(){for(var f=arguments.length,v=Array(f),d=0;d<f;d++)v[d]=arguments[d];var p=null;return c.forEach(function(y){if(p==null){var x=y.apply(void 0,v);x!=null&&(p=x)}}),p}return(0,s.default)(m)}e.exports=r.default})(Ne,Ne.exports);var lt=["as","className","type","tooltip"],ot={type:re.string,tooltip:re.bool,as:re.elementType},ae=a.forwardRef(function(e,r){var t=e.as,s=t===void 0?"div":t,i=e.className,n=e.type,o=n===void 0?"valid":n,c=e.tooltip,l=c===void 0?!1:c,m=E(e,lt);return a.createElement(s,F({},m,{ref:r,className:$(i,o+"-"+(l?"tooltip":"feedback"))}))});ae.displayName="Feedback",ae.propTypes=ot;const ne=ae;var ct=a.createContext({controlId:void 0});const j=ct;var ut=["id","bsPrefix","bsCustomPrefix","className","type","isValid","isInvalid","isStatic","as"],Pe=a.forwardRef(function(e,r){var t=e.id,s=e.bsPrefix,i=e.bsCustomPrefix,n=e.className,o=e.type,c=o===void 0?"checkbox":o,l=e.isValid,m=l===void 0?!1:l,f=e.isInvalid,v=f===void 0?!1:f,d=e.isStatic,p=e.as,y=p===void 0?"input":p,x=E(e,ut),h=a.useContext(j),I=h.controlId,w=h.custom,k=w?[i,"custom-control-input"]:[s,"form-check-input"],u=k[0],g=k[1];return s=O(u,g),a.createElement(y,F({},x,{ref:r,type:c,id:t||I,className:$(n,s,m&&"is-valid",v&&"is-invalid",d&&"position-static")}))});Pe.displayName="FormCheckInput";const Fe=Pe;var dt=["bsPrefix","bsCustomPrefix","className","htmlFor"],Ie=a.forwardRef(function(e,r){var t=e.bsPrefix,s=e.bsCustomPrefix,i=e.className,n=e.htmlFor,o=E(e,dt),c=a.useContext(j),l=c.controlId,m=c.custom,f=m?[s,"custom-control-label"]:[t,"form-check-label"],v=f[0],d=f[1];return t=O(v,d),a.createElement("label",F({},o,{ref:r,htmlFor:n||l,className:$(i,t)}))});Ie.displayName="FormCheckLabel";const we=Ie;var mt=["id","bsPrefix","bsCustomPrefix","inline","disabled","isValid","isInvalid","feedbackTooltip","feedback","className","style","title","type","label","children","custom","as"],Y=a.forwardRef(function(e,r){var t=e.id,s=e.bsPrefix,i=e.bsCustomPrefix,n=e.inline,o=n===void 0?!1:n,c=e.disabled,l=c===void 0?!1:c,m=e.isValid,f=m===void 0?!1:m,v=e.isInvalid,d=v===void 0?!1:v,p=e.feedbackTooltip,y=p===void 0?!1:p,x=e.feedback,h=e.className,I=e.style,w=e.title,k=w===void 0?"":w,u=e.type,g=u===void 0?"checkbox":u,P=e.label,A=e.children,b=e.custom,N=e.as,L=N===void 0?"input":N,M=E(e,mt),S=g==="switch"?!0:b,V=S?[i,"custom-control"]:[s,"form-check"],D=V[0],Q=V[1];s=O(D,Q);var G=a.useContext(j),U=G.controlId,ee=a.useMemo(function(){return{controlId:t||U,custom:S}},[U,S,t]),Ve=S||P!=null&&P!==!1&&!A,kt=a.createElement(Fe,F({},M,{type:g==="switch"?"checkbox":g,ref:r,isValid:f,isInvalid:d,isStatic:!Ve,disabled:l,as:L}));return a.createElement(j.Provider,{value:ee},a.createElement("div",{style:I,className:$(h,s,S&&"custom-"+g,o&&s+"-inline")},A||a.createElement(a.Fragment,null,kt,Ve&&a.createElement(we,{title:k},P),(f||d)&&a.createElement(ne,{type:f?"valid":"invalid",tooltip:y},x))))});Y.displayName="FormCheck",Y.Input=Fe,Y.Label=we;const Z=Y;var ft=["id","bsPrefix","bsCustomPrefix","className","isValid","isInvalid","lang","as"],Te=a.forwardRef(function(e,r){var t=e.id,s=e.bsPrefix,i=e.bsCustomPrefix,n=e.className,o=e.isValid,c=e.isInvalid,l=e.lang,m=e.as,f=m===void 0?"input":m,v=E(e,ft),d=a.useContext(j),p=d.controlId,y=d.custom,x="file",h=y?[i,"custom-file-input"]:[s,"form-control-file"],I=h[0],w=h[1];return s=O(I,w),a.createElement(f,F({},v,{ref:r,id:t||p,type:x,lang:l,className:$(n,s,o&&"is-valid",c&&"is-invalid")}))});Te.displayName="FormFileInput";const Ee=Te;var pt=["bsPrefix","bsCustomPrefix","className","htmlFor"],$e=a.forwardRef(function(e,r){var t=e.bsPrefix,s=e.bsCustomPrefix,i=e.className,n=e.htmlFor,o=E(e,pt),c=a.useContext(j),l=c.controlId,m=c.custom,f=m?[s,"custom-file-label"]:[t,"form-file-label"],v=f[0],d=f[1];return t=O(v,d),a.createElement("label",F({},o,{ref:r,htmlFor:n||l,className:$(i,t),"data-browse":o["data-browse"]}))});$e.displayName="FormFileLabel";const ie=$e;var vt=["id","bsPrefix","bsCustomPrefix","disabled","isValid","isInvalid","feedbackTooltip","feedback","className","style","label","children","custom","lang","data-browse","as","inputAs"],_=a.forwardRef(function(e,r){var t=e.id,s=e.bsPrefix,i=e.bsCustomPrefix,n=e.disabled,o=n===void 0?!1:n,c=e.isValid,l=c===void 0?!1:c,m=e.isInvalid,f=m===void 0?!1:m,v=e.feedbackTooltip,d=v===void 0?!1:v,p=e.feedback,y=e.className,x=e.style,h=e.label,I=e.children,w=e.custom,k=e.lang,u=e["data-browse"],g=e.as,P=g===void 0?"div":g,A=e.inputAs,b=A===void 0?"input":A,N=E(e,vt),L=w?[i,"custom"]:[s,"form-file"],M=L[0],S=L[1];s=O(M,S);var V="file",D=a.useContext(j),Q=D.controlId,G=a.useMemo(function(){return{controlId:t||Q,custom:w}},[Q,w,t]),U=h!=null&&h!==!1&&!I,ee=a.createElement(Ee,F({},N,{ref:r,isValid:l,isInvalid:f,disabled:o,as:b,lang:k}));return a.createElement(j.Provider,{value:G},a.createElement(P,{style:x,className:$(y,s,w&&"custom-"+V)},I||a.createElement(a.Fragment,null,w?a.createElement(a.Fragment,null,ee,U&&a.createElement(ie,{"data-browse":u},h)):a.createElement(a.Fragment,null,U&&a.createElement(ie,null,h),ee),(l||f)&&a.createElement(ne,{type:l?"valid":"invalid",tooltip:d},p))))});_.displayName="FormFile",_.Input=Ee,_.Label=ie;const ht=_;var bt=["bsPrefix","bsCustomPrefix","type","size","htmlSize","id","className","isValid","isInvalid","plaintext","readOnly","custom","as"],Se=a.forwardRef(function(e,r){var t=e.bsPrefix,s=e.bsCustomPrefix,i=e.type,n=e.size,o=e.htmlSize,c=e.id,l=e.className,m=e.isValid,f=m===void 0?!1:m,v=e.isInvalid,d=v===void 0?!1:v,p=e.plaintext,y=e.readOnly,x=e.custom,h=e.as,I=h===void 0?"input":h,w=E(e,bt),k=a.useContext(j),u=k.controlId,g=x?[s,"custom"]:[t,"form-control"],P=g[0],A=g[1];t=O(P,A);var b;if(p){var N;b=(N={},N[t+"-plaintext"]=!0,N)}else if(i==="file"){var L;b=(L={},L[t+"-file"]=!0,L)}else if(i==="range"){var M;b=(M={},M[t+"-range"]=!0,M)}else if(I==="select"&&x){var S;b=(S={},S[t+"-select"]=!0,S[t+"-select-"+n]=n,S)}else{var V;b=(V={},V[t]=!0,V[t+"-"+n]=n,V)}return a.createElement(I,F({},w,{type:i,size:o,ref:r,readOnly:y,id:c||u,className:$(l,b,f&&"is-valid",d&&"is-invalid")}))});Se.displayName="FormControl";const gt=Object.assign(Se,{Feedback:ne});var yt=["bsPrefix","className","children","controlId","as"],Oe=a.forwardRef(function(e,r){var t=e.bsPrefix,s=e.className,i=e.children,n=e.controlId,o=e.as,c=o===void 0?"div":o,l=E(e,yt);t=O(t,"form-group");var m=a.useMemo(function(){return{controlId:n}},[n]);return a.createElement(j.Provider,{value:m},a.createElement(c,F({},l,{ref:r,className:$(s,t)}),i))});Oe.displayName="FormGroup";const xt=Oe;var Ct=["as","bsPrefix","column","srOnly","className","htmlFor"],Nt={column:!1,srOnly:!1},le=a.forwardRef(function(e,r){var t=e.as,s=t===void 0?"label":t,i=e.bsPrefix,n=e.column,o=e.srOnly,c=e.className,l=e.htmlFor,m=E(e,Ct),f=a.useContext(j),v=f.controlId;i=O(i,"form-label");var d="col-form-label";typeof n=="string"&&(d=d+" "+d+"-"+n);var p=$(c,i,o&&"sr-only",n&&d);return l=l||v,n?a.createElement(nt,F({ref:r,as:"label",className:p,htmlFor:l},m)):a.createElement(s,F({ref:r,className:p,htmlFor:l},m))});le.displayName="FormLabel",le.defaultProps=Nt;const Pt=le;var Ft=["bsPrefix","className","as","muted"],ke=a.forwardRef(function(e,r){var t=e.bsPrefix,s=e.className,i=e.as,n=i===void 0?"small":i,o=e.muted,c=E(e,Ft);return t=O(t,"form-text"),a.createElement(n,F({},c,{ref:r,className:$(s,t,o&&"text-muted")}))});ke.displayName="FormText";const It=ke;var J=a.forwardRef(function(e,r){return a.createElement(Z,F({},e,{ref:r,type:"switch"}))});J.displayName="Switch",J.Input=Z.Input,J.Label=Z.Label;const wt=J;var Tt=["bsPrefix","inline","className","validated","as"],Et=rt("form-row"),$t={inline:!1},q=a.forwardRef(function(e,r){var t=e.bsPrefix,s=e.inline,i=e.className,n=e.validated,o=e.as,c=o===void 0?"form":o,l=E(e,Tt);return t=O(t,"form"),a.createElement(c,F({},l,{ref:r,className:$(i,n&&"was-validated",s&&t+"-inline")}))});q.displayName="Form",q.defaultProps=$t,q.Row=Et,q.Group=xt,q.Control=gt,q.Check=Z,q.File=ht,q.Switch=wt,q.Label=Pt,q.Text=It;const H=q,Le="(all)",R=new Map;R.set(Le,T.UNKNOWN);for(const e of T.allResults)R.set(T.intToResultText[e],e);const oe="(all)";function St(e,r,t,s,i,n,o,c,l,m){var k;const f=new Map,v=new Set;for(const u of r.array)u.branch===null&&(u.branch="master"),f.set(u.sourcestamp.ssid,{change:u,buildsets:new Map});const d=new Map;for(const u of e.array){if(u.sourcestamps.length===0)continue;const g=u.sourcestamps[u.sourcestamps.length-1],P=f.get(g.ssid);P!==void 0&&(P.buildsets.set(u.bsid,u),v.add(P.change.branch),!(n!==oe&&P.change.branch!==n)&&d.set(P.change.changeid,P))}let p=[...d.values()];p.sort((u,g)=>u.change.changeid-g.change.changeid),p.length>l&&(p=p.slice(p.length-l)),c||(p=p.reverse());const y=[oe,...v.keys()];y.sort((u,g)=>u.localeCompare(g));const x=new Map;for(const u of s.array){const g=x.get(u.buildsetid);g===void 0?x.set(u.buildsetid,[u]):g.push(u)}const h=new Map;for(const u of i.array){if(u.buildrequestid===null)continue;const g=h.get(u.buildrequestid);g===void 0?h.set(u.buildrequestid,[u]):g.push(u)}const I=new Map;for(const u of p)for(const g of u.buildsets.values()){const P=x.get(g.bsid);if(P!==void 0)for(const A of P){const b=((k=h.get(A.buildrequestid))!=null?k:[]).filter(M=>o===T.UNKNOWN||M.results===o);if(b.length===0)continue;const N=t.getByIdOrNull(b[0].builderid.toString());if(N===null||!m(N.tags))continue;const L=I.get(N.builderid);L===void 0?I.set(N.builderid,{builder:N,buildsByChangeId:new Map([[u.change.changeid,b]])}):L.buildsByChangeId.set(u.change.changeid,b)}}const w=[...I.values()];return w.sort((u,g)=>u.builder.name.localeCompare(g.builder.name)),[y,p,w]}const Ot=Be.observer(()=>{const e=T.useDataAccessor([]),r=K.useTagFilterManager("tags"),t=B.buildbotGetSettings(),s=t.getIntegerSetting("Grid.revisionLimit"),i=t.getIntegerSetting("Grid.changeFetchLimit"),n=t.getIntegerSetting("Grid.buildFetchLimit"),o=t.getBooleanSetting("Grid.fullChanges"),c=t.getBooleanSetting("Grid.leftToRight"),[l,m]=a.useState(Le),[f,v]=a.useState(oe),d=R.get(l),p=T.useDataApiQuery(()=>T.Buildset.getAll(e,{query:{limit:n,order:"-bsid"}})),y=T.useDataApiQuery(()=>T.Change.getAll(e,{query:{limit:i,order:"-changeid"}})),x=T.useDataApiQuery(()=>T.Builder.getAll(e)),h=T.useDataApiQuery(()=>T.Buildrequest.getAll(e,{query:{limit:n,order:"-buildrequestid"}})),I=T.useDataApiQuery(()=>T.Build.getAll(e,{query:{limit:n,order:"-buildrequestid"}}));if(!(p.resolved&&y.resolved&&x.resolved&&h.resolved&&I.resolved))return C("div",{className:"bb-grid-container",children:C(K.LoadingIndicator,{})});if(y.array.length===0)return C("div",{className:"bb-grid-container",children:W("p",{children:["No changes. Grid View needs a changesource to be setup, and ",C(ce.Link,{to:"/changes",children:" changes"})," to be in the system."]})});const[k,u,g]=St(p,y,x,h,I,f,d,c,s,b=>r.shouldShowByTags(b)),P=u.slice().sort((b,N)=>N.change.changeid-b.change.changeid).map(b=>C("th",{className:"change",children:C(K.ChangeDetails,{change:b.change,compact:!o,showDetails:!1,setShowDetails:()=>{}})})),A=g.map(b=>{const N=b.builder,L=b.buildsByChangeId,M=u.map(S=>{var Q;const V=S.change,D=[...(Q=L.get(V.changeid))!=null?Q:[]];return D.sort((G,U)=>G.buildid-U.buildid),C("td",{children:D.map(G=>C(K.BuildLinkWithSummaryTooltip,{build:G},G.id))},V.changeid)});return W("tr",{children:[C("th",{children:C(ce.Link,{to:`/builders/${N.builderid}`,children:N.name})}),C("td",{children:r.getElementsForTags(N.tags)}),M]},N.name)});return W("div",{className:"container grid",children:[W(H,{inline:!0,className:"mb-sm-2",children:[C(H.Label,{className:"mr-sm-2",children:"Branch"}),C(H.Control,{className:"mr-sm-2",as:"select",multiple:!1,value:f,onChange:b=>v(b.target.value),children:k.map(b=>C("option",{children:b}))}),C(H.Label,{className:"mr-sm-2",children:"Results"}),C(H.Control,{className:"mr-sm-2",as:"select",multiple:!1,value:l,onChange:b=>m(b.target.value),children:[...R.keys()].map(b=>C("option",{children:b}))})]}),W("table",{className:"table table-condensed table-striped table-hover",children:[C("thead",{children:W("tr",{children:[C("th",{children:"Builder"}),W("th",{children:[r.getFiltersHelpElement(),r.getEnabledFiltersElements()]}),P]})}),C("tbody",{children:A})]})]})});B.buildbotSetupPlugin(e=>{e.registerMenuGroup({name:"grid",caption:"Grid View",icon:C(De,{}),order:4,route:"/grid",parentName:null}),e.registerRoute({route:"/grid",group:"grid",element:()=>C(Ot,{})}),e.registerSettingGroup({name:"Grid",caption:"Grid related settings",items:[{type:"boolean",name:"fullChanges",caption:"Show avatar and time ago in change details",defaultValue:!1},{type:"boolean",name:"leftToRight",caption:"Show most recent changes on the right",defaultValue:!1},{type:"integer",name:"revisionLimit",caption:"Maximum number of revisions to display",defaultValue:5},{type:"integer",name:"changeFetchLimit",caption:"Maximum number of changes to fetch",defaultValue:100},{type:"integer",name:"buildFetchLimit",caption:"Maximum number of builds to fetch",defaultValue:1e3}]})})});
