'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('./3b5f8e2469c474c8d433c1c6926d8999.js'),
    c = require('classnames'),
    d = require('./d3976cc01aeebc5b09e11c4135b6bd8d.js'),
    e = require('./c4190a2430506f3602ca550e1e75d620.js'),
    f = require('./eadce02c750c875a10680bcfedadec88.js'),
    g = require('./3c55dff3626a3ee184d599f076158345.js'),
    { connect: h } = require('react-redux')
  class i extends a.Component {
    constructor(a) {
      super(a),
        (this.state = { showSuc: '' }),
        (this.actionList = [
          '\u6E05\u9664\u5F00\u53D1\u8005\u5DE5\u5177cookie',
          '\u6E05\u9664\u5F00\u53D1\u8005\u5DE5\u5177\u7F13\u5B58',
          '\u6E05\u9664\u5730\u5740\u680F\u5386\u53F2\u8BB0\u5F55'
        ])
    }
    hideTipsTimeout() {
      setTimeout(() => {
        this.setState({ showSuc: '' })
      }, 500)
    }
    onSelectClick(a) {
      0 === a
        ? this.props.webview &&
          this.props.webview.clearData({ since: 0 }, { cookies: !0 }, () => {})
        : 1 === a
          ? this.props.webview &&
            this.props.webview.clearData(
              { since: 0 },
              {
                appcache: !0,
                cache: !0,
                fileSystems: !0,
                indexedDB: !0,
                localStorage: !0,
                webSQL: !0
              },
              () => {}
            )
          : 2 === a && this.props.clearAutoComplete(),
        this.props.setClickkey(f.NONE)
    }
    handleOnClick(a) {
      a.stopPropagation()
      let b =
        this.props.clickkey == f.WEBDEBUGCLEANCACHE
          ? f.NONE
          : f.WEBDEBUGCLEANCACHE
      this.props.setClickkey(b)
      let c = a.currentTarget.getBoundingClientRect()
      this.setState({ left: c.left - 132, top: c.top + 22 })
    }
    render() {
      let c = this.props.show ? {} : b.displayNone,
        d = this.state.showSuc
      return a.createElement(
        'div',
        { className: 'location-bar-ext' },
        a.createElement(
          'div',
          {
            className: 'toolbar-action',
            onClick: this.handleOnClick.bind(this)
          },
          a.createElement(
            'div',
            { className: 'toolbar-button' },
            a.createElement('i', { className: 'ui-icon-cache' }),
            a.createElement('i', { className: 'ui-icon-arrow-down' })
          ),
          a.createElement(
            'p',
            { className: 'toolbar-label' },
            '\u6E05\u7F13\u5B58'
          )
        ),
        a.createElement(g, {
          show: this.props.show,
          list: this.actionList,
          left: this.state.left,
          top: this.state.top,
          onSelectClick: this.onSelectClick.bind(this)
        })
      )
    }
  }
  module.exports = h(
    a => {
      let b = a.webdebugger || {}
      return {
        clickkey: b.clickkey,
        show: b.clickkey == f.WEBDEBUGCLEANCACHE,
        url: b.url,
        webview: b.webview,
        autocomplete: b.autocomplete,
        focusAddress: b.focusAddress,
        webviewID: b.currentWebviewID
      }
    },
    a => {
      return {
        clearAutoComplete: d.bindActionCreators(e.clearAutoComplete, a),
        setClickkey: d.bindActionCreators(e.setClickkey, a)
      }
    }
  )(i)
})(require('lazyload'), require)
