import{Bc as u,Ed as c,Ja as n,Qb as o,Sa as s,Wa as l,xa as r}from"./chunk-O7RN3KYY.js";import{a}from"./chunk-ZE2KCNEA.js";a();var g=(()=>{class i{constructor(){this.el=r(l),this.target=c(),this.newWindowSuffix=$localize`:suffix for links that will open in new window: (opens in a new window)`,this.originalAriaLabel=void 0,s(()=>this.updateAriaLabel());let e=this.el.nativeElement;if(e instanceof HTMLAnchorElement){let t=new MutationObserver(()=>this.updateAriaLabel());t.observe(e,{childList:!0,characterData:!0,subtree:!0,attributes:!0,attributeFilter:["title","href"]}),r(n).onDestroy(()=>t.disconnect())}}updateAriaLabel(){let e=this.el.nativeElement;if(e instanceof HTMLAnchorElement)if(this.originalAriaLabel===void 0&&(this.originalAriaLabel=e.getAttribute("aria-label")),this.target()==="_blank"){let t=this.originalAriaLabel||e.title||e.innerText||e.textContent||e.href;e.setAttribute("aria-label",t+this.newWindowSuffix)}else this.originalAriaLabel===null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",this.originalAriaLabel)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275dir=o({type:i,selectors:[["a","target",""]],hostVars:1,hostBindings:function(t,f){t&2&&u("target",f.target())},inputs:{target:[1,"target"]}})}}return i})();export{g as a};