internal,static: randomize initial homepage tip index

Change-Id: I2c73f6c3c45afff99aa1868ebf73ef437d9c4495
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/351000
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
diff --git a/internal/frontend/details.go b/internal/frontend/details.go
index b01f6ee..7e6552c 100644
--- a/internal/frontend/details.go
+++ b/internal/frontend/details.go
@@ -27,11 +27,12 @@
 func (s *Server) serveDetails(w http.ResponseWriter, r *http.Request, ds internal.DataSource) (err error) {
 	defer middleware.ElapsedStat(r.Context(), "serveDetails")()
 
+	ctx := r.Context()
 	if r.Method != http.MethodGet && r.Method != http.MethodHead {
 		return &serverError{status: http.StatusMethodNotAllowed}
 	}
 	if r.URL.Path == "/" {
-		s.staticPageHandler("homepage", "Home")(w, r)
+		s.serveHomepage(ctx, w, r)
 		return nil
 	}
 	if strings.HasSuffix(r.URL.Path, "/") {
@@ -39,7 +40,6 @@
 		return
 	}
 
-	ctx := r.Context()
 	// If page statistics are enabled, use the "exp" query param to adjust
 	// the active experiments.
 	if s.serveStats {
diff --git a/internal/frontend/homepage.go b/internal/frontend/homepage.go
new file mode 100644
index 0000000..46ac4bf
--- /dev/null
+++ b/internal/frontend/homepage.go
@@ -0,0 +1,56 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package frontend
+
+import (
+	"context"
+	"math/rand"
+	"net/http"
+)
+
+// searchTip represents a snippet of text on the homepage demonstrating
+// how to effectively use pkg.go.dev search.
+type searchTip struct {
+	Text     string
+	Example1 string
+	Example2 string
+}
+
+var searchTips = []searchTip{
+	{
+		"Search for a package, for example",
+		"http",
+		"command",
+	},
+	{
+		"Search for a symbol, for example",
+		"Unmarshal",
+		"io.Reader",
+	},
+	{
+		"Search for symbols within a package using the # filter. For example",
+		"golang.org/x #error",
+		"reader io",
+	},
+}
+
+// Homepage contains fields used in rendering the homepage template.
+type homepage struct {
+	basePage
+
+	// TipIndex is the index of the initial search tip to render.
+	TipIndex int
+
+	// SearchTips is a collection of search tips to show on the homepage.
+	SearchTips []searchTip
+}
+
+func (s *Server) serveHomepage(ctx context.Context, w http.ResponseWriter, r *http.Request) {
+	s.servePage(ctx, w, "homepage", homepage{
+		basePage:   s.newBasePage(r, "pkg.go.dev"),
+		SearchTips: searchTips,
+		TipIndex:   rand.Intn(len(searchTips)),
+	})
+}
diff --git a/internal/frontend/server.go b/internal/frontend/server.go
index 42d2585..a16d87c 100644
--- a/internal/frontend/server.go
+++ b/internal/frontend/server.go
@@ -13,6 +13,7 @@
 	"io"
 	"io/fs"
 	"net/http"
+	"net/url"
 	"strings"
 	"sync"
 	"time"
@@ -556,6 +557,7 @@
 	},
 	"stripscheme": stripScheme,
 	"capitalize":  strings.Title,
+	"queryescape": url.QueryEscape,
 }
 
 func stripScheme(url string) string {
diff --git a/internal/frontend/server_test.go b/internal/frontend/server_test.go
index d359a48..02fc123 100644
--- a/internal/frontend/server_test.go
+++ b/internal/frontend/server_test.go
@@ -1582,7 +1582,7 @@
 		// error.tmpl omitted because relies on an associated "message" template
 		// that's parsed on demand; see renderErrorPage above.
 		{"fetch", nil, errorPage{}},
-		{"homepage", nil, basePage{}},
+		{"homepage", nil, homepage{}},
 		{"license-policy", nil, licensePolicyPage{}},
 		{"search", nil, SearchPage{}},
 		{"legacy_search", nil, SearchPage{}},
diff --git a/static/frontend/frontend.js b/static/frontend/frontend.js
index 0a9955c..02f1cf4 100644
--- a/static/frontend/frontend.js
+++ b/static/frontend/frontend.js
@@ -1,4 +1,4 @@
-var _=Object.defineProperty;var R=e=>_(e,"__esModule",{value:!0});var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var K=(e,t)=>{R(e);for(var o in t)_(e,o,{get:t[o],enumerable:!0})};var A={};K(A,{default:()=>z});function F(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),o=function(i,n){return!(t[i]===void 0||t[i]===n)};if(t.opacity<1||o("zIndex","auto")||o("transform","none")||o("mixBlendMode","normal")||o("filter","none")||o("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;e=e.parentElement}return!1}function u(e){for(;e;){if(e.localName==="dialog")return e;e=e.parentElement}return null}function T(e){e&&e.blur&&e!==document.body&&e.blur()}function U(e,t){for(var o=0;o<e.length;++o)if(e[o]===t)return!0;return!1}function h(e){return!e||!e.hasAttribute("method")?!1:e.getAttribute("method").toLowerCase()==="dialog"}function S(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute("role")||e.setAttribute("role","dialog"),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),"returnValue"in e||(e.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(e,{attributes:!0,attributeFilter:["open"]})}else{var o=!1,i=function(){o?this.downgradeModal():this.maybeHideModal(),o=!1}.bind(this),n,r=function(s){if(s.target===e){var l="DOMNodeRemoved";o|=s.type.substr(0,l.length)===l,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(s){e.addEventListener(s,r)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("click",this.backdropClick_.bind(this))}var c,a,y,d,k,x,D,C,z,H=j(()=>{c=window.CustomEvent;(!c||typeof c=="object")&&(c=function(t,o){o=o||{};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,!!o.bubbles,!!o.cancelable,o.detail||null),i},c.prototype=window.Event.prototype);S.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&document.body.contains(this.dialog_)||this.downgradeModal()},downgradeModal:function(){!this.openAsModal_||(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),a.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropClick_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var o=document.createEvent("MouseEvents");o.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(o),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");if(!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),!e){var t=["button","input","keygen","select","textarea"],o=t.map(function(i){return i+":not([disabled])"});o.push('[tabindex]:not([disabled]):not([tabindex=""])'),e=this.dialog_.querySelector(o.join(", "))}T(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!document.body.contains(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!a.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");F(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,a.needsCentering(this.dialog_)?(a.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),e!==void 0&&(this.dialog_.returnValue=e);var t=new c("close",{bubbles:!1,cancelable:!1});this.dialog_.dispatchEvent(t)}};a={};a.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,o=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,o)+"px"};a.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var o=document.styleSheets[t],i=null;try{i=o.cssRules}catch(P){}if(!!i)for(var n=0;n<i.length;++n){var r=i[n],s=null;try{s=document.querySelectorAll(r.selectorText)}catch(P){}if(!(!s||!U(s,e))){var l=r.style.getPropertyValue("top"),E=r.style.getPropertyValue("bottom");if(l&&l!=="auto"||E&&E!=="auto")return!0}}}return!1};a.needsCentering=function(e){var t=window.getComputedStyle(e);return t.position!=="absolute"||e.style.top!=="auto"&&e.style.top!==""||e.style.bottom!=="auto"&&e.style.bottom!==""?!1:!a.isInlinePositionSetByStylesheet(e)};a.forceRegisterDialog=function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",e),e.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new S(e)};a.registerDialog=function(e){e.showModal||a.forceRegisterDialog(e)};a.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=1e5+150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(i){for(var n=0,r;r=i.removedNodes[n];++n){if(r instanceof Element)r.localName==="dialog"&&o.push(r);else continue;o=o.concat(r.querySelectorAll("dialog"))}}),o.length&&e(o)}))};a.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})};a.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()};a.DialogManager.prototype.updateStacking=function(){for(var e=this.zIndexHigh_,t=0,o;o=this.pendingDialogStack[t];++t)o.updateZIndex(--e,--e),t===0&&(this.overlay.style.zIndex=--e);var i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)};a.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=u(e);){for(var t=0,o;o=this.pendingDialogStack[t];++t)if(o.dialog===e)return t===0;e=e.parentElement}return!1};a.DialogManager.prototype.handleFocus_=function(e){if(!this.containedByTopDialog_(e.target)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),T(e.target),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],o=t.dialog,i=o.compareDocumentPosition(e.target);return i&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e.target!==document.documentElement&&document.documentElement.focus()),!1}};a.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,e.keyCode===27){e.preventDefault(),e.stopPropagation();var t=new c("cancel",{bubbles:!1,cancelable:!0}),o=this.pendingDialogStack[0];o&&o.dialog.dispatchEvent(t)&&o.dialog.close()}else e.keyCode===9&&(this.forwardTab_=!e.shiftKey)};a.DialogManager.prototype.checkDOM_=function(e){var t=this.pendingDialogStack.slice();t.forEach(function(o){e.indexOf(o.dialog)!==-1?o.downgradeModal():o.maybeHideModal()})};a.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(e)===1&&this.blockDocument(),this.updateStacking(),!0)};a.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())};a.dm=new a.DialogManager;a.formSubmitter=null;a.useValue=null;window.HTMLDialogElement===void 0&&(y=document.createElement("form"),y.setAttribute("method","dialog"),y.method!=="dialog"&&(d=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method"),d&&(k=d.get,d.get=function(){return h(this)?"dialog":k.call(this)},x=d.set,d.set=function(e){return typeof e=="string"&&e.toLowerCase()==="dialog"?this.setAttribute("method",e):x.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",d))),document.addEventListener("click",function(e){if(a.formSubmitter=null,a.useValue=null,!e.defaultPrevented){var t=e.target;if(!(!t||!h(t.form))){var o=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!o){if(!(t.localName==="input"&&t.type==="image"))return;a.useValue=e.offsetX+","+e.offsetY}var i=u(t);!i||(a.formSubmitter=t)}}},!1),D=HTMLFormElement.prototype.submit,C=function(){if(!h(this))return D.call(this);var e=u(this);e&&e.close()},HTMLFormElement.prototype.submit=C,document.addEventListener("submit",function(e){if(!e.defaultPrevented){var t=e.target;if(!!h(t)){e.preventDefault();var o=u(t);if(!!o){var i=a.formSubmitter;i&&i.form===t?o.close(a.useValue||i.value):o.close(),a.formSubmitter=null}}}},!1));z=a});function L(){let e=document.querySelector(".js-header"),t=document.querySelectorAll(".js-headerMenuButton");t.forEach(i=>{i.addEventListener("click",n=>{n.preventDefault(),e==null||e.classList.toggle("is-active"),i.setAttribute("aria-expanded",String(e==null?void 0:e.classList.contains("is-active")))})});let o=document.querySelector(".js-scrim");o==null||o.addEventListener("click",i=>{i.preventDefault(),e==null||e.classList.remove("is-active"),t.forEach(n=>{n.setAttribute("aria-expanded",String(e==null?void 0:e.classList.contains("is-active")))})})}function M(){let e=document.querySelector(".js-searchForm"),t=document.querySelector(".js-expandSearch"),o=e==null?void 0:e.querySelector("input"),i=document.querySelector(".js-headerLogo"),n=document.querySelector(".js-headerMenuButton");t==null||t.addEventListener("click",()=>{e==null||e.classList.add("go-SearchForm--expanded"),i==null||i.classList.add("go-Header-logo--hidden"),n==null||n.classList.add("go-Header-navOpen--hidden"),o==null||o.focus()}),document==null||document.addEventListener("click",r=>{(e==null?void 0:e.contains(r.target))||(e==null||e.classList.remove("go-SearchForm--expanded"),i==null||i.classList.remove("go-Header-logo--hidden"),n==null||n.classList.remove("go-Header-navOpen--hidden"))})}var g=class{constructor(t){this.el=t;this.setActive=t=>{this.activeIndex=(t+this.slides.length)%this.slides.length;for(let o of this.dots)o.classList.remove("go-Carousel-dot--active");this.dots[this.activeIndex].classList.add("go-Carousel-dot--active");for(let o of this.slides)o.setAttribute("aria-hidden","true");this.slides[this.activeIndex].removeAttribute("aria-hidden"),this.liveRegion.textContent="Slide "+(this.activeIndex+1)+" of "+this.slides.length};this.slides=Array.from(t.querySelectorAll(".go-Carousel-slide")),this.dots=[],this.liveRegion=document.createElement("div"),this.activeIndex=0,this.initSlides(),this.initArrows(),this.initDots(),this.initLiveRegion()}initSlides(){for(let[t,o]of this.slides.entries())t!==0&&o.setAttribute("aria-hidden","true")}initArrows(){var o,i;let t=document.createElement("ul");t.classList.add("go-Carousel-arrows"),t.innerHTML=`
+var _=Object.defineProperty;var R=e=>_(e,"__esModule",{value:!0});var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var K=(e,t)=>{R(e);for(var o in t)_(e,o,{get:t[o],enumerable:!0})};var A={};K(A,{default:()=>z});function F(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),o=function(i,n){return!(t[i]===void 0||t[i]===n)};if(t.opacity<1||o("zIndex","auto")||o("transform","none")||o("mixBlendMode","normal")||o("filter","none")||o("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;e=e.parentElement}return!1}function u(e){for(;e;){if(e.localName==="dialog")return e;e=e.parentElement}return null}function T(e){e&&e.blur&&e!==document.body&&e.blur()}function U(e,t){for(var o=0;o<e.length;++o)if(e[o]===t)return!0;return!1}function h(e){return!e||!e.hasAttribute("method")?!1:e.getAttribute("method").toLowerCase()==="dialog"}function S(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute("role")||e.setAttribute("role","dialog"),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),"returnValue"in e||(e.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(e,{attributes:!0,attributeFilter:["open"]})}else{var o=!1,i=function(){o?this.downgradeModal():this.maybeHideModal(),o=!1}.bind(this),n,r=function(s){if(s.target===e){var l="DOMNodeRemoved";o|=s.type.substr(0,l.length)===l,window.clearTimeout(n),n=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(s){e.addEventListener(s,r)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("click",this.backdropClick_.bind(this))}var c,a,y,d,x,k,D,C,z,H=j(()=>{c=window.CustomEvent;(!c||typeof c=="object")&&(c=function(t,o){o=o||{};var i=document.createEvent("CustomEvent");return i.initCustomEvent(t,!!o.bubbles,!!o.cancelable,o.detail||null),i},c.prototype=window.Event.prototype);S.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&document.body.contains(this.dialog_)||this.downgradeModal()},downgradeModal:function(){!this.openAsModal_||(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),a.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropClick_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var o=document.createEvent("MouseEvents");o.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(o),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");if(!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),!e){var t=["button","input","keygen","select","textarea"],o=t.map(function(i){return i+":not([disabled])"});o.push('[tabindex]:not([disabled]):not([tabindex=""])'),e=this.dialog_.querySelector(o.join(", "))}T(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!document.body.contains(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!a.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");F(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,a.needsCentering(this.dialog_)?(a.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),e!==void 0&&(this.dialog_.returnValue=e);var t=new c("close",{bubbles:!1,cancelable:!1});this.dialog_.dispatchEvent(t)}};a={};a.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,o=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,o)+"px"};a.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var o=document.styleSheets[t],i=null;try{i=o.cssRules}catch(P){}if(!!i)for(var n=0;n<i.length;++n){var r=i[n],s=null;try{s=document.querySelectorAll(r.selectorText)}catch(P){}if(!(!s||!U(s,e))){var l=r.style.getPropertyValue("top"),E=r.style.getPropertyValue("bottom");if(l&&l!=="auto"||E&&E!=="auto")return!0}}}return!1};a.needsCentering=function(e){var t=window.getComputedStyle(e);return t.position!=="absolute"||e.style.top!=="auto"&&e.style.top!==""||e.style.bottom!=="auto"&&e.style.bottom!==""?!1:!a.isInlinePositionSetByStylesheet(e)};a.forceRegisterDialog=function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",e),e.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new S(e)};a.registerDialog=function(e){e.showModal||a.forceRegisterDialog(e)};a.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=1e5+150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(i){for(var n=0,r;r=i.removedNodes[n];++n){if(r instanceof Element)r.localName==="dialog"&&o.push(r);else continue;o=o.concat(r.querySelectorAll("dialog"))}}),o.length&&e(o)}))};a.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})};a.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()};a.DialogManager.prototype.updateStacking=function(){for(var e=this.zIndexHigh_,t=0,o;o=this.pendingDialogStack[t];++t)o.updateZIndex(--e,--e),t===0&&(this.overlay.style.zIndex=--e);var i=this.pendingDialogStack[0];if(i){var n=i.dialog.parentNode||document.body;n.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)};a.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=u(e);){for(var t=0,o;o=this.pendingDialogStack[t];++t)if(o.dialog===e)return t===0;e=e.parentElement}return!1};a.DialogManager.prototype.handleFocus_=function(e){if(!this.containedByTopDialog_(e.target)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),T(e.target),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],o=t.dialog,i=o.compareDocumentPosition(e.target);return i&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e.target!==document.documentElement&&document.documentElement.focus()),!1}};a.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,e.keyCode===27){e.preventDefault(),e.stopPropagation();var t=new c("cancel",{bubbles:!1,cancelable:!0}),o=this.pendingDialogStack[0];o&&o.dialog.dispatchEvent(t)&&o.dialog.close()}else e.keyCode===9&&(this.forwardTab_=!e.shiftKey)};a.DialogManager.prototype.checkDOM_=function(e){var t=this.pendingDialogStack.slice();t.forEach(function(o){e.indexOf(o.dialog)!==-1?o.downgradeModal():o.maybeHideModal()})};a.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(e)===1&&this.blockDocument(),this.updateStacking(),!0)};a.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())};a.dm=new a.DialogManager;a.formSubmitter=null;a.useValue=null;window.HTMLDialogElement===void 0&&(y=document.createElement("form"),y.setAttribute("method","dialog"),y.method!=="dialog"&&(d=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method"),d&&(x=d.get,d.get=function(){return h(this)?"dialog":x.call(this)},k=d.set,d.set=function(e){return typeof e=="string"&&e.toLowerCase()==="dialog"?this.setAttribute("method",e):k.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",d))),document.addEventListener("click",function(e){if(a.formSubmitter=null,a.useValue=null,!e.defaultPrevented){var t=e.target;if(!(!t||!h(t.form))){var o=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!o){if(!(t.localName==="input"&&t.type==="image"))return;a.useValue=e.offsetX+","+e.offsetY}var i=u(t);!i||(a.formSubmitter=t)}}},!1),D=HTMLFormElement.prototype.submit,C=function(){if(!h(this))return D.call(this);var e=u(this);e&&e.close()},HTMLFormElement.prototype.submit=C,document.addEventListener("submit",function(e){if(!e.defaultPrevented){var t=e.target;if(!!h(t)){e.preventDefault();var o=u(t);if(!!o){var i=a.formSubmitter;i&&i.form===t?o.close(a.useValue||i.value):o.close(),a.formSubmitter=null}}}},!1));z=a});function L(){let e=document.querySelector(".js-header"),t=document.querySelectorAll(".js-headerMenuButton");t.forEach(i=>{i.addEventListener("click",n=>{n.preventDefault(),e==null||e.classList.toggle("is-active"),i.setAttribute("aria-expanded",String(e==null?void 0:e.classList.contains("is-active")))})});let o=document.querySelector(".js-scrim");o==null||o.addEventListener("click",i=>{i.preventDefault(),e==null||e.classList.remove("is-active"),t.forEach(n=>{n.setAttribute("aria-expanded",String(e==null?void 0:e.classList.contains("is-active")))})})}function M(){let e=document.querySelector(".js-searchForm"),t=document.querySelector(".js-expandSearch"),o=e==null?void 0:e.querySelector("input"),i=document.querySelector(".js-headerLogo"),n=document.querySelector(".js-headerMenuButton");t==null||t.addEventListener("click",()=>{e==null||e.classList.add("go-SearchForm--expanded"),i==null||i.classList.add("go-Header-logo--hidden"),n==null||n.classList.add("go-Header-navOpen--hidden"),o==null||o.focus()}),document==null||document.addEventListener("click",r=>{(e==null?void 0:e.contains(r.target))||(e==null||e.classList.remove("go-SearchForm--expanded"),i==null||i.classList.remove("go-Header-logo--hidden"),n==null||n.classList.remove("go-Header-navOpen--hidden"))})}var g=class{constructor(t){this.el=t;this.setActive=t=>{this.activeIndex=(t+this.slides.length)%this.slides.length,this.el.setAttribute("data-slide-index",String(this.activeIndex));for(let o of this.dots)o.classList.remove("go-Carousel-dot--active");this.dots[this.activeIndex].classList.add("go-Carousel-dot--active");for(let o of this.slides)o.setAttribute("aria-hidden","true");this.slides[this.activeIndex].removeAttribute("aria-hidden"),this.liveRegion.textContent="Slide "+(this.activeIndex+1)+" of "+this.slides.length};var o;this.slides=Array.from(t.querySelectorAll(".go-Carousel-slide")),this.dots=[],this.liveRegion=document.createElement("div"),this.activeIndex=Number((o=t.getAttribute("data-slide-index"))!=null?o:0),this.initSlides(),this.initArrows(),this.initDots(),this.initLiveRegion()}initSlides(){for(let[t,o]of this.slides.entries())t!==this.activeIndex&&o.setAttribute("aria-hidden","true")}initArrows(){var o,i;let t=document.createElement("ul");t.classList.add("go-Carousel-arrows"),t.innerHTML=`
       <li>
         <button class="go-Carousel-prevSlide" aria-label="Go to previous slide">
           <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_left_gm_grey_24dp.svg" alt="">
@@ -9,7 +9,7 @@
           <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_right_gm_grey_24dp.svg" alt="">
         </button>
       </li>
-    `,(o=t.querySelector(".go-Carousel-prevSlide"))==null||o.addEventListener("click",()=>this.setActive(this.activeIndex-1)),(i=t.querySelector(".go-Carousel-nextSlide"))==null||i.addEventListener("click",()=>this.setActive(this.activeIndex+1)),this.el.append(t)}initDots(){let t=document.createElement("ul");t.classList.add("go-Carousel-dots");for(let o=0;o<this.slides.length;o++){let i=document.createElement("li"),n=document.createElement("button");n.classList.add("go-Carousel-dot"),o===0&&n.classList.add("go-Carousel-dot--active"),n.innerHTML=`<span class="go-Carousel-obscured">Slide ${o+1}</span>`,n.addEventListener("click",()=>this.setActive(o)),i.append(n),t.append(i),this.dots.push(n)}this.el.append(t)}initLiveRegion(){this.liveRegion.setAttribute("aria-live","polite"),this.liveRegion.setAttribute("aria-atomic","true"),this.liveRegion.setAttribute("class","go-Carousel-obscured"),this.liveRegion.textContent=`Slide ${this.activeIndex+1} of ${this.slides.length}`,this.el.appendChild(this.liveRegion)}};var m=class{constructor(t){this.el=t;var o,i,n,r,s;this.data=(o=t.dataset.toCopy)!=null?o:t.innerText,!this.data&&((i=t.parentElement)==null?void 0:i.classList.contains("go-InputGroup"))&&(this.data=(s=this.data||((r=(n=t.parentElement)==null?void 0:n.querySelector("input"))==null?void 0:r.value))!=null?s:""),t.addEventListener("click",l=>this.handleCopyClick(l))}handleCopyClick(t){t.preventDefault();let o=1e3;if(!navigator.clipboard){this.showTooltipText("Unable to copy",o);return}navigator.clipboard.writeText(this.data).then(()=>{this.showTooltipText("Copied!",o)}).catch(()=>{this.showTooltipText("Unable to copy",o)})}showTooltipText(t,o){this.el.setAttribute("data-tooltip",t),setTimeout(()=>this.el.setAttribute("data-tooltip",""),o)}};var v=class{constructor(t){this.el=t;document.addEventListener("click",o=>{this.el.contains(o.target)||this.el.removeAttribute("open")})}};var b=class{constructor(t){this.el=t;this.el.addEventListener("change",o=>{let i=o.target,n=i.value;i.value.startsWith("/")||(n="/"+n),window.location.href=n})}};var w=class{constructor(t){this.el=t;!window.HTMLDialogElement&&!t.showModal&&Promise.resolve().then(()=>(H(),A)).then(({default:n})=>{n.registerDialog(t)});let o=t.id,i=document.querySelector(`[aria-controls="${o}"]`);i&&i.addEventListener("click",()=>{var n;this.el.showModal?this.el.showModal():this.el.open=!0,(n=t.querySelector("input"))==null||n.focus()});for(let n of this.el.querySelectorAll("[data-modal-close]"))n.addEventListener("click",()=>{this.el.close?this.el.close():this.el.open=!1})}};function f(e,t,o,i){var n;(n=window.dataLayer)!=null||(window.dataLayer=[]),typeof e=="string"?window.dataLayer.push({event:e,event_category:t,event_action:o,event_label:i}):window.dataLayer.push(e)}function O(e){var t;(t=window.dataLayer)!=null||(window.dataLayer=[]),window.dataLayer.push(e)}var I=class{constructor(){this.handlers={},document.addEventListener("keydown",t=>this.handleKeyPress(t))}on(t,o,i,n){var r,s;return(s=(r=this.handlers)[t])!=null||(r[t]=new Set),this.handlers[t].add({description:o,callback:i,...n}),this}handleKeyPress(t){var o;for(let i of(o=this.handlers[t.key.toLowerCase()])!=null?o:new Set){if(i.target&&i.target!==t.target)return;let n=t.target;if(!i.target&&((n==null?void 0:n.tagName)==="INPUT"||(n==null?void 0:n.tagName)==="SELECT"||(n==null?void 0:n.tagName)==="TEXTAREA")||(n==null?void 0:n.isContentEditable)||i.withMeta&&!(t.ctrlKey||t.metaKey)||!i.withMeta&&(t.ctrlKey||t.metaKey))return;f("keypress","hotkeys",`${t.key} pressed`,i.description),i.callback(t)}}},p=new I;L();M();for(let e of document.querySelectorAll(".js-clipboard"))new m(e);for(let e of document.querySelectorAll(".js-modal"))new w(e);for(let e of document.querySelectorAll(".js-tooltip"))new v(e);for(let e of document.querySelectorAll(".js-selectNav"))new b(e);for(let e of document.querySelectorAll(".js-carousel"))new g(e);p.on("t","toggle theme",()=>{let e="dark",t=document.documentElement.getAttribute("data-theme");t==="dark"?e="light":t==="light"&&(e="auto"),document.documentElement.setAttribute("data-theme",e),document.cookie=`prefers-color-scheme=${e};path=/;max-age=31536000;`});p.on("/","focus search",e=>{let t=Array.from(document.querySelectorAll(".js-searchFocus")).pop();t&&!window.navigator.userAgent.includes("Firefox")&&(e.preventDefault(),t.focus())});p.on("y","set canonical url",()=>{var t;let e=(t=document.querySelector(".js-canonicalURLPath"))==null?void 0:t.dataset.canonicalUrlPath;e&&e!==""&&window.history.replaceState(null,"",e)});(function(){f({"gtm.start":new Date().getTime(),event:"gtm.js"})})();function N(){let e=new URLSearchParams(window.location.search),t=e.get("utm_source");if(t!=="gopls"&&t!=="godoc"&&t!=="pkggodev")return;let o=new URL(window.location.href);e.delete("utm_source"),o.search=e.toString(),window.history.replaceState(null,"",o.toString())}var q;((q=document.querySelector(".js-gtmID"))==null?void 0:q.dataset.gtmid)&&window.dataLayer?O(function(){N()}):N();
+    `,(o=t.querySelector(".go-Carousel-prevSlide"))==null||o.addEventListener("click",()=>this.setActive(this.activeIndex-1)),(i=t.querySelector(".go-Carousel-nextSlide"))==null||i.addEventListener("click",()=>this.setActive(this.activeIndex+1)),this.el.append(t)}initDots(){let t=document.createElement("ul");t.classList.add("go-Carousel-dots");for(let o=0;o<this.slides.length;o++){let i=document.createElement("li"),n=document.createElement("button");n.classList.add("go-Carousel-dot"),o===this.activeIndex&&n.classList.add("go-Carousel-dot--active"),n.innerHTML=`<span class="go-Carousel-obscured">Slide ${o+1}</span>`,n.addEventListener("click",()=>this.setActive(o)),i.append(n),t.append(i),this.dots.push(n)}this.el.append(t)}initLiveRegion(){this.liveRegion.setAttribute("aria-live","polite"),this.liveRegion.setAttribute("aria-atomic","true"),this.liveRegion.setAttribute("class","go-Carousel-obscured"),this.liveRegion.textContent=`Slide ${this.activeIndex+1} of ${this.slides.length}`,this.el.appendChild(this.liveRegion)}};var m=class{constructor(t){this.el=t;var o,i,n,r,s;this.data=(o=t.dataset.toCopy)!=null?o:t.innerText,!this.data&&((i=t.parentElement)==null?void 0:i.classList.contains("go-InputGroup"))&&(this.data=(s=this.data||((r=(n=t.parentElement)==null?void 0:n.querySelector("input"))==null?void 0:r.value))!=null?s:""),t.addEventListener("click",l=>this.handleCopyClick(l))}handleCopyClick(t){t.preventDefault();let o=1e3;if(!navigator.clipboard){this.showTooltipText("Unable to copy",o);return}navigator.clipboard.writeText(this.data).then(()=>{this.showTooltipText("Copied!",o)}).catch(()=>{this.showTooltipText("Unable to copy",o)})}showTooltipText(t,o){this.el.setAttribute("data-tooltip",t),setTimeout(()=>this.el.setAttribute("data-tooltip",""),o)}};var v=class{constructor(t){this.el=t;document.addEventListener("click",o=>{this.el.contains(o.target)||this.el.removeAttribute("open")})}};var b=class{constructor(t){this.el=t;this.el.addEventListener("change",o=>{let i=o.target,n=i.value;i.value.startsWith("/")||(n="/"+n),window.location.href=n})}};var w=class{constructor(t){this.el=t;!window.HTMLDialogElement&&!t.showModal&&Promise.resolve().then(()=>(H(),A)).then(({default:n})=>{n.registerDialog(t)});let o=t.id,i=document.querySelector(`[aria-controls="${o}"]`);i&&i.addEventListener("click",()=>{var n;this.el.showModal?this.el.showModal():this.el.open=!0,(n=t.querySelector("input"))==null||n.focus()});for(let n of this.el.querySelectorAll("[data-modal-close]"))n.addEventListener("click",()=>{this.el.close?this.el.close():this.el.open=!1})}};function f(e,t,o,i){var n;(n=window.dataLayer)!=null||(window.dataLayer=[]),typeof e=="string"?window.dataLayer.push({event:e,event_category:t,event_action:o,event_label:i}):window.dataLayer.push(e)}function I(e){var t;(t=window.dataLayer)!=null||(window.dataLayer=[]),window.dataLayer.push(e)}var O=class{constructor(){this.handlers={},document.addEventListener("keydown",t=>this.handleKeyPress(t))}on(t,o,i,n){var r,s;return(s=(r=this.handlers)[t])!=null||(r[t]=new Set),this.handlers[t].add({description:o,callback:i,...n}),this}handleKeyPress(t){var o;for(let i of(o=this.handlers[t.key.toLowerCase()])!=null?o:new Set){if(i.target&&i.target!==t.target)return;let n=t.target;if(!i.target&&((n==null?void 0:n.tagName)==="INPUT"||(n==null?void 0:n.tagName)==="SELECT"||(n==null?void 0:n.tagName)==="TEXTAREA")||(n==null?void 0:n.isContentEditable)||i.withMeta&&!(t.ctrlKey||t.metaKey)||!i.withMeta&&(t.ctrlKey||t.metaKey))return;f("keypress","hotkeys",`${t.key} pressed`,i.description),i.callback(t)}}},p=new O;L();M();for(let e of document.querySelectorAll(".js-clipboard"))new m(e);for(let e of document.querySelectorAll(".js-modal"))new w(e);for(let e of document.querySelectorAll(".js-tooltip"))new v(e);for(let e of document.querySelectorAll(".js-selectNav"))new b(e);for(let e of document.querySelectorAll(".js-carousel"))new g(e);p.on("t","toggle theme",()=>{let e="dark",t=document.documentElement.getAttribute("data-theme");t==="dark"?e="light":t==="light"&&(e="auto"),document.documentElement.setAttribute("data-theme",e),document.cookie=`prefers-color-scheme=${e};path=/;max-age=31536000;`});p.on("/","focus search",e=>{let t=Array.from(document.querySelectorAll(".js-searchFocus")).pop();t&&!window.navigator.userAgent.includes("Firefox")&&(e.preventDefault(),t.focus())});p.on("y","set canonical url",()=>{var t;let e=(t=document.querySelector(".js-canonicalURLPath"))==null?void 0:t.dataset.canonicalUrlPath;e&&e!==""&&window.history.replaceState(null,"",e)});(function(){f({"gtm.start":new Date().getTime(),event:"gtm.js"})})();function N(){let e=new URLSearchParams(window.location.search),t=e.get("utm_source");if(t!=="gopls"&&t!=="godoc"&&t!=="pkggodev")return;let o=new URL(window.location.href);e.delete("utm_source"),o.search=e.toString(),window.history.replaceState(null,"",o.toString())}var q;((q=document.querySelector(".js-gtmID"))==null?void 0:q.dataset.gtmid)&&window.dataLayer?I(function(){N()}):N();
 /*!
  * @license
  * Copyright 2019-2020 The Go Authors. All rights reserved.
diff --git a/static/frontend/frontend.js.map b/static/frontend/frontend.js.map
index a42bdc6..5e942b0 100644
--- a/static/frontend/frontend.js.map
+++ b/static/frontend/frontend.js.map
@@ -1,7 +1,7 @@
 {
   "version": 3,
   "sources": ["../../third_party/dialog-polyfill/dialog-polyfill.esm.js", "../shared/header/header.ts", "../shared/carousel/carousel.ts", "../shared/clipboard/clipboard.ts", "../shared/tooltip/tooltip.ts", "../shared/outline/select.ts", "../shared/modal/modal.ts", "../shared/analytics/analytics.ts", "../shared/keyboard/keyboard.ts", "frontend.ts"],
-  "sourcesContent": ["// nb. This is for IE10 and lower _only_.\nvar supportCustomEvent = window.CustomEvent;\nif (!supportCustomEvent || typeof supportCustomEvent === 'object') {\n  supportCustomEvent = function CustomEvent(event, x) {\n    x = x || {};\n    var ev = document.createEvent('CustomEvent');\n    ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null);\n    return ev;\n  };\n  supportCustomEvent.prototype = window.Event.prototype;\n}\n\n/**\n * @param {Element} el to check for stacking context\n * @return {boolean} whether this el or its parents creates a stacking context\n */\nfunction createsStackingContext(el) {\n  while (el && el !== document.body) {\n    var s = window.getComputedStyle(el);\n    var invalid = function(k, ok) {\n      return !(s[k] === undefined || s[k] === ok);\n    };\n\n    if (s.opacity < 1 ||\n        invalid('zIndex', 'auto') ||\n        invalid('transform', 'none') ||\n        invalid('mixBlendMode', 'normal') ||\n        invalid('filter', 'none') ||\n        invalid('perspective', 'none') ||\n        s['isolation'] === 'isolate' ||\n        s.position === 'fixed' ||\n        s.webkitOverflowScrolling === 'touch') {\n      return true;\n    }\n    el = el.parentElement;\n  }\n  return false;\n}\n\n/**\n * Finds the nearest <dialog> from the passed element.\n *\n * @param {Element} el to search from\n * @return {HTMLDialogElement} dialog found\n */\nfunction findNearestDialog(el) {\n  while (el) {\n    if (el.localName === 'dialog') {\n      return /** @type {HTMLDialogElement} */ (el);\n    }\n    el = el.parentElement;\n  }\n  return null;\n}\n\n/**\n * Blur the specified element, as long as it's not the HTML body element.\n * This works around an IE9/10 bug - blurring the body causes Windows to\n * blur the whole application.\n *\n * @param {Element} el to blur\n */\nfunction safeBlur(el) {\n  if (el && el.blur && el !== document.body) {\n    el.blur();\n  }\n}\n\n/**\n * @param {!NodeList} nodeList to search\n * @param {Node} node to find\n * @return {boolean} whether node is inside nodeList\n */\nfunction inNodeList(nodeList, node) {\n  for (var i = 0; i < nodeList.length; ++i) {\n    if (nodeList[i] === node) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * @param {HTMLFormElement} el to check\n * @return {boolean} whether this form has method=\"dialog\"\n */\nfunction isFormMethodDialog(el) {\n  if (!el || !el.hasAttribute('method')) {\n    return false;\n  }\n  return el.getAttribute('method').toLowerCase() === 'dialog';\n}\n\n/**\n * @param {!HTMLDialogElement} dialog to upgrade\n * @constructor\n */\nfunction dialogPolyfillInfo(dialog) {\n  this.dialog_ = dialog;\n  this.replacedStyleTop_ = false;\n  this.openAsModal_ = false;\n\n  // Set a11y role. Browsers that support dialog implicitly know this already.\n  if (!dialog.hasAttribute('role')) {\n    dialog.setAttribute('role', 'dialog');\n  }\n\n  dialog.show = this.show.bind(this);\n  dialog.showModal = this.showModal.bind(this);\n  dialog.close = this.close.bind(this);\n\n  if (!('returnValue' in dialog)) {\n    dialog.returnValue = '';\n  }\n\n  if ('MutationObserver' in window) {\n    var mo = new MutationObserver(this.maybeHideModal.bind(this));\n    mo.observe(dialog, {attributes: true, attributeFilter: ['open']});\n  } else {\n    // IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also\n    // seem to fire even if the element was removed as part of a parent removal. Use the removed\n    // events to force downgrade (useful if removed/immediately added).\n    var removed = false;\n    var cb = function() {\n      removed ? this.downgradeModal() : this.maybeHideModal();\n      removed = false;\n    }.bind(this);\n    var timeout;\n    var delayModel = function(ev) {\n      if (ev.target !== dialog) { return; }  // not for a child element\n      var cand = 'DOMNodeRemoved';\n      removed |= (ev.type.substr(0, cand.length) === cand);\n      window.clearTimeout(timeout);\n      timeout = window.setTimeout(cb, 0);\n    };\n    ['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) {\n      dialog.addEventListener(name, delayModel);\n    });\n  }\n  // Note that the DOM is observed inside DialogManager while any dialog\n  // is being displayed as a modal, to catch modal removal from the DOM.\n\n  Object.defineProperty(dialog, 'open', {\n    set: this.setOpen.bind(this),\n    get: dialog.hasAttribute.bind(dialog, 'open')\n  });\n\n  this.backdrop_ = document.createElement('div');\n  this.backdrop_.className = 'backdrop';\n  this.backdrop_.addEventListener('click', this.backdropClick_.bind(this));\n}\n\ndialogPolyfillInfo.prototype = {\n\n  get dialog() {\n    return this.dialog_;\n  },\n\n  /**\n   * Maybe remove this dialog from the modal top layer. This is called when\n   * a modal dialog may no longer be tenable, e.g., when the dialog is no\n   * longer open or is no longer part of the DOM.\n   */\n  maybeHideModal: function() {\n    if (this.dialog_.hasAttribute('open') && document.body.contains(this.dialog_)) { return; }\n    this.downgradeModal();\n  },\n\n  /**\n   * Remove this dialog from the modal top layer, leaving it as a non-modal.\n   */\n  downgradeModal: function() {\n    if (!this.openAsModal_) { return; }\n    this.openAsModal_ = false;\n    this.dialog_.style.zIndex = '';\n\n    // This won't match the native <dialog> exactly because if the user set top on a centered\n    // polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's\n    // possible to polyfill this perfectly.\n    if (this.replacedStyleTop_) {\n      this.dialog_.style.top = '';\n      this.replacedStyleTop_ = false;\n    }\n\n    // Clear the backdrop and remove from the manager.\n    this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);\n    dialogPolyfill.dm.removeDialog(this);\n  },\n\n  /**\n   * @param {boolean} value whether to open or close this dialog\n   */\n  setOpen: function(value) {\n    if (value) {\n      this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', '');\n    } else {\n      this.dialog_.removeAttribute('open');\n      this.maybeHideModal();  // nb. redundant with MutationObserver\n    }\n  },\n\n  /**\n   * Handles clicks on the fake .backdrop element, redirecting them as if\n   * they were on the dialog itself.\n   *\n   * @param {!Event} e to redirect\n   */\n  backdropClick_: function(e) {\n    if (!this.dialog_.hasAttribute('tabindex')) {\n      // Clicking on the backdrop should move the implicit cursor, even if dialog cannot be\n      // focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this\n      // would not be needed - clicks would move the implicit cursor there.\n      var fake = document.createElement('div');\n      this.dialog_.insertBefore(fake, this.dialog_.firstChild);\n      fake.tabIndex = -1;\n      fake.focus();\n      this.dialog_.removeChild(fake);\n    } else {\n      this.dialog_.focus();\n    }\n\n    var redirectedEvent = document.createEvent('MouseEvents');\n    redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,\n        e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,\n        e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);\n    this.dialog_.dispatchEvent(redirectedEvent);\n    e.stopPropagation();\n  },\n\n  /**\n   * Focuses on the first focusable element within the dialog. This will always blur the current\n   * focus, even if nothing within the dialog is found.\n   */\n  focus_: function() {\n    // Find element with `autofocus` attribute, or fall back to the first form/tabindex control.\n    var target = this.dialog_.querySelector('[autofocus]:not([disabled])');\n    if (!target && this.dialog_.tabIndex >= 0) {\n      target = this.dialog_;\n    }\n    if (!target) {\n      // Note that this is 'any focusable area'. This list is probably not exhaustive, but the\n      // alternative involves stepping through and trying to focus everything.\n      var opts = ['button', 'input', 'keygen', 'select', 'textarea'];\n      var query = opts.map(function(el) {\n        return el + ':not([disabled])';\n      });\n      // TODO(samthor): tabindex values that are not numeric are not focusable.\n      query.push('[tabindex]:not([disabled]):not([tabindex=\"\"])');  // tabindex != \"\", not disabled\n      target = this.dialog_.querySelector(query.join(', '));\n    }\n    safeBlur(document.activeElement);\n    target && target.focus();\n  },\n\n  /**\n   * Sets the zIndex for the backdrop and dialog.\n   *\n   * @param {number} dialogZ\n   * @param {number} backdropZ\n   */\n  updateZIndex: function(dialogZ, backdropZ) {\n    if (dialogZ < backdropZ) {\n      throw new Error('dialogZ should never be < backdropZ');\n    }\n    this.dialog_.style.zIndex = dialogZ;\n    this.backdrop_.style.zIndex = backdropZ;\n  },\n\n  /**\n   * Shows the dialog. If the dialog is already open, this does nothing.\n   */\n  show: function() {\n    if (!this.dialog_.open) {\n      this.setOpen(true);\n      this.focus_();\n    }\n  },\n\n  /**\n   * Show this dialog modally.\n   */\n  showModal: function() {\n    if (this.dialog_.hasAttribute('open')) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: The element is already open, and therefore cannot be opened modally.');\n    }\n    if (!document.body.contains(this.dialog_)) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: The element is not in a Document.');\n    }\n    if (!dialogPolyfill.dm.pushDialog(this)) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: There are too many open modal dialogs.');\n    }\n\n    if (createsStackingContext(this.dialog_.parentElement)) {\n      console.warn('A dialog is being shown inside a stacking context. ' +\n          'This may cause it to be unusable. For more information, see this link: ' +\n          'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');\n    }\n\n    this.setOpen(true);\n    this.openAsModal_ = true;\n\n    // Optionally center vertically, relative to the current viewport.\n    if (dialogPolyfill.needsCentering(this.dialog_)) {\n      dialogPolyfill.reposition(this.dialog_);\n      this.replacedStyleTop_ = true;\n    } else {\n      this.replacedStyleTop_ = false;\n    }\n\n    // Insert backdrop.\n    this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);\n\n    // Focus on whatever inside the dialog.\n    this.focus_();\n  },\n\n  /**\n   * Closes this HTMLDialogElement. This is optional vs clearing the open\n   * attribute, however this fires a 'close' event.\n   *\n   * @param {string=} opt_returnValue to use as the returnValue\n   */\n  close: function(opt_returnValue) {\n    if (!this.dialog_.hasAttribute('open')) {\n      throw new Error('Failed to execute \\'close\\' on dialog: The element does not have an \\'open\\' attribute, and therefore cannot be closed.');\n    }\n    this.setOpen(false);\n\n    // Leave returnValue untouched in case it was set directly on the element\n    if (opt_returnValue !== undefined) {\n      this.dialog_.returnValue = opt_returnValue;\n    }\n\n    // Triggering \"close\" event for any attached listeners on the <dialog>.\n    var closeEvent = new supportCustomEvent('close', {\n      bubbles: false,\n      cancelable: false\n    });\n    this.dialog_.dispatchEvent(closeEvent);\n  }\n\n};\n\nvar dialogPolyfill = {};\n\ndialogPolyfill.reposition = function(element) {\n  var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;\n  var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2;\n  element.style.top = Math.max(scrollTop, topValue) + 'px';\n};\n\ndialogPolyfill.isInlinePositionSetByStylesheet = function(element) {\n  for (var i = 0; i < document.styleSheets.length; ++i) {\n    var styleSheet = document.styleSheets[i];\n    var cssRules = null;\n    // Some browsers throw on cssRules.\n    try {\n      cssRules = styleSheet.cssRules;\n    } catch (e) {}\n    if (!cssRules) { continue; }\n    for (var j = 0; j < cssRules.length; ++j) {\n      var rule = cssRules[j];\n      var selectedNodes = null;\n      // Ignore errors on invalid selector texts.\n      try {\n        selectedNodes = document.querySelectorAll(rule.selectorText);\n      } catch(e) {}\n      if (!selectedNodes || !inNodeList(selectedNodes, element)) {\n        continue;\n      }\n      var cssTop = rule.style.getPropertyValue('top');\n      var cssBottom = rule.style.getPropertyValue('bottom');\n      if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) {\n        return true;\n      }\n    }\n  }\n  return false;\n};\n\ndialogPolyfill.needsCentering = function(dialog) {\n  var computedStyle = window.getComputedStyle(dialog);\n  if (computedStyle.position !== 'absolute') {\n    return false;\n  }\n\n  // We must determine whether the top/bottom specified value is non-auto.  In\n  // WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but\n  // Firefox returns the used value. So we do this crazy thing instead: check\n  // the inline style and then go through CSS rules.\n  if ((dialog.style.top !== 'auto' && dialog.style.top !== '') ||\n      (dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) {\n    return false;\n  }\n  return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog);\n};\n\n/**\n * @param {!Element} element to force upgrade\n */\ndialogPolyfill.forceRegisterDialog = function(element) {\n  if (window.HTMLDialogElement || element.showModal) {\n    console.warn('This browser already supports <dialog>, the polyfill ' +\n        'may not work correctly', element);\n  }\n  if (element.localName !== 'dialog') {\n    throw new Error('Failed to register dialog: The element is not a dialog.');\n  }\n  new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));\n};\n\n/**\n * @param {!Element} element to upgrade, if necessary\n */\ndialogPolyfill.registerDialog = function(element) {\n  if (!element.showModal) {\n    dialogPolyfill.forceRegisterDialog(element);\n  }\n};\n\n/**\n * @constructor\n */\ndialogPolyfill.DialogManager = function() {\n  /** @type {!Array<!dialogPolyfillInfo>} */\n  this.pendingDialogStack = [];\n\n  var checkDOM = this.checkDOM_.bind(this);\n\n  // The overlay is used to simulate how a modal dialog blocks the document.\n  // The blocking dialog is positioned on top of the overlay, and the rest of\n  // the dialogs on the pending dialog stack are positioned below it. In the\n  // actual implementation, the modal dialog stacking is controlled by the\n  // top layer, where z-index has no effect.\n  this.overlay = document.createElement('div');\n  this.overlay.className = '_dialog_overlay';\n  this.overlay.addEventListener('click', function(e) {\n    this.forwardTab_ = undefined;\n    e.stopPropagation();\n    checkDOM([]);  // sanity-check DOM\n  }.bind(this));\n\n  this.handleKey_ = this.handleKey_.bind(this);\n  this.handleFocus_ = this.handleFocus_.bind(this);\n\n  this.zIndexLow_ = 100000;\n  this.zIndexHigh_ = 100000 + 150;\n\n  this.forwardTab_ = undefined;\n\n  if ('MutationObserver' in window) {\n    this.mo_ = new MutationObserver(function(records) {\n      var removed = [];\n      records.forEach(function(rec) {\n        for (var i = 0, c; c = rec.removedNodes[i]; ++i) {\n          if (!(c instanceof Element)) {\n            continue;\n          } else if (c.localName === 'dialog') {\n            removed.push(c);\n          }\n          removed = removed.concat(c.querySelectorAll('dialog'));\n        }\n      });\n      removed.length && checkDOM(removed);\n    });\n  }\n};\n\n/**\n * Called on the first modal dialog being shown. Adds the overlay and related\n * handlers.\n */\ndialogPolyfill.DialogManager.prototype.blockDocument = function() {\n  document.documentElement.addEventListener('focus', this.handleFocus_, true);\n  document.addEventListener('keydown', this.handleKey_);\n  this.mo_ && this.mo_.observe(document, {childList: true, subtree: true});\n};\n\n/**\n * Called on the first modal dialog being removed, i.e., when no more modal\n * dialogs are visible.\n */\ndialogPolyfill.DialogManager.prototype.unblockDocument = function() {\n  document.documentElement.removeEventListener('focus', this.handleFocus_, true);\n  document.removeEventListener('keydown', this.handleKey_);\n  this.mo_ && this.mo_.disconnect();\n};\n\n/**\n * Updates the stacking of all known dialogs.\n */\ndialogPolyfill.DialogManager.prototype.updateStacking = function() {\n  var zIndex = this.zIndexHigh_;\n\n  for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n    dpi.updateZIndex(--zIndex, --zIndex);\n    if (i === 0) {\n      this.overlay.style.zIndex = --zIndex;\n    }\n  }\n\n  // Make the overlay a sibling of the dialog itself.\n  var last = this.pendingDialogStack[0];\n  if (last) {\n    var p = last.dialog.parentNode || document.body;\n    p.appendChild(this.overlay);\n  } else if (this.overlay.parentNode) {\n    this.overlay.parentNode.removeChild(this.overlay);\n  }\n};\n\n/**\n * @param {Element} candidate to check if contained or is the top-most modal dialog\n * @return {boolean} whether candidate is contained in top dialog\n */\ndialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) {\n  while (candidate = findNearestDialog(candidate)) {\n    for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n      if (dpi.dialog === candidate) {\n        return i === 0;  // only valid if top-most\n      }\n    }\n    candidate = candidate.parentElement;\n  }\n  return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) {\n  if (this.containedByTopDialog_(event.target)) { return; }\n\n  if (document.activeElement === document.documentElement) { return; }\n\n  event.preventDefault();\n  event.stopPropagation();\n  safeBlur(/** @type {Element} */ (event.target));\n\n  if (this.forwardTab_ === undefined) { return; }  // move focus only from a tab key\n\n  var dpi = this.pendingDialogStack[0];\n  var dialog = dpi.dialog;\n  var position = dialog.compareDocumentPosition(event.target);\n  if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n    if (this.forwardTab_) {\n      // forward\n      dpi.focus_();\n    } else if (event.target !== document.documentElement) {\n      // backwards if we're not already focused on <html>\n      document.documentElement.focus();\n    }\n  }\n\n  return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleKey_ = function(event) {\n  this.forwardTab_ = undefined;\n  if (event.keyCode === 27) {\n    event.preventDefault();\n    event.stopPropagation();\n    var cancelEvent = new supportCustomEvent('cancel', {\n      bubbles: false,\n      cancelable: true\n    });\n    var dpi = this.pendingDialogStack[0];\n    if (dpi && dpi.dialog.dispatchEvent(cancelEvent)) {\n      dpi.dialog.close();\n    }\n  } else if (event.keyCode === 9) {\n    this.forwardTab_ = !event.shiftKey;\n  }\n};\n\n/**\n * Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are\n * removed and immediately readded don't stay modal, they become normal.\n *\n * @param {!Array<!HTMLDialogElement>} removed that have definitely been removed\n */\ndialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) {\n  // This operates on a clone because it may cause it to change. Each change also calls\n  // updateStacking, which only actually needs to happen once. But who removes many modal dialogs\n  // at a time?!\n  var clone = this.pendingDialogStack.slice();\n  clone.forEach(function(dpi) {\n    if (removed.indexOf(dpi.dialog) !== -1) {\n      dpi.downgradeModal();\n    } else {\n      dpi.maybeHideModal();\n    }\n  });\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n * @return {boolean} whether the dialog was allowed\n */\ndialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) {\n  var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;\n  if (this.pendingDialogStack.length >= allowed) {\n    return false;\n  }\n  if (this.pendingDialogStack.unshift(dpi) === 1) {\n    this.blockDocument();\n  }\n  this.updateStacking();\n  return true;\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n */\ndialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) {\n  var index = this.pendingDialogStack.indexOf(dpi);\n  if (index === -1) { return; }\n\n  this.pendingDialogStack.splice(index, 1);\n  if (this.pendingDialogStack.length === 0) {\n    this.unblockDocument();\n  }\n  this.updateStacking();\n};\n\ndialogPolyfill.dm = new dialogPolyfill.DialogManager();\ndialogPolyfill.formSubmitter = null;\ndialogPolyfill.useValue = null;\n\n/**\n * Installs global handlers, such as click listers and native method overrides. These are needed\n * even if a no dialog is registered, as they deal with <form method=\"dialog\">.\n */\nif (window.HTMLDialogElement === undefined) {\n\n  /**\n   * If HTMLFormElement translates method=\"DIALOG\" into 'get', then replace the descriptor with\n   * one that returns the correct value.\n   */\n  var testForm = document.createElement('form');\n  testForm.setAttribute('method', 'dialog');\n  if (testForm.method !== 'dialog') {\n    var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method');\n    if (methodDescriptor) {\n      // nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything\n      // and don't bother to update the element.\n      var realGet = methodDescriptor.get;\n      methodDescriptor.get = function() {\n        if (isFormMethodDialog(this)) {\n          return 'dialog';\n        }\n        return realGet.call(this);\n      };\n      var realSet = methodDescriptor.set;\n      methodDescriptor.set = function(v) {\n        if (typeof v === 'string' && v.toLowerCase() === 'dialog') {\n          return this.setAttribute('method', v);\n        }\n        return realSet.call(this, v);\n      };\n      Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor);\n    }\n  }\n\n  /**\n   * Global 'click' handler, to capture the <input type=\"submit\"> or <button> element which has\n   * submitted a <form method=\"dialog\">. Needed as Safari and others don't report this inside\n   * document.activeElement.\n   */\n  document.addEventListener('click', function(ev) {\n    dialogPolyfill.formSubmitter = null;\n    dialogPolyfill.useValue = null;\n    if (ev.defaultPrevented) { return; }  // e.g. a submit which prevents default submission\n\n    var target = /** @type {Element} */ (ev.target);\n    if (!target || !isFormMethodDialog(target.form)) { return; }\n\n    var valid = (target.type === 'submit' && ['button', 'input'].indexOf(target.localName) > -1);\n    if (!valid) {\n      if (!(target.localName === 'input' && target.type === 'image')) { return; }\n      // this is a <input type=\"image\">, which can submit forms\n      dialogPolyfill.useValue = ev.offsetX + ',' + ev.offsetY;\n    }\n\n    var dialog = findNearestDialog(target);\n    if (!dialog) { return; }\n\n    dialogPolyfill.formSubmitter = target;\n\n  }, false);\n\n  /**\n   * Replace the native HTMLFormElement.submit() method, as it won't fire the\n   * submit event and give us a chance to respond.\n   */\n  var nativeFormSubmit = HTMLFormElement.prototype.submit;\n  var replacementFormSubmit = function () {\n    if (!isFormMethodDialog(this)) {\n      return nativeFormSubmit.call(this);\n    }\n    var dialog = findNearestDialog(this);\n    dialog && dialog.close();\n  };\n  HTMLFormElement.prototype.submit = replacementFormSubmit;\n\n  /**\n   * Global form 'dialog' method handler. Closes a dialog correctly on submit\n   * and possibly sets its return value.\n   */\n  document.addEventListener('submit', function(ev) {\n    if (ev.defaultPrevented) { return; }  // e.g. a submit which prevents default submission\n\n    var form = /** @type {HTMLFormElement} */ (ev.target);\n    if (!isFormMethodDialog(form)) { return; }\n    ev.preventDefault();\n\n    var dialog = findNearestDialog(form);\n    if (!dialog) { return; }\n\n    // Forms can only be submitted via .submit() or a click (?), but anyway: sanity-check that\n    // the submitter is correct before using its value as .returnValue.\n    var s = dialogPolyfill.formSubmitter;\n    if (s && s.form === form) {\n      dialog.close(dialogPolyfill.useValue || s.value);\n    } else {\n      dialog.close();\n    }\n    dialogPolyfill.formSubmitter = null;\n\n  }, false);\n}\n\nexport default dialogPolyfill;\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nexport function registerHeaderListeners(): void {\n  const header = document.querySelector('.js-header');\n  const menuButtons = document.querySelectorAll('.js-headerMenuButton');\n  menuButtons.forEach(button => {\n    button.addEventListener('click', e => {\n      e.preventDefault();\n      header?.classList.toggle('is-active');\n      button.setAttribute('aria-expanded', String(header?.classList.contains('is-active')));\n    });\n  });\n\n  const scrim = document.querySelector('.js-scrim');\n  scrim?.addEventListener('click', e => {\n    e.preventDefault();\n    header?.classList.remove('is-active');\n    menuButtons.forEach(button => {\n      button.setAttribute('aria-expanded', String(header?.classList.contains('is-active')));\n    });\n  });\n}\n\nexport function registerSearchFormListeners(): void {\n  const searchForm = document.querySelector('.js-searchForm');\n  const expandSearch = document.querySelector('.js-expandSearch');\n  const input = searchForm?.querySelector('input');\n  const headerLogo = document.querySelector('.js-headerLogo');\n  const menuButton = document.querySelector('.js-headerMenuButton');\n  expandSearch?.addEventListener('click', () => {\n    searchForm?.classList.add('go-SearchForm--expanded');\n    headerLogo?.classList.add('go-Header-logo--hidden');\n    menuButton?.classList.add('go-Header-navOpen--hidden');\n    input?.focus();\n  });\n  document?.addEventListener('click', e => {\n    if (!searchForm?.contains(e.target as Node)) {\n      searchForm?.classList.remove('go-SearchForm--expanded');\n      headerLogo?.classList.remove('go-Header-logo--hidden');\n      menuButton?.classList.remove('go-Header-navOpen--hidden');\n    }\n  });\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * Carousel Controller adds event listeners, accessibilty enhancements, and\n * control elements to a carousel component.\n */\nexport class CarouselController {\n  /**\n   * slides is a collection of slides in the carousel.\n   */\n  private slides: HTMLLIElement[];\n  /**\n   * dots is a collection of dot navigation controls, added to the carousel\n   * by this controller.\n   */\n  private dots: HTMLElement[];\n  /**\n   * liveRegion is a visually hidden element that notifies assitive devices\n   * of visual changes to the carousel. They are added to the carousel by\n   * this controller.\n   */\n  private liveRegion: HTMLElement;\n  /**\n   * activeIndex is the 0-index of the currently active slide.\n   */\n  private activeIndex: number;\n\n  constructor(private el: HTMLElement) {\n    this.slides = Array.from(el.querySelectorAll('.go-Carousel-slide'));\n    this.dots = [];\n    this.liveRegion = document.createElement('div');\n    this.activeIndex = 0;\n\n    this.initSlides();\n    this.initArrows();\n    this.initDots();\n    this.initLiveRegion();\n  }\n\n  private initSlides() {\n    for (const [i, v] of this.slides.entries()) {\n      if (i === 0) continue;\n      v.setAttribute('aria-hidden', 'true');\n    }\n  }\n\n  private initArrows() {\n    const arrows = document.createElement('ul');\n    arrows.classList.add('go-Carousel-arrows');\n    arrows.innerHTML = `\n      <li>\n        <button class=\"go-Carousel-prevSlide\" aria-label=\"Go to previous slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_left_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n      <li>\n        <button class=\"go-Carousel-nextSlide\" aria-label=\"Go to next slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_right_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n    `;\n    arrows\n      .querySelector('.go-Carousel-prevSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex - 1));\n    arrows\n      .querySelector('.go-Carousel-nextSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex + 1));\n    this.el.append(arrows);\n  }\n\n  private initDots() {\n    const dots = document.createElement('ul');\n    dots.classList.add('go-Carousel-dots');\n    for (let i = 0; i < this.slides.length; i++) {\n      const li = document.createElement('li');\n      const button = document.createElement('button');\n      button.classList.add('go-Carousel-dot');\n      if (i === 0) {\n        button.classList.add('go-Carousel-dot--active');\n      }\n      button.innerHTML = `<span class=\"go-Carousel-obscured\">Slide ${i + 1}</span>`;\n      button.addEventListener('click', () => this.setActive(i));\n      li.append(button);\n      dots.append(li);\n      this.dots.push(button);\n    }\n    this.el.append(dots);\n  }\n\n  private initLiveRegion() {\n    this.liveRegion.setAttribute('aria-live', 'polite');\n    this.liveRegion.setAttribute('aria-atomic', 'true');\n    this.liveRegion.setAttribute('class', 'go-Carousel-obscured');\n    this.liveRegion.textContent = `Slide ${this.activeIndex + 1} of ${this.slides.length}`;\n    this.el.appendChild(this.liveRegion);\n  }\n\n  private setActive = (index: number) => {\n    this.activeIndex = (index + this.slides.length) % this.slides.length;\n    for (const d of this.dots) {\n      d.classList.remove('go-Carousel-dot--active');\n    }\n    this.dots[this.activeIndex].classList.add('go-Carousel-dot--active');\n    for (const s of this.slides) {\n      s.setAttribute('aria-hidden', 'true');\n    }\n    this.slides[this.activeIndex].removeAttribute('aria-hidden');\n    this.liveRegion.textContent = 'Slide ' + (this.activeIndex + 1) + ' of ' + this.slides.length;\n  };\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This class decorates an element to copy arbitrary data attached via a data-\n * attribute to the clipboard.\n */\nexport class ClipboardController {\n  /**\n   * The data to be copied to the clipboard.\n   */\n  private data: string;\n\n  /**\n   * @param el The element that will trigger copying text to the clipboard. The text is\n   * expected to be within its data-to-copy attribute.\n   */\n  constructor(private el: HTMLButtonElement) {\n    this.data = el.dataset['toCopy'] ?? el.innerText;\n    // if data-to-copy is empty and the button is part of an input group\n    // capture the value of the input.\n    if (!this.data && el.parentElement?.classList.contains('go-InputGroup')) {\n      this.data = (this.data || el.parentElement?.querySelector('input')?.value) ?? '';\n    }\n    el.addEventListener('click', e => this.handleCopyClick(e));\n  }\n\n  /**\n   * Handles when the primary element is clicked.\n   */\n  handleCopyClick(e: MouseEvent): void {\n    e.preventDefault();\n    const TOOLTIP_SHOW_DURATION_MS = 1000;\n\n    // This API is not available on iOS.\n    if (!navigator.clipboard) {\n      this.showTooltipText('Unable to copy', TOOLTIP_SHOW_DURATION_MS);\n      return;\n    }\n    navigator.clipboard\n      .writeText(this.data)\n      .then(() => {\n        this.showTooltipText('Copied!', TOOLTIP_SHOW_DURATION_MS);\n      })\n      .catch(() => {\n        this.showTooltipText('Unable to copy', TOOLTIP_SHOW_DURATION_MS);\n      });\n  }\n\n  /**\n   * Shows the given text in a tooltip for a specified amount of time, in milliseconds.\n   */\n  showTooltipText(text: string, durationMs: number): void {\n    this.el.setAttribute('data-tooltip', text);\n    setTimeout(() => this.el.setAttribute('data-tooltip', ''), durationMs);\n  }\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * ToolTipController handles closing tooltips on external clicks.\n */\nexport class ToolTipController {\n  constructor(private el: HTMLDetailsElement) {\n    document.addEventListener('click', e => {\n      const insideTooltip = this.el.contains(e.target as Element);\n      if (!insideTooltip) {\n        this.el.removeAttribute('open');\n      }\n    });\n  }\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { TreeNavController } from './tree.js';\n\nexport class SelectNavController {\n  constructor(private el: Element) {\n    this.el.addEventListener('change', e => {\n      const target = e.target as HTMLSelectElement;\n      let href = target.value;\n      if (!target.value.startsWith('/')) {\n        href = '/' + href;\n      }\n      window.location.href = href;\n    });\n  }\n}\n\nexport function makeSelectNav(tree: TreeNavController): HTMLLabelElement {\n  const label = document.createElement('label');\n  label.classList.add('go-Label');\n  label.setAttribute('aria-label', 'Menu');\n  const select = document.createElement('select');\n  select.classList.add('go-Select', 'js-selectNav');\n  label.appendChild(select);\n  const outline = document.createElement('optgroup');\n  outline.label = 'Outline';\n  select.appendChild(outline);\n  const groupMap: Record<string, HTMLOptGroupElement> = {};\n  let group: HTMLOptGroupElement;\n  for (const t of tree.treeitems) {\n    if (Number(t.depth) > 4) continue;\n    if (t.groupTreeitem) {\n      group = groupMap[t.groupTreeitem.label];\n      if (!group) {\n        group = groupMap[t.groupTreeitem.label] = document.createElement('optgroup');\n        group.label = t.groupTreeitem.label;\n        select.appendChild(group);\n      }\n    } else {\n      group = outline;\n    }\n    const o = document.createElement('option');\n    o.label = t.label;\n    o.textContent = t.label;\n    o.value = (t.el as HTMLAnchorElement).href.replace(window.location.origin, '').replace('/', '');\n    group.appendChild(o);\n  }\n  tree.addObserver(t => {\n    const hash = (t.el as HTMLAnchorElement).hash;\n    const value = select.querySelector<HTMLOptionElement>(`[value$=\"${hash}\"]`)?.value;\n    if (value) {\n      select.value = value;\n    }\n  }, 50);\n  return label;\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * ModalController registers a dialog element with the polyfill if\n * necessary for the current browser, add adds event listeners to\n * close and open modals.\n */\nexport class ModalController {\n  constructor(private el: HTMLDialogElement) {\n    // Only load the dialog polyfill if necessary for the environment.\n    if (!window.HTMLDialogElement && !el.showModal) {\n      import('../../../third_party/dialog-polyfill/dialog-polyfill.esm.js').then(\n        ({ default: polyfill }) => {\n          polyfill.registerDialog(el);\n        }\n      );\n    }\n    const id = el.id;\n    const button = document.querySelector<HTMLButtonElement>(`[aria-controls=\"${id}\"]`);\n    if (button) {\n      button.addEventListener('click', () => {\n        if (this.el.showModal) {\n          this.el.showModal();\n        } else {\n          this.el.open = true;\n        }\n        el.querySelector('input')?.focus();\n      });\n    }\n    for (const close of this.el.querySelectorAll<HTMLButtonElement>('[data-modal-close]')) {\n      close.addEventListener('click', () => {\n        if (this.el.close) {\n          this.el.close();\n        } else {\n          this.el.open = false;\n        }\n      });\n    }\n  }\n}\n", "interface TagManagerEvent {\n  /**\n   * event is the name of the event, used to filter events in\n   * Google Analytics.\n   */\n  event: string;\n\n  /**\n   * event_category is a name that you supply as a way to group objects\n   * that to analyze. Typically, you will use the same category name\n   * multiple times over related UI elements (buttons, links, etc).\n   */\n  event_category?: string;\n\n  /**\n   * event_action is used to name the type of event or interaction you\n   * want to measure for a particular web object. For example, with a\n   * single \"form\" category, you can analyze a number of specific events\n   * with this parameter, such as: form entered, form submitted.\n   */\n  event_action?: string;\n\n  /**\n   * event_label provide additional information for events that you want\n   * to analyze, such as the text label of a link.\n   */\n  event_label?: string;\n\n  /**\n   * gtm.start is used to initialize Google Tag Manager.\n   */\n  'gtm.start'?: number;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ndeclare global {\n  interface Window {\n    dataLayer?: (TagManagerEvent | VoidFunction)[];\n    ga?: unknown;\n  }\n}\n\n/**\n * track sends events to Google Tag Manager.\n */\nexport function track(\n  event: string | TagManagerEvent,\n  category?: string,\n  action?: string,\n  label?: string\n): void {\n  window.dataLayer ??= [];\n  if (typeof event === 'string') {\n    window.dataLayer.push({\n      event,\n      event_category: category,\n      event_action: action,\n      event_label: label,\n    });\n  } else {\n    window.dataLayer.push(event);\n  }\n}\n\n/**\n * func adds functions to run sequentionally after\n * Google Tag Manager is ready.\n */\nexport function func(fn: () => void): void {\n  window.dataLayer ??= [];\n  window.dataLayer.push(fn);\n}\n", "/*!\n * @license\n * Copyright 2019-2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { track } from '../analytics/analytics';\n\n/**\n * Options are keyhandler callback options.\n */\ninterface Options {\n  /**\n   * target is the element the key event should filter on. The\n   * default target is the document.\n   */\n  target?: Element;\n\n  /**\n   * withMeta specifies if the event callback should fire when\n   * the key is pressed with a meta key (ctrl, alt, etc). By\n   * default meta keypresses are ignored.\n   */\n  withMeta?: boolean;\n}\n\n/**\n * KeyHandler is the config for a keyboard event callback.\n */\ninterface KeyHandler extends Options {\n  description: string;\n  callback: (e: KeyboardEvent) => void;\n}\n\n/**\n * KeyboardController controls event callbacks for sitewide\n * keyboard events. Multiple callbacks can be registered for\n * a single key and by default the controller ignores events\n * for text input targets.\n */\nclass KeyboardController {\n  handlers: Record<string, Set<KeyHandler>>;\n\n  constructor() {\n    this.handlers = {};\n    document.addEventListener('keydown', e => this.handleKeyPress(e));\n  }\n\n  /**\n   * on registers keyboard event callbacks.\n   * @param key the key to register.\n   * @param description name of the event.\n   * @param callback event callback.\n   * @param options set target and withMeta options to override the default behaviors.\n   */\n  on(key: string, description: string, callback: (e: KeyboardEvent) => void, options?: Options) {\n    this.handlers[key] ??= new Set();\n    this.handlers[key].add({ description, callback, ...options });\n    return this;\n  }\n\n  private handleKeyPress(e: KeyboardEvent) {\n    for (const handler of this.handlers[e.key.toLowerCase()] ?? new Set()) {\n      if (handler.target && handler.target !== e.target) {\n        return;\n      }\n      const t = e.target as HTMLElement | null;\n      if (\n        !handler.target &&\n        (t?.tagName === 'INPUT' || t?.tagName === 'SELECT' || t?.tagName === 'TEXTAREA')\n      ) {\n        return;\n      }\n      if (t?.isContentEditable) {\n        return;\n      }\n      if (\n        (handler.withMeta && !(e.ctrlKey || e.metaKey)) ||\n        (!handler.withMeta && (e.ctrlKey || e.metaKey))\n      ) {\n        return;\n      }\n      track('keypress', 'hotkeys', `${e.key} pressed`, handler.description);\n      handler.callback(e);\n    }\n  }\n}\n\nexport const keyboard = new KeyboardController();\n", "/**\n * @license\n * Copyright 2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { registerHeaderListeners, registerSearchFormListeners } from 'static/shared/header/header';\nimport { CarouselController } from 'static/shared/carousel/carousel';\nimport { ClipboardController } from 'static/shared/clipboard/clipboard';\nimport { ToolTipController } from 'static/shared/tooltip/tooltip';\nimport { SelectNavController } from 'static/shared/outline/select';\nimport { ModalController } from 'static/shared/modal/modal';\n\nimport { keyboard } from 'static/shared/keyboard/keyboard';\nimport * as analytics from 'static/shared/analytics/analytics';\n\nregisterHeaderListeners();\nregisterSearchFormListeners();\n\nfor (const el of document.querySelectorAll<HTMLButtonElement>('.js-clipboard')) {\n  new ClipboardController(el);\n}\n\nfor (const el of document.querySelectorAll<HTMLDialogElement>('.js-modal')) {\n  new ModalController(el);\n}\n\nfor (const t of document.querySelectorAll<HTMLDetailsElement>('.js-tooltip')) {\n  new ToolTipController(t);\n}\n\nfor (const el of document.querySelectorAll<HTMLSelectElement>('.js-selectNav')) {\n  new SelectNavController(el);\n}\n\nfor (const el of document.querySelectorAll<HTMLSelectElement>('.js-carousel')) {\n  new CarouselController(el);\n}\n\n// Temporary shortcut for testing out the dark theme.\nkeyboard.on('t', 'toggle theme', () => {\n  let nextTheme = 'dark';\n  const theme = document.documentElement.getAttribute('data-theme');\n  if (theme === 'dark') {\n    nextTheme = 'light';\n  } else if (theme === 'light') {\n    nextTheme = 'auto';\n  }\n  document.documentElement.setAttribute('data-theme', nextTheme);\n  document.cookie = `prefers-color-scheme=${nextTheme};path=/;max-age=31536000;`;\n});\n\n// Pressing '/' focuses the search box\nkeyboard.on('/', 'focus search', e => {\n  const searchInput = Array.from(\n    document.querySelectorAll<HTMLInputElement>('.js-searchFocus')\n  ).pop();\n  // Favoring the Firefox quick find feature over search input\n  // focus. See: https://github.com/golang/go/issues/41093.\n  if (searchInput && !window.navigator.userAgent.includes('Firefox')) {\n    e.preventDefault();\n    searchInput.focus();\n  }\n});\n\n// Pressing 'y' changes the browser URL to the canonical URL\n// without triggering a reload.\nkeyboard.on('y', 'set canonical url', () => {\n  const canonicalURLPath = document.querySelector<HTMLDivElement>('.js-canonicalURLPath')?.dataset[\n    'canonicalUrlPath'\n  ];\n  if (canonicalURLPath && canonicalURLPath !== '') {\n    window.history.replaceState(null, '', canonicalURLPath);\n  }\n});\n\n/**\n * setupGoogleTagManager intializes Google Tag Manager.\n */\n(function setupGoogleTagManager() {\n  analytics.track({\n    'gtm.start': new Date().getTime(),\n    event: 'gtm.js',\n  });\n})();\n\n/**\n * removeUTMSource removes the utm_source GET parameter if present.\n * This is done using JavaScript, so that the utm_source is still\n * captured by Google Analytics.\n */\nfunction removeUTMSource() {\n  const urlParams = new URLSearchParams(window.location.search);\n  const utmSource = urlParams.get('utm_source');\n  if (utmSource !== 'gopls' && utmSource !== 'godoc' && utmSource !== 'pkggodev') {\n    return;\n  }\n\n  /** Strip the utm_source query parameter and replace the URL. **/\n  const newURL = new URL(window.location.href);\n  urlParams.delete('utm_source');\n  newURL.search = urlParams.toString();\n  window.history.replaceState(null, '', newURL.toString());\n}\n\nif (document.querySelector<HTMLElement>('.js-gtmID')?.dataset.gtmid && window.dataLayer) {\n  analytics.func(function () {\n    removeUTMSource();\n  });\n} else {\n  removeUTMSource();\n}\n"],
-  "mappings": "wKAAA,8BAgBA,WAAgC,EAAI,CAClC,KAAO,GAAM,IAAO,S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,iBAAqC,eAC5D,GAAI,GAAkB,GAGxB,OAAW,KAAM,UAAS,iBAAoC,iBAC5D,GAAI,GAAoB,GAG1B,OAAW,KAAM,UAAS,iBAAoC,gBAC5D,GAAI,GAAmB,GAIzB,EAAS,GAAG,IAAK,eAAgB,IAAM,CACrC,GAAI,GAAY,OACV,EAAQ,SAAS,gBAAgB,aAAa,cACpD,AAAI,IAAU,OACZ,EAAY,QACH,IAAU,SACnB,GAAY,QAEd,SAAS,gBAAgB,aAAa,aAAc,GACpD,SAAS,OAAS,wBAAwB,+BAI5C,EAAS,GAAG,IAAK,eAAgB,GAAK,CACpC,GAAM,GAAc,MAAM,KACxB,SAAS,iBAAmC,oBAC5C,MAGF,AAAI,GAAe,CAAC,OAAO,UAAU,UAAU,SAAS,YACtD,GAAE,iBACF,EAAY,WAMhB,EAAS,GAAG,IAAK,oBAAqB,IAAM,CApE5C,MAqEE,GAAM,GAAmB,YAAS,cAA8B,0BAAvC,cAAgE,QACvF,iBAEF,AAAI,GAAoB,IAAqB,IAC3C,OAAO,QAAQ,aAAa,KAAM,GAAI,KAO1C,AAAC,WAAiC,CAChC,AAAU,EAAM,CACd,YAAa,GAAI,QAAO,UACxB,MAAO,eASX,YAA2B,CACzB,GAAM,GAAY,GAAI,iBAAgB,OAAO,SAAS,QAChD,EAAY,EAAU,IAAI,cAChC,GAAI,IAAc,SAAW,IAAc,SAAW,IAAc,WAClE,OAIF,GAAM,GAAS,GAAI,KAAI,OAAO,SAAS,MACvC,EAAU,OAAO,cACjB,EAAO,OAAS,EAAU,WAC1B,OAAO,QAAQ,aAAa,KAAM,GAAI,EAAO,YAvG/C,MA0GA,AAAI,aAAS,cAA2B,eAApC,cAAkD,QAAQ,QAAS,OAAO,UAC5E,AAAU,EAAK,UAAY,CACzB,MAGF",
+  "sourcesContent": ["// nb. This is for IE10 and lower _only_.\nvar supportCustomEvent = window.CustomEvent;\nif (!supportCustomEvent || typeof supportCustomEvent === 'object') {\n  supportCustomEvent = function CustomEvent(event, x) {\n    x = x || {};\n    var ev = document.createEvent('CustomEvent');\n    ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null);\n    return ev;\n  };\n  supportCustomEvent.prototype = window.Event.prototype;\n}\n\n/**\n * @param {Element} el to check for stacking context\n * @return {boolean} whether this el or its parents creates a stacking context\n */\nfunction createsStackingContext(el) {\n  while (el && el !== document.body) {\n    var s = window.getComputedStyle(el);\n    var invalid = function(k, ok) {\n      return !(s[k] === undefined || s[k] === ok);\n    };\n\n    if (s.opacity < 1 ||\n        invalid('zIndex', 'auto') ||\n        invalid('transform', 'none') ||\n        invalid('mixBlendMode', 'normal') ||\n        invalid('filter', 'none') ||\n        invalid('perspective', 'none') ||\n        s['isolation'] === 'isolate' ||\n        s.position === 'fixed' ||\n        s.webkitOverflowScrolling === 'touch') {\n      return true;\n    }\n    el = el.parentElement;\n  }\n  return false;\n}\n\n/**\n * Finds the nearest <dialog> from the passed element.\n *\n * @param {Element} el to search from\n * @return {HTMLDialogElement} dialog found\n */\nfunction findNearestDialog(el) {\n  while (el) {\n    if (el.localName === 'dialog') {\n      return /** @type {HTMLDialogElement} */ (el);\n    }\n    el = el.parentElement;\n  }\n  return null;\n}\n\n/**\n * Blur the specified element, as long as it's not the HTML body element.\n * This works around an IE9/10 bug - blurring the body causes Windows to\n * blur the whole application.\n *\n * @param {Element} el to blur\n */\nfunction safeBlur(el) {\n  if (el && el.blur && el !== document.body) {\n    el.blur();\n  }\n}\n\n/**\n * @param {!NodeList} nodeList to search\n * @param {Node} node to find\n * @return {boolean} whether node is inside nodeList\n */\nfunction inNodeList(nodeList, node) {\n  for (var i = 0; i < nodeList.length; ++i) {\n    if (nodeList[i] === node) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * @param {HTMLFormElement} el to check\n * @return {boolean} whether this form has method=\"dialog\"\n */\nfunction isFormMethodDialog(el) {\n  if (!el || !el.hasAttribute('method')) {\n    return false;\n  }\n  return el.getAttribute('method').toLowerCase() === 'dialog';\n}\n\n/**\n * @param {!HTMLDialogElement} dialog to upgrade\n * @constructor\n */\nfunction dialogPolyfillInfo(dialog) {\n  this.dialog_ = dialog;\n  this.replacedStyleTop_ = false;\n  this.openAsModal_ = false;\n\n  // Set a11y role. Browsers that support dialog implicitly know this already.\n  if (!dialog.hasAttribute('role')) {\n    dialog.setAttribute('role', 'dialog');\n  }\n\n  dialog.show = this.show.bind(this);\n  dialog.showModal = this.showModal.bind(this);\n  dialog.close = this.close.bind(this);\n\n  if (!('returnValue' in dialog)) {\n    dialog.returnValue = '';\n  }\n\n  if ('MutationObserver' in window) {\n    var mo = new MutationObserver(this.maybeHideModal.bind(this));\n    mo.observe(dialog, {attributes: true, attributeFilter: ['open']});\n  } else {\n    // IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also\n    // seem to fire even if the element was removed as part of a parent removal. Use the removed\n    // events to force downgrade (useful if removed/immediately added).\n    var removed = false;\n    var cb = function() {\n      removed ? this.downgradeModal() : this.maybeHideModal();\n      removed = false;\n    }.bind(this);\n    var timeout;\n    var delayModel = function(ev) {\n      if (ev.target !== dialog) { return; }  // not for a child element\n      var cand = 'DOMNodeRemoved';\n      removed |= (ev.type.substr(0, cand.length) === cand);\n      window.clearTimeout(timeout);\n      timeout = window.setTimeout(cb, 0);\n    };\n    ['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) {\n      dialog.addEventListener(name, delayModel);\n    });\n  }\n  // Note that the DOM is observed inside DialogManager while any dialog\n  // is being displayed as a modal, to catch modal removal from the DOM.\n\n  Object.defineProperty(dialog, 'open', {\n    set: this.setOpen.bind(this),\n    get: dialog.hasAttribute.bind(dialog, 'open')\n  });\n\n  this.backdrop_ = document.createElement('div');\n  this.backdrop_.className = 'backdrop';\n  this.backdrop_.addEventListener('click', this.backdropClick_.bind(this));\n}\n\ndialogPolyfillInfo.prototype = {\n\n  get dialog() {\n    return this.dialog_;\n  },\n\n  /**\n   * Maybe remove this dialog from the modal top layer. This is called when\n   * a modal dialog may no longer be tenable, e.g., when the dialog is no\n   * longer open or is no longer part of the DOM.\n   */\n  maybeHideModal: function() {\n    if (this.dialog_.hasAttribute('open') && document.body.contains(this.dialog_)) { return; }\n    this.downgradeModal();\n  },\n\n  /**\n   * Remove this dialog from the modal top layer, leaving it as a non-modal.\n   */\n  downgradeModal: function() {\n    if (!this.openAsModal_) { return; }\n    this.openAsModal_ = false;\n    this.dialog_.style.zIndex = '';\n\n    // This won't match the native <dialog> exactly because if the user set top on a centered\n    // polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's\n    // possible to polyfill this perfectly.\n    if (this.replacedStyleTop_) {\n      this.dialog_.style.top = '';\n      this.replacedStyleTop_ = false;\n    }\n\n    // Clear the backdrop and remove from the manager.\n    this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);\n    dialogPolyfill.dm.removeDialog(this);\n  },\n\n  /**\n   * @param {boolean} value whether to open or close this dialog\n   */\n  setOpen: function(value) {\n    if (value) {\n      this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', '');\n    } else {\n      this.dialog_.removeAttribute('open');\n      this.maybeHideModal();  // nb. redundant with MutationObserver\n    }\n  },\n\n  /**\n   * Handles clicks on the fake .backdrop element, redirecting them as if\n   * they were on the dialog itself.\n   *\n   * @param {!Event} e to redirect\n   */\n  backdropClick_: function(e) {\n    if (!this.dialog_.hasAttribute('tabindex')) {\n      // Clicking on the backdrop should move the implicit cursor, even if dialog cannot be\n      // focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this\n      // would not be needed - clicks would move the implicit cursor there.\n      var fake = document.createElement('div');\n      this.dialog_.insertBefore(fake, this.dialog_.firstChild);\n      fake.tabIndex = -1;\n      fake.focus();\n      this.dialog_.removeChild(fake);\n    } else {\n      this.dialog_.focus();\n    }\n\n    var redirectedEvent = document.createEvent('MouseEvents');\n    redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,\n        e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,\n        e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);\n    this.dialog_.dispatchEvent(redirectedEvent);\n    e.stopPropagation();\n  },\n\n  /**\n   * Focuses on the first focusable element within the dialog. This will always blur the current\n   * focus, even if nothing within the dialog is found.\n   */\n  focus_: function() {\n    // Find element with `autofocus` attribute, or fall back to the first form/tabindex control.\n    var target = this.dialog_.querySelector('[autofocus]:not([disabled])');\n    if (!target && this.dialog_.tabIndex >= 0) {\n      target = this.dialog_;\n    }\n    if (!target) {\n      // Note that this is 'any focusable area'. This list is probably not exhaustive, but the\n      // alternative involves stepping through and trying to focus everything.\n      var opts = ['button', 'input', 'keygen', 'select', 'textarea'];\n      var query = opts.map(function(el) {\n        return el + ':not([disabled])';\n      });\n      // TODO(samthor): tabindex values that are not numeric are not focusable.\n      query.push('[tabindex]:not([disabled]):not([tabindex=\"\"])');  // tabindex != \"\", not disabled\n      target = this.dialog_.querySelector(query.join(', '));\n    }\n    safeBlur(document.activeElement);\n    target && target.focus();\n  },\n\n  /**\n   * Sets the zIndex for the backdrop and dialog.\n   *\n   * @param {number} dialogZ\n   * @param {number} backdropZ\n   */\n  updateZIndex: function(dialogZ, backdropZ) {\n    if (dialogZ < backdropZ) {\n      throw new Error('dialogZ should never be < backdropZ');\n    }\n    this.dialog_.style.zIndex = dialogZ;\n    this.backdrop_.style.zIndex = backdropZ;\n  },\n\n  /**\n   * Shows the dialog. If the dialog is already open, this does nothing.\n   */\n  show: function() {\n    if (!this.dialog_.open) {\n      this.setOpen(true);\n      this.focus_();\n    }\n  },\n\n  /**\n   * Show this dialog modally.\n   */\n  showModal: function() {\n    if (this.dialog_.hasAttribute('open')) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: The element is already open, and therefore cannot be opened modally.');\n    }\n    if (!document.body.contains(this.dialog_)) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: The element is not in a Document.');\n    }\n    if (!dialogPolyfill.dm.pushDialog(this)) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: There are too many open modal dialogs.');\n    }\n\n    if (createsStackingContext(this.dialog_.parentElement)) {\n      console.warn('A dialog is being shown inside a stacking context. ' +\n          'This may cause it to be unusable. For more information, see this link: ' +\n          'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');\n    }\n\n    this.setOpen(true);\n    this.openAsModal_ = true;\n\n    // Optionally center vertically, relative to the current viewport.\n    if (dialogPolyfill.needsCentering(this.dialog_)) {\n      dialogPolyfill.reposition(this.dialog_);\n      this.replacedStyleTop_ = true;\n    } else {\n      this.replacedStyleTop_ = false;\n    }\n\n    // Insert backdrop.\n    this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);\n\n    // Focus on whatever inside the dialog.\n    this.focus_();\n  },\n\n  /**\n   * Closes this HTMLDialogElement. This is optional vs clearing the open\n   * attribute, however this fires a 'close' event.\n   *\n   * @param {string=} opt_returnValue to use as the returnValue\n   */\n  close: function(opt_returnValue) {\n    if (!this.dialog_.hasAttribute('open')) {\n      throw new Error('Failed to execute \\'close\\' on dialog: The element does not have an \\'open\\' attribute, and therefore cannot be closed.');\n    }\n    this.setOpen(false);\n\n    // Leave returnValue untouched in case it was set directly on the element\n    if (opt_returnValue !== undefined) {\n      this.dialog_.returnValue = opt_returnValue;\n    }\n\n    // Triggering \"close\" event for any attached listeners on the <dialog>.\n    var closeEvent = new supportCustomEvent('close', {\n      bubbles: false,\n      cancelable: false\n    });\n    this.dialog_.dispatchEvent(closeEvent);\n  }\n\n};\n\nvar dialogPolyfill = {};\n\ndialogPolyfill.reposition = function(element) {\n  var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;\n  var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2;\n  element.style.top = Math.max(scrollTop, topValue) + 'px';\n};\n\ndialogPolyfill.isInlinePositionSetByStylesheet = function(element) {\n  for (var i = 0; i < document.styleSheets.length; ++i) {\n    var styleSheet = document.styleSheets[i];\n    var cssRules = null;\n    // Some browsers throw on cssRules.\n    try {\n      cssRules = styleSheet.cssRules;\n    } catch (e) {}\n    if (!cssRules) { continue; }\n    for (var j = 0; j < cssRules.length; ++j) {\n      var rule = cssRules[j];\n      var selectedNodes = null;\n      // Ignore errors on invalid selector texts.\n      try {\n        selectedNodes = document.querySelectorAll(rule.selectorText);\n      } catch(e) {}\n      if (!selectedNodes || !inNodeList(selectedNodes, element)) {\n        continue;\n      }\n      var cssTop = rule.style.getPropertyValue('top');\n      var cssBottom = rule.style.getPropertyValue('bottom');\n      if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) {\n        return true;\n      }\n    }\n  }\n  return false;\n};\n\ndialogPolyfill.needsCentering = function(dialog) {\n  var computedStyle = window.getComputedStyle(dialog);\n  if (computedStyle.position !== 'absolute') {\n    return false;\n  }\n\n  // We must determine whether the top/bottom specified value is non-auto.  In\n  // WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but\n  // Firefox returns the used value. So we do this crazy thing instead: check\n  // the inline style and then go through CSS rules.\n  if ((dialog.style.top !== 'auto' && dialog.style.top !== '') ||\n      (dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) {\n    return false;\n  }\n  return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog);\n};\n\n/**\n * @param {!Element} element to force upgrade\n */\ndialogPolyfill.forceRegisterDialog = function(element) {\n  if (window.HTMLDialogElement || element.showModal) {\n    console.warn('This browser already supports <dialog>, the polyfill ' +\n        'may not work correctly', element);\n  }\n  if (element.localName !== 'dialog') {\n    throw new Error('Failed to register dialog: The element is not a dialog.');\n  }\n  new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));\n};\n\n/**\n * @param {!Element} element to upgrade, if necessary\n */\ndialogPolyfill.registerDialog = function(element) {\n  if (!element.showModal) {\n    dialogPolyfill.forceRegisterDialog(element);\n  }\n};\n\n/**\n * @constructor\n */\ndialogPolyfill.DialogManager = function() {\n  /** @type {!Array<!dialogPolyfillInfo>} */\n  this.pendingDialogStack = [];\n\n  var checkDOM = this.checkDOM_.bind(this);\n\n  // The overlay is used to simulate how a modal dialog blocks the document.\n  // The blocking dialog is positioned on top of the overlay, and the rest of\n  // the dialogs on the pending dialog stack are positioned below it. In the\n  // actual implementation, the modal dialog stacking is controlled by the\n  // top layer, where z-index has no effect.\n  this.overlay = document.createElement('div');\n  this.overlay.className = '_dialog_overlay';\n  this.overlay.addEventListener('click', function(e) {\n    this.forwardTab_ = undefined;\n    e.stopPropagation();\n    checkDOM([]);  // sanity-check DOM\n  }.bind(this));\n\n  this.handleKey_ = this.handleKey_.bind(this);\n  this.handleFocus_ = this.handleFocus_.bind(this);\n\n  this.zIndexLow_ = 100000;\n  this.zIndexHigh_ = 100000 + 150;\n\n  this.forwardTab_ = undefined;\n\n  if ('MutationObserver' in window) {\n    this.mo_ = new MutationObserver(function(records) {\n      var removed = [];\n      records.forEach(function(rec) {\n        for (var i = 0, c; c = rec.removedNodes[i]; ++i) {\n          if (!(c instanceof Element)) {\n            continue;\n          } else if (c.localName === 'dialog') {\n            removed.push(c);\n          }\n          removed = removed.concat(c.querySelectorAll('dialog'));\n        }\n      });\n      removed.length && checkDOM(removed);\n    });\n  }\n};\n\n/**\n * Called on the first modal dialog being shown. Adds the overlay and related\n * handlers.\n */\ndialogPolyfill.DialogManager.prototype.blockDocument = function() {\n  document.documentElement.addEventListener('focus', this.handleFocus_, true);\n  document.addEventListener('keydown', this.handleKey_);\n  this.mo_ && this.mo_.observe(document, {childList: true, subtree: true});\n};\n\n/**\n * Called on the first modal dialog being removed, i.e., when no more modal\n * dialogs are visible.\n */\ndialogPolyfill.DialogManager.prototype.unblockDocument = function() {\n  document.documentElement.removeEventListener('focus', this.handleFocus_, true);\n  document.removeEventListener('keydown', this.handleKey_);\n  this.mo_ && this.mo_.disconnect();\n};\n\n/**\n * Updates the stacking of all known dialogs.\n */\ndialogPolyfill.DialogManager.prototype.updateStacking = function() {\n  var zIndex = this.zIndexHigh_;\n\n  for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n    dpi.updateZIndex(--zIndex, --zIndex);\n    if (i === 0) {\n      this.overlay.style.zIndex = --zIndex;\n    }\n  }\n\n  // Make the overlay a sibling of the dialog itself.\n  var last = this.pendingDialogStack[0];\n  if (last) {\n    var p = last.dialog.parentNode || document.body;\n    p.appendChild(this.overlay);\n  } else if (this.overlay.parentNode) {\n    this.overlay.parentNode.removeChild(this.overlay);\n  }\n};\n\n/**\n * @param {Element} candidate to check if contained or is the top-most modal dialog\n * @return {boolean} whether candidate is contained in top dialog\n */\ndialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) {\n  while (candidate = findNearestDialog(candidate)) {\n    for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n      if (dpi.dialog === candidate) {\n        return i === 0;  // only valid if top-most\n      }\n    }\n    candidate = candidate.parentElement;\n  }\n  return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) {\n  if (this.containedByTopDialog_(event.target)) { return; }\n\n  if (document.activeElement === document.documentElement) { return; }\n\n  event.preventDefault();\n  event.stopPropagation();\n  safeBlur(/** @type {Element} */ (event.target));\n\n  if (this.forwardTab_ === undefined) { return; }  // move focus only from a tab key\n\n  var dpi = this.pendingDialogStack[0];\n  var dialog = dpi.dialog;\n  var position = dialog.compareDocumentPosition(event.target);\n  if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n    if (this.forwardTab_) {\n      // forward\n      dpi.focus_();\n    } else if (event.target !== document.documentElement) {\n      // backwards if we're not already focused on <html>\n      document.documentElement.focus();\n    }\n  }\n\n  return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleKey_ = function(event) {\n  this.forwardTab_ = undefined;\n  if (event.keyCode === 27) {\n    event.preventDefault();\n    event.stopPropagation();\n    var cancelEvent = new supportCustomEvent('cancel', {\n      bubbles: false,\n      cancelable: true\n    });\n    var dpi = this.pendingDialogStack[0];\n    if (dpi && dpi.dialog.dispatchEvent(cancelEvent)) {\n      dpi.dialog.close();\n    }\n  } else if (event.keyCode === 9) {\n    this.forwardTab_ = !event.shiftKey;\n  }\n};\n\n/**\n * Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are\n * removed and immediately readded don't stay modal, they become normal.\n *\n * @param {!Array<!HTMLDialogElement>} removed that have definitely been removed\n */\ndialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) {\n  // This operates on a clone because it may cause it to change. Each change also calls\n  // updateStacking, which only actually needs to happen once. But who removes many modal dialogs\n  // at a time?!\n  var clone = this.pendingDialogStack.slice();\n  clone.forEach(function(dpi) {\n    if (removed.indexOf(dpi.dialog) !== -1) {\n      dpi.downgradeModal();\n    } else {\n      dpi.maybeHideModal();\n    }\n  });\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n * @return {boolean} whether the dialog was allowed\n */\ndialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) {\n  var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;\n  if (this.pendingDialogStack.length >= allowed) {\n    return false;\n  }\n  if (this.pendingDialogStack.unshift(dpi) === 1) {\n    this.blockDocument();\n  }\n  this.updateStacking();\n  return true;\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n */\ndialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) {\n  var index = this.pendingDialogStack.indexOf(dpi);\n  if (index === -1) { return; }\n\n  this.pendingDialogStack.splice(index, 1);\n  if (this.pendingDialogStack.length === 0) {\n    this.unblockDocument();\n  }\n  this.updateStacking();\n};\n\ndialogPolyfill.dm = new dialogPolyfill.DialogManager();\ndialogPolyfill.formSubmitter = null;\ndialogPolyfill.useValue = null;\n\n/**\n * Installs global handlers, such as click listers and native method overrides. These are needed\n * even if a no dialog is registered, as they deal with <form method=\"dialog\">.\n */\nif (window.HTMLDialogElement === undefined) {\n\n  /**\n   * If HTMLFormElement translates method=\"DIALOG\" into 'get', then replace the descriptor with\n   * one that returns the correct value.\n   */\n  var testForm = document.createElement('form');\n  testForm.setAttribute('method', 'dialog');\n  if (testForm.method !== 'dialog') {\n    var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method');\n    if (methodDescriptor) {\n      // nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything\n      // and don't bother to update the element.\n      var realGet = methodDescriptor.get;\n      methodDescriptor.get = function() {\n        if (isFormMethodDialog(this)) {\n          return 'dialog';\n        }\n        return realGet.call(this);\n      };\n      var realSet = methodDescriptor.set;\n      methodDescriptor.set = function(v) {\n        if (typeof v === 'string' && v.toLowerCase() === 'dialog') {\n          return this.setAttribute('method', v);\n        }\n        return realSet.call(this, v);\n      };\n      Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor);\n    }\n  }\n\n  /**\n   * Global 'click' handler, to capture the <input type=\"submit\"> or <button> element which has\n   * submitted a <form method=\"dialog\">. Needed as Safari and others don't report this inside\n   * document.activeElement.\n   */\n  document.addEventListener('click', function(ev) {\n    dialogPolyfill.formSubmitter = null;\n    dialogPolyfill.useValue = null;\n    if (ev.defaultPrevented) { return; }  // e.g. a submit which prevents default submission\n\n    var target = /** @type {Element} */ (ev.target);\n    if (!target || !isFormMethodDialog(target.form)) { return; }\n\n    var valid = (target.type === 'submit' && ['button', 'input'].indexOf(target.localName) > -1);\n    if (!valid) {\n      if (!(target.localName === 'input' && target.type === 'image')) { return; }\n      // this is a <input type=\"image\">, which can submit forms\n      dialogPolyfill.useValue = ev.offsetX + ',' + ev.offsetY;\n    }\n\n    var dialog = findNearestDialog(target);\n    if (!dialog) { return; }\n\n    dialogPolyfill.formSubmitter = target;\n\n  }, false);\n\n  /**\n   * Replace the native HTMLFormElement.submit() method, as it won't fire the\n   * submit event and give us a chance to respond.\n   */\n  var nativeFormSubmit = HTMLFormElement.prototype.submit;\n  var replacementFormSubmit = function () {\n    if (!isFormMethodDialog(this)) {\n      return nativeFormSubmit.call(this);\n    }\n    var dialog = findNearestDialog(this);\n    dialog && dialog.close();\n  };\n  HTMLFormElement.prototype.submit = replacementFormSubmit;\n\n  /**\n   * Global form 'dialog' method handler. Closes a dialog correctly on submit\n   * and possibly sets its return value.\n   */\n  document.addEventListener('submit', function(ev) {\n    if (ev.defaultPrevented) { return; }  // e.g. a submit which prevents default submission\n\n    var form = /** @type {HTMLFormElement} */ (ev.target);\n    if (!isFormMethodDialog(form)) { return; }\n    ev.preventDefault();\n\n    var dialog = findNearestDialog(form);\n    if (!dialog) { return; }\n\n    // Forms can only be submitted via .submit() or a click (?), but anyway: sanity-check that\n    // the submitter is correct before using its value as .returnValue.\n    var s = dialogPolyfill.formSubmitter;\n    if (s && s.form === form) {\n      dialog.close(dialogPolyfill.useValue || s.value);\n    } else {\n      dialog.close();\n    }\n    dialogPolyfill.formSubmitter = null;\n\n  }, false);\n}\n\nexport default dialogPolyfill;\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nexport function registerHeaderListeners(): void {\n  const header = document.querySelector('.js-header');\n  const menuButtons = document.querySelectorAll('.js-headerMenuButton');\n  menuButtons.forEach(button => {\n    button.addEventListener('click', e => {\n      e.preventDefault();\n      header?.classList.toggle('is-active');\n      button.setAttribute('aria-expanded', String(header?.classList.contains('is-active')));\n    });\n  });\n\n  const scrim = document.querySelector('.js-scrim');\n  scrim?.addEventListener('click', e => {\n    e.preventDefault();\n    header?.classList.remove('is-active');\n    menuButtons.forEach(button => {\n      button.setAttribute('aria-expanded', String(header?.classList.contains('is-active')));\n    });\n  });\n}\n\nexport function registerSearchFormListeners(): void {\n  const searchForm = document.querySelector('.js-searchForm');\n  const expandSearch = document.querySelector('.js-expandSearch');\n  const input = searchForm?.querySelector('input');\n  const headerLogo = document.querySelector('.js-headerLogo');\n  const menuButton = document.querySelector('.js-headerMenuButton');\n  expandSearch?.addEventListener('click', () => {\n    searchForm?.classList.add('go-SearchForm--expanded');\n    headerLogo?.classList.add('go-Header-logo--hidden');\n    menuButton?.classList.add('go-Header-navOpen--hidden');\n    input?.focus();\n  });\n  document?.addEventListener('click', e => {\n    if (!searchForm?.contains(e.target as Node)) {\n      searchForm?.classList.remove('go-SearchForm--expanded');\n      headerLogo?.classList.remove('go-Header-logo--hidden');\n      menuButton?.classList.remove('go-Header-navOpen--hidden');\n    }\n  });\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * Carousel Controller adds event listeners, accessibilty enhancements, and\n * control elements to a carousel component.\n */\nexport class CarouselController {\n  /**\n   * slides is a collection of slides in the carousel.\n   */\n  private slides: HTMLLIElement[];\n  /**\n   * dots is a collection of dot navigation controls, added to the carousel\n   * by this controller.\n   */\n  private dots: HTMLElement[];\n  /**\n   * liveRegion is a visually hidden element that notifies assitive devices\n   * of visual changes to the carousel. They are added to the carousel by\n   * this controller.\n   */\n  private liveRegion: HTMLElement;\n  /**\n   * activeIndex is the 0-index of the currently active slide.\n   */\n  private activeIndex: number;\n\n  constructor(private el: HTMLElement) {\n    this.slides = Array.from(el.querySelectorAll('.go-Carousel-slide'));\n    this.dots = [];\n    this.liveRegion = document.createElement('div');\n    this.activeIndex = Number(el.getAttribute('data-slide-index') ?? 0);\n\n    this.initSlides();\n    this.initArrows();\n    this.initDots();\n    this.initLiveRegion();\n  }\n\n  private initSlides() {\n    for (const [i, v] of this.slides.entries()) {\n      if (i === this.activeIndex) continue;\n      v.setAttribute('aria-hidden', 'true');\n    }\n  }\n\n  private initArrows() {\n    const arrows = document.createElement('ul');\n    arrows.classList.add('go-Carousel-arrows');\n    arrows.innerHTML = `\n      <li>\n        <button class=\"go-Carousel-prevSlide\" aria-label=\"Go to previous slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_left_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n      <li>\n        <button class=\"go-Carousel-nextSlide\" aria-label=\"Go to next slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_right_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n    `;\n    arrows\n      .querySelector('.go-Carousel-prevSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex - 1));\n    arrows\n      .querySelector('.go-Carousel-nextSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex + 1));\n    this.el.append(arrows);\n  }\n\n  private initDots() {\n    const dots = document.createElement('ul');\n    dots.classList.add('go-Carousel-dots');\n    for (let i = 0; i < this.slides.length; i++) {\n      const li = document.createElement('li');\n      const button = document.createElement('button');\n      button.classList.add('go-Carousel-dot');\n      if (i === this.activeIndex) {\n        button.classList.add('go-Carousel-dot--active');\n      }\n      button.innerHTML = `<span class=\"go-Carousel-obscured\">Slide ${i + 1}</span>`;\n      button.addEventListener('click', () => this.setActive(i));\n      li.append(button);\n      dots.append(li);\n      this.dots.push(button);\n    }\n    this.el.append(dots);\n  }\n\n  private initLiveRegion() {\n    this.liveRegion.setAttribute('aria-live', 'polite');\n    this.liveRegion.setAttribute('aria-atomic', 'true');\n    this.liveRegion.setAttribute('class', 'go-Carousel-obscured');\n    this.liveRegion.textContent = `Slide ${this.activeIndex + 1} of ${this.slides.length}`;\n    this.el.appendChild(this.liveRegion);\n  }\n\n  private setActive = (index: number) => {\n    this.activeIndex = (index + this.slides.length) % this.slides.length;\n    this.el.setAttribute('data-slide-index', String(this.activeIndex));\n    for (const d of this.dots) {\n      d.classList.remove('go-Carousel-dot--active');\n    }\n    this.dots[this.activeIndex].classList.add('go-Carousel-dot--active');\n    for (const s of this.slides) {\n      s.setAttribute('aria-hidden', 'true');\n    }\n    this.slides[this.activeIndex].removeAttribute('aria-hidden');\n    this.liveRegion.textContent = 'Slide ' + (this.activeIndex + 1) + ' of ' + this.slides.length;\n  };\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This class decorates an element to copy arbitrary data attached via a data-\n * attribute to the clipboard.\n */\nexport class ClipboardController {\n  /**\n   * The data to be copied to the clipboard.\n   */\n  private data: string;\n\n  /**\n   * @param el The element that will trigger copying text to the clipboard. The text is\n   * expected to be within its data-to-copy attribute.\n   */\n  constructor(private el: HTMLButtonElement) {\n    this.data = el.dataset['toCopy'] ?? el.innerText;\n    // if data-to-copy is empty and the button is part of an input group\n    // capture the value of the input.\n    if (!this.data && el.parentElement?.classList.contains('go-InputGroup')) {\n      this.data = (this.data || el.parentElement?.querySelector('input')?.value) ?? '';\n    }\n    el.addEventListener('click', e => this.handleCopyClick(e));\n  }\n\n  /**\n   * Handles when the primary element is clicked.\n   */\n  handleCopyClick(e: MouseEvent): void {\n    e.preventDefault();\n    const TOOLTIP_SHOW_DURATION_MS = 1000;\n\n    // This API is not available on iOS.\n    if (!navigator.clipboard) {\n      this.showTooltipText('Unable to copy', TOOLTIP_SHOW_DURATION_MS);\n      return;\n    }\n    navigator.clipboard\n      .writeText(this.data)\n      .then(() => {\n        this.showTooltipText('Copied!', TOOLTIP_SHOW_DURATION_MS);\n      })\n      .catch(() => {\n        this.showTooltipText('Unable to copy', TOOLTIP_SHOW_DURATION_MS);\n      });\n  }\n\n  /**\n   * Shows the given text in a tooltip for a specified amount of time, in milliseconds.\n   */\n  showTooltipText(text: string, durationMs: number): void {\n    this.el.setAttribute('data-tooltip', text);\n    setTimeout(() => this.el.setAttribute('data-tooltip', ''), durationMs);\n  }\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * ToolTipController handles closing tooltips on external clicks.\n */\nexport class ToolTipController {\n  constructor(private el: HTMLDetailsElement) {\n    document.addEventListener('click', e => {\n      const insideTooltip = this.el.contains(e.target as Element);\n      if (!insideTooltip) {\n        this.el.removeAttribute('open');\n      }\n    });\n  }\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { TreeNavController } from './tree.js';\n\nexport class SelectNavController {\n  constructor(private el: Element) {\n    this.el.addEventListener('change', e => {\n      const target = e.target as HTMLSelectElement;\n      let href = target.value;\n      if (!target.value.startsWith('/')) {\n        href = '/' + href;\n      }\n      window.location.href = href;\n    });\n  }\n}\n\nexport function makeSelectNav(tree: TreeNavController): HTMLLabelElement {\n  const label = document.createElement('label');\n  label.classList.add('go-Label');\n  label.setAttribute('aria-label', 'Menu');\n  const select = document.createElement('select');\n  select.classList.add('go-Select', 'js-selectNav');\n  label.appendChild(select);\n  const outline = document.createElement('optgroup');\n  outline.label = 'Outline';\n  select.appendChild(outline);\n  const groupMap: Record<string, HTMLOptGroupElement> = {};\n  let group: HTMLOptGroupElement;\n  for (const t of tree.treeitems) {\n    if (Number(t.depth) > 4) continue;\n    if (t.groupTreeitem) {\n      group = groupMap[t.groupTreeitem.label];\n      if (!group) {\n        group = groupMap[t.groupTreeitem.label] = document.createElement('optgroup');\n        group.label = t.groupTreeitem.label;\n        select.appendChild(group);\n      }\n    } else {\n      group = outline;\n    }\n    const o = document.createElement('option');\n    o.label = t.label;\n    o.textContent = t.label;\n    o.value = (t.el as HTMLAnchorElement).href.replace(window.location.origin, '').replace('/', '');\n    group.appendChild(o);\n  }\n  tree.addObserver(t => {\n    const hash = (t.el as HTMLAnchorElement).hash;\n    const value = select.querySelector<HTMLOptionElement>(`[value$=\"${hash}\"]`)?.value;\n    if (value) {\n      select.value = value;\n    }\n  }, 50);\n  return label;\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * ModalController registers a dialog element with the polyfill if\n * necessary for the current browser, add adds event listeners to\n * close and open modals.\n */\nexport class ModalController {\n  constructor(private el: HTMLDialogElement) {\n    // Only load the dialog polyfill if necessary for the environment.\n    if (!window.HTMLDialogElement && !el.showModal) {\n      import('../../../third_party/dialog-polyfill/dialog-polyfill.esm.js').then(\n        ({ default: polyfill }) => {\n          polyfill.registerDialog(el);\n        }\n      );\n    }\n    const id = el.id;\n    const button = document.querySelector<HTMLButtonElement>(`[aria-controls=\"${id}\"]`);\n    if (button) {\n      button.addEventListener('click', () => {\n        if (this.el.showModal) {\n          this.el.showModal();\n        } else {\n          this.el.open = true;\n        }\n        el.querySelector('input')?.focus();\n      });\n    }\n    for (const close of this.el.querySelectorAll<HTMLButtonElement>('[data-modal-close]')) {\n      close.addEventListener('click', () => {\n        if (this.el.close) {\n          this.el.close();\n        } else {\n          this.el.open = false;\n        }\n      });\n    }\n  }\n}\n", "interface TagManagerEvent {\n  /**\n   * event is the name of the event, used to filter events in\n   * Google Analytics.\n   */\n  event: string;\n\n  /**\n   * event_category is a name that you supply as a way to group objects\n   * that to analyze. Typically, you will use the same category name\n   * multiple times over related UI elements (buttons, links, etc).\n   */\n  event_category?: string;\n\n  /**\n   * event_action is used to name the type of event or interaction you\n   * want to measure for a particular web object. For example, with a\n   * single \"form\" category, you can analyze a number of specific events\n   * with this parameter, such as: form entered, form submitted.\n   */\n  event_action?: string;\n\n  /**\n   * event_label provide additional information for events that you want\n   * to analyze, such as the text label of a link.\n   */\n  event_label?: string;\n\n  /**\n   * gtm.start is used to initialize Google Tag Manager.\n   */\n  'gtm.start'?: number;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ndeclare global {\n  interface Window {\n    dataLayer?: (TagManagerEvent | VoidFunction)[];\n    ga?: unknown;\n  }\n}\n\n/**\n * track sends events to Google Tag Manager.\n */\nexport function track(\n  event: string | TagManagerEvent,\n  category?: string,\n  action?: string,\n  label?: string\n): void {\n  window.dataLayer ??= [];\n  if (typeof event === 'string') {\n    window.dataLayer.push({\n      event,\n      event_category: category,\n      event_action: action,\n      event_label: label,\n    });\n  } else {\n    window.dataLayer.push(event);\n  }\n}\n\n/**\n * func adds functions to run sequentionally after\n * Google Tag Manager is ready.\n */\nexport function func(fn: () => void): void {\n  window.dataLayer ??= [];\n  window.dataLayer.push(fn);\n}\n", "/*!\n * @license\n * Copyright 2019-2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { track } from '../analytics/analytics';\n\n/**\n * Options are keyhandler callback options.\n */\ninterface Options {\n  /**\n   * target is the element the key event should filter on. The\n   * default target is the document.\n   */\n  target?: Element;\n\n  /**\n   * withMeta specifies if the event callback should fire when\n   * the key is pressed with a meta key (ctrl, alt, etc). By\n   * default meta keypresses are ignored.\n   */\n  withMeta?: boolean;\n}\n\n/**\n * KeyHandler is the config for a keyboard event callback.\n */\ninterface KeyHandler extends Options {\n  description: string;\n  callback: (e: KeyboardEvent) => void;\n}\n\n/**\n * KeyboardController controls event callbacks for sitewide\n * keyboard events. Multiple callbacks can be registered for\n * a single key and by default the controller ignores events\n * for text input targets.\n */\nclass KeyboardController {\n  handlers: Record<string, Set<KeyHandler>>;\n\n  constructor() {\n    this.handlers = {};\n    document.addEventListener('keydown', e => this.handleKeyPress(e));\n  }\n\n  /**\n   * on registers keyboard event callbacks.\n   * @param key the key to register.\n   * @param description name of the event.\n   * @param callback event callback.\n   * @param options set target and withMeta options to override the default behaviors.\n   */\n  on(key: string, description: string, callback: (e: KeyboardEvent) => void, options?: Options) {\n    this.handlers[key] ??= new Set();\n    this.handlers[key].add({ description, callback, ...options });\n    return this;\n  }\n\n  private handleKeyPress(e: KeyboardEvent) {\n    for (const handler of this.handlers[e.key.toLowerCase()] ?? new Set()) {\n      if (handler.target && handler.target !== e.target) {\n        return;\n      }\n      const t = e.target as HTMLElement | null;\n      if (\n        !handler.target &&\n        (t?.tagName === 'INPUT' || t?.tagName === 'SELECT' || t?.tagName === 'TEXTAREA')\n      ) {\n        return;\n      }\n      if (t?.isContentEditable) {\n        return;\n      }\n      if (\n        (handler.withMeta && !(e.ctrlKey || e.metaKey)) ||\n        (!handler.withMeta && (e.ctrlKey || e.metaKey))\n      ) {\n        return;\n      }\n      track('keypress', 'hotkeys', `${e.key} pressed`, handler.description);\n      handler.callback(e);\n    }\n  }\n}\n\nexport const keyboard = new KeyboardController();\n", "/**\n * @license\n * Copyright 2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { registerHeaderListeners, registerSearchFormListeners } from 'static/shared/header/header';\nimport { CarouselController } from 'static/shared/carousel/carousel';\nimport { ClipboardController } from 'static/shared/clipboard/clipboard';\nimport { ToolTipController } from 'static/shared/tooltip/tooltip';\nimport { SelectNavController } from 'static/shared/outline/select';\nimport { ModalController } from 'static/shared/modal/modal';\n\nimport { keyboard } from 'static/shared/keyboard/keyboard';\nimport * as analytics from 'static/shared/analytics/analytics';\n\nregisterHeaderListeners();\nregisterSearchFormListeners();\n\nfor (const el of document.querySelectorAll<HTMLButtonElement>('.js-clipboard')) {\n  new ClipboardController(el);\n}\n\nfor (const el of document.querySelectorAll<HTMLDialogElement>('.js-modal')) {\n  new ModalController(el);\n}\n\nfor (const t of document.querySelectorAll<HTMLDetailsElement>('.js-tooltip')) {\n  new ToolTipController(t);\n}\n\nfor (const el of document.querySelectorAll<HTMLSelectElement>('.js-selectNav')) {\n  new SelectNavController(el);\n}\n\nfor (const el of document.querySelectorAll<HTMLSelectElement>('.js-carousel')) {\n  new CarouselController(el);\n}\n\n// Temporary shortcut for testing out the dark theme.\nkeyboard.on('t', 'toggle theme', () => {\n  let nextTheme = 'dark';\n  const theme = document.documentElement.getAttribute('data-theme');\n  if (theme === 'dark') {\n    nextTheme = 'light';\n  } else if (theme === 'light') {\n    nextTheme = 'auto';\n  }\n  document.documentElement.setAttribute('data-theme', nextTheme);\n  document.cookie = `prefers-color-scheme=${nextTheme};path=/;max-age=31536000;`;\n});\n\n// Pressing '/' focuses the search box\nkeyboard.on('/', 'focus search', e => {\n  const searchInput = Array.from(\n    document.querySelectorAll<HTMLInputElement>('.js-searchFocus')\n  ).pop();\n  // Favoring the Firefox quick find feature over search input\n  // focus. See: https://github.com/golang/go/issues/41093.\n  if (searchInput && !window.navigator.userAgent.includes('Firefox')) {\n    e.preventDefault();\n    searchInput.focus();\n  }\n});\n\n// Pressing 'y' changes the browser URL to the canonical URL\n// without triggering a reload.\nkeyboard.on('y', 'set canonical url', () => {\n  const canonicalURLPath = document.querySelector<HTMLDivElement>('.js-canonicalURLPath')?.dataset[\n    'canonicalUrlPath'\n  ];\n  if (canonicalURLPath && canonicalURLPath !== '') {\n    window.history.replaceState(null, '', canonicalURLPath);\n  }\n});\n\n/**\n * setupGoogleTagManager intializes Google Tag Manager.\n */\n(function setupGoogleTagManager() {\n  analytics.track({\n    'gtm.start': new Date().getTime(),\n    event: 'gtm.js',\n  });\n})();\n\n/**\n * removeUTMSource removes the utm_source GET parameter if present.\n * This is done using JavaScript, so that the utm_source is still\n * captured by Google Analytics.\n */\nfunction removeUTMSource() {\n  const urlParams = new URLSearchParams(window.location.search);\n  const utmSource = urlParams.get('utm_source');\n  if (utmSource !== 'gopls' && utmSource !== 'godoc' && utmSource !== 'pkggodev') {\n    return;\n  }\n\n  /** Strip the utm_source query parameter and replace the URL. **/\n  const newURL = new URL(window.location.href);\n  urlParams.delete('utm_source');\n  newURL.search = urlParams.toString();\n  window.history.replaceState(null, '', newURL.toString());\n}\n\nif (document.querySelector<HTMLElement>('.js-gtmID')?.dataset.gtmid && window.dataLayer) {\n  analytics.func(function () {\n    removeUTMSource();\n  });\n} else {\n  removeUTMSource();\n}\n"],
+  "mappings": "wKAAA,8BAgBA,WAAgC,EAAI,CAClC,KAAO,GAAM,IAAO,SAAS,MAAM,CACjC,GAAI,GAAI,OAAO,iBAAiB,GAC5B,EAAU,SAAS,EAAG,EAAI,CAC5B,MAAO,CAAE,GAAE,KAAO,QAAa,EAAE,KAAO,IAG1C,GAAI,EAAE,QAAU,GACZ,EAAQ,SAAU,SAClB,EAAQ,YAAa,SACrB,EAAQ,eAAgB,WACxB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oC,gBAC5D,GAAI,GAAmB,GAIzB,EAAS,GAAG,IAAK,eAAgB,IAAM,CACrC,GAAI,GAAY,OACV,EAAQ,SAAS,gBAAgB,aAAa,cACpD,AAAI,IAAU,OACZ,EAAY,QACH,IAAU,SACnB,GAAY,QAEd,SAAS,gBAAgB,aAAa,aAAc,GACpD,SAAS,OAAS,wBAAwB,+BAI5C,EAAS,GAAG,IAAK,eAAgB,GAAK,CACpC,GAAM,GAAc,MAAM,KACxB,SAAS,iBAAmC,oBAC5C,MAGF,AAAI,GAAe,CAAC,OAAO,UAAU,UAAU,SAAS,YACtD,GAAE,iBACF,EAAY,WAMhB,EAAS,GAAG,IAAK,oBAAqB,IAAM,CApE5C,MAqEE,GAAM,GAAmB,YAAS,cAA8B,0BAAvC,cAAgE,QACvF,iBAEF,AAAI,GAAoB,IAAqB,IAC3C,OAAO,QAAQ,aAAa,KAAM,GAAI,KAO1C,AAAC,WAAiC,CAChC,AAAU,EAAM,CACd,YAAa,GAAI,QAAO,UACxB,MAAO,eASX,YAA2B,CACzB,GAAM,GAAY,GAAI,iBAAgB,OAAO,SAAS,QAChD,EAAY,EAAU,IAAI,cAChC,GAAI,IAAc,SAAW,IAAc,SAAW,IAAc,WAClE,OAIF,GAAM,GAAS,GAAI,KAAI,OAAO,SAAS,MACvC,EAAU,OAAO,cACjB,EAAO,OAAS,EAAU,WAC1B,OAAO,QAAQ,aAAa,KAAM,GAAI,EAAO,YAvG/C,MA0GA,AAAI,aAAS,cAA2B,eAApC,cAAkD,QAAQ,QAAS,OAAO,UAC5E,AAAU,EAAK,UAAY,CACzB,MAGF",
   "names": []
 }
diff --git a/static/frontend/homepage/homepage.tmpl b/static/frontend/homepage/homepage.tmpl
index 1db04c1..72a78ef 100644
--- a/static/frontend/homepage/homepage.tmpl
+++ b/static/frontend/homepage/homepage.tmpl
@@ -47,36 +47,20 @@
         <button type="submit" class="go-Button">Search</button>
       </form>
       {{if .Experiments.IsActive "symbol-search"}}
-        <section class="go-Carousel Homepage-tips js-carousel" aria-label="Search Tips Carousel">
+        <section class="go-Carousel Homepage-tips js-carousel" aria-label="Search Tips Carousel" data-slide-index="{{.TipIndex}}">
           <ul>
-            <li class="go-Carousel-slide">
-              <p>
-                <strong>Tip:</strong> Search for a package, for example
-                <a href="/search?q=http">“http”</a> or <a href="/search?q=command">“command”</a>.
-                <a href="/search-help" target="_blank" rel="noopener" class="Homepage-helpLink">
-                  Search help <span><img width="24" height="24" src="/static/shared/icon/launch_gm_grey_24dp.svg" alt=""></span>
-                </a>
-              </p>
-            </li>
-            <li class="go-Carousel-slide" aria-hidden>
-              <p>
-                <strong>Tip:</strong> Search for a symbol, for example
-                <a href="/search?q=Unmarshal">“Unmarshal”</a> or <a href="/search?q=io.Reader">“io.Reader”</a>.
-                <a href="/search-help" target="_blank" rel="noopener" class="Homepage-helpLink">
-                  Search help <span><img width="24" height="24" src="/static/shared/icon/launch_gm_grey_24dp.svg" alt=""></span>
-                </a>
-              </p>
-            </li>
-            <li class="go-Carousel-slide" aria-hidden>
-              <p>
-                <strong>Tip:</strong> Search for symbols within a package using the # filter. For example
-                <a href="/search?q=golang.org%2Fx+%23error">“golang.org/x #error”</a> or
-                <a href="/search?q=%23reader+io&m=symbol">“#reader io”</a>.
-                <a href="/search-help" target="_blank" rel="noopener" class="Homepage-helpLink">
-                  Search help <span><img width="24" height="24" src="/static/shared/icon/launch_gm_grey_24dp.svg" alt=""></span>
-                </a>
-              </p>
-            </li>
+            {{range $i, $v := .SearchTips}}
+              <li class="go-Carousel-slide" {{if not (eq $.TipIndex $i)}}aria-hidden{{end}}>
+                <p>
+                  <strong>Tip:</strong> {{.Text}}
+                  <a href="/search?q={{queryescape $v.Example1}}">“{{$v.Example1}}”</a> or
+                  <a href="/search?q={{queryescape $v.Example2}}">“{{$v.Example2}}”</a>.
+                  <a href="/search-help" target="_blank" rel="noopener" class="Homepage-helpLink">
+                    Search help <span><img width="24" height="24" src="/static/shared/icon/launch_gm_grey_24dp.svg" alt=""></span>
+                  </a>
+                </p>
+              </li>
+            {{end}}
           </ul>
         </section>
       {{else}}
diff --git a/static/frontend/styleguide/styleguide.js b/static/frontend/styleguide/styleguide.js
index d9d263d..8222b35 100644
--- a/static/frontend/styleguide/styleguide.js
+++ b/static/frontend/styleguide/styleguide.js
@@ -1,4 +1,4 @@
-var h=class{constructor(e){this.el=e;this.setActive=e=>{this.activeIndex=(e+this.slides.length)%this.slides.length;for(let t of this.dots)t.classList.remove("go-Carousel-dot--active");this.dots[this.activeIndex].classList.add("go-Carousel-dot--active");for(let t of this.slides)t.setAttribute("aria-hidden","true");this.slides[this.activeIndex].removeAttribute("aria-hidden"),this.liveRegion.textContent="Slide "+(this.activeIndex+1)+" of "+this.slides.length};this.slides=Array.from(e.querySelectorAll(".go-Carousel-slide")),this.dots=[],this.liveRegion=document.createElement("div"),this.activeIndex=0,this.initSlides(),this.initArrows(),this.initDots(),this.initLiveRegion()}initSlides(){for(let[e,t]of this.slides.entries())e!==0&&t.setAttribute("aria-hidden","true")}initArrows(){var t,i;let e=document.createElement("ul");e.classList.add("go-Carousel-arrows"),e.innerHTML=`
+var h=class{constructor(e){this.el=e;this.setActive=e=>{this.activeIndex=(e+this.slides.length)%this.slides.length,this.el.setAttribute("data-slide-index",String(this.activeIndex));for(let t of this.dots)t.classList.remove("go-Carousel-dot--active");this.dots[this.activeIndex].classList.add("go-Carousel-dot--active");for(let t of this.slides)t.setAttribute("aria-hidden","true");this.slides[this.activeIndex].removeAttribute("aria-hidden"),this.liveRegion.textContent="Slide "+(this.activeIndex+1)+" of "+this.slides.length};var t;this.slides=Array.from(e.querySelectorAll(".go-Carousel-slide")),this.dots=[],this.liveRegion=document.createElement("div"),this.activeIndex=Number((t=e.getAttribute("data-slide-index"))!=null?t:0),this.initSlides(),this.initArrows(),this.initDots(),this.initLiveRegion()}initSlides(){for(let[e,t]of this.slides.entries())e!==this.activeIndex&&t.setAttribute("aria-hidden","true")}initArrows(){var t,i;let e=document.createElement("ul");e.classList.add("go-Carousel-arrows"),e.innerHTML=`
       <li>
         <button class="go-Carousel-prevSlide" aria-label="Go to previous slide">
           <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_left_gm_grey_24dp.svg" alt="">
@@ -9,7 +9,7 @@
           <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_right_gm_grey_24dp.svg" alt="">
         </button>
       </li>
-    `,(t=e.querySelector(".go-Carousel-prevSlide"))==null||t.addEventListener("click",()=>this.setActive(this.activeIndex-1)),(i=e.querySelector(".go-Carousel-nextSlide"))==null||i.addEventListener("click",()=>this.setActive(this.activeIndex+1)),this.el.append(e)}initDots(){let e=document.createElement("ul");e.classList.add("go-Carousel-dots");for(let t=0;t<this.slides.length;t++){let i=document.createElement("li"),s=document.createElement("button");s.classList.add("go-Carousel-dot"),t===0&&s.classList.add("go-Carousel-dot--active"),s.innerHTML=`<span class="go-Carousel-obscured">Slide ${t+1}</span>`,s.addEventListener("click",()=>this.setActive(t)),i.append(s),e.append(i),this.dots.push(s)}this.el.append(e)}initLiveRegion(){this.liveRegion.setAttribute("aria-live","polite"),this.liveRegion.setAttribute("aria-atomic","true"),this.liveRegion.setAttribute("class","go-Carousel-obscured"),this.liveRegion.textContent=`Slide ${this.activeIndex+1} of ${this.slides.length}`,this.el.appendChild(this.liveRegion)}};var u=class{constructor(e){this.el=e;this.el.addEventListener("change",t=>{let i=t.target,s=i.value;i.value.startsWith("/")||(s="/"+s),window.location.href=s})}};function m(l){let e=document.createElement("label");e.classList.add("go-Label"),e.setAttribute("aria-label","Menu");let t=document.createElement("select");t.classList.add("go-Select","js-selectNav"),e.appendChild(t);let i=document.createElement("optgroup");i.label="Outline",t.appendChild(i);let s={},r;for(let n of l.treeitems){if(Number(n.depth)>4)continue;n.groupTreeitem?(r=s[n.groupTreeitem.label],r||(r=s[n.groupTreeitem.label]=document.createElement("optgroup"),r.label=n.groupTreeitem.label,t.appendChild(r))):r=i;let a=document.createElement("option");a.label=n.label,a.textContent=n.label,a.value=n.el.href.replace(window.location.origin,"").replace("/",""),r.appendChild(a)}return l.addObserver(n=>{var d;let a=n.el.hash,o=(d=t.querySelector(`[value$="${a}"]`))==null?void 0:d.value;o&&(t.value=o)},50),e}var c=class{constructor(e){this.el=e;this.handleResize=()=>{this.el.style.setProperty("--js-tree-height","100vh"),this.el.style.setProperty("--js-tree-height",this.el.clientHeight+"px")};this.treeitems=[],this.firstChars=[],this.firstTreeitem=null,this.lastTreeitem=null,this.observerCallbacks=[],this.init()}init(){this.handleResize(),window.addEventListener("resize",this.handleResize),this.findTreeItems(),this.updateVisibleTreeitems(),this.observeTargets(),this.firstTreeitem&&(this.firstTreeitem.el.tabIndex=0)}observeTargets(){this.addObserver(i=>{this.expandTreeitem(i),this.setSelected(i)});let e=new Map,t=new IntersectionObserver(i=>{for(let s of i)e.set(s.target.id,s.isIntersecting||s.intersectionRatio===1);for(let[s,r]of e)if(r){let n=this.treeitems.find(a=>{var o;return(o=a.el)==null?void 0:o.href.endsWith(`#${s}`)});if(n)for(let a of this.observerCallbacks)a(n);break}},{threshold:1,rootMargin:"-60px 0px 0px 0px"});for(let i of this.treeitems.map(s=>s.el.getAttribute("href")))if(i){let s=i.replace(window.location.origin,"").replace("/","").replace("#",""),r=document.getElementById(s);r&&t.observe(r)}}addObserver(e,t=200){this.observerCallbacks.push(g(e,t))}setFocusToNextItem(e){let t=null;for(let i=e.index+1;i<this.treeitems.length;i++){let s=this.treeitems[i];if(s.isVisible){t=s;break}}t&&this.setFocusToItem(t)}setFocusToPreviousItem(e){let t=null;for(let i=e.index-1;i>-1;i--){let s=this.treeitems[i];if(s.isVisible){t=s;break}}t&&this.setFocusToItem(t)}setFocusToParentItem(e){e.groupTreeitem&&this.setFocusToItem(e.groupTreeitem)}setFocusToFirstItem(){this.firstTreeitem&&this.setFocusToItem(this.firstTreeitem)}setFocusToLastItem(){this.lastTreeitem&&this.setFocusToItem(this.lastTreeitem)}setSelected(e){var t;for(let i of this.el.querySelectorAll('[aria-expanded="true"]'))i!==e.el&&(((t=i.nextElementSibling)==null?void 0:t.contains(e.el))||i.setAttribute("aria-expanded","false"));for(let i of this.el.querySelectorAll("[aria-selected]"))i!==e.el&&i.setAttribute("aria-selected","false");e.el.setAttribute("aria-selected","true"),this.updateVisibleTreeitems(),this.setFocusToItem(e,!1)}expandTreeitem(e){let t=e;for(;t;)t.isExpandable&&t.el.setAttribute("aria-expanded","true"),t=t.groupTreeitem;this.updateVisibleTreeitems()}expandAllSiblingItems(e){for(let t of this.treeitems)t.groupTreeitem===e.groupTreeitem&&t.isExpandable&&this.expandTreeitem(t)}collapseTreeitem(e){let t=null;e.isExpanded()?t=e:t=e.groupTreeitem,t&&(t.el.setAttribute("aria-expanded","false"),this.updateVisibleTreeitems(),this.setFocusToItem(t))}setFocusByFirstCharacter(e,t){let i,s;t=t.toLowerCase(),i=e.index+1,i===this.treeitems.length&&(i=0),s=this.getIndexFirstChars(i,t),s===-1&&(s=this.getIndexFirstChars(0,t)),s>-1&&this.setFocusToItem(this.treeitems[s])}findTreeItems(){let e=(t,i)=>{let s=i,r=t.firstElementChild;for(;r;)(r.tagName==="A"||r.tagName==="SPAN")&&(s=new b(r,this,i),this.treeitems.push(s),this.firstChars.push(s.label.substring(0,1).toLowerCase())),r.firstElementChild&&e(r,s),r=r.nextElementSibling};e(this.el,null),this.treeitems.map((t,i)=>t.index=i)}updateVisibleTreeitems(){this.firstTreeitem=this.treeitems[0];for(let e of this.treeitems){let t=e.groupTreeitem;for(e.isVisible=!0;t&&t.el!==this.el;)t.isExpanded()||(e.isVisible=!1),t=t.groupTreeitem;e.isVisible&&(this.lastTreeitem=e)}}setFocusToItem(e,t=!0){e.el.tabIndex=0,t&&e.el.focus();for(let i of this.treeitems)i!==e&&(i.el.tabIndex=-1)}getIndexFirstChars(e,t){for(let i=e;i<this.firstChars.length;i++)if(this.treeitems[i].isVisible&&t===this.firstChars[i])return i;return-1}},b=class{constructor(e,t,i){var n,a,o,d,p;e.tabIndex=-1,this.el=e,this.groupTreeitem=i,this.label=(a=(n=e.textContent)==null?void 0:n.trim())!=null?a:"",this.tree=t,this.depth=((i==null?void 0:i.depth)||0)+1,this.index=0;let s=e.parentElement;(s==null?void 0:s.tagName.toLowerCase())==="li"&&(s==null||s.setAttribute("role","none")),e.setAttribute("aria-level",this.depth+""),e.getAttribute("aria-label")&&(this.label=(d=(o=e==null?void 0:e.getAttribute("aria-label"))==null?void 0:o.trim())!=null?d:""),this.isExpandable=!1,this.isVisible=!1,this.isInGroup=!!i;let r=e.nextElementSibling;for(;r;){if(r.tagName.toLowerCase()=="ul"){let f=`${(p=i==null?void 0:i.label)!=null?p:""} nav group ${this.label}`.replace(/[\W_]+/g,"_");e.setAttribute("aria-owns",f),e.setAttribute("aria-expanded","false"),r.setAttribute("role","group"),r.setAttribute("id",f),this.isExpandable=!0;break}r=r.nextElementSibling}this.init()}init(){this.el.tabIndex=-1,this.el.getAttribute("role")||this.el.setAttribute("role","treeitem"),this.el.addEventListener("keydown",this.handleKeydown.bind(this)),this.el.addEventListener("click",this.handleClick.bind(this)),this.el.addEventListener("focus",this.handleFocus.bind(this)),this.el.addEventListener("blur",this.handleBlur.bind(this))}isExpanded(){return this.isExpandable?this.el.getAttribute("aria-expanded")==="true":!1}isSelected(){return this.el.getAttribute("aria-selected")==="true"}handleClick(e){e.target!==this.el&&e.target!==this.el.firstElementChild||(this.isExpandable&&(this.isExpanded()&&this.isSelected()?this.tree.collapseTreeitem(this):this.tree.expandTreeitem(this),e.stopPropagation()),this.tree.setSelected(this))}handleFocus(){var t;let e=this.el;this.isExpandable&&(e=(t=e.firstElementChild)!=null?t:e),e.classList.add("focus")}handleBlur(){var t;let e=this.el;this.isExpandable&&(e=(t=e.firstElementChild)!=null?t:e),e.classList.remove("focus")}handleKeydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=!1;switch(e.key){case" ":case"Enter":this.isExpandable?(this.isExpanded()&&this.isSelected()?this.tree.collapseTreeitem(this):this.tree.expandTreeitem(this),t=!0):e.stopPropagation(),this.tree.setSelected(this);break;case"ArrowUp":this.tree.setFocusToPreviousItem(this),t=!0;break;case"ArrowDown":this.tree.setFocusToNextItem(this),t=!0;break;case"ArrowRight":this.isExpandable&&(this.isExpanded()?this.tree.setFocusToNextItem(this):this.tree.expandTreeitem(this)),t=!0;break;case"ArrowLeft":this.isExpandable&&this.isExpanded()?(this.tree.collapseTreeitem(this),t=!0):this.isInGroup&&(this.tree.setFocusToParentItem(this),t=!0);break;case"Home":this.tree.setFocusToFirstItem(),t=!0;break;case"End":this.tree.setFocusToLastItem(),t=!0;break;default:e.key.length===1&&e.key.match(/\S/)&&(e.key=="*"?this.tree.expandAllSiblingItems(this):this.tree.setFocusByFirstCharacter(this,e.key),t=!0);break}t&&(e.stopPropagation(),e.preventDefault())}};function g(l,e){let t;return(...i)=>{let s=()=>{t=null,l(...i)};t&&clearTimeout(t),t=setTimeout(s,e)}}window.addEventListener("load",()=>{var t,i;let l=document.querySelector(".js-tree");if(l){let s=new c(l),r=m(s);(t=document.querySelector(".js-mainNavMobile"))==null||t.appendChild(r)}let e=document.querySelector(".Outline .js-tree");if(e){let s=new c(e),r=m(s);(i=document.querySelector(".Outline .js-select"))==null||i.appendChild(r)}for(let s of document.querySelectorAll(".js-toggleTheme"))s.addEventListener("click",r=>{let n=r.currentTarget.getAttribute("data-value");document.documentElement.setAttribute("data-theme",String(n))});for(let s of document.querySelectorAll(".js-toggleLayout"))s.addEventListener("click",r=>{let n=r.currentTarget.getAttribute("data-value");document.documentElement.setAttribute("data-layout",String(n))});for(let s of document.querySelectorAll(".js-selectNav"))new u(s);for(let s of document.querySelectorAll(".js-carousel"))new h(s)});customElements.define("go-color",class extends HTMLElement{constructor(){super();var e;this.style.setProperty("display","contents");let l=this.id;this.removeAttribute("id"),this.innerHTML=`
+    `,(t=e.querySelector(".go-Carousel-prevSlide"))==null||t.addEventListener("click",()=>this.setActive(this.activeIndex-1)),(i=e.querySelector(".go-Carousel-nextSlide"))==null||i.addEventListener("click",()=>this.setActive(this.activeIndex+1)),this.el.append(e)}initDots(){let e=document.createElement("ul");e.classList.add("go-Carousel-dots");for(let t=0;t<this.slides.length;t++){let i=document.createElement("li"),s=document.createElement("button");s.classList.add("go-Carousel-dot"),t===this.activeIndex&&s.classList.add("go-Carousel-dot--active"),s.innerHTML=`<span class="go-Carousel-obscured">Slide ${t+1}</span>`,s.addEventListener("click",()=>this.setActive(t)),i.append(s),e.append(i),this.dots.push(s)}this.el.append(e)}initLiveRegion(){this.liveRegion.setAttribute("aria-live","polite"),this.liveRegion.setAttribute("aria-atomic","true"),this.liveRegion.setAttribute("class","go-Carousel-obscured"),this.liveRegion.textContent=`Slide ${this.activeIndex+1} of ${this.slides.length}`,this.el.appendChild(this.liveRegion)}};var u=class{constructor(e){this.el=e;this.el.addEventListener("change",t=>{let i=t.target,s=i.value;i.value.startsWith("/")||(s="/"+s),window.location.href=s})}};function m(l){let e=document.createElement("label");e.classList.add("go-Label"),e.setAttribute("aria-label","Menu");let t=document.createElement("select");t.classList.add("go-Select","js-selectNav"),e.appendChild(t);let i=document.createElement("optgroup");i.label="Outline",t.appendChild(i);let s={},r;for(let n of l.treeitems){if(Number(n.depth)>4)continue;n.groupTreeitem?(r=s[n.groupTreeitem.label],r||(r=s[n.groupTreeitem.label]=document.createElement("optgroup"),r.label=n.groupTreeitem.label,t.appendChild(r))):r=i;let a=document.createElement("option");a.label=n.label,a.textContent=n.label,a.value=n.el.href.replace(window.location.origin,"").replace("/",""),r.appendChild(a)}return l.addObserver(n=>{var d;let a=n.el.hash,o=(d=t.querySelector(`[value$="${a}"]`))==null?void 0:d.value;o&&(t.value=o)},50),e}var c=class{constructor(e){this.el=e;this.handleResize=()=>{this.el.style.setProperty("--js-tree-height","100vh"),this.el.style.setProperty("--js-tree-height",this.el.clientHeight+"px")};this.treeitems=[],this.firstChars=[],this.firstTreeitem=null,this.lastTreeitem=null,this.observerCallbacks=[],this.init()}init(){this.handleResize(),window.addEventListener("resize",this.handleResize),this.findTreeItems(),this.updateVisibleTreeitems(),this.observeTargets(),this.firstTreeitem&&(this.firstTreeitem.el.tabIndex=0)}observeTargets(){this.addObserver(i=>{this.expandTreeitem(i),this.setSelected(i)});let e=new Map,t=new IntersectionObserver(i=>{for(let s of i)e.set(s.target.id,s.isIntersecting||s.intersectionRatio===1);for(let[s,r]of e)if(r){let n=this.treeitems.find(a=>{var o;return(o=a.el)==null?void 0:o.href.endsWith(`#${s}`)});if(n)for(let a of this.observerCallbacks)a(n);break}},{threshold:1,rootMargin:"-60px 0px 0px 0px"});for(let i of this.treeitems.map(s=>s.el.getAttribute("href")))if(i){let s=i.replace(window.location.origin,"").replace("/","").replace("#",""),r=document.getElementById(s);r&&t.observe(r)}}addObserver(e,t=200){this.observerCallbacks.push(g(e,t))}setFocusToNextItem(e){let t=null;for(let i=e.index+1;i<this.treeitems.length;i++){let s=this.treeitems[i];if(s.isVisible){t=s;break}}t&&this.setFocusToItem(t)}setFocusToPreviousItem(e){let t=null;for(let i=e.index-1;i>-1;i--){let s=this.treeitems[i];if(s.isVisible){t=s;break}}t&&this.setFocusToItem(t)}setFocusToParentItem(e){e.groupTreeitem&&this.setFocusToItem(e.groupTreeitem)}setFocusToFirstItem(){this.firstTreeitem&&this.setFocusToItem(this.firstTreeitem)}setFocusToLastItem(){this.lastTreeitem&&this.setFocusToItem(this.lastTreeitem)}setSelected(e){var t;for(let i of this.el.querySelectorAll('[aria-expanded="true"]'))i!==e.el&&(((t=i.nextElementSibling)==null?void 0:t.contains(e.el))||i.setAttribute("aria-expanded","false"));for(let i of this.el.querySelectorAll("[aria-selected]"))i!==e.el&&i.setAttribute("aria-selected","false");e.el.setAttribute("aria-selected","true"),this.updateVisibleTreeitems(),this.setFocusToItem(e,!1)}expandTreeitem(e){let t=e;for(;t;)t.isExpandable&&t.el.setAttribute("aria-expanded","true"),t=t.groupTreeitem;this.updateVisibleTreeitems()}expandAllSiblingItems(e){for(let t of this.treeitems)t.groupTreeitem===e.groupTreeitem&&t.isExpandable&&this.expandTreeitem(t)}collapseTreeitem(e){let t=null;e.isExpanded()?t=e:t=e.groupTreeitem,t&&(t.el.setAttribute("aria-expanded","false"),this.updateVisibleTreeitems(),this.setFocusToItem(t))}setFocusByFirstCharacter(e,t){let i,s;t=t.toLowerCase(),i=e.index+1,i===this.treeitems.length&&(i=0),s=this.getIndexFirstChars(i,t),s===-1&&(s=this.getIndexFirstChars(0,t)),s>-1&&this.setFocusToItem(this.treeitems[s])}findTreeItems(){let e=(t,i)=>{let s=i,r=t.firstElementChild;for(;r;)(r.tagName==="A"||r.tagName==="SPAN")&&(s=new b(r,this,i),this.treeitems.push(s),this.firstChars.push(s.label.substring(0,1).toLowerCase())),r.firstElementChild&&e(r,s),r=r.nextElementSibling};e(this.el,null),this.treeitems.map((t,i)=>t.index=i)}updateVisibleTreeitems(){this.firstTreeitem=this.treeitems[0];for(let e of this.treeitems){let t=e.groupTreeitem;for(e.isVisible=!0;t&&t.el!==this.el;)t.isExpanded()||(e.isVisible=!1),t=t.groupTreeitem;e.isVisible&&(this.lastTreeitem=e)}}setFocusToItem(e,t=!0){e.el.tabIndex=0,t&&e.el.focus();for(let i of this.treeitems)i!==e&&(i.el.tabIndex=-1)}getIndexFirstChars(e,t){for(let i=e;i<this.firstChars.length;i++)if(this.treeitems[i].isVisible&&t===this.firstChars[i])return i;return-1}},b=class{constructor(e,t,i){var n,a,o,d,p;e.tabIndex=-1,this.el=e,this.groupTreeitem=i,this.label=(a=(n=e.textContent)==null?void 0:n.trim())!=null?a:"",this.tree=t,this.depth=((i==null?void 0:i.depth)||0)+1,this.index=0;let s=e.parentElement;(s==null?void 0:s.tagName.toLowerCase())==="li"&&(s==null||s.setAttribute("role","none")),e.setAttribute("aria-level",this.depth+""),e.getAttribute("aria-label")&&(this.label=(d=(o=e==null?void 0:e.getAttribute("aria-label"))==null?void 0:o.trim())!=null?d:""),this.isExpandable=!1,this.isVisible=!1,this.isInGroup=!!i;let r=e.nextElementSibling;for(;r;){if(r.tagName.toLowerCase()=="ul"){let f=`${(p=i==null?void 0:i.label)!=null?p:""} nav group ${this.label}`.replace(/[\W_]+/g,"_");e.setAttribute("aria-owns",f),e.setAttribute("aria-expanded","false"),r.setAttribute("role","group"),r.setAttribute("id",f),this.isExpandable=!0;break}r=r.nextElementSibling}this.init()}init(){this.el.tabIndex=-1,this.el.getAttribute("role")||this.el.setAttribute("role","treeitem"),this.el.addEventListener("keydown",this.handleKeydown.bind(this)),this.el.addEventListener("click",this.handleClick.bind(this)),this.el.addEventListener("focus",this.handleFocus.bind(this)),this.el.addEventListener("blur",this.handleBlur.bind(this))}isExpanded(){return this.isExpandable?this.el.getAttribute("aria-expanded")==="true":!1}isSelected(){return this.el.getAttribute("aria-selected")==="true"}handleClick(e){e.target!==this.el&&e.target!==this.el.firstElementChild||(this.isExpandable&&(this.isExpanded()&&this.isSelected()?this.tree.collapseTreeitem(this):this.tree.expandTreeitem(this),e.stopPropagation()),this.tree.setSelected(this))}handleFocus(){var t;let e=this.el;this.isExpandable&&(e=(t=e.firstElementChild)!=null?t:e),e.classList.add("focus")}handleBlur(){var t;let e=this.el;this.isExpandable&&(e=(t=e.firstElementChild)!=null?t:e),e.classList.remove("focus")}handleKeydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=!1;switch(e.key){case" ":case"Enter":this.isExpandable?(this.isExpanded()&&this.isSelected()?this.tree.collapseTreeitem(this):this.tree.expandTreeitem(this),t=!0):e.stopPropagation(),this.tree.setSelected(this);break;case"ArrowUp":this.tree.setFocusToPreviousItem(this),t=!0;break;case"ArrowDown":this.tree.setFocusToNextItem(this),t=!0;break;case"ArrowRight":this.isExpandable&&(this.isExpanded()?this.tree.setFocusToNextItem(this):this.tree.expandTreeitem(this)),t=!0;break;case"ArrowLeft":this.isExpandable&&this.isExpanded()?(this.tree.collapseTreeitem(this),t=!0):this.isInGroup&&(this.tree.setFocusToParentItem(this),t=!0);break;case"Home":this.tree.setFocusToFirstItem(),t=!0;break;case"End":this.tree.setFocusToLastItem(),t=!0;break;default:e.key.length===1&&e.key.match(/\S/)&&(e.key=="*"?this.tree.expandAllSiblingItems(this):this.tree.setFocusByFirstCharacter(this,e.key),t=!0);break}t&&(e.stopPropagation(),e.preventDefault())}};function g(l,e){let t;return(...i)=>{let s=()=>{t=null,l(...i)};t&&clearTimeout(t),t=setTimeout(s,e)}}window.addEventListener("load",()=>{var t,i;let l=document.querySelector(".js-tree");if(l){let s=new c(l),r=m(s);(t=document.querySelector(".js-mainNavMobile"))==null||t.appendChild(r)}let e=document.querySelector(".Outline .js-tree");if(e){let s=new c(e),r=m(s);(i=document.querySelector(".Outline .js-select"))==null||i.appendChild(r)}for(let s of document.querySelectorAll(".js-toggleTheme"))s.addEventListener("click",r=>{let n=r.currentTarget.getAttribute("data-value");document.documentElement.setAttribute("data-theme",String(n))});for(let s of document.querySelectorAll(".js-toggleLayout"))s.addEventListener("click",r=>{let n=r.currentTarget.getAttribute("data-value");document.documentElement.setAttribute("data-layout",String(n))});for(let s of document.querySelectorAll(".js-selectNav"))new u(s);for(let s of document.querySelectorAll(".js-carousel"))new h(s)});customElements.define("go-color",class extends HTMLElement{constructor(){super();var e;this.style.setProperty("display","contents");let l=this.id;this.removeAttribute("id"),this.innerHTML=`
         <div style="--color: var(${l});" class="GoColor-circle"></div>
         <span>
           <div id="${l}" class="go-textLabel GoColor-title">${l.replace("--color-","").replaceAll("-"," ")}</div>
diff --git a/static/frontend/styleguide/styleguide.js.map b/static/frontend/styleguide/styleguide.js.map
index 7b577d0..d10a3bf 100644
--- a/static/frontend/styleguide/styleguide.js.map
+++ b/static/frontend/styleguide/styleguide.js.map
@@ -1,7 +1,7 @@
 {
   "version": 3,
   "sources": ["../../shared/carousel/carousel.ts", "../../shared/outline/select.ts", "../../shared/outline/tree.ts", "styleguide.ts"],
-  "sourcesContent": ["/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * Carousel Controller adds event listeners, accessibilty enhancements, and\n * control elements to a carousel component.\n */\nexport class CarouselController {\n  /**\n   * slides is a collection of slides in the carousel.\n   */\n  private slides: HTMLLIElement[];\n  /**\n   * dots is a collection of dot navigation controls, added to the carousel\n   * by this controller.\n   */\n  private dots: HTMLElement[];\n  /**\n   * liveRegion is a visually hidden element that notifies assitive devices\n   * of visual changes to the carousel. They are added to the carousel by\n   * this controller.\n   */\n  private liveRegion: HTMLElement;\n  /**\n   * activeIndex is the 0-index of the currently active slide.\n   */\n  private activeIndex: number;\n\n  constructor(private el: HTMLElement) {\n    this.slides = Array.from(el.querySelectorAll('.go-Carousel-slide'));\n    this.dots = [];\n    this.liveRegion = document.createElement('div');\n    this.activeIndex = 0;\n\n    this.initSlides();\n    this.initArrows();\n    this.initDots();\n    this.initLiveRegion();\n  }\n\n  private initSlides() {\n    for (const [i, v] of this.slides.entries()) {\n      if (i === 0) continue;\n      v.setAttribute('aria-hidden', 'true');\n    }\n  }\n\n  private initArrows() {\n    const arrows = document.createElement('ul');\n    arrows.classList.add('go-Carousel-arrows');\n    arrows.innerHTML = `\n      <li>\n        <button class=\"go-Carousel-prevSlide\" aria-label=\"Go to previous slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_left_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n      <li>\n        <button class=\"go-Carousel-nextSlide\" aria-label=\"Go to next slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_right_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n    `;\n    arrows\n      .querySelector('.go-Carousel-prevSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex - 1));\n    arrows\n      .querySelector('.go-Carousel-nextSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex + 1));\n    this.el.append(arrows);\n  }\n\n  private initDots() {\n    const dots = document.createElement('ul');\n    dots.classList.add('go-Carousel-dots');\n    for (let i = 0; i < this.slides.length; i++) {\n      const li = document.createElement('li');\n      const button = document.createElement('button');\n      button.classList.add('go-Carousel-dot');\n      if (i === 0) {\n        button.classList.add('go-Carousel-dot--active');\n      }\n      button.innerHTML = `<span class=\"go-Carousel-obscured\">Slide ${i + 1}</span>`;\n      button.addEventListener('click', () => this.setActive(i));\n      li.append(button);\n      dots.append(li);\n      this.dots.push(button);\n    }\n    this.el.append(dots);\n  }\n\n  private initLiveRegion() {\n    this.liveRegion.setAttribute('aria-live', 'polite');\n    this.liveRegion.setAttribute('aria-atomic', 'true');\n    this.liveRegion.setAttribute('class', 'go-Carousel-obscured');\n    this.liveRegion.textContent = `Slide ${this.activeIndex + 1} of ${this.slides.length}`;\n    this.el.appendChild(this.liveRegion);\n  }\n\n  private setActive = (index: number) => {\n    this.activeIndex = (index + this.slides.length) % this.slides.length;\n    for (const d of this.dots) {\n      d.classList.remove('go-Carousel-dot--active');\n    }\n    this.dots[this.activeIndex].classList.add('go-Carousel-dot--active');\n    for (const s of this.slides) {\n      s.setAttribute('aria-hidden', 'true');\n    }\n    this.slides[this.activeIndex].removeAttribute('aria-hidden');\n    this.liveRegion.textContent = 'Slide ' + (this.activeIndex + 1) + ' of ' + this.slides.length;\n  };\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { TreeNavController } from './tree.js';\n\nexport class SelectNavController {\n  constructor(private el: Element) {\n    this.el.addEventListener('change', e => {\n      const target = e.target as HTMLSelectElement;\n      let href = target.value;\n      if (!target.value.startsWith('/')) {\n        href = '/' + href;\n      }\n      window.location.href = href;\n    });\n  }\n}\n\nexport function makeSelectNav(tree: TreeNavController): HTMLLabelElement {\n  const label = document.createElement('label');\n  label.classList.add('go-Label');\n  label.setAttribute('aria-label', 'Menu');\n  const select = document.createElement('select');\n  select.classList.add('go-Select', 'js-selectNav');\n  label.appendChild(select);\n  const outline = document.createElement('optgroup');\n  outline.label = 'Outline';\n  select.appendChild(outline);\n  const groupMap: Record<string, HTMLOptGroupElement> = {};\n  let group: HTMLOptGroupElement;\n  for (const t of tree.treeitems) {\n    if (Number(t.depth) > 4) continue;\n    if (t.groupTreeitem) {\n      group = groupMap[t.groupTreeitem.label];\n      if (!group) {\n        group = groupMap[t.groupTreeitem.label] = document.createElement('optgroup');\n        group.label = t.groupTreeitem.label;\n        select.appendChild(group);\n      }\n    } else {\n      group = outline;\n    }\n    const o = document.createElement('option');\n    o.label = t.label;\n    o.textContent = t.label;\n    o.value = (t.el as HTMLAnchorElement).href.replace(window.location.origin, '').replace('/', '');\n    group.appendChild(o);\n  }\n  tree.addObserver(t => {\n    const hash = (t.el as HTMLAnchorElement).hash;\n    const value = select.querySelector<HTMLOptionElement>(`[value$=\"${hash}\"]`)?.value;\n    if (value) {\n      select.value = value;\n    }\n  }, 50);\n  return label;\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * TreeNavController is the navigation tree component of the documentation page.\n * It adds accessiblity attributes to a tree, observes the heading elements\n * focus the topmost link for headings visible on the page, and implements the\n * WAI-ARIA Treeview Design Pattern with full\n * [keyboard support](https://www.w3.org/TR/wai-aria-practices/examples/treeview/treeview-2/treeview-2a.html#kbd_label).\n */\nexport class TreeNavController {\n  treeitems: TreeItem[];\n\n  /**\n   * firstChars is the first character of each treeitem in the same order\n   * as this.treeitems. We use this array to set focus by character when\n   * navigating the tree with a keyboard.\n   */\n  private firstChars: string[];\n  private firstTreeitem: TreeItem | null;\n  private lastTreeitem: TreeItem | null;\n  private observerCallbacks: ((t: TreeItem) => void)[];\n\n  constructor(private el: HTMLElement) {\n    this.treeitems = [];\n    this.firstChars = [];\n    this.firstTreeitem = null;\n    this.lastTreeitem = null;\n    this.observerCallbacks = [];\n    this.init();\n  }\n\n  private init(): void {\n    this.handleResize();\n    window.addEventListener('resize', this.handleResize);\n    this.findTreeItems();\n    this.updateVisibleTreeitems();\n    this.observeTargets();\n    if (this.firstTreeitem) {\n      this.firstTreeitem.el.tabIndex = 0;\n    }\n  }\n\n  private handleResize = (): void => {\n    this.el.style.setProperty('--js-tree-height', '100vh');\n    this.el.style.setProperty('--js-tree-height', this.el.clientHeight + 'px');\n  };\n\n  private observeTargets() {\n    this.addObserver(treeitem => {\n      this.expandTreeitem(treeitem);\n      this.setSelected(treeitem);\n      // TODO: Fix scroll issue in https://golang.org/issue/47450.\n      // treeitem.el.scrollIntoView({ block: 'nearest' });\n    });\n\n    const targets = new Map<string, boolean>();\n    const observer = new IntersectionObserver(\n      entries => {\n        for (const entry of entries) {\n          targets.set(entry.target.id, entry.isIntersecting || entry.intersectionRatio === 1);\n        }\n        for (const [id, isIntersecting] of targets) {\n          if (isIntersecting) {\n            const active = this.treeitems.find(t =>\n              (t.el as HTMLAnchorElement)?.href.endsWith(`#${id}`)\n            );\n            if (active) {\n              for (const fn of this.observerCallbacks) {\n                fn(active);\n              }\n            }\n            break;\n          }\n        }\n      },\n      {\n        threshold: 1.0,\n        rootMargin: '-60px 0px 0px 0px',\n      }\n    );\n\n    for (const href of this.treeitems.map(t => t.el.getAttribute('href'))) {\n      if (href) {\n        const id = href.replace(window.location.origin, '').replace('/', '').replace('#', '');\n        const target = document.getElementById(id);\n        if (target) {\n          observer.observe(target);\n        }\n      }\n    }\n  }\n\n  addObserver(fn: (t: TreeItem) => void, delay = 200): void {\n    this.observerCallbacks.push(debounce(fn, delay));\n  }\n\n  setFocusToNextItem(currentItem: TreeItem): void {\n    let nextItem = null;\n    for (let i = currentItem.index + 1; i < this.treeitems.length; i++) {\n      const ti = this.treeitems[i];\n      if (ti.isVisible) {\n        nextItem = ti;\n        break;\n      }\n    }\n    if (nextItem) {\n      this.setFocusToItem(nextItem);\n    }\n  }\n\n  setFocusToPreviousItem(currentItem: TreeItem): void {\n    let prevItem = null;\n    for (let i = currentItem.index - 1; i > -1; i--) {\n      const ti = this.treeitems[i];\n      if (ti.isVisible) {\n        prevItem = ti;\n        break;\n      }\n    }\n    if (prevItem) {\n      this.setFocusToItem(prevItem);\n    }\n  }\n\n  setFocusToParentItem(currentItem: TreeItem): void {\n    if (currentItem.groupTreeitem) {\n      this.setFocusToItem(currentItem.groupTreeitem);\n    }\n  }\n\n  setFocusToFirstItem(): void {\n    this.firstTreeitem && this.setFocusToItem(this.firstTreeitem);\n  }\n\n  setFocusToLastItem(): void {\n    this.lastTreeitem && this.setFocusToItem(this.lastTreeitem);\n  }\n\n  setSelected(currentItem: TreeItem): void {\n    for (const l1 of this.el.querySelectorAll('[aria-expanded=\"true\"]')) {\n      if (l1 === currentItem.el) continue;\n      if (!l1.nextElementSibling?.contains(currentItem.el)) {\n        l1.setAttribute('aria-expanded', 'false');\n      }\n    }\n    for (const l1 of this.el.querySelectorAll('[aria-selected]')) {\n      if (l1 !== currentItem.el) {\n        l1.setAttribute('aria-selected', 'false');\n      }\n    }\n    currentItem.el.setAttribute('aria-selected', 'true');\n    this.updateVisibleTreeitems();\n    this.setFocusToItem(currentItem, false);\n  }\n\n  expandTreeitem(treeitem: TreeItem): void {\n    let currentItem: TreeItem | null = treeitem;\n    while (currentItem) {\n      if (currentItem.isExpandable) {\n        currentItem.el.setAttribute('aria-expanded', 'true');\n      }\n      currentItem = currentItem.groupTreeitem;\n    }\n    this.updateVisibleTreeitems();\n  }\n\n  expandAllSiblingItems(currentItem: TreeItem): void {\n    for (const ti of this.treeitems) {\n      if (ti.groupTreeitem === currentItem.groupTreeitem && ti.isExpandable) {\n        this.expandTreeitem(ti);\n      }\n    }\n  }\n\n  collapseTreeitem(currentItem: TreeItem): void {\n    let groupTreeitem = null;\n\n    if (currentItem.isExpanded()) {\n      groupTreeitem = currentItem;\n    } else {\n      groupTreeitem = currentItem.groupTreeitem;\n    }\n\n    if (groupTreeitem) {\n      groupTreeitem.el.setAttribute('aria-expanded', 'false');\n      this.updateVisibleTreeitems();\n      this.setFocusToItem(groupTreeitem);\n    }\n  }\n\n  setFocusByFirstCharacter(currentItem: TreeItem, char: string): void {\n    let start: number, index: number;\n    char = char.toLowerCase();\n\n    // Get start index for search based on position of currentItem\n    start = currentItem.index + 1;\n    if (start === this.treeitems.length) {\n      start = 0;\n    }\n\n    // Check remaining slots in the menu\n    index = this.getIndexFirstChars(start, char);\n\n    // If not found in remaining slots, check from beginning\n    if (index === -1) {\n      index = this.getIndexFirstChars(0, char);\n    }\n\n    // If match was found...\n    if (index > -1) {\n      this.setFocusToItem(this.treeitems[index]);\n    }\n  }\n\n  private findTreeItems() {\n    const findItems = (el: HTMLElement, group: TreeItem | null) => {\n      let ti = group;\n      let curr = el.firstElementChild as HTMLElement;\n      while (curr) {\n        if (curr.tagName === 'A' || curr.tagName === 'SPAN') {\n          ti = new TreeItem(curr, this, group);\n          this.treeitems.push(ti);\n          this.firstChars.push(ti.label.substring(0, 1).toLowerCase());\n        }\n        if (curr.firstElementChild) {\n          findItems(curr, ti);\n        }\n        curr = curr.nextElementSibling as HTMLElement;\n      }\n    };\n    findItems(this.el as HTMLElement, null);\n    this.treeitems.map((ti, idx) => (ti.index = idx));\n  }\n\n  private updateVisibleTreeitems(): void {\n    this.firstTreeitem = this.treeitems[0];\n\n    for (const ti of this.treeitems) {\n      let parent = ti.groupTreeitem;\n      ti.isVisible = true;\n      while (parent && parent.el !== this.el) {\n        if (!parent.isExpanded()) {\n          ti.isVisible = false;\n        }\n        parent = parent.groupTreeitem;\n      }\n      if (ti.isVisible) {\n        this.lastTreeitem = ti;\n      }\n    }\n  }\n\n  private setFocusToItem(treeitem: TreeItem, focusEl = true) {\n    treeitem.el.tabIndex = 0;\n    if (focusEl) {\n      treeitem.el.focus();\n    }\n    for (const ti of this.treeitems) {\n      if (ti !== treeitem) {\n        ti.el.tabIndex = -1;\n      }\n    }\n  }\n\n  private getIndexFirstChars(startIndex: number, char: string): number {\n    for (let i = startIndex; i < this.firstChars.length; i++) {\n      if (this.treeitems[i].isVisible && char === this.firstChars[i]) {\n        return i;\n      }\n    }\n    return -1;\n  }\n}\n\nclass TreeItem {\n  el: HTMLElement;\n  groupTreeitem: TreeItem | null;\n  label: string;\n  isExpandable: boolean;\n  isVisible: boolean;\n  depth: number;\n  index: number;\n\n  private tree: TreeNavController;\n  private isInGroup: boolean;\n\n  constructor(el: HTMLElement, treeObj: TreeNavController, group: TreeItem | null) {\n    el.tabIndex = -1;\n    this.el = el;\n    this.groupTreeitem = group;\n    this.label = el.textContent?.trim() ?? '';\n    this.tree = treeObj;\n    this.depth = (group?.depth || 0) + 1;\n    this.index = 0;\n\n    const parent = el.parentElement;\n    if (parent?.tagName.toLowerCase() === 'li') {\n      parent?.setAttribute('role', 'none');\n    }\n    el.setAttribute('aria-level', this.depth + '');\n    if (el.getAttribute('aria-label')) {\n      this.label = el?.getAttribute('aria-label')?.trim() ?? '';\n    }\n\n    this.isExpandable = false;\n    this.isVisible = false;\n    this.isInGroup = !!group;\n\n    let curr = el.nextElementSibling;\n    while (curr) {\n      if (curr.tagName.toLowerCase() == 'ul') {\n        const groupId = `${group?.label ?? ''} nav group ${this.label}`.replace(/[\\W_]+/g, '_');\n        el.setAttribute('aria-owns', groupId);\n        el.setAttribute('aria-expanded', 'false');\n        curr.setAttribute('role', 'group');\n        curr.setAttribute('id', groupId);\n        this.isExpandable = true;\n        break;\n      }\n\n      curr = curr.nextElementSibling;\n    }\n    this.init();\n  }\n\n  private init() {\n    this.el.tabIndex = -1;\n    if (!this.el.getAttribute('role')) {\n      this.el.setAttribute('role', 'treeitem');\n    }\n    this.el.addEventListener('keydown', this.handleKeydown.bind(this));\n    this.el.addEventListener('click', this.handleClick.bind(this));\n    this.el.addEventListener('focus', this.handleFocus.bind(this));\n    this.el.addEventListener('blur', this.handleBlur.bind(this));\n  }\n\n  isExpanded() {\n    if (this.isExpandable) {\n      return this.el.getAttribute('aria-expanded') === 'true';\n    }\n\n    return false;\n  }\n\n  isSelected() {\n    return this.el.getAttribute('aria-selected') === 'true';\n  }\n\n  private handleClick(event: MouseEvent) {\n    // only process click events that directly happened on this treeitem\n    if (event.target !== this.el && event.target !== this.el.firstElementChild) {\n      return;\n    }\n    if (this.isExpandable) {\n      if (this.isExpanded() && this.isSelected()) {\n        this.tree.collapseTreeitem(this);\n      } else {\n        this.tree.expandTreeitem(this);\n      }\n      event.stopPropagation();\n    }\n    this.tree.setSelected(this);\n  }\n\n  private handleFocus() {\n    let el = this.el;\n    if (this.isExpandable) {\n      el = (el.firstElementChild as HTMLElement) ?? el;\n    }\n    el.classList.add('focus');\n  }\n\n  private handleBlur() {\n    let el = this.el;\n    if (this.isExpandable) {\n      el = (el.firstElementChild as HTMLElement) ?? el;\n    }\n    el.classList.remove('focus');\n  }\n\n  private handleKeydown(event: KeyboardEvent) {\n    if (event.altKey || event.ctrlKey || event.metaKey) {\n      return;\n    }\n\n    let captured = false;\n    switch (event.key) {\n      case ' ':\n      case 'Enter':\n        if (this.isExpandable) {\n          if (this.isExpanded() && this.isSelected()) {\n            this.tree.collapseTreeitem(this);\n          } else {\n            this.tree.expandTreeitem(this);\n          }\n          captured = true;\n        } else {\n          event.stopPropagation();\n        }\n        this.tree.setSelected(this);\n        break;\n\n      case 'ArrowUp':\n        this.tree.setFocusToPreviousItem(this);\n        captured = true;\n        break;\n\n      case 'ArrowDown':\n        this.tree.setFocusToNextItem(this);\n        captured = true;\n        break;\n\n      case 'ArrowRight':\n        if (this.isExpandable) {\n          if (this.isExpanded()) {\n            this.tree.setFocusToNextItem(this);\n          } else {\n            this.tree.expandTreeitem(this);\n          }\n        }\n        captured = true;\n        break;\n\n      case 'ArrowLeft':\n        if (this.isExpandable && this.isExpanded()) {\n          this.tree.collapseTreeitem(this);\n          captured = true;\n        } else {\n          if (this.isInGroup) {\n            this.tree.setFocusToParentItem(this);\n            captured = true;\n          }\n        }\n        break;\n\n      case 'Home':\n        this.tree.setFocusToFirstItem();\n        captured = true;\n        break;\n\n      case 'End':\n        this.tree.setFocusToLastItem();\n        captured = true;\n        break;\n\n      default:\n        if (event.key.length === 1 && event.key.match(/\\S/)) {\n          if (event.key == '*') {\n            this.tree.expandAllSiblingItems(this);\n          } else {\n            this.tree.setFocusByFirstCharacter(this, event.key);\n          }\n          captured = true;\n        }\n        break;\n    }\n\n    if (captured) {\n      event.stopPropagation();\n      event.preventDefault();\n    }\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction debounce<T extends (...args: any[]) => any>(func: T, wait: number) {\n  let timeout: ReturnType<typeof setTimeout> | null;\n  return (...args: Parameters<T>) => {\n    const later = () => {\n      timeout = null;\n      func(...args);\n    };\n    if (timeout) {\n      clearTimeout(timeout);\n    }\n    timeout = setTimeout(later, wait);\n  };\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { CarouselController } from '../../shared/carousel/carousel';\nimport { SelectNavController, makeSelectNav } from '../../shared/outline/select';\nimport { TreeNavController } from '../../shared/outline/tree';\n\nwindow.addEventListener('load', () => {\n  const tree = document.querySelector<HTMLElement>('.js-tree');\n  if (tree) {\n    const treeCtrl = new TreeNavController(tree);\n    const select = makeSelectNav(treeCtrl);\n    document.querySelector('.js-mainNavMobile')?.appendChild(select);\n  }\n\n  const guideTree = document.querySelector<HTMLElement>('.Outline .js-tree');\n  if (guideTree) {\n    const treeCtrl = new TreeNavController(guideTree);\n    const select = makeSelectNav(treeCtrl);\n    document.querySelector('.Outline .js-select')?.appendChild(select);\n  }\n\n  for (const el of document.querySelectorAll('.js-toggleTheme')) {\n    el.addEventListener('click', e => {\n      const value = (e.currentTarget as HTMLButtonElement).getAttribute('data-value');\n      document.documentElement.setAttribute('data-theme', String(value));\n    });\n  }\n  for (const el of document.querySelectorAll('.js-toggleLayout')) {\n    el.addEventListener('click', e => {\n      const value = (e.currentTarget as HTMLButtonElement).getAttribute('data-value');\n      document.documentElement.setAttribute('data-layout', String(value));\n    });\n  }\n\n  for (const el of document.querySelectorAll<HTMLSelectElement>('.js-selectNav')) {\n    new SelectNavController(el);\n  }\n\n  for (const el of document.querySelectorAll<HTMLSelectElement>('.js-carousel')) {\n    new CarouselController(el);\n  }\n});\n\ncustomElements.define(\n  'go-color',\n  class extends HTMLElement {\n    constructor() {\n      super();\n      this.style.setProperty('display', 'contents');\n      // The current version of TypeScript is not aware of String.replaceAll.\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const name = this.id as any;\n      this.removeAttribute('id');\n      this.innerHTML = `\n        <div style=\"--color: var(${name});\" class=\"GoColor-circle\"></div>\n        <span>\n          <div id=\"${name}\" class=\"go-textLabel GoColor-title\">${name\n        .replace('--color-', '')\n        .replaceAll('-', ' ')}</div>\n          <pre class=\"StringifyElement-markup\">var(${name})</pre>\n        </span>\n      `;\n      this.querySelector('pre')?.addEventListener('click', () => {\n        navigator.clipboard.writeText(`var(${name})`);\n      });\n    }\n  }\n);\n\ncustomElements.define(\n  'go-icon',\n  class extends HTMLElement {\n    constructor() {\n      super();\n      this.style.setProperty('display', 'contents');\n      // The current version of TypeScript is not aware of String.replaceAll.\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const name = this.getAttribute('name') as any;\n      this.innerHTML = `<p id=\"icon-${name}\" class=\"go-textLabel GoIcon-title\">${name.replaceAll(\n        '_',\n        ' '\n      )}</p>\n        <stringify-el>\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/${name}_gm_grey_24dp.svg\" alt=\"\">\n        </stringify-el>\n      `;\n    }\n  }\n);\n\ncustomElements.define(\n  'clone-el',\n  class extends HTMLElement {\n    constructor() {\n      super();\n      this.style.setProperty('display', 'contents');\n      const selector = this.getAttribute('selector');\n      if (!selector) return;\n      const html = '    ' + document.querySelector(selector)?.outerHTML;\n      this.innerHTML = `\n        <stringify-el collapsed>${html}</stringify-el>\n      `;\n    }\n  }\n);\n\ncustomElements.define(\n  'stringify-el',\n  class extends HTMLElement {\n    constructor() {\n      super();\n      this.style.setProperty('display', 'contents');\n      const html = this.innerHTML;\n      const idAttr = this.id ? ` id=\"${this.id}\"` : '';\n      this.removeAttribute('id');\n      let markup = `<pre class=\"StringifyElement-markup\">` + escape(trim(html)) + `</pre>`;\n      if (this.hasAttribute('collapsed')) {\n        markup = `<details class=\"StringifyElement-details\"><summary>Markup</summary>${markup}</details>`;\n      }\n      this.innerHTML = `<span${idAttr}>${html}</span>${markup}`;\n      this.querySelector('pre')?.addEventListener('click', () => {\n        navigator.clipboard.writeText(html);\n      });\n    }\n  }\n);\n\n/**\n * trim removes excess indentation from html markup by\n * measuring the number of spaces in the first line of\n * the given string and removing that number of spaces\n * from the beginning of each line.\n */\nfunction trim(html: string) {\n  return html\n    .split('\\n')\n    .reduce<{ result: string[]; start: number }>(\n      (acc, val) => {\n        if (acc.result.length === 0) {\n          const start = val.indexOf('<');\n          acc.start = start === -1 ? 0 : start;\n        }\n        val = val.slice(acc.start);\n        if (val) {\n          acc.result.push(val);\n        }\n        return acc;\n      },\n      { result: [], start: 0 }\n    )\n    .result.join('\\n');\n}\n\nfunction escape(html: string) {\n  // The current version of TypeScript is not aware of String.replaceAll.\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return (html as any)?.replaceAll('<', '&lt;')?.replaceAll('>', '&gt;');\n}\n"],
-  "mappings": "AAAA,AAWO,WAAyB,CAqB9B,YAAoB,EAAiB,CAAjB,UAsEZ,eAAY,AAAC,GAAkB,CACrC,KAAK,YAAe,GAAQ,KAAK,OAAO,QAAU,KAAK,OAAO,OAC9D,OAAW,KAAK,MAAK,KACnB,EAAE,UAAU,OAAO,2BAErB,KAAK,KAAK,KAAK,aAAa,UAAU,IAAI,2BAC1C,OAAW,KAAK,MAAK,OACnB,EAAE,aAAa,cAAe,QAEhC,KAAK,OAAO,KAAK,aAAa,gBAAgB,eAC9C,KAAK,WAAW,YAAc,SAAY,MAAK,YAAc,GAAK,OAAS,KAAK,OAAO,QA/EvF,KAAK,OAAS,MAAM,KAAK,EAAG,iBAAiB,uB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AA;AAAA,WAOjF,eAAe,OACb,WACA,aAAc,YAAY,CACxB,aAAc,CACZ,QAnGN,MAoGM,KAAK,MAAM,YAAY,UAAW,YAClC,GAAM,GAAW,KAAK,aAAa,YACnC,GAAI,CAAC,EAAU,OACf,GAAM,GAAO,OAAS,aAAS,cAAc,KAAvB,cAAkC,WACxD,KAAK,UAAY;AAAA,kCACW;AAAA,WAMlC,eAAe,OACb,eACA,aAAc,YAAY,CACxB,aAAc,CACZ,QAnHN,MAoHM,KAAK,MAAM,YAAY,UAAW,YAClC,GAAM,GAAO,KAAK,UACZ,EAAS,KAAK,GAAK,QAAQ,KAAK,MAAQ,GAC9C,KAAK,gBAAgB,MACrB,GAAI,GAAS,wCAA0C,EAAO,EAAK,IAAS,SAC5E,AAAI,KAAK,aAAa,cACpB,GAAS,sEAAsE,eAEjF,KAAK,UAAY,QAAQ,KAAU,WAAc,IACjD,QAAK,cAAc,SAAnB,QAA2B,iBAAiB,QAAS,IAAM,CACzD,UAAU,UAAU,UAAU,QAYtC,WAAc,EAAc,CAC1B,MAAO,GACJ,MAAM;AAAA,GACN,OACC,CAAC,EAAK,IAAQ,CACZ,GAAI,EAAI,OAAO,SAAW,EAAG,CAC3B,GAAM,GAAQ,EAAI,QAAQ,KAC1B,EAAI,MAAQ,IAAU,GAAK,EAAI,EAEjC,SAAM,EAAI,MAAM,EAAI,OAChB,GACF,EAAI,OAAO,KAAK,GAEX,GAET,CAAE,OAAQ,GAAI,MAAO,IAEtB,OAAO,KAAK;AAAA,GAGjB,WAAgB,EAAc,CA9J9B,MAiKE,MAAQ,oBAAc,WAAW,IAAK,UAA9B,cAAuC,WAAW,IAAK",
+  "sourcesContent": ["/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * Carousel Controller adds event listeners, accessibilty enhancements, and\n * control elements to a carousel component.\n */\nexport class CarouselController {\n  /**\n   * slides is a collection of slides in the carousel.\n   */\n  private slides: HTMLLIElement[];\n  /**\n   * dots is a collection of dot navigation controls, added to the carousel\n   * by this controller.\n   */\n  private dots: HTMLElement[];\n  /**\n   * liveRegion is a visually hidden element that notifies assitive devices\n   * of visual changes to the carousel. They are added to the carousel by\n   * this controller.\n   */\n  private liveRegion: HTMLElement;\n  /**\n   * activeIndex is the 0-index of the currently active slide.\n   */\n  private activeIndex: number;\n\n  constructor(private el: HTMLElement) {\n    this.slides = Array.from(el.querySelectorAll('.go-Carousel-slide'));\n    this.dots = [];\n    this.liveRegion = document.createElement('div');\n    this.activeIndex = Number(el.getAttribute('data-slide-index') ?? 0);\n\n    this.initSlides();\n    this.initArrows();\n    this.initDots();\n    this.initLiveRegion();\n  }\n\n  private initSlides() {\n    for (const [i, v] of this.slides.entries()) {\n      if (i === this.activeIndex) continue;\n      v.setAttribute('aria-hidden', 'true');\n    }\n  }\n\n  private initArrows() {\n    const arrows = document.createElement('ul');\n    arrows.classList.add('go-Carousel-arrows');\n    arrows.innerHTML = `\n      <li>\n        <button class=\"go-Carousel-prevSlide\" aria-label=\"Go to previous slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_left_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n      <li>\n        <button class=\"go-Carousel-nextSlide\" aria-label=\"Go to next slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_right_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n    `;\n    arrows\n      .querySelector('.go-Carousel-prevSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex - 1));\n    arrows\n      .querySelector('.go-Carousel-nextSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex + 1));\n    this.el.append(arrows);\n  }\n\n  private initDots() {\n    const dots = document.createElement('ul');\n    dots.classList.add('go-Carousel-dots');\n    for (let i = 0; i < this.slides.length; i++) {\n      const li = document.createElement('li');\n      const button = document.createElement('button');\n      button.classList.add('go-Carousel-dot');\n      if (i === this.activeIndex) {\n        button.classList.add('go-Carousel-dot--active');\n      }\n      button.innerHTML = `<span class=\"go-Carousel-obscured\">Slide ${i + 1}</span>`;\n      button.addEventListener('click', () => this.setActive(i));\n      li.append(button);\n      dots.append(li);\n      this.dots.push(button);\n    }\n    this.el.append(dots);\n  }\n\n  private initLiveRegion() {\n    this.liveRegion.setAttribute('aria-live', 'polite');\n    this.liveRegion.setAttribute('aria-atomic', 'true');\n    this.liveRegion.setAttribute('class', 'go-Carousel-obscured');\n    this.liveRegion.textContent = `Slide ${this.activeIndex + 1} of ${this.slides.length}`;\n    this.el.appendChild(this.liveRegion);\n  }\n\n  private setActive = (index: number) => {\n    this.activeIndex = (index + this.slides.length) % this.slides.length;\n    this.el.setAttribute('data-slide-index', String(this.activeIndex));\n    for (const d of this.dots) {\n      d.classList.remove('go-Carousel-dot--active');\n    }\n    this.dots[this.activeIndex].classList.add('go-Carousel-dot--active');\n    for (const s of this.slides) {\n      s.setAttribute('aria-hidden', 'true');\n    }\n    this.slides[this.activeIndex].removeAttribute('aria-hidden');\n    this.liveRegion.textContent = 'Slide ' + (this.activeIndex + 1) + ' of ' + this.slides.length;\n  };\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { TreeNavController } from './tree.js';\n\nexport class SelectNavController {\n  constructor(private el: Element) {\n    this.el.addEventListener('change', e => {\n      const target = e.target as HTMLSelectElement;\n      let href = target.value;\n      if (!target.value.startsWith('/')) {\n        href = '/' + href;\n      }\n      window.location.href = href;\n    });\n  }\n}\n\nexport function makeSelectNav(tree: TreeNavController): HTMLLabelElement {\n  const label = document.createElement('label');\n  label.classList.add('go-Label');\n  label.setAttribute('aria-label', 'Menu');\n  const select = document.createElement('select');\n  select.classList.add('go-Select', 'js-selectNav');\n  label.appendChild(select);\n  const outline = document.createElement('optgroup');\n  outline.label = 'Outline';\n  select.appendChild(outline);\n  const groupMap: Record<string, HTMLOptGroupElement> = {};\n  let group: HTMLOptGroupElement;\n  for (const t of tree.treeitems) {\n    if (Number(t.depth) > 4) continue;\n    if (t.groupTreeitem) {\n      group = groupMap[t.groupTreeitem.label];\n      if (!group) {\n        group = groupMap[t.groupTreeitem.label] = document.createElement('optgroup');\n        group.label = t.groupTreeitem.label;\n        select.appendChild(group);\n      }\n    } else {\n      group = outline;\n    }\n    const o = document.createElement('option');\n    o.label = t.label;\n    o.textContent = t.label;\n    o.value = (t.el as HTMLAnchorElement).href.replace(window.location.origin, '').replace('/', '');\n    group.appendChild(o);\n  }\n  tree.addObserver(t => {\n    const hash = (t.el as HTMLAnchorElement).hash;\n    const value = select.querySelector<HTMLOptionElement>(`[value$=\"${hash}\"]`)?.value;\n    if (value) {\n      select.value = value;\n    }\n  }, 50);\n  return label;\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * TreeNavController is the navigation tree component of the documentation page.\n * It adds accessiblity attributes to a tree, observes the heading elements\n * focus the topmost link for headings visible on the page, and implements the\n * WAI-ARIA Treeview Design Pattern with full\n * [keyboard support](https://www.w3.org/TR/wai-aria-practices/examples/treeview/treeview-2/treeview-2a.html#kbd_label).\n */\nexport class TreeNavController {\n  treeitems: TreeItem[];\n\n  /**\n   * firstChars is the first character of each treeitem in the same order\n   * as this.treeitems. We use this array to set focus by character when\n   * navigating the tree with a keyboard.\n   */\n  private firstChars: string[];\n  private firstTreeitem: TreeItem | null;\n  private lastTreeitem: TreeItem | null;\n  private observerCallbacks: ((t: TreeItem) => void)[];\n\n  constructor(private el: HTMLElement) {\n    this.treeitems = [];\n    this.firstChars = [];\n    this.firstTreeitem = null;\n    this.lastTreeitem = null;\n    this.observerCallbacks = [];\n    this.init();\n  }\n\n  private init(): void {\n    this.handleResize();\n    window.addEventListener('resize', this.handleResize);\n    this.findTreeItems();\n    this.updateVisibleTreeitems();\n    this.observeTargets();\n    if (this.firstTreeitem) {\n      this.firstTreeitem.el.tabIndex = 0;\n    }\n  }\n\n  private handleResize = (): void => {\n    this.el.style.setProperty('--js-tree-height', '100vh');\n    this.el.style.setProperty('--js-tree-height', this.el.clientHeight + 'px');\n  };\n\n  private observeTargets() {\n    this.addObserver(treeitem => {\n      this.expandTreeitem(treeitem);\n      this.setSelected(treeitem);\n      // TODO: Fix scroll issue in https://golang.org/issue/47450.\n      // treeitem.el.scrollIntoView({ block: 'nearest' });\n    });\n\n    const targets = new Map<string, boolean>();\n    const observer = new IntersectionObserver(\n      entries => {\n        for (const entry of entries) {\n          targets.set(entry.target.id, entry.isIntersecting || entry.intersectionRatio === 1);\n        }\n        for (const [id, isIntersecting] of targets) {\n          if (isIntersecting) {\n            const active = this.treeitems.find(t =>\n              (t.el as HTMLAnchorElement)?.href.endsWith(`#${id}`)\n            );\n            if (active) {\n              for (const fn of this.observerCallbacks) {\n                fn(active);\n              }\n            }\n            break;\n          }\n        }\n      },\n      {\n        threshold: 1.0,\n        rootMargin: '-60px 0px 0px 0px',\n      }\n    );\n\n    for (const href of this.treeitems.map(t => t.el.getAttribute('href'))) {\n      if (href) {\n        const id = href.replace(window.location.origin, '').replace('/', '').replace('#', '');\n        const target = document.getElementById(id);\n        if (target) {\n          observer.observe(target);\n        }\n      }\n    }\n  }\n\n  addObserver(fn: (t: TreeItem) => void, delay = 200): void {\n    this.observerCallbacks.push(debounce(fn, delay));\n  }\n\n  setFocusToNextItem(currentItem: TreeItem): void {\n    let nextItem = null;\n    for (let i = currentItem.index + 1; i < this.treeitems.length; i++) {\n      const ti = this.treeitems[i];\n      if (ti.isVisible) {\n        nextItem = ti;\n        break;\n      }\n    }\n    if (nextItem) {\n      this.setFocusToItem(nextItem);\n    }\n  }\n\n  setFocusToPreviousItem(currentItem: TreeItem): void {\n    let prevItem = null;\n    for (let i = currentItem.index - 1; i > -1; i--) {\n      const ti = this.treeitems[i];\n      if (ti.isVisible) {\n        prevItem = ti;\n        break;\n      }\n    }\n    if (prevItem) {\n      this.setFocusToItem(prevItem);\n    }\n  }\n\n  setFocusToParentItem(currentItem: TreeItem): void {\n    if (currentItem.groupTreeitem) {\n      this.setFocusToItem(currentItem.groupTreeitem);\n    }\n  }\n\n  setFocusToFirstItem(): void {\n    this.firstTreeitem && this.setFocusToItem(this.firstTreeitem);\n  }\n\n  setFocusToLastItem(): void {\n    this.lastTreeitem && this.setFocusToItem(this.lastTreeitem);\n  }\n\n  setSelected(currentItem: TreeItem): void {\n    for (const l1 of this.el.querySelectorAll('[aria-expanded=\"true\"]')) {\n      if (l1 === currentItem.el) continue;\n      if (!l1.nextElementSibling?.contains(currentItem.el)) {\n        l1.setAttribute('aria-expanded', 'false');\n      }\n    }\n    for (const l1 of this.el.querySelectorAll('[aria-selected]')) {\n      if (l1 !== currentItem.el) {\n        l1.setAttribute('aria-selected', 'false');\n      }\n    }\n    currentItem.el.setAttribute('aria-selected', 'true');\n    this.updateVisibleTreeitems();\n    this.setFocusToItem(currentItem, false);\n  }\n\n  expandTreeitem(treeitem: TreeItem): void {\n    let currentItem: TreeItem | null = treeitem;\n    while (currentItem) {\n      if (currentItem.isExpandable) {\n        currentItem.el.setAttribute('aria-expanded', 'true');\n      }\n      currentItem = currentItem.groupTreeitem;\n    }\n    this.updateVisibleTreeitems();\n  }\n\n  expandAllSiblingItems(currentItem: TreeItem): void {\n    for (const ti of this.treeitems) {\n      if (ti.groupTreeitem === currentItem.groupTreeitem && ti.isExpandable) {\n        this.expandTreeitem(ti);\n      }\n    }\n  }\n\n  collapseTreeitem(currentItem: TreeItem): void {\n    let groupTreeitem = null;\n\n    if (currentItem.isExpanded()) {\n      groupTreeitem = currentItem;\n    } else {\n      groupTreeitem = currentItem.groupTreeitem;\n    }\n\n    if (groupTreeitem) {\n      groupTreeitem.el.setAttribute('aria-expanded', 'false');\n      this.updateVisibleTreeitems();\n      this.setFocusToItem(groupTreeitem);\n    }\n  }\n\n  setFocusByFirstCharacter(currentItem: TreeItem, char: string): void {\n    let start: number, index: number;\n    char = char.toLowerCase();\n\n    // Get start index for search based on position of currentItem\n    start = currentItem.index + 1;\n    if (start === this.treeitems.length) {\n      start = 0;\n    }\n\n    // Check remaining slots in the menu\n    index = this.getIndexFirstChars(start, char);\n\n    // If not found in remaining slots, check from beginning\n    if (index === -1) {\n      index = this.getIndexFirstChars(0, char);\n    }\n\n    // If match was found...\n    if (index > -1) {\n      this.setFocusToItem(this.treeitems[index]);\n    }\n  }\n\n  private findTreeItems() {\n    const findItems = (el: HTMLElement, group: TreeItem | null) => {\n      let ti = group;\n      let curr = el.firstElementChild as HTMLElement;\n      while (curr) {\n        if (curr.tagName === 'A' || curr.tagName === 'SPAN') {\n          ti = new TreeItem(curr, this, group);\n          this.treeitems.push(ti);\n          this.firstChars.push(ti.label.substring(0, 1).toLowerCase());\n        }\n        if (curr.firstElementChild) {\n          findItems(curr, ti);\n        }\n        curr = curr.nextElementSibling as HTMLElement;\n      }\n    };\n    findItems(this.el as HTMLElement, null);\n    this.treeitems.map((ti, idx) => (ti.index = idx));\n  }\n\n  private updateVisibleTreeitems(): void {\n    this.firstTreeitem = this.treeitems[0];\n\n    for (const ti of this.treeitems) {\n      let parent = ti.groupTreeitem;\n      ti.isVisible = true;\n      while (parent && parent.el !== this.el) {\n        if (!parent.isExpanded()) {\n          ti.isVisible = false;\n        }\n        parent = parent.groupTreeitem;\n      }\n      if (ti.isVisible) {\n        this.lastTreeitem = ti;\n      }\n    }\n  }\n\n  private setFocusToItem(treeitem: TreeItem, focusEl = true) {\n    treeitem.el.tabIndex = 0;\n    if (focusEl) {\n      treeitem.el.focus();\n    }\n    for (const ti of this.treeitems) {\n      if (ti !== treeitem) {\n        ti.el.tabIndex = -1;\n      }\n    }\n  }\n\n  private getIndexFirstChars(startIndex: number, char: string): number {\n    for (let i = startIndex; i < this.firstChars.length; i++) {\n      if (this.treeitems[i].isVisible && char === this.firstChars[i]) {\n        return i;\n      }\n    }\n    return -1;\n  }\n}\n\nclass TreeItem {\n  el: HTMLElement;\n  groupTreeitem: TreeItem | null;\n  label: string;\n  isExpandable: boolean;\n  isVisible: boolean;\n  depth: number;\n  index: number;\n\n  private tree: TreeNavController;\n  private isInGroup: boolean;\n\n  constructor(el: HTMLElement, treeObj: TreeNavController, group: TreeItem | null) {\n    el.tabIndex = -1;\n    this.el = el;\n    this.groupTreeitem = group;\n    this.label = el.textContent?.trim() ?? '';\n    this.tree = treeObj;\n    this.depth = (group?.depth || 0) + 1;\n    this.index = 0;\n\n    const parent = el.parentElement;\n    if (parent?.tagName.toLowerCase() === 'li') {\n      parent?.setAttribute('role', 'none');\n    }\n    el.setAttribute('aria-level', this.depth + '');\n    if (el.getAttribute('aria-label')) {\n      this.label = el?.getAttribute('aria-label')?.trim() ?? '';\n    }\n\n    this.isExpandable = false;\n    this.isVisible = false;\n    this.isInGroup = !!group;\n\n    let curr = el.nextElementSibling;\n    while (curr) {\n      if (curr.tagName.toLowerCase() == 'ul') {\n        const groupId = `${group?.label ?? ''} nav group ${this.label}`.replace(/[\\W_]+/g, '_');\n        el.setAttribute('aria-owns', groupId);\n        el.setAttribute('aria-expanded', 'false');\n        curr.setAttribute('role', 'group');\n        curr.setAttribute('id', groupId);\n        this.isExpandable = true;\n        break;\n      }\n\n      curr = curr.nextElementSibling;\n    }\n    this.init();\n  }\n\n  private init() {\n    this.el.tabIndex = -1;\n    if (!this.el.getAttribute('role')) {\n      this.el.setAttribute('role', 'treeitem');\n    }\n    this.el.addEventListener('keydown', this.handleKeydown.bind(this));\n    this.el.addEventListener('click', this.handleClick.bind(this));\n    this.el.addEventListener('focus', this.handleFocus.bind(this));\n    this.el.addEventListener('blur', this.handleBlur.bind(this));\n  }\n\n  isExpanded() {\n    if (this.isExpandable) {\n      return this.el.getAttribute('aria-expanded') === 'true';\n    }\n\n    return false;\n  }\n\n  isSelected() {\n    return this.el.getAttribute('aria-selected') === 'true';\n  }\n\n  private handleClick(event: MouseEvent) {\n    // only process click events that directly happened on this treeitem\n    if (event.target !== this.el && event.target !== this.el.firstElementChild) {\n      return;\n    }\n    if (this.isExpandable) {\n      if (this.isExpanded() && this.isSelected()) {\n        this.tree.collapseTreeitem(this);\n      } else {\n        this.tree.expandTreeitem(this);\n      }\n      event.stopPropagation();\n    }\n    this.tree.setSelected(this);\n  }\n\n  private handleFocus() {\n    let el = this.el;\n    if (this.isExpandable) {\n      el = (el.firstElementChild as HTMLElement) ?? el;\n    }\n    el.classList.add('focus');\n  }\n\n  private handleBlur() {\n    let el = this.el;\n    if (this.isExpandable) {\n      el = (el.firstElementChild as HTMLElement) ?? el;\n    }\n    el.classList.remove('focus');\n  }\n\n  private handleKeydown(event: KeyboardEvent) {\n    if (event.altKey || event.ctrlKey || event.metaKey) {\n      return;\n    }\n\n    let captured = false;\n    switch (event.key) {\n      case ' ':\n      case 'Enter':\n        if (this.isExpandable) {\n          if (this.isExpanded() && this.isSelected()) {\n            this.tree.collapseTreeitem(this);\n          } else {\n            this.tree.expandTreeitem(this);\n          }\n          captured = true;\n        } else {\n          event.stopPropagation();\n        }\n        this.tree.setSelected(this);\n        break;\n\n      case 'ArrowUp':\n        this.tree.setFocusToPreviousItem(this);\n        captured = true;\n        break;\n\n      case 'ArrowDown':\n        this.tree.setFocusToNextItem(this);\n        captured = true;\n        break;\n\n      case 'ArrowRight':\n        if (this.isExpandable) {\n          if (this.isExpanded()) {\n            this.tree.setFocusToNextItem(this);\n          } else {\n            this.tree.expandTreeitem(this);\n          }\n        }\n        captured = true;\n        break;\n\n      case 'ArrowLeft':\n        if (this.isExpandable && this.isExpanded()) {\n          this.tree.collapseTreeitem(this);\n          captured = true;\n        } else {\n          if (this.isInGroup) {\n            this.tree.setFocusToParentItem(this);\n            captured = true;\n          }\n        }\n        break;\n\n      case 'Home':\n        this.tree.setFocusToFirstItem();\n        captured = true;\n        break;\n\n      case 'End':\n        this.tree.setFocusToLastItem();\n        captured = true;\n        break;\n\n      default:\n        if (event.key.length === 1 && event.key.match(/\\S/)) {\n          if (event.key == '*') {\n            this.tree.expandAllSiblingItems(this);\n          } else {\n            this.tree.setFocusByFirstCharacter(this, event.key);\n          }\n          captured = true;\n        }\n        break;\n    }\n\n    if (captured) {\n      event.stopPropagation();\n      event.preventDefault();\n    }\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction debounce<T extends (...args: any[]) => any>(func: T, wait: number) {\n  let timeout: ReturnType<typeof setTimeout> | null;\n  return (...args: Parameters<T>) => {\n    const later = () => {\n      timeout = null;\n      func(...args);\n    };\n    if (timeout) {\n      clearTimeout(timeout);\n    }\n    timeout = setTimeout(later, wait);\n  };\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { CarouselController } from '../../shared/carousel/carousel';\nimport { SelectNavController, makeSelectNav } from '../../shared/outline/select';\nimport { TreeNavController } from '../../shared/outline/tree';\n\nwindow.addEventListener('load', () => {\n  const tree = document.querySelector<HTMLElement>('.js-tree');\n  if (tree) {\n    const treeCtrl = new TreeNavController(tree);\n    const select = makeSelectNav(treeCtrl);\n    document.querySelector('.js-mainNavMobile')?.appendChild(select);\n  }\n\n  const guideTree = document.querySelector<HTMLElement>('.Outline .js-tree');\n  if (guideTree) {\n    const treeCtrl = new TreeNavController(guideTree);\n    const select = makeSelectNav(treeCtrl);\n    document.querySelector('.Outline .js-select')?.appendChild(select);\n  }\n\n  for (const el of document.querySelectorAll('.js-toggleTheme')) {\n    el.addEventListener('click', e => {\n      const value = (e.currentTarget as HTMLButtonElement).getAttribute('data-value');\n      document.documentElement.setAttribute('data-theme', String(value));\n    });\n  }\n  for (const el of document.querySelectorAll('.js-toggleLayout')) {\n    el.addEventListener('click', e => {\n      const value = (e.currentTarget as HTMLButtonElement).getAttribute('data-value');\n      document.documentElement.setAttribute('data-layout', String(value));\n    });\n  }\n\n  for (const el of document.querySelectorAll<HTMLSelectElement>('.js-selectNav')) {\n    new SelectNavController(el);\n  }\n\n  for (const el of document.querySelectorAll<HTMLSelectElement>('.js-carousel')) {\n    new CarouselController(el);\n  }\n});\n\ncustomElements.define(\n  'go-color',\n  class extends HTMLElement {\n    constructor() {\n      super();\n      this.style.setProperty('display', 'contents');\n      // The current version of TypeScript is not aware of String.replaceAll.\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const name = this.id as any;\n      this.removeAttribute('id');\n      this.innerHTML = `\n        <div style=\"--color: var(${name});\" class=\"GoColor-circle\"></div>\n        <span>\n          <div id=\"${name}\" class=\"go-textLabel GoColor-title\">${name\n        .replace('--color-', '')\n        .replaceAll('-', ' ')}</div>\n          <pre class=\"StringifyElement-markup\">var(${name})</pre>\n        </span>\n      `;\n      this.querySelector('pre')?.addEventListener('click', () => {\n        navigator.clipboard.writeText(`var(${name})`);\n      });\n    }\n  }\n);\n\ncustomElements.define(\n  'go-icon',\n  class extends HTMLElement {\n    constructor() {\n      super();\n      this.style.setProperty('display', 'contents');\n      // The current version of TypeScript is not aware of String.replaceAll.\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      const name = this.getAttribute('name') as any;\n      this.innerHTML = `<p id=\"icon-${name}\" class=\"go-textLabel GoIcon-title\">${name.replaceAll(\n        '_',\n        ' '\n      )}</p>\n        <stringify-el>\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/${name}_gm_grey_24dp.svg\" alt=\"\">\n        </stringify-el>\n      `;\n    }\n  }\n);\n\ncustomElements.define(\n  'clone-el',\n  class extends HTMLElement {\n    constructor() {\n      super();\n      this.style.setProperty('display', 'contents');\n      const selector = this.getAttribute('selector');\n      if (!selector) return;\n      const html = '    ' + document.querySelector(selector)?.outerHTML;\n      this.innerHTML = `\n        <stringify-el collapsed>${html}</stringify-el>\n      `;\n    }\n  }\n);\n\ncustomElements.define(\n  'stringify-el',\n  class extends HTMLElement {\n    constructor() {\n      super();\n      this.style.setProperty('display', 'contents');\n      const html = this.innerHTML;\n      const idAttr = this.id ? ` id=\"${this.id}\"` : '';\n      this.removeAttribute('id');\n      let markup = `<pre class=\"StringifyElement-markup\">` + escape(trim(html)) + `</pre>`;\n      if (this.hasAttribute('collapsed')) {\n        markup = `<details class=\"StringifyElement-details\"><summary>Markup</summary>${markup}</details>`;\n      }\n      this.innerHTML = `<span${idAttr}>${html}</span>${markup}`;\n      this.querySelector('pre')?.addEventListener('click', () => {\n        navigator.clipboard.writeText(html);\n      });\n    }\n  }\n);\n\n/**\n * trim removes excess indentation from html markup by\n * measuring the number of spaces in the first line of\n * the given string and removing that number of spaces\n * from the beginning of each line.\n */\nfunction trim(html: string) {\n  return html\n    .split('\\n')\n    .reduce<{ result: string[]; start: number }>(\n      (acc, val) => {\n        if (acc.result.length === 0) {\n          const start = val.indexOf('<');\n          acc.start = start === -1 ? 0 : start;\n        }\n        val = val.slice(acc.start);\n        if (val) {\n          acc.result.push(val);\n        }\n        return acc;\n      },\n      { result: [], start: 0 }\n    )\n    .result.join('\\n');\n}\n\nfunction escape(html: string) {\n  // The current version of TypeScript is not aware of String.replaceAll.\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return (html as any)?.replaceAll('<', '&lt;')?.replaceAll('>', '&gt;');\n}\n"],
+  "mappings": "AAAA,AAWO,WAAyB,CAqB9B,YAAoB,EAAiB,CAAjB,UAsEZ,eAAY,AAAC,GAAkB,CACrC,KAAK,YAAe,GAAQ,KAAK,OAAO,QAAU,KAAK,OAAO,OAC9D,KAAK,GAAG,aAAa,mBAAoB,OAAO,KAAK,cACrD,OAAW,KAAK,MAAK,KACnB,EAAE,UAAU,OAAO,2BAErB,KAAK,KAAK,KAAK,aAAa,UAAU,IAAI,2BAC1C,OAAW,KAAK,MAAK,OACnB,EAAE,aAAa,cAAe,QAEhC,KAAK,OAAO,KAAK,aAAa,gBAAgB,eAC9C,KAAK,WAAW,YAAc,SAAY,MAAK,YAAc,GAAK,OAAS,KAAK,OAAO,QAjH3F,MAiCI,KAAK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,aAAa,QAC/B,KAAK,UAAY,eAAe,wCAA2C,EAAK,WAC9E,IACA;AAAA;AAAA,iFAGyE;AAAA;AAAA,WAOjF,eAAe,OACb,WACA,aAAc,YAAY,CACxB,aAAc,CACZ,QAnGN,MAoGM,KAAK,MAAM,YAAY,UAAW,YAClC,GAAM,GAAW,KAAK,aAAa,YACnC,GAAI,CAAC,EAAU,OACf,GAAM,GAAO,OAAS,aAAS,cAAc,KAAvB,cAAkC,WACxD,KAAK,UAAY;AAAA,kCACW;AAAA,WAMlC,eAAe,OACb,eACA,aAAc,YAAY,CACxB,aAAc,CACZ,QAnHN,MAoHM,KAAK,MAAM,YAAY,UAAW,YAClC,GAAM,GAAO,KAAK,UACZ,EAAS,KAAK,GAAK,QAAQ,KAAK,MAAQ,GAC9C,KAAK,gBAAgB,MACrB,GAAI,GAAS,wCAA0C,EAAO,EAAK,IAAS,SAC5E,AAAI,KAAK,aAAa,cACpB,GAAS,sEAAsE,eAEjF,KAAK,UAAY,QAAQ,KAAU,WAAc,IACjD,QAAK,cAAc,SAAnB,QAA2B,iBAAiB,QAAS,IAAM,CACzD,UAAU,UAAU,UAAU,QAYtC,WAAc,EAAc,CAC1B,MAAO,GACJ,MAAM;AAAA,GACN,OACC,CAAC,EAAK,IAAQ,CACZ,GAAI,EAAI,OAAO,SAAW,EAAG,CAC3B,GAAM,GAAQ,EAAI,QAAQ,KAC1B,EAAI,MAAQ,IAAU,GAAK,EAAI,EAEjC,SAAM,EAAI,MAAM,EAAI,OAChB,GACF,EAAI,OAAO,KAAK,GAEX,GAET,CAAE,OAAQ,GAAI,MAAO,IAEtB,OAAO,KAAK;AAAA,GAGjB,WAAgB,EAAc,CA9J9B,MAiKE,MAAQ,oBAAc,WAAW,IAAK,UAA9B,cAAuC,WAAW,IAAK",
   "names": []
 }
diff --git a/static/shared/carousel/carousel.md b/static/shared/carousel/carousel.md
index 77fead9..03bf45d 100644
--- a/static/shared/carousel/carousel.md
+++ b/static/shared/carousel/carousel.md
@@ -5,7 +5,7 @@
 ### With Heading
 
 ```html
-<section class="go-Carousel js-carousel">
+<section class="go-Carousel js-carousel" data-slide-index="0">
   <h5>Search Tips</h2>
   <ul>
     <li class="go-Carousel-slide">
@@ -26,7 +26,7 @@
 Use aria-label to create an accessible label that is visually hidden.
 
 ```html
-<section class="go-Carousel js-carousel" aria-label="Search Tips Carousel">
+<section class="go-Carousel js-carousel" aria-label="Search Tips Carousel" data-slide-index="0">
   <ul>
     <li class="go-Carousel-slide">
       <p>Search for a package by name, for example “logrus”</p>
diff --git a/static/shared/carousel/carousel.ts b/static/shared/carousel/carousel.ts
index cf16e19..8c4d257 100644
--- a/static/shared/carousel/carousel.ts
+++ b/static/shared/carousel/carousel.ts
@@ -34,7 +34,7 @@
     this.slides = Array.from(el.querySelectorAll('.go-Carousel-slide'));
     this.dots = [];
     this.liveRegion = document.createElement('div');
-    this.activeIndex = 0;
+    this.activeIndex = Number(el.getAttribute('data-slide-index') ?? 0);
 
     this.initSlides();
     this.initArrows();
@@ -44,7 +44,7 @@
 
   private initSlides() {
     for (const [i, v] of this.slides.entries()) {
-      if (i === 0) continue;
+      if (i === this.activeIndex) continue;
       v.setAttribute('aria-hidden', 'true');
     }
   }
@@ -80,7 +80,7 @@
       const li = document.createElement('li');
       const button = document.createElement('button');
       button.classList.add('go-Carousel-dot');
-      if (i === 0) {
+      if (i === this.activeIndex) {
         button.classList.add('go-Carousel-dot--active');
       }
       button.innerHTML = `<span class="go-Carousel-obscured">Slide ${i + 1}</span>`;
@@ -102,6 +102,7 @@
 
   private setActive = (index: number) => {
     this.activeIndex = (index + this.slides.length) % this.slides.length;
+    this.el.setAttribute('data-slide-index', String(this.activeIndex));
     for (const d of this.dots) {
       d.classList.remove('go-Carousel-dot--active');
     }