'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('./612dbee40a6cb82d84b13dc7e046e2b6.js')
  class c extends a.Component {
    constructor(a) {
      super(a)
    }
    componentDidMount() {}
    componentDidUpdate() {}
    componentWillReceiveProps() {}
    onClick(a) {
      a.stopPropagation()
      const b = a.currentTarget.dataset
      if (b.path)
        try {
          let a = this.props.tree[b.path]
          const { path: c, isDir: d, isOpen: e } = a
          d
            ? (this.props.cosActions.setDir(c, !e),
              this.props.cosActions.setCurrentPath(c))
            : this.props.cosActions.setCurrentPath(c)
        } catch (a) {
          console.error(`directory-tree.js: handleTreeLeftClick: ${a}`)
        }
    }
    onRightClick(a) {
      a.stopPropagation()
      const b = a.currentTarget.dataset
      b.path &&
        this.props.cosActions.setContextMenu({
          show: !0,
          path: b.path,
          x: a.pageX,
          y: a.pageY
        })
    }
    onMouseDown(a) {
      a.preventDefault(),
        0 == a.button ? this.onClick(a) : 3 > a.button && this.onRightClick(a)
    }
    render() {
      const { tree: c, currentPath: d } = this.props,
        e = c['/']
      let f = e.children.map(e => {
        let f = c[e]
        return f
          ? a.createElement(b, {
              key: e,
              tree: c,
              node: f,
              offset: 0,
              onItemClick: this.onMouseDown.bind(this),
              currentPath: d
            })
          : null
      })
      return a.createElement(
        'div',
        { className: 'tree', style: { height: 300 } },
        f
      )
    }
  }
  module.exports = c
})(require('lazyload'), require)
