import { Component, h, Host, Prop, State } from "@stencil/core";
import { withHooks } from "@saasquatch/stencil-hooks";
import { isDemo } from "@saasquatch/component-boilerplate";
import { NavigationMenuView, } from "./sqm-navigation-menu-view";
import { useNavigationMenu } from "./useNavigationMenu";
import { getProps } from "../../utils/utils";
import deepmerge from "deepmerge";
/**
 * @uiName Navigation Menu
 * @validParents ["sqm-portal-container","div","sqm-brand","sqm-divided-layout"]
 */
export class NavigationMenu {
  constructor() {
    this.ignored = true;
    withHooks(this);
  }
  disconnectedCallback() { }
  render() {
    const props = isDemo()
      ? useNavigationMenuDemo(getProps(this))
      : useNavigationMenu(getProps(this));
    return (h(Host, { slot: "sqm-navigation-menu" },
      h(NavigationMenuView, Object.assign({}, props))));
  }
  static get is() { return "sqm-navigation-menu"; }
  static get encapsulation() { return "shadow"; }
  static get originalStyleUrls() { return {
    "$": ["sqm-navigation-menu.scss"]
  }; }
  static get styleUrls() { return {
    "$": ["sqm-navigation-menu.css"]
  }; }
  static get properties() { return {
    "includeDropdown": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Include dropdown menu",
            "name": "uiName"
          }],
        "text": ""
      },
      "attribute": "include-dropdown",
      "reflect": false
    },
    "menuLabel": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [{
            "text": "Menu label",
            "name": "uiName"
          }],
        "text": "Label on the header menu"
      },
      "attribute": "menu-label",
      "reflect": false
    },
    "demoData": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "DemoData<NavigationMenuViewProps>",
        "resolved": "{ states?: { includeDropdown: boolean; styles: { menuLabel: string; }; }; ref?: { current: any; }; }",
        "references": {
          "DemoData": {
            "location": "import",
            "path": "../../global/demo"
          },
          "NavigationMenuViewProps": {
            "location": "import",
            "path": "./sqm-navigation-menu-view"
          }
        }
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [{
            "text": undefined,
            "name": "undocumented"
          }, {
            "text": "object",
            "name": "uiType"
          }],
        "text": ""
      }
    }
  }; }
  static get states() { return {
    "ignored": {}
  }; }
}
function useNavigationMenuDemo(props) {
  return deepmerge({
    states: {
      includeDropdown: true,
      styles: {
        ...props,
        menuLabel: "Menu",
      },
    },
    callbacks: {
      rerender: () => { },
    },
    ref: { current: undefined },
  }, props.demoData || {}, { arrayMerge: (_, a) => a });
}
