'use strict';

function _jade_template_fn(locals) {
  locals = locals || {};;;
  var result_of_with = function ($attrs, $helpers, JSON, propertyFilter) {
    var h = require('panel').h;
    var jade_mixins = {};
    jade_mixins['menu-content'] = function () {
      var block = this && this.block,
          attributes = this && this.attributes || {};

      return function () {
        var __jade_nodes = [];
        __jade_nodes = __jade_nodes.concat(h("div", {
          "class": {
            'pfm-container': true
          }
        }, function () {
          var __jade_nodes = [];
          __jade_nodes = __jade_nodes.concat(!propertyFilter.hasSelectedProperty() ? function () {
            var __jade_nodes = [];
            __jade_nodes = __jade_nodes.concat(h("mp-properties-screen", {
              "attrs": $helpers.filterAttributes({
                'all-events': $attrs['all-events'],
                'display-context': $helpers.getDisplayContext(),
                'event-name': $helpers.getEventName(),
                'is-blocked-people': $helpers.getIsBlockedPeople(),
                'project-has-events': $helpers.getProjectHasEvents(),
                'project-has-people': $helpers.getProjectHasPeople(),
                'project-id': $helpers.getProjectId(),
                'search-filter': $helpers.getPropertySearchFilter()
              }),
              "on": {
                clickProperty: $helpers.clickProperty
              },
              "props": $helpers.getKeydownProxyElProps()
            }));;
            return __jade_nodes;
          }.call(this) : function () {
            var __jade_nodes = [];
            __jade_nodes = __jade_nodes.concat(h("mp-property-values-screen", {
              "attrs": $helpers.filterAttributes({
                'all-events': $attrs['all-events'],
                'display-context': $helpers.getDisplayContext(),
                'event-name': propertyFilter.resourceType === $helpers.ResourceType.Event ? $helpers.getEventName() : null,
                'property-filter': JSON.stringify(propertyFilter.getAttributes()),
                'has-back-button': true,
                'project-id': $helpers.getProjectId()
              }),
              "on": {
                clickBack: $helpers.clickBackFromPropertyValues,
                changePropertyFilter: $helpers.changePropertyFilter,
                commitPropertyFilter: $helpers.commitPropertyFilter,
                draw: $helpers.dispatchDraw
              },
              "props": $helpers.getKeydownProxyElProps()
            }));;
            return __jade_nodes;
          }.call(this));;
          return __jade_nodes;
        }.call(this).filter(Boolean)));;
        return __jade_nodes;
      }.call(this);
    };
    return {
      value: h("div", {
        "class": {
          'pfm-outer': true
        }
      }, function () {
        var __jade_nodes = [];
        __jade_nodes = __jade_nodes.concat($attrs['has-drop-menu'] ? function () {
          var __jade_nodes = [];
          __jade_nodes = __jade_nodes.concat(h("mp-drop-menu", {
            "attrs": {
              open: $helpers.getOpen(),
              'prevent-close-selectors': $helpers.getPreventCloseSelectors()
            },
            "on": {
              change: $helpers.changeDropMenu
            }
          }, function () {
            var __jade_nodes = [];
            __jade_nodes = __jade_nodes.concat(jade_mixins['menu-content'].call(this));;
            return __jade_nodes;
          }.call(this).filter(Boolean)));;
          return __jade_nodes;
        }.call(this) : function () {
          var __jade_nodes = [];
          __jade_nodes = __jade_nodes.concat(jade_mixins['menu-content'].call(this));;
          return __jade_nodes;
        }.call(this));;
        return __jade_nodes;
      }.call(this).filter(Boolean))
    };
  }.call(this, "$attrs" in locals ? locals.$attrs : typeof $attrs !== "undefined" ? $attrs : undefined, "$helpers" in locals ? locals.$helpers : typeof $helpers !== "undefined" ? $helpers : undefined, "JSON" in locals ? locals.JSON : typeof JSON !== "undefined" ? JSON : undefined, "propertyFilter" in locals ? locals.propertyFilter : typeof propertyFilter !== "undefined" ? propertyFilter : undefined);
  if (result_of_with) return result_of_with.value;
}
module.exports = _jade_template_fn;