1import{a as z}from"./chunk-X42WS3QT.js";import{i as F}from"./chunk-GSBPI73C.js";import"./chunk-MDFI7MM2.js";import{w as R,y as S}from"./chunk-46TIY27H.js";import{Ca as v,Gc as A,Hc as E,Ja as L,Kb as x,Lb as b,Pa as _,Tb as P,Ub as O,Vb as c,Wb as h,Xb as w,Yb as d,fc as I,gd as B,hb as a,jd as C,nd as D,oa as s,qc as T,sb as l,sc as m,ta as p,ua as k,wb as M,ya as H,za as y}from"./chunk-ZKNABTT2.js";var $=["kb-page-anchor-menu",""],q=(r,o)=>o.href;function j(r,o){if(r&1){let n=I();h(0,"li")(1,"a",0),T("click",function(){let t=p(n).$implicit,i=m();return k(i.handleItemClick(t.href))})("keypress.enter",function(){let t=p(n).$implicit,i=m();return k(i.handleItemClick(t.href))}),d(2,"span",1),h(3,"span",2),A(4),w()()()}if(r&2){let n=o.$implicit,e=m();a(),c("routerLink",e.getRouterLink(n.href))("fragment",e.getFragmentValue(n.href)),b("aria-current",e.isActive(n)?"location":null),a(3),E(n.label)}}var V=(()=>{let o=class o{constructor(){this.urlSchemeRegex=new RegExp("^[a-z0-9]+:","i"),this.scrollTolerancePx=1,this.clickedItemLockTimeoutMs=150,this.ariaLabel=C("Page sections"),this.items=C.required(),this.activeHref=v(null),this.destroyRef=s(y),this.cdr=s(D),this.document=s(H),this.viewportScroller=s(S),this.platformId=s(_),this.isBrowser=R(this.platformId),this.viewInitialized=v(!1),this.observer=null,this.observedElements=new Map,this.hashChangeHandler=null,this.scrollHandler=null,this.clickedHrefLock=null,this.clickedHrefLockReleaseArmed=!1,this.clickedHrefLockTimerId=null,this.itemsEffect=B(()=>{let e=this.items();if(this.clickedHrefLock&&!e.some(t=>t.href===this.clickedHrefLock)&&this.clearClickedHrefLock(),!!this.viewInitialized()){if(!this.isBrowser){this.activeHref.set(e[0]?.href??null);return}this.initObserver(e)}})}ngAfterViewInit(){this.viewInitialized.set(!0),!(!this.isBrowser||typeof window>"u")&&(this.scrollHandler=()=>{this.handleScroll()},window.addEventListener("scroll",this.scrollHandler,{passive:!0}),this.destroyRef.onDestroy(()=>{this.scrollHandler&&(window.removeEventListener("scroll",this.scrollHandler),this.scrollHandler=null)}),this.updateBottomActivationState())}ngOnDestroy(){this.teardownObserver(),this.hashChangeHandler&&(window.removeEventListener("hashchange",this.hashChangeHandler),this.hashChangeHandler=null),this.scrollHandler&&(window.removeEventListener("scroll",this.scrollHandler),this.scrollHandler=null),this.clearClickedHrefLock()}isActive(e){return this.activeHref()===e.href}handleItemClick(e){this.clickedHrefLock=e,this.clickedHrefLockReleaseArmed=!1,this.clearClickedHrefLockTimer(),this.activeHref()!==e&&(this.activeHref.set(e),this.cdr.markForCheck())}getRouterLink(e){let t=e.indexOf("#");return(t===-1?e:e.slice(0,t))||"."}getFragmentValue(e){let t=this.getHash(e);return t?t.slice(1):void 0}initObserver(e){if(this.teardownObserver(),this.hashChangeHandler&&typeof window<"u"&&(window.removeEventListener("hashchange",this.hashChangeHandler),this.hashChangeHandler=null),!this.isBrowser||typeof window>"u"){this.activeHref.set(e[0]?.href??null);return}let t=e.map(i=>({item:i,element:this.getTargetElement(i.href)})).filter(i=>!!i.element);if(t.length===0||typeof globalThis.IntersectionObserver>"u"){this.syncActiveHrefWithLocation();return}this.observer=new IntersectionObserver(i=>{if(this.clickedHrefLock||this.updateBottomActivationState())return;let f=i.filter(g=>g.isIntersecting).sort((g,N)=>N.intersectionRatio-g.intersectionRatio);if(f.length===0)return;let u=this.observedElements.get(f[0].target);u&&u!==this.activeHref()&&(this.activeHref.set(u),this.cdr.markForCheck())},{root:null,rootMargin:"-20% 0px -55% 0px",threshold:[.2,.5,.8]}),this.observedElements.clear();for(let i of t)this.observedElements.set(i.element,i.item.href),this.observer.observe(i.element);this.syncActiveHrefWithLocation(),this.hashChangeHandler=()=>{this.syncActiveHrefWithLocation()},window.addEventListener("hashchange",this.hashChangeHandler),this.destroyRef.onDestroy(()=>{this.hashChangeHandler&&(window.removeEventListener("hashchange",this.hashChangeHandler),this.hashChangeHandler=null)})}teardownObserver(){this.observer?.disconnect(),this.observer=null,this.observedElements.clear()}syncActiveHrefWithLocation(){if(!this.isBrowser||typeof window>"u"||this.clickedHrefLock||this.updateBottomActivationState())return;let e=window.location.hash;if(e){let t=this.items().find(i=>this.getHash(i.href)===e);if(t){this.activeHref.set(t.href),this.cdr.markForCheck();return}}this.activeHref.set(this.items()[0]?.href??null),this.cdr.markForCheck()}handleScroll(){if(!(!this.isBrowser||typeof window>"u")){if(this.clickedHrefLock)if(this.clickedHrefLockReleaseArmed)this.clearClickedHrefLock();else{this.armClickedHrefLockRelease();return}this.updateBottomActivationState()}}updateBottomActivationState(){if(!this.isBrowser||typeof window>"u"||!this.isScrolledToBottom())return!1;let e=this.items().at(-1);return e?(this.activeHref()!==e.href&&(this.activeHref.set(e.href),this.cdr.markForCheck()),!0):!1}armClickedHrefLockRelease(){typeof window>"u"||(this.clearClickedHrefLockTimer(),this.clickedHrefLockTimerId=window.setTimeout(()=>{this.clickedHrefLockReleaseArmed=!0,this.clickedHrefLockTimerId=null},this.clickedItemLockTimeoutMs))}clearClickedHrefLock(){this.clickedHrefLock=null,this.clickedHrefLockReleaseArmed=!1,this.clearClickedHrefLockTimer()}clearClickedHrefLockTimer(){this.clickedHrefLockTimerId===null||typeof window>"u"||(window.clearTimeout(this.clickedHrefLockTimerId),this.clickedHrefLockTimerId=null)}isScrolledToBottom(){let e=this.document.scrollingElement??this.document.documentElement,[,t]=this.viewportScroller.getScrollPosition(),i=window.innerHeight||this.document.documentElement.clientHeight||0;return t+i>=e.scrollHeight-this.scrollTolerancePx}getTargetElement(e){let t=this.getHash(e);if(!t)return null;let i=t.slice(1);return i?this.document.getElementById(i):null}getHash(e){let t=e.indexOf("#");return t===-1?"":e.slice(t)}};o.\u0275fac=function(t){return new(t||o)}
1,o.\u0275cmp=l({type:o,selectors:[["nav","kb-page-anchor-menu",""]],hostVars:1,hostBindings:function(t,i){t&2&&b("aria-label",i.ariaLabel())},inputs:{ariaLabel:[1,"ariaLabel"],items:[1,"items"]},attrs:$,decls:3,vars:0,consts:[["kb-link","","queryParamsHandling","preserve","tabindex","0",3,"click","keypress.enter","routerLink","fragment"],["aria-hidden","true",1,"marker"],[1,"label"]],template:function(t,i){t&1&&(h(0,"ul"),P(1,j,5,4,"li",null,q),w()),t&2&&(a(),O(i.items()))},dependencies:[F],styles:['[_nghost-%COMP%]{position:fixed;inset-inline-end:0;top:50%;transform:translateY(-50%);z-index:10;display:inline-flex;padding:var(--kb-gap--inner-column--text) var(--kb-gap--inner-row--text);background-color:var(--kb-color--secondary-variant);color:var(--kb-color--on-background--high);border-inline-start:.0625rem solid var(--kb-color--on-background--low-variant);font-size:var(--kb-typography--size-extra-small);line-height:var(--kb-typography--height-extra-small)}[_nghost-%COMP%]:hover .label[_ngcontent-%COMP%], [_nghost-%COMP%]:focus-within .label[_ngcontent-%COMP%]{max-width:18rem;opacity:1;transform:translate(0)}[_nghost-%COMP%] ul[_ngcontent-%COMP%]{display:grid;gap:var(--kb-gap--inner-column);margin:0;padding:0;list-style:none}[_nghost-%COMP%] li[_ngcontent-%COMP%]{position:relative;padding-inline-start:calc(var(--kb-gap--outer-row) + var(--kb-gap--inner-column--text))}[_nghost-%COMP%] li[_ngcontent-%COMP%]:not(:last-child):after{content:"";position:absolute;inset-inline-start:calc(var(--kb-gap--outer-row) / 2);top:calc(50% + var(--kb-typography--size-extra-extra-small) / 2);bottom:calc((var(--kb-gap--inner-column) + calc(var(--kb-gap--outer-row) + var(--kb-gap--inner-column--text)) / 2) * -1);width:var(--kb-width--outline);background-color:var(--kb-color--primary);transform:translate(-50%)}[_nghost-%COMP%] a[_ngcontent-%COMP%]{display:inline-flex;align-items:center;outline:none}[_nghost-%COMP%] a[_ngcontent-%COMP%]:focus-visible{outline:var(--kb-width--outline) solid var(--kb-color--primary);outline-offset:var(--kb-gap--inner-column--text) var(--kb-gap--inner-row--text)}[_nghost-%COMP%] [kb-link][_ngcontent-%COMP%]{text-decoration:none}[_nghost-%COMP%] .marker[_ngcontent-%COMP%]{position:absolute;inset-inline-start:calc(var(--kb-gap--outer-row) / 2);top:50%;width:var(--kb-typography--size-extra-extra-small);height:var(--kb-typography--size-extra-extra-small);background-color:var(--kb-color--primary);transform:translate(-50%,-50%);transition:width var(--kb-speed--slow),height var(--kb-speed--slow)}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{max-width:0;overflow:hidden;opacity:0;white-space:nowrap;transform:translate(-var(--kb-gap--inner-row--text));transition:max-width var(--kb-speed--slow),opacity var(--kb-speed--slow),transform var(--kb-speed--slow);font-size:var(--kb-typography--size-normal);line-height:var(--kb-typography--height-normal)}[_nghost-%COMP%] [aria-current][_ngcontent-%COMP%]{font-weight:700}[_nghost-%COMP%] [aria-current][_ngcontent-%COMP%] .marker[_ngcontent-%COMP%]{width:var(--kb-typography--size-large);height:var(--kb-typography--size-large);background-color:var(--kb-color--on-background--high)}'],changeDetection:0});let r=o;return r})();var ee=(()=>{class r extends z{static \u0275fac=(()=>{let n;return function(t){return(n||(n=L(r)))(t||r)}})();static \u0275cmp=l({type:r,selectors:[["app-page-anchor-menu"]],features:[M],decls:1,vars:2,consts:[["kb-page-anchor-menu","",3,"ariaLabel","items"]],template:function(e,t){e&1&&d(0,"nav",0),e&2&&(x("ariaLabel",t.attributes.ariaLabel??"Page sections"),c("items",t.attributes.items))},dependencies:[V],encapsulation:2,changeDetection:0})}return r})();export{ee as PageAnchorMenuComponent}; 2/**i18n:9b2f1e34af068233b6abd63a66684d4e9dbff90014448b8ec97e38af3af71f01*/ 3//# sourceMappingURL=chunk-I2Q3YGL5.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.