You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
6.8 KiB

(function(_ds){var window=this;'use strict';var jK=function(){var a=_ds.R.call(this)||this;a.K=null;a.C=!1;a.j=null;a.h=null;a.m=new _ds.Qj;a.D=null;a.G=new Promise(function(b){a.D=b});a.H=new _ds.Nj(function(){hK(a)},15);a.F=new _ds.Nj(function(){iK(a)},20);a.o=new Set;return a},lK=function(a,b){b=Array.from((void 0===b?a:b).querySelectorAll(".devsite-nav-title"));a.o=new Set(b);if(_ds.zi().hash){b=new _ds.ru;a=_ds.n(a.o);for(var c=a.next();!c.done;c=a.next())_ds.tu(b,c.value)}else kK(a,a.o)},kK=function(a,b){var c,d;_ds.E(function(e){if(1==
e.h)return _ds.u(e,DevsiteApp.whenReady(),2);c=new _ds.ru;d=function(g){g=g.target;_ds.tu(c,g);a.o.delete(g);DevsiteApp.unregisterIntersectionForElement(g)};b.forEach(function(g){try{DevsiteApp.registerIntersectionForElement(g,d)}catch(k){d({target:g})}});_ds.v(e)})},iK=function(a){a=0<a.getElementsByClassName("devsite-nav-item").length;var b=document.getElementById("devsite-hamburger-menu");b&&(a?b.removeAttribute("visually-hidden"):b.setAttribute("visually-hidden",""))},pK=function(a){a.m.listen(a,
"click",function(b){if(!b.defaultPrevented){var c=b.target;"devsite-close-nav"===c.getAttribute("id")&&(b.preventDefault(),b.stopPropagation(),a.scrollTop=0,a.hasAttribute("top-level-nav")?a.dispatchEvent(new CustomEvent("devsite-sitemask-hide",{bubbles:!0})):a.setAttribute("top-level-nav",""));if(c.hasAttribute("menu")){var d=c.getAttribute("menu");d&&mK(a,d)&&(b.preventDefault(),b.stopPropagation(),a.scrollTop=0,a.removeAttribute("top-level-nav"))}if(!(c.classList.contains("devsite-nav-toggle")||
c.classList.contains("devsite-nav-title-no-path")||c.parentElement.classList.contains("devsite-nav-title-no-path"))){a.j&&(b=a.j.querySelector("[menu=_book]"))&&b.contains(c)&&a.dispatchEvent(new CustomEvent("devsite-sitemask-hide",{bubbles:!0}));var e;c instanceof Element&&c.matches("a.devsite-nav-title")?e=c:e=_ds.Ah(c,"a","devsite-nav-title");e&&!e.classList.contains("devsite-nav-has-children")&&a.dispatchEvent(new CustomEvent("devsite-sitemask-hide",{bubbles:!0}))}}});a.m.listen(a,[nK,"focusin"],
function(b){return void oK(a,b)});a.m.listen(document.body,"devsite-sitemask-hidden",function(){a.j&&(mK(a,"_book")?a.removeAttribute("top-level-nav"):a.setAttribute("top-level-nav",""))});a.m.listen(document.body,"devsite-page-loaded",function(){return void a.F.ra()});a.m.listen(a,"devsite-content-updated",function(){a.F.ra();a.H.ra()});a.m.listen(a,"scroll",function(){return a.C=!0})},mK=function(a,b){var c=!1;Array.from(a.j.querySelectorAll("[menu]")).forEach(function(d){d.getAttribute("menu")===
b?(d.removeAttribute("hidden"),c=!0):d.setAttribute("hidden","")});return c},oK=function(a,b){b.defaultPrevented||(b=_ds.zh(b.target,function(c){return c instanceof HTMLAnchorElement&&c.hasAttribute("href")||c===a},!0),b!==a&&_ds.Dd(b,_ds.Gi(b.href).href))},qK=function(a){_ds.E(function(b){switch(b.h){case 1:return a.C=!1,_ds.u(b,_ds.Oi(),2);case 2:return hK(a),_ds.u(b,a.G,3);case 3:return _ds.u(b,DevsiteApp.whenReady(),4);case 4:return _ds.u(b,_ds.Oi(),5);case 5:hK(a),_ds.v(b)}})},rK=function(a,
b){(b=void 0===b?a:b)||(b=a);Array.from(b.getElementsByClassName("devsite-nav-active")).forEach(function(c){c.classList.remove("devsite-nav-active")});a=_ds.Si(_ds.zi().pathname);a='[href="'+_ds.Gi(a).href+'"], [href="'+a+'"],\n [alt-paths*=" '+a+' "]';Array.from(b.querySelectorAll(a)).forEach(function(c){c.classList.add("devsite-nav-active")})},sK=function(a,b){(b=void 0===b?a:b)||(b=a);var c=b.getElementsByClassName("devsite-mobile-nav-bottom")[0];if(c){var d=c.getElementsByClassName("devsite-nav-active")[0];
if(d)for(;d.parentNode&&d.parentNode!=b;)d.hasAttribute("collapsed")&&(d.removeAttribute("animatable"),_ds.Uj(a.m,d,"devsite-expandable-nav-transition-end",function(){d.setAttribute("animatable","")}),d.removeAttribute("collapsed")),d=d.parentNode}},hK=function(a){var b;_ds.E(function(c){if(1==c.h)return a.j?_ds.u(c,DevsiteApp.whenReady(),2):c.return();if(b=a.j.getElementsByClassName("devsite-nav-active")[0])a.C||tK(a,b),a.setAttribute("animatable","");_ds.v(c)})},tK=function(a,b){var c,d;_ds.E(function(e){if(1==
e.h)return c=a.C,"scrollIntoViewIfNeeded"in b?b.scrollIntoViewIfNeeded():(d=_ds.mk(b,a,!0),a.scrollTop=d.y),_ds.u(e,_ds.Oi(),2);a.C=c;_ds.v(e)})},uK=function(a){var b,c,d;_ds.E(function(e){if(1==e.h)return _ds.u(e,DevsiteApp.whenReady(),2);b=_ds.n(a.o);for(c=b.next();!c.done;c=b.next())d=c.value,DevsiteApp.unregisterIntersectionForElement(d);_ds.v(e)})},nK="onpointerover"in window?"pointerover":"mouseover";_ds.t(jK,_ds.R);_ds.f=jK.prototype;
_ds.f.connectedCallback=function(){this.h||(this.h=document.createElement("div"),this.h.classList.add("devsite-book-nav-bg"));_ds.Yg(this.h,this);iK(this);pK(this);this.Ma();this.setAttribute("animatable","");lK(this)};_ds.f.disconnectedCallback=function(){_ds.Wj(this.m);uK(this);this.o.clear();var a=document.getElementById("devsite-hamburger-menu");a&&a.setAttribute("visually-hidden","");this.h&&_ds.ah(this.h);this.removeAttribute("animatable")};
_ds.f.attributeChangedCallback=function(a){if("hidden"==a){var b=this.hasAttribute("hidden");this.dispatchEvent(new CustomEvent(b?"devsite-element-hidden":"devsite-element-visible",{bubbles:!0}));var c=document.getElementsByClassName("devsite-main-content")[0];c&&(b?c.removeAttribute("has-book-nav"):c.setAttribute("has-book-nav",""))}if("fixed"==a||"hidden"==a)b=this.hasAttribute(a),this.h&&(b?this.h.setAttribute(a,""):this.h.removeAttribute(a));"fixed"==a&&this.D()};
_ds.f.Ma=function(a){var b=this;a=void 0===a?!0:a;this.K=this.getElementsByClassName("devsite-book-nav")[0];this.j=this.getElementsByClassName("devsite-mobile-nav-bottom")[0];this.setAttribute("top-level-nav","");this.j&&this.j.querySelector("[menu=_book]")&&this.removeAttribute("top-level-nav");0===this.children.length&&this.setAttribute("hidden","");!this.hasAttribute("hidden")&&a&&(rK(this),sK(this),qK(this));this.h&&["hidden","fixed"].forEach(function(c){b.hasAttribute(c)&&b.h.setAttribute(c,
"")});!this.hasAttribute("hidden")&&this.j&&this.j.getElementsByClassName("devsite-nav-active")[0]||this.setAttribute("animatable","")};_ds.f.updateContent=function(a){var b=this;a?(this.removeAttribute("animatable"),a=a.querySelector("nav"),rK(this,a),sK(this,a),a&&(uK(this),this.o.clear(),lK(this,a)),_ds.Hl(this,this.getElementsByTagName("nav")[0],a),this.H.ra()):_ds.Xg(this);window.requestAnimationFrame(function(){b.Ma(!1)})};
_ds.fa.Object.defineProperties(jK,{observedAttributes:{configurable:!0,enumerable:!0,get:function(){return["hidden","fixed"]}}});jK.prototype.updateContent=jK.prototype.updateContent;jK.prototype.attributeChangedCallback=jK.prototype.attributeChangedCallback;jK.prototype.disconnectedCallback=jK.prototype.disconnectedCallback;jK.prototype.connectedCallback=jK.prototype.connectedCallback;try{window.customElements.define("devsite-book-nav",jK)}catch(a){console.warn("devsite.app.customElement.DevsiteBookNav",a)};})(_ds_www);