import{LitElement as i,html as e,css as o}from"../../../../../lit/index.js";import{store as s}from"../../core/haxcms-site-store.js";import{autorun as t,toJS as a}from"../../../../../mobx/dist/mobx.esm.js";import{varGet as c}from"../../../../utils/utils.js";import"../../../../simple-icon/simple-icon.js";import"../../../../simple-icon/lib/simple-icons.js";import"../../../../simple-icon/lib/simple-icon-button.js";import"../../../../hax-iconset/lib/simple-hax-iconset.js";import{defineCustomElements as l}from"../../../../../web-social-share/dist/esm/loader.js";class SiteShareWidget extends i{static get tag(){return"site-share-widget"}static get styles(){return[o`
        :host {
          display: block;
        }
        simple-icon-button {
          color: #ffffff;
          background-color: var(--site-share-widget-bg);
          padding: 8px;
          margin: 0 0 0 4px;
          border-radius: 50%;
        }
        web-social-share {
          --web-social-share-zindex: 10000;
        }
        simple-icon {
          display: block;
        }
        simple-icon:hover {
          box-shadow: 0 0 20px var(--haxcms-color, #000000);
        }
      `]}render(){return e`
      <simple-icon-button
        @click="${this.click}"
        title="${this.alt}"
        icon="${this.icon}"
        dark
      ></simple-icon-button>
      <web-social-share share="false">
        <simple-icon slot="facebook" icon="mdi-social:facebook"></simple-icon>
        <simple-icon slot="twitter" icon="mdi-social:twitter"></simple-icon>
        <simple-icon slot="pinterest" icon="mdi-social:pinterest"></simple-icon>
        <simple-icon slot="linkedin" icon="mdi-social:linkedin"></simple-icon>
        <simple-icon slot="email" icon="icons:mail"></simple-icon>
        <simple-icon slot="copy" icon="icons:content-copy"></simple-icon>
      </web-social-share>
    `}constructor(){super(),l(globalThis),this.alt="Share page",this.icon="social:share",this.activeGitFileLink="",this.__disposer=[],t((i=>{s.activeItem&&(this.activeItem=a(s.activeItem)),this.__disposer.push(i)}))}click(i){if(this.shadowRoot&&this.shadowRoot.querySelector("web-social-share")){const i=globalThis.location.href,e={displayNames:!0,config:[{facebook:{socialShareUrl:i,socialSharePopupWidth:400,socialSharePopupHeight:400}},{twitter:{socialShareUrl:i,socialSharePopupWidth:300,socialSharePopupHeight:400}},{linkedin:{socialShareUrl:i}},{pinterest:{socialShareUrl:i}},{email:{socialShareTo:c(s,"manifest.metadata.author.email",""),socialShareBody:i}},{copy:{socialShareUrl:i}}]};this.shadowRoot.querySelector("web-social-share").share=e}this.shadowRoot.querySelector("web-social-share").show=!0}disconnectedCallback(){for(var i in this.__disposer)this.__disposer[i].dispose();super.disconnectedCallback()}static get properties(){return{activeItem:{type:Object},show:{type:Boolean},alt:{type:String},icon:{type:String}}}}customElements.define(SiteShareWidget.tag,SiteShareWidget);export{SiteShareWidget};