export const __webpack_ids__=["3769"];export const __webpack_modules__={19958:function(e,r,t){e.exports=t.p+"languages.dcba936080e5be86.svg"},36403:function(e,r,t){t.r(r),t.d(r,{MDNLanguageSwitcher:()=>MDNLanguageSwitcher});var n=t(35470),o=t(14703),a=t(69535);let i=(0,o.YP)`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4m0-4h.01"/></svg>`;var l=t(43894),s=t(94722),c=t(40113);t(18399),t(32013);let MDNLanguageSwitcher=class MDNLanguageSwitcher extends(0,a.q)(o.oi){static styles=c.Z;static properties={locale:{type:String},native:{type:String},translations:{type:Array},url:{type:String},notFound:{type:Boolean,attribute:"not-found"},_preferredLocale:{state:!0}};constructor(){super(),this.translations=[],this.native="",this.locale="en-US",this.url="/",this.notFound=!1,this._preferredLocale=void 0}_notFoundFallback=new n.iQ(this,{args:()=>[this.notFound],task:async([e])=>{if(e)return await (0,l.Y)(location.pathname)}});firstUpdated(){this._preferredLocale=(0,s.aj)()}get _isLocalePreferred(){return this._preferredLocale==this.locale}_togglePreferredLocale(){this.notFound||(this._isLocalePreferred?((0,s.Oq)(),this._preferredLocale=void 0):((0,s.Yc)(this.locale),this._preferredLocale=this.locale))}render(){let{translations:e,native:r,locale:t,url:n,notFound:a}=this;return 0===e.length?o.Ld:(0,o.dy)`<div class="language-switcher">
      <mdn-dropdown>
        <button
          slot="button"
          class="language-switcher__button"
          type="button"
          aria-labelledby="current-locale"
        >
          <span id="current-locale">${r??t}</span>
        </button>
        <div
          slot="dropdown"
          class="language-switcher__dropdown"
          id="language-switcher__dropdown"
        >
          <div class="language_switcher__remember">
            <mdn-switch
              @toggle=${this._togglePreferredLocale}
              ?checked=${this._isLocalePreferred}
              >${this.l10n`Remember language`}</mdn-switch
            >
            <mdn-button
              variant="plain"
              .icon=${i}
              icon-only
              href="https://github.com/orgs/mdn/discussions/739"
              target="_blank"
              title=${this.l10n`Enable this setting to always switch to the current language when available. (Click to learn more.)`}
              >${this.l10n`Learn more`}</mdn-button
            >
          </div>
          <ul class="language-switcher__list">
            ${a?this._notFoundFallback.render({initial:()=>this._renderCurrentLocale(),pending:()=>this._renderCurrentLocale(),error:()=>this._renderCurrentLocale(),complete:e=>e?.other_translations?this._renderDropdownItems(e.other_translations,t,e.mdn_url,a):this._renderCurrentLocale()}):this._renderDropdownItems(e,t,n)}
          </ul>
        </div>
      </mdn-dropdown>
    </div>`}_renderDropdownItems(e,r,t,n=!1){return e.sort((e,r)=>e.locale.localeCompare(r.locale)).map(e=>(0,o.dy)`
          <li>
            <a
              class="language-switcher__option"
              ?data-current=${r===e.locale}
              @click=${s.Oq}
              href=${t.replace(`/${n?"en-US":r}/`,`/${e.locale}/`)}
              >${e.native}</a
            >
          </li>
        `)}_renderCurrentLocale(){return(0,o.dy)`
      <li>
        <a
          class="language-switcher__option"
          ?data-current=${!0}
          href=${this.url}
          >${this.native}</a
        >
      </li>
    `}};customElements.define("mdn-language-switcher",MDNLanguageSwitcher)},40113:function(e,r,t){t.d(r,{Z:()=>_});var n=t(14703),o=t(8081),a=t.n(o),i=t(23645),l=t.n(i),s=t(54681),c=t(61667),d=t.n(c),g=new t.U(t(19958)),u=l()(a());u.i(s.Z);var h=d()(g);u.push([e.id,`.language-switcher{position:relative}.language-switcher__button{align-items:center;background-color:initial;border:none;color:inherit;column-gap:.25rem;cursor:pointer;display:flex;font:inherit;margin:0;padding:0 .5rem}.language-switcher__button:is(:hover,:focus,[aria-expanded=true]){background-color:var(--color-background-secondary)}@media screen and (width <= 480px){.language-switcher__button>span{display:none}}.language-switcher__button:before{background-color:currentcolor;content:"";height:1.25rem;-webkit-mask-image:url(${h});mask-image:url(${h});-webkit-mask-size:cover;mask-size:cover;width:1.25rem}.language-switcher__dropdown{background-color:var(--color-background-primary);border:1px solid var(--color-border-primary);margin:0;padding:.75rem;position:absolute;right:0;width:max-content;z-index:1}.language_switcher__remember{border-bottom:1px solid var(--color-border-primary);display:flex;font-size:var(--font-size-small);place-items:center;width:100%}.language_switcher__remember mdn-switch{padding:.25rem}:is(.language_switcher__remember mdn-switch):hover{background-color:var(--color-background-secondary)}.language-switcher__list{background-color:var(--color-background-primary);list-style:none;margin:0;padding:0;width:100%}.language-switcher__option{align-items:center;background-color:initial;border:none;color:var(--color-text-primary);column-gap:.25rem;display:flex;font:inherit;margin:0;padding:.25rem;-webkit-text-decoration:none;text-decoration:none;width:100%}.language-switcher__option:hover,.language-switcher__option[data-current]{background-color:var(--color-background-secondary)}`,""]);let _=(0,n.iv)([u.toString()])}};
//# sourceMappingURL=3769.029156cb25d3f10c.js.map