/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
import"../polymer/polymer-legacy.js";import{Polymer as n}from"../polymer/lib/legacy/polymer-fn.js";import{html as e}from"../polymer/lib/utils/html-tag.js";export const IronA11yAnnouncer=n({_template:e`
    <style>
      :host {
        display: inline-block;
        position: fixed;
        clip: rect(0px,0px,0px,0px);
      }
    </style>
    <div aria-live$="[[mode]]">[[_text]]</div>
`,is:"iron-a11y-announcer",properties:{mode:{type:String,value:"polite"},timeout:{type:Number,value:150},_text:{type:String,value:""}},created:function(){IronA11yAnnouncer.instance||(IronA11yAnnouncer.instance=this),document.addEventListener("iron-announce",this._onIronAnnounce.bind(this))},announce:function(n){this._text="",this.async((function(){this._text=n}),this.timeout)},_onIronAnnounce:function(n){n.detail&&n.detail.text&&this.announce(n.detail.text)}});IronA11yAnnouncer.instance=null,IronA11yAnnouncer.requestAvailability=function(){IronA11yAnnouncer.instance||(IronA11yAnnouncer.instance=document.createElement("iron-a11y-announcer")),document.body?document.body.appendChild(IronA11yAnnouncer.instance):document.addEventListener("load",(function(){document.body.appendChild(IronA11yAnnouncer.instance)}))};