'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('./d3976cc01aeebc5b09e11c4135b6bd8d.js'),
    c = require('./ea653f45dc25181ca4f1b108175009b7.js'),
    d = require('./a8c87029da0fa06e986298d447ab0fe2.js'),
    e = require('./1ca0b7713664710bff99ca9c6d29c43c.js'),
    f = require('./4eda66dd430c8d8ac4d33b7eead4775e.js'),
    g = require('classnames'),
    h = require('./9fdd4ac31a05c27355910f0d74accd4c.js'),
    i = require('./6242f55dbdfe53c2f07b7a51568311f2.js'),
    j = require('./NavigationBar.js'),
    k = require('./4389a88e405d1d37f36c16fc0ec96540.js'),
    l = require('./e6d0a4ae874ce935a5da29d582503809.js'),
    m = require('./10279410b7cf7ea9409d42a7eb37225c.js'),
    n = require('./b6dd6ba0b853899c69527eaf93a58f7b.js'),
    o = require('./413e1df0d2a135fa20cefc4c23f8e8e1.js'),
    p = require('./d03a90fbd796428c64e8c47eef5f4e71.js'),
    { connect: q } = require('react-redux')
  class r extends a.Component {
    componentDidMount() {
      chrome.fontSettings.setMinimumFontSize({ pixelSize: 1 })
    }
    onResizeStop(a, b) {
      this.props.windowActions.setSimulator({ width: b })
    }
    getOptionsComponents() {
      let b = this.props,
        c = []
      return (
        b.switch.selectorPickerShow &&
          c.push(a.createElement(p, { key: 'selectorpicker' })),
        b.switch.datePickerShow &&
          c.push(a.createElement(m, { key: 'datepicker' })),
        b.switch.timePickerShow &&
          c.push(a.createElement(n, { key: 'timepicker' })),
        b.switch.multiPickerShow &&
          c.push(a.createElement(o, { key: 'multipicker' })),
        c
      )
    }
    renderConversationNode() {
      let b = this.props
      return a.createElement(
        'div',
        { className: 'chat' },
        a.createElement(
          'div',
          { className: 'ui-message' },
          a.createElement(
            'div',
            { className: 'ui-message-avatar' },
            a.createElement('i', { className: 'ui-icon-default-avatar' })
          ),
          a.createElement(
            'div',
            { className: 'ui-message-body' },
            a.createElement(
              'div',
              { className: 'ui-miniapp' },
              a.createElement(
                'div',
                { className: 'ui-miniapp-hd' },
                a.createElement(
                  'div',
                  { className: 'ui-miniapp-logo' },
                  a.createElement('img', { src: b.appShowImageUrl, alt: '' })
                ),
                a.createElement(
                  'div',
                  { className: 'ui-miniapp-name' },
                  a.createElement('p', null, b.appShowName)
                )
              ),
              a.createElement(
                'div',
                { className: 'ui-miniapp-bd' },
                a.createElement(
                  'h3',
                  { className: 'ui-miniapp-title' },
                  '\u5C0F\u7A0B\u5E8F\u5185\u9875\u6807\u9898'
                ),
                a.createElement(
                  'div',
                  { className: 'ui-miniapp-thumb' },
                  a.createElement(
                    'div',
                    { style: { width: b.canvasWidth, height: b.canvasHeight } },
                    a.createElement(f, null)
                  )
                )
              ),
              a.createElement(
                'div',
                { className: 'ui-miniapp-ft' },
                a.createElement('i', { className: 'ui-icon-miniapp' }),
                a.createElement('span', null, '\u5C0F\u7A0B\u5E8F')
              )
            )
          )
        )
      )
    }
    renderSearchNode() {
      const b = this.props
      return a.createElement(
        'div',
        { className: 'webview', style: { backgroundColor: '#efeff4' } },
        a.createElement(
          'div',
          { className: 'search-list' },
          a.createElement(
            'div',
            { className: 'search-item' },
            a.createElement(
              'div',
              { className: 'search-item-hd' },
              a.createElement(
                'p',
                null,
                a.createElement(
                  'span',
                  { className: 'search-highlight' },
                  b.condiction.query
                ),
                a.createElement('span', null, ' - '),
                a.createElement('span', null, '\u67E5\u8BE2\u7ED3\u679C')
              )
            ),
            a.createElement(
              'div',
              { className: 'search-item-bd' },
              a.createElement(
                'div',
                { style: { height: b.canvasHeight } },
                a.createElement(f, null)
              )
            ),
            a.createElement(
              'div',
              { className: 'search-item-ft' },
              a.createElement('img', {
                className: 'search-provider-logo',
                src: b.appShowImageUrl
              }),
              a.createElement(
                'span',
                null,
                b.appShowName ? `由${b.appShowName}提供` : ''
              )
            )
          )
        )
      )
    }
    render() {
      let b = this.props
      return a.createElement(
        c,
        {
          width: b.width,
          height: '100%',
          className: g('simulator-container', { 'ui-invisible': !b.show }),
          leftResizable: 'right' === b.position,
          rightResizable: 'left' === b.position,
          onResizeStop: this.onResizeStop.bind(this)
        },
        a.createElement(e, null),
        a.createElement(
          'div',
          { className: 'simulator-shell' },
          a.createElement(
            'div',
            {
              className: 'simulator',
              style: {
                marginLeft: -b.screenWidth / 2,
                width: b.screenWidth,
                height: b.screenHeight,
                transform: `scale(${b.deviceScale})`,
                transformOrigin: '50% 0'
              }
            },
            a.createElement(k, {
              titleStyle: 'black',
              height: b.statusbarHeight,
              backgroundColor: '#efeff4'
            }),
            b.compileType == h.search ? a.createElement(l, null) : null,
            b.compileType == h.conversation
              ? a.createElement(j, {
                  showLeftBtn: !1,
                  showRightBtn: !1,
                  titleStyle: 'b',
                  backgroundColor: '#000000',
                  height: b.navigationbarHeight,
                  title: '\u4F1A\u8BDD'
                })
              : null,
            b.compileType == h.conversation
              ? this.renderConversationNode()
              : null,
            b.compileType == h.search ? this.renderSearchNode() : null,
            this.getOptionsComponents()
          )
        ),
        a.createElement('div', {
          className: 'ui-divider-vertical',
          style: { pointerEvents: 'none' }
        })
      )
    }
  }
  module.exports = q(
    a => {
      let c = a.window.simulator || {},
        d = a.toolbar.deviceInfo,
        e = a.project.current,
        f = e.compileType,
        g = b.getWidgetOffset(f, d),
        { width: j, height: k } = g
      if (f == h.search) {
        let b = i.default_search_widget_radio
        ;(j = g.width),
          (k =
            a.simulator.widget && a.simulator.widget.height
              ? a.simulator.widget.height
              : j * b)
      }
      let l = e.condiction[f] || {},
        m = l.list[l.current] || {},
        n = a.simulator.pickerInfo || {}
      return {
        deviceScale: a.toolbar.deviceScale,
        appShowName: e.appShowName,
        appShowImageUrl: e.appShowImageUrl,
        show: c.show,
        position: c.position,
        statusbarHeight: d.statusbarHeight,
        navigationbarHeight: d.navigationbarHeight,
        canvasWidth: j,
        canvasHeight: k,
        screenWidth: d.screenWidth,
        screenHeight: d.screenHeight,
        compileType: e.compileType,
        switch: {
          selectorPickerShow: n.show && 'selector' == n.mode,
          datePickerShow: n.show && 'date' == n.mode,
          timePickerShow: n.show && 'time' == n.mode,
          multiPickerShow: n.show && 'multi' == n.mode
        },
        condiction: m
      }
    },
    a => {
      return { windowActions: b.bindActionCreators(d, a) }
    }
  )(r)
})(require('lazyload'), require)
