'use strict'
!(function(require, directRequire) {
  const {
      BROADCAST_CHANNEL_NAME: a
    } = require('./29663300bfa19b7ed51ebc10354be1e9.js'),
    { syncSettings: b } = require('./e98c60a262d8d98e69e574a9d12a21df.js'),
    { syncUser: c } = require('./9c906d27ca74e18d0deaaa231e71fdfa.js'),
    { syncProject: d } = require('./cc2c2970ff81ae4a83123e81ee123da2.js'),
    { syncWindow: e } = require('./a8c87029da0fa06e986298d447ab0fe2.js'),
    { syncConfig: f } = require('./3b66d845db4d098b7a16cb0357f5c072.js'),
    {
      select: g,
      getType: h,
      getMergeData: i
    } = require('./f2016183e756007d724ae6d6a2e6a3d4.js'),
    j = new BroadcastChannel(a)
  let k
  const l = {
      user: {},
      settings: {},
      'window.remoteDebugWindow.debuggingProjectId': {}
    },
    m = {},
    n = {},
    o = {
      user: c,
      settings: b,
      project: d,
      config: f,
      'window.remoteDebugWindow.debuggingProjectId': e
    },
    p = { settings: ['show', 'currentCategory'], project: ['current'] },
    q = (a, b) => {
      let c = l[b],
        d = g(a, b),
        e = c !== d
      if ((e && (e = m[b] === n[b]), !e)) return !1
      if (p[b]) {
        const c = l[b],
          d = a[b]
        for (const a in d) if (-1 === p[b].indexOf(a) && d[a] != c[a]) return !0
        return !1
      }
      return !0
    },
    r = () => {
      const a = k.getState()
      for (const b in l)
        q(a, b) &&
          j.postMessage({ key: b, value: i(a, b), syncTime: +new Date() }),
          (l[b] = a[b])
    }
  ;(j.onmessage = a => {
    if (k) {
      const { key: b, value: c, syncTime: d } = a.data
      b && o[b] && ((n[b] = d), k.dispatch(o[b](c, d)), (m[b] = n[b]))
    }
  }),
    (module.exports = a => {
      k = a
      const b = k.getState()
      for (const c in l)
        (l[c] = g(b, c)), (m[c] = +new Date()), (n[c] = +new Date())
      k.subscribe(r)
    })
})(require('lazyload'), require)
