text: define(["exports","require","../../../../../lit-element/lit-element.js","../../core/haxcms-site-store.js","../../../../../mobx/lib/mobx.module.js","../../../../../@polymer/polymer/lib/elements/custom-style.js"],(function(e,t,i,s,a,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SiteMenu=void 0,t=babelHelpers.interopRequireWildcard(t);
  /**
     * Copyright 2019 The Pennsylvania State University
     * @license Apache-2.0, see License.md for full text.
     */
  class SiteMenu extends i.LitElement{static get styles(){return[i.css`
          :host {
            display: block;
            height: 100vh;
          }
          map-menu[disabled] {
            pointer-events: none;
            opacity: 0.5;
            background-color: grey;
          }
          map-menu:not(:defined) {
            display: none;
          }
  
          map-menu::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 4px
              var(--site-menu-scrolltrack-bg-color, rgba(56, 63, 69, 0.9));
            border-radius: 0;
            background-color: var(--site-menu-bg-color, #383f45);
          }
          map-menu::-webkit-scrollbar {
            width: 2px;
            background-color: var(--site-menu-bg-color, #383f45);
          }
          map-menu::-webkit-scrollbar-thumb {
            border-radius: 1px;
            -webkit-box-shadow: inset 0 0 4px var(--site-menu-bg-shadow, #747474);
            background-color: var(--site-menu-bg-color, #383f45);
          }
        `]}static get tag(){return"site-menu"}constructor(){super(),new Promise((e,i)=>t.default(["../../../../map-menu/map-menu.js"],e,i)),this.hideActiveIndicator=!1,this.preventAutoScroll=!1,this.trackIcon="",this.__disposer=[],(0,a.autorun)(e=>{this.routerManifest=Object.assign({},(0,a.toJS)(s.store.routerManifest)),this.__disposer.push(e)}),(0,a.autorun)(e=>{this.editMode=(0,a.toJS)(s.store.editMode),this.__disposer.push(e)})}render(){return i.html`
        <custom-style>
          <style>
            map-menu {
              @apply --site-menu;
              --map-menu-active-color: var(--site-menu-active-color);
              --map-menu-container: var(--site-menu-container);
              --map-menu-item-active-item: var(--site-menu-item-active-item);
            }
          </style>
        </custom-style>
        <map-menu
          ?disabled="${this.editMode}"
          .selected="${this.activeId}"
          .manifest="${this.routerManifest}"
          ?active-indicator="${!this.hideActiveIndicator}"
          selected="${this.activeId}"
          ?auto-scroll="${!this.preventAutoScroll}"
          @active-item="${this.mapMenuActiveChanged}"
        ></map-menu>
      `}firstUpdated(e){(0,a.autorun)(e=>{this.activeId=(0,a.toJS)(s.store.activeId),this.__disposer.push(e)})}static get properties(){return{routerManifest:{type:Object},activeId:{type:String,attribute:"active-id"},hideActiveIndicator:{type:Boolean,attribute:"hide-active-indicator"},preventAutoScroll:{type:Boolean,attribute:"prevent-auto-scroll"},trackIcon:{type:String,attribute:"track-icon"}}}disconnectedCallback(){for(var e in this.__disposer)this.__disposer[e].dispose();super.disconnectedCallback()}mapMenuActiveChanged(e){e.detail.trackIcon=this.trackIcon;let t=JSON.parse(window.localStorage.getItem("HAXCMSSystemData"));for(var i in t.manifests&&void 0===t.manifests[this.routerManifest.id]&&(t.manifests[this.routerManifest.id]={accessData:{}}),t.manifests[this.routerManifest.id].accessData||(t.manifests[this.routerManifest.id].accessData={}),t.manifests[this.routerManifest.id].accessData[e.detail.id]={timestamp:Math.floor(Date.now()/1e3),trackIcon:this.trackIcon},this.routerManifest.items)this.routerManifest.items[i].id===e.detail.id&&(this.routerManifest.items[i].metadata.accessData=t.manifests[this.routerManifest.id].accessData[e.detail.id]);window.localStorage.setItem("HAXCMSSystemData",JSON.stringify(t))}}e.SiteMenu=SiteMenu,window.customElements.define(SiteMenu.tag,SiteMenu)}));