import{r as s,h as e,H as i,g as t}from"./p-5925f187.js";import{b as a}from"./p-e48090a7.js";import{r}from"./p-4fb8ce4b.js";import"./p-e9c4f463.js";const h=class{constructor(e){s(this,e);this.regions={};this.messagesQueue=a({delay:500});this.id=r("aria-live-");this.regions={}}onFindAriaLive({detail:s}){if(!s.element||!this.isInSearchInterface){s.element=this.host}}get isInSearchInterface(){let s=this.host;while(s){if(s.tagName==="ATOMIC-SEARCH-INTERFACE"){return true}s=s.parentElement}return false}async updateMessage(s,e,i){const t=()=>this.regions={...this.regions,[s]:{assertive:i,message:e}};if(e){this.messagesQueue.enqueue(t,s)}else{this.messagesQueue.cancelActionIfQueued(s);t()}}async registerRegion(s,e){if(s in this.regions){return}this.regions={...this.regions,[s]:{assertive:e,message:""}}}disconnectedCallback(){this.messagesQueue.clear()}render(){return e(i,{key:"30c575d25e6ae03303ff9a1bab7a5ce9b11bc096",style:{position:"absolute",display:"block",height:"0",overflow:"hidden",margin:"0"}},Object.entries(this.regions).map((([s,{assertive:i,message:t}])=>e("div",{key:s,id:`${this.id}-${s}`,"aria-live":i?"assertive":"polite",role:"status"},t))))}get host(){return t(this)}};export{h as atomic_aria_live}; //# sourceMappingURL=p-a0432fef.entry.js.map