diff --git a/.eslintignore b/.eslintignore index e9e8489..032e6ed 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,3 +3,4 @@ node_modules /biz/webui/htdocs/src/js/components /test/assets/values /test/plugins/whistle.test/assets +/bin/import.js diff --git a/CHANGELOG.md b/CHANGELOG.md index c4bf7fc..ae34c93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,49 @@ + +# v2.9.56 +1. feat: 支持通过 `Online / IPv6-only network` 强制 dns 获取 ipv6(命令行版本还可以通过 `-M ipv6Only` 开启) +2. feat: `w2 add` 命令支持 `type: module` +# v2.9.55 +1. feat: 显示 `captureError`,且可以通过插件获取到这类型错误的抓包数据 +2. fix: 完善 `refreshPlugins` 方法(内部方法) + +# v2.9.54 +1. fix: 修复 Dark Mode 模式下图片显示问题 +2. fix: JSON 过滤搜索时保留数组的 index + +# v2.9.53 +1. feat: 支持通过 `enable://forHttp|forHttps` 设置 `enable://capture` 只对 http 或 https 生效 +2. feat: 支持通过请求参数设置登录态 +3. feat: 支持 `Dark Mode`,且可以通过界面 `Online -> 打开对话框 -> Disable dark mode` 关闭自动切换 `Dark Mode` + +# v2.9.52 +1. feat: 跨域请求本地替换自动设置 cors,可以通过 `disable://autoCors` 或 `lineProps://disableAutoCors` 关闭 + +# v2.9.51 +1. fix: https://github.com/avwo/whistle/issues/912 +# v2.9.50 +1. fix: Node 20.1.0 版本 `http.request` 只支持通过 `options.search` 设置参数问题 +2. feat: 支持通过 `--uiport "127.0.0.1:8080"` 限制 WebUI 只能通过指定网卡和端口访问 + +# v2.9.49 +1. fix: `headerReplace://req.host:pattern=value` 无效问题 +2. feat: 插件添加 `sharedStorage` 方便插件在不同实例中共享存储数据 +3. style: https://github.com/avwo/whistle/pull/898 + +# v2.9.48 +1. feat: 插件扩展的右键菜单和 Tab 添加 `exportSessions(sessions, type, name)` 方法 +2. feat: 插件 server 的 options 添加 `generateSaz(sessions): Buffer` 和 `extract(saz: Buffer, cb(sessions))` 方法 +3. refactor: 兼容 saz 的 comment,需要配合插件使用:https://github.com/whistle-plugins/whistle.comment.git +4. fix: 修复访问 socks 代理可能出现 pending 的问题 +5. style: 界面优化 + +# v2.9.47 +1. refactor: 解决安装时依赖包安全警告问题 +2. feat: 支持自定义右键菜单获取树结点下的所有抓包数据 + +# v2.9.46 +1. feat: 扩展 Tab 支持 `copyText` 方法 +2. feat: `tpl` 协议支持模板字符串语法 + # v2.9.45 1. feat: 插件界面提供 `copyText` 方法 2. feat: 支持 `lineProps://strictHtml` 和 `lineProsy://safeHtml` 只对当前行的规则生效 diff --git a/README.md b/README.md index 373b4c7..9a699d7 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ [![NPM count](https://img.shields.io/npm/dt/whistle.svg?style=flat-square)](https://www.npmjs.com/package/whistle) [![License](https://img.shields.io/npm/l/whistle.svg?style=flat-square)](https://www.npmjs.com/package/whistle) +**Mac 或 Windows 系统推荐使用客户端版本:https://github.com/avwo/whistle-client** + Whistle 是基于 Node 实现的跨平台抓包调试工具,其主要特点: 1. **完全跨平台**:支持 Mac、Windows 等桌面系统,且支持服务端等命令行系统 2. **功能强大(理论上可以对请求做任意修改)**: diff --git a/assets/fiddler/meta.xml b/assets/fiddler/meta.xml index 3405b4d..4cb5e88 100644 --- a/assets/fiddler/meta.xml +++ b/assets/fiddler/meta.xml @@ -18,5 +18,6 @@ + diff --git a/assets/launcher/windows/README.md b/assets/launcher/windows/README.md index 5898592..6ae17a5 100644 --- a/assets/launcher/windows/README.md +++ b/assets/launcher/windows/README.md @@ -1,8 +1,8 @@ # Windows上配置开机重启whistle -首先,下载Windows上的whistle脚步文件:[whistle.zip](https://github.com/avwo/whistle/raw/avenwu/assets/launcher/windows/whistle.zip)。 +首先,下载Windows上的whistle脚步文件:[whistle.zip](https://github.com/avwo/whistle/raw/master/assets/launcher/windows/whistle.zip)。 -1. 解压whistle.zip获取whistle.bat的脚本文件,把该脚本文件拷贝一份到Windows的桌面,这样可以直接在Mac的桌面上刊登whistle的启动脚本,双击即可重启whistle(会先弹出一个命令行窗口,等3秒左右就会自动消失); +1. 解压whistle.zip获取whistle.bat的脚本文件,把该脚本文件拷贝一份到Windows的桌面,这样可以直接在Windows的桌面上看到whistle的启动脚本,双击即可重启whistle(会先弹出一个命令行窗口,等3秒左右就会自动消失); 2. 把桌面上的whistle.bat文件拖到桌面左下角的系统**开始菜单 --> 所有程序 --> 启动**目录下面,或者直接拷贝到系统目录`C:\Users\{yourAccount}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup`(可以直接在开始菜单或者文件管理器中的输入框输入`%appData%\Microsoft\Windows\Start Menu\Programs\Startup`快速定位到启动菜单目录),这样就配置好了开机自动重启whistle。 -![设置Windows开机重启whistle](whistle.gif) \ No newline at end of file +![设置Windows开机重启whistle](whistle.gif) diff --git a/assets/menu.html b/assets/menu.html index e5f31a7..caff24c 100644 --- a/assets/menu.html +++ b/assets/menu.html @@ -157,11 +157,13 @@ Object.keys(options.msgBox).forEach(function(name) { toast[name] = options.msgBox[name]; }); + whistleBridge.updateUI = options.updateUI; whistleBridge.copyText = options.copyText; whistleBridge.pageId = options.pageId; whistleBridge.compose = options.compose; whistleBridge.decodeBase64 = options.decodeBase64; whistleBridge.importSessions = options.importSessions; + whistleBridge.exportSessions = options.exportSessions; whistleBridge.request = options.request; whistleBridge.createRequest = options.createRequest; whistleBridge.showModal = options.showModal; diff --git a/assets/tab.html b/assets/tab.html index 6f3fe6b..83daf37 100644 --- a/assets/tab.html +++ b/assets/tab.html @@ -282,10 +282,13 @@ }); getActiveSession = options.getActiveSession; getSelectedSessionList = options.getSelectedSessionList; + whistleBridge.updateUI = options.updateUI; + whistleBridge.copyText = options.copyText; whistleBridge.pageId = options.pageId; whistleBridge.compose = options.compose; whistleBridge.decodeBase64 = options.decodeBase64; whistleBridge.importSessions = options.importSessions; + whistleBridge.exportSessions = options.exportSessions; whistleBridge.request = options.request; whistleBridge.createRequest = options.createRequest; whistleBridge.showModal = options.showModal; diff --git a/bin/import.js b/bin/import.js new file mode 100644 index 0000000..41d4881 --- /dev/null +++ b/bin/import.js @@ -0,0 +1,23 @@ +var fs = require('fs'); + +function importModle(filepath, callback) { + return import(filepath).then(callback); +} + +module.exports = function(filepath, callback) { + try { + return callback(require(filepath)); + } catch (e) { + var code =e && e.code; + if (code === 'ERR_REQUIRE_ESM') { + // ignore eslint & fix type=module + return importModle(filepath, callback); + } else if (code === 'MODULE_NOT_FOUND' && /\.js$/i.test(filepath)) { + filepath = filepath.slice(0, -3) + '.mjs'; + if (fs.existsSync(filepath)) { + return importModle(filepath, callback); + } + } + throw e; + } +}; diff --git a/bin/plugin.js b/bin/plugin.js index 4d0dbf0..296c355 100755 --- a/bin/plugin.js +++ b/bin/plugin.js @@ -8,6 +8,8 @@ var commonUtil = require('../lib/util/common'); var getWhistlePath = commonUtil.getWhistlePath; var REMOTE_URL_RE = commonUtil.REMOTE_URL_RE; +var WHISTLE_PLUGIN_RE = commonUtil.WHISTLE_PLUGIN_RE; +const getPlugins = commonUtil.getPlugins; var CMD_SUFFIX = process.platform === 'win32' ? '.cmd' : ''; var CUSTOM_PLUGIN_PATH = path.join(getWhistlePath(), 'custom_plugins'); var DEFAULT_PATH = commonUtil.getDefaultWhistlePath(); @@ -15,25 +17,12 @@ var REGISTRY_LIST = path.join(DEFAULT_PATH, '.registry.list'); var PACKAGE_JSON = '{"repository":"https://github.com/avwo/whistle","license":"MIT"}'; var LICENSE = 'Copyright (c) 2019 avwo'; var RESP_URL = 'https://github.com/avwo/whistle'; -var WHISTLE_PLUGIN_RE = /^((?:@[\w-]+\/)?whistle\.[a-z\d_-]+)(?:\@([\w.^~*-]*))?$/; var MAX_REG_COUNT = 100; function getInstallPath(name, dir) { return path.join(dir || CUSTOM_PLUGIN_PATH, name); } -function getPlugins(argv, isInstall) { - return argv.filter(function(name, i) { - if (WHISTLE_PLUGIN_RE.test(name)) { - return true; - } - if (argv[i - 1] === '--registry') { - return false; - } - return isInstall && REMOTE_URL_RE.test(name); - }); -} - function removeDir(installPath) { if (fs.existsSync(installPath)) { fse.removeSync(installPath); diff --git a/bin/use.js b/bin/use.js index 553c0c3..3339c86 100755 --- a/bin/use.js +++ b/bin/use.js @@ -2,8 +2,11 @@ var path = require('path'); var fs = require('fs'); var http = require('http'); var url = require('url'); +var Buffer = require('safe-buffer').Buffer; var util = require('./util'); +var importModule = require('./import'); var pkg = require('../package.json'); +var getHomedir = require('../lib/util/common').getHomedir; var isRunning = util.isRunning; var error = util.error; @@ -14,24 +17,28 @@ var MAX_RULES_LEN = 1024 * 256; var DEFAULT_OPTIONS = { host: '127.0.0.1', port: 8899 }; var options; -function showStartWhistleTips(storage) { - error('No running whistle, execute `w2 start' + (storage ? ' -S ' + storage : '') - + '` to start whistle on the cli.'); +function showStartWhistleTips(storage, isClient) { + if (isClient) { + error('No running whistle client, please install and start the latest whistle client: https://github.com/avwo/whistle-client'); + } else { + error('No running whistle, execute `w2 start' + (storage ? ' -S ' + storage : '') + '` to start whistle on the cli.'); + } } function handleRules(filepath, callback, port) { - var getRules = require(filepath); - if (typeof getRules !== 'function') { - return callback(getRules); - } - var opts = { - port: port, - existsPlugin: existsPlugin - }; - if (options && options.host) { - opts.host = options.host; - } - getRules(callback, opts); + importModule(filepath, function(getRules) { + if (typeof getRules !== 'function') { + return callback(getRules); + } + var opts = { + port: port, + existsPlugin: existsPlugin + }; + if (options && options.host) { + opts.host = options.host; + } + getRules(callback, opts); + }); } function getString(str) { @@ -75,10 +82,13 @@ function request(body, callback) { reqOptions.headers = { 'content-type': 'application/x-www-form-urlencoded' }; + if (options.specialAuth) { + reqOptions.headers['x-whistle-special-auth'] = options.specialAuth; + } reqOptions.method = 'POST'; if (options.username || options.password) { var auth = [options.username || '', options.password || ''].join(':'); - reqOptions.headers.authorization = 'Basic ' + new Buffer(auth).toString('base64'); + reqOptions.headers.authorization = 'Basic ' + new Buffer.from(auth).toString('base64'); } } var req = http.request(reqOptions, function(res) { @@ -93,10 +103,13 @@ function request(body, callback) { req.end(body); } -function checkDefault(running, storage, callback) { +function checkDefault(running, storage, isClient, callback) { if (running) { return callback(); } + if (isClient) { + return callback(true); + } var execCallback = function(err) { callback && callback(err); callback = null; @@ -114,20 +127,42 @@ function checkDefault(running, storage, callback) { req.end(); } -module.exports = function(filepath, storage, force) { - storage = storage || ''; - var dir = encodeURIComponent(storage); - var config = readConfig(dir) || ''; +function readClientConfig() { + var procPath = path.join(getHomedir(), '.whistle_client.pid'); + try { + var info = fs.readFileSync(procPath, { encoding: 'utf-8' }).split(','); + if (info.length === 4) { + return { + pid: info[0], + options: { + host: info[1], + port: info[2], + specialAuth: info[3] + } + }; + } + } catch (e) {} +} + +module.exports = function(filepath, storage, force, isClient) { + var config; + var dir = ''; + if (isClient) { + storage = ''; + config = readClientConfig() || ''; + } else { + storage = storage || ''; + dir = encodeURIComponent(storage); + config = readConfig(dir) || ''; + if (config.options) { + delete config.options.specialAuth; + } + } options = config.options || ''; - var pid = options && config.pid; - var addon = options && options.addon; - var conf = require('../lib/config'); - conf.addon = addon && typeof addon === 'string' ? addon.split(/[|,]/) : null; - conf.noGlobalPlugins = options && options.noGlobalPlugins; - isRunning(pid, function(running) { - checkDefault(running, dir, function(err, port) { + isRunning(options && config.pid, function(running) { + checkDefault(running, dir, isClient, function(err, port) { if (err) { - return showStartWhistleTips(storage); + return showStartWhistleTips(storage, isClient); } filepath = path.resolve(filepath || '.whistle.js'); if (port) { @@ -158,7 +193,7 @@ module.exports = function(filepath, storage, force) { 'groupName=' + encodeURIComponent(groupName.trim()) ].join('&'); request(body, function() { - info('Setting whistle (' + (options.host || '127.0.0.1') + ':' + port + ') rules successful.'); + info('Setting whistle' + (isClient ? ' client' : '') + ' (' + (options.host || '127.0.0.1') + ':' + port + ') rules successful.'); }); }; if (force) { diff --git a/bin/util.js b/bin/util.js index 6248b5d..6cbb133 100755 --- a/bin/util.js +++ b/bin/util.js @@ -80,7 +80,7 @@ function showUsage(isRunning, options, restart) { info('[i] ' + config.name + '@' + config.version + (restart ? ' restarted' : ' started')); } var port = /^\d+$/.test(options.port) && options.port > 0 ? options.port : config.port; - var list = options.host ? [options.host] : getIpList(); + var list = options.host && typeof options.host === 'string' ? [options.host] : getIpList(); info('[i] 1. use your device to visit the following URL list, gets the ' + colors.bold('IP') + ' of the URL you can access:'); info(list.map(function(ip) { return ' http://' + colors.bold(getIpHost(ip)) + (port && port != 80 ? ':' + port : '') + '/'; diff --git a/bin/whistle.js b/bin/whistle.js index d787001..a0e512e 100755 --- a/bin/whistle.js +++ b/bin/whistle.js @@ -134,8 +134,8 @@ program .option('-F, --frameCacheSize [frameCacheSize]', 'set the cache size of webSocket and socket\'s frames (512 by default)', String, undefined) .option('-A, --addon [pluginPaths]', 'add custom plugin paths', String, undefined) .option('--init [bypass]', 'auto set global proxy (and bypass) and install root CA') - .option('--config [workers]', 'start the cluster server and set worker number (os.cpus().length by default)', String, undefined) - .option('--cluster [config]', 'load the startup config from a local file', String, undefined) + .option('--cluster [workers]', 'start the cluster server and set worker number (os.cpus().length by default)', String, undefined) + .option('--config [config]', 'load the startup config from a local file', String, undefined) .option('--dnsServer [dnsServer]', 'set custom dns servers', String, undefined) .option('--socksPort [socksPort]', 'set the socksv5 server port', String, undefined) .option('--httpPort [httpPort]', 'set the http server port', String, undefined) @@ -179,6 +179,16 @@ if (cmd === 'status') { if (force) { argv.splice(index, 1); } + index = argv.indexOf('-c'); + var isClient = index !== -1; + if (isClient) { + argv.splice(index, 1); + } + index = argv.indexOf('--client'); + if (index !== -1) { + isClient = true; + argv.splice(index, 1); + } var filepath = argv[3]; if (filepath === '-S') { filepath = null; @@ -189,7 +199,7 @@ if (cmd === 'status') { if (filepath && /^-/.test(filepath)) { filepath = null; } - useRules(filepath, storage, force); + useRules(filepath, storage, force, isClient); } else if ((cmd === 'run' || cmd === 'exec') && argv[3] && /^[^-]/.test(argv[3])) { cmd = argv[3]; argv = Array.prototype.slice.call(argv, 4); diff --git a/biz/index.js b/biz/index.js index 384032b..6382762 100644 --- a/biz/index.js +++ b/biz/index.js @@ -20,6 +20,14 @@ var CUSTOM_PLUGIN_RE = new RegExp('^/[\\w.-]*\\.whistle-path\\.5b6af7b9884e1165[ var REAL_WEBUI_HOST_PARAM = /_whistleInternalHost_=(__([a-z\d.-]+)(?:__(\d{1,5}))?__)/; var OUTER_PLUGIN_RE = /^(?:\/whistle)?\/((?:whistle|plugin)\.[a-z\\d_-]+)::(\d{1,5})\//; + +function transformUI(req, res) { + if (config.customUIHost && !config.keepProxyUI) { + return res.status(404).end(); + } + return handleUIReq(req, res); +} + module.exports = function(req, res, next) { var config = this.config; var pluginMgr = this.pluginMgr; @@ -133,7 +141,7 @@ module.exports = function(req, res, next) { if (isWeinre) { handleWeinreReq(req, res); } else { - handleUIReq(req, res); + transformUI(req, res); } } } else if (localRule = rules.resolveLocalRule(req)) { @@ -142,7 +150,7 @@ module.exports = function(req, res, next) { req.headers.host = '127.0.0.1:' + localRule.realPort; util.transformReq(req, res, localRule.realPort); } else { - handleUIReq(req, res); + transformUI(req, res); } } else { next(); diff --git a/biz/init.js b/biz/init.js index 950c98c..5b58a49 100644 --- a/biz/init.js +++ b/biz/init.js @@ -10,6 +10,7 @@ module.exports = function init(proxy, callback) { ui.setupServer(server); util.getBoundIp(config.uihost, function(host) { if (host) { + config.customUIHost = host; server.listen(config.uiport, host, callback); } else { server.listen(config.uiport, callback); diff --git a/biz/webui/cgi-bin/add-rules-values.js b/biz/webui/cgi-bin/add-rules-values.js index ad2181e..a180359 100644 --- a/biz/webui/cgi-bin/add-rules-values.js +++ b/biz/webui/cgi-bin/add-rules-values.js @@ -7,7 +7,11 @@ module.exports = function(req, res) { var rulesData = body.rules; var valuesData = body.values; if (rulesData) { - rules.add(rulesData.name, rulesData.value, clientId); + if (rulesData.name === 'Default') { + rules.setDefault(rulesData.value, clientId); + } else { + rules.add(rulesData.name, rulesData.value, clientId); + } rules.select(rulesData.name); } if (valuesData) { diff --git a/biz/webui/cgi-bin/create-cert.js b/biz/webui/cgi-bin/create-cert.js index 54ee5a0..ed10580 100644 --- a/biz/webui/cgi-bin/create-cert.js +++ b/biz/webui/cgi-bin/create-cert.js @@ -1,7 +1,8 @@ -var Zip = require('node-native-zip2'); +var Zip = require('adm-zip'); var Buffer = require('safe-buffer').Buffer; var qs = require('querystring'); var ca = require('../../../lib/https/ca'); +var sendError = require('./util').sendError; var URL_RE = /^(?:([\w.-]+:)?\/\/)?([\w.=&!~*'()%-]+)/i; var ILLEGAL_CHARS_RE = /[=&!~*'()%]/; @@ -28,7 +29,11 @@ module.exports = function(req, res) { var zip = new Zip(); domain = isStr ? domain : 'root'; var dir = domain + '/' + domain; - zip.add(dir + '.crt', Buffer.from(cert.cert)); - zip.add(dir + '.key', Buffer(cert.key)); - res.attachment(domain + '.zip').send(zip.toBuffer()); + zip.addFile(dir + '.crt', Buffer.from(cert.cert)); + zip.addFile(dir + '.key', Buffer(cert.key)); + zip.toBuffer(function(body) { + res.attachment(domain + '.zip').send(body); + }, function(err) { + sendError(res, err); + }); }; diff --git a/biz/webui/cgi-bin/get-data.js b/biz/webui/cgi-bin/get-data.js index bade061..fb4dcce 100644 --- a/biz/webui/cgi-bin/get-data.js +++ b/biz/webui/cgi-bin/get-data.js @@ -20,9 +20,12 @@ module.exports = function(req, res) { var stopRecordConsole = data.startLogTime == -3; var stopRecordSvrLog = data.startSvrLogTime == -3; var h = req.headers; + var curLogId = proxy.getLatestId(); + var curSvrLogId = logger.getLatestId(); util.sendGzip(req, res, { ec: 0, version: config.version, + epm: config.epm, custom1: properties.get('Custom1'), custom2: properties.get('Custom2'), custom1Key: properties.get('Custom1Key'), @@ -36,8 +39,10 @@ module.exports = function(req, res) { mvaluesTime: config.mvaluesTime, server: util.getServerInfo(req), hasARules: rulesUtil.hasAccountRules ? 1 : undefined, - lastLogId: stopRecordConsole ? proxy.getLatestId() : undefined, - lastSvrLogId: stopRecordSvrLog ? logger.getLatestId() : undefined, + curLogId: stopRecordConsole ? undefined : curLogId, + curSvrLogId: stopRecordSvrLog ? undefined : curSvrLogId, + lastLogId: stopRecordConsole ? curLogId : undefined, + lastSvrLogId: stopRecordSvrLog ? curSvrLogId : undefined, log: stopRecordConsole ? [] : proxy.getLogs(data.startLogTime, data.count, data.logId), svrLog: stopRecordSvrLog ? [] : logger.getLogs(data.startSvrLogTime, data.count), plugins: pluginMgr.getPlugins(), diff --git a/biz/webui/cgi-bin/init.js b/biz/webui/cgi-bin/init.js index 80d8746..7e64f94 100644 --- a/biz/webui/cgi-bin/init.js +++ b/biz/webui/cgi-bin/init.js @@ -16,6 +16,7 @@ module.exports = function(req, res) { util.sendGzip(req, res, { version: config.version, + epm: config.epm, custom1: properties.get('Custom1'), custom2: properties.get('Custom2'), hasInvalidCerts: ca.hasInvalidCerts, diff --git a/biz/webui/cgi-bin/plugins/install.js b/biz/webui/cgi-bin/plugins/install.js new file mode 100644 index 0000000..8efbd82 --- /dev/null +++ b/biz/webui/cgi-bin/plugins/install.js @@ -0,0 +1,11 @@ +var config = require('../../../../lib/config'); +var common = require('../../../../lib/util/common'); + +module.exports = function(req, res) { + if (!config.installPlugins) { + return res.status(404).end(); + } + var data = common.getPluginsData(req.body); + data && config.installPlugins(data); + res.json({ ec: 0, count: data ? data.pkgs.length : 0 }); +}; \ No newline at end of file diff --git a/biz/webui/cgi-bin/plugins/uninstall.js b/biz/webui/cgi-bin/plugins/uninstall.js new file mode 100644 index 0000000..67b860f --- /dev/null +++ b/biz/webui/cgi-bin/plugins/uninstall.js @@ -0,0 +1,11 @@ +var config = require('../../../../lib/config'); +var common = require('../../../../lib/util/common'); + +module.exports = function(req, res) { + if (!config.uninstallPlugins) { + return res.status(404).end(); + } + var data = common.getPluginsData(req.body); + data && config.uninstallPlugins(data); + res.json({ ec: 0, count: data ? data.pkgs.length : 0 }); +}; \ No newline at end of file diff --git a/biz/webui/cgi-bin/set-ipv6-only.js b/biz/webui/cgi-bin/set-ipv6-only.js new file mode 100644 index 0000000..259ef9b --- /dev/null +++ b/biz/webui/cgi-bin/set-ipv6-only.js @@ -0,0 +1,6 @@ +var properties = require('../../../lib/rules/util').properties; + +module.exports = function(req, res) { + properties.setIPv6Only(req.body.checked); + res.json({ec: 0, ipv6Only: req.body.checked}); +}; diff --git a/biz/webui/cgi-bin/status.js b/biz/webui/cgi-bin/status.js index d5836ea..47ad23a 100644 --- a/biz/webui/cgi-bin/status.js +++ b/biz/webui/cgi-bin/status.js @@ -1,8 +1,12 @@ var config = require('../../../lib/config'); +var pid = process.pid; + module.exports = function(req, res) { res.json({ + pid: pid, storage: config.storage || '', + client: config.client, name: config.name, version: config.version }); diff --git a/biz/webui/cgi-bin/util.js b/biz/webui/cgi-bin/util.js index ef206b3..70816a2 100644 --- a/biz/webui/cgi-bin/util.js +++ b/biz/webui/cgi-bin/util.js @@ -25,6 +25,7 @@ exports.getServerInfo = function(req) { var info = { pid: PID, pInfo: proc, + ipv6Only: config.ipv6Only, dcc: config.disableCustomCerts, dns: dnsOverHttps || config.dnsServer, doh: doh, @@ -138,6 +139,13 @@ exports.formatDate = formatDate; exports.getClientIp = util.getClientIp; +function sendError(res, err) { + res.status(500).send(config.debugMode ? + '
' + util.encodeHtml(util.getErrorStack(err)) + '
' : 'Internal Server Error'); +} + +exports.sendError = sendError; + exports.sendGzip = function(req, res, data) { if (!util.canGzip(req)) { return res.json(data); @@ -147,8 +155,7 @@ exports.sendGzip = function(req, res, data) { try { res.json(data); } catch (e) { - res.status(500).send(config.debugMode ? - '
' + util.encodeHtml(util.getErrorStack(err)) + '
' : 'Internal Server Error'); + sendError(e); } return; } diff --git a/biz/webui/htdocs/index.html b/biz/webui/htdocs/index.html index 8142a79..8ef8d5e 100644 --- a/biz/webui/htdocs/index.html +++ b/biz/webui/htdocs/index.html @@ -1,13 +1,13 @@ - + -Whistle Web Debugger +Whistle Web Debugging Proxy
- + diff --git a/biz/webui/htdocs/js/index.js b/biz/webui/htdocs/js/index.js index e7983fc..c1c4d42 100644 --- a/biz/webui/htdocs/js/index.js +++ b/biz/webui/htdocs/js/index.js @@ -1,7 +1,7 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){if(/\.json$/i.test(e.name)&&W.test(e.value))try{JSON.parse(e.value)}catch(t){z.warn("Warning: the value of "+e.name+" can`t be parsed into json. "+t.message)}}function o(e,t){e=JSON.stringify(e);var n=new FormData,r=new File([e],"data.json",{type:"application/json"});return n.append(t||"rules",r),n}function i(e){return e=e.trim(),e?/^https?:\/\/[^/]/i.test(e)?e:void z.error("Please input the correct url."):void z.error("The url cannot be empty.")}function a(e){return function(t,n){if(!t)return S.showSystemError(n),e(!0);if(0!==t.ec)return z.error(t.em),e(!0);try{if(t=t.body&&JSON.parse(t.body),t&&Object.keys(t).length)return e(!1,t);z.info("No body data.")}catch(r){z.error(r.message)}e(!0)}}function s(e){if(e.networkMode)return"network";if(e.rulesMode&&e.pluginsMode)return"plugins";var t=location.hash.substring(1);return t=t?t.replace(/[?#].*$/,""):location.href.replace(/[?#].*$/,"").replace(/.*\//,""),e.rulesOnlyMode?"values"===t?"values":"rules":e.rulesMode?"network"===t?"rules":t:e.pluginsMode&&"plugins"!==t?"network":t}function l(e,t){var n,r=e.length;for(n=0;r>n;n++)if(-1===f.inArray(e[n],t))return!1;var o=t.length;if(r!==o)for(n=0;o>n;n++)if(-1===f.inArray(t[n],e))return!1;return!0}function c(e){if(0==e.indexOf("{")){var t=e.lastIndexOf("}");return t>1&&e.substring(1,t)}return!1}function u(e){if(0==e.indexOf("(")){var t=e.lastIndexOf(")");return-1!=t&&e.substring(1,t)||""}return!1}var d=Object.assign||function(e){for(var t=1;tn?1:-1)}).forEach(function(n){var r=e[n];t.push({name:n.slice(0,-1),icon:"checkbox",mtime:r.mtime,homepage:r.homepage,latest:r.latest,hideLongProtocol:r.hideLongProtocol,hideShortProtocol:r.hideShortProtocol,path:r.path,pluginVars:r.pluginVars})}),t},reloadRules:function(e){var t=this,n=j.get("activeRules",!0)||e.current,r=[],o={};r.push(X),o.Default={name:X,fixed:!0,value:e.defaultRules,selected:!e.defaultRulesIsDisabled,isDefault:!0,active:n===X},e.list.forEach(function(e){r.push(e.name),e=o[e.name]={name:e.name,value:e.data,selected:e.selected,active:n===e.name}}),t.state.rules.reset(r,o),t.setState({})},reloadValues:function(e){var t=this,n=j.get("activeValues",!0)||e.current,r=[],o={};e.list.forEach(function(e){r.push(e.name),o[e.name]={name:e.name,value:e.data,active:n===e.name}}),t.state.values.reset(r,o),t.setState({})},reloadData:function(){var e=this,t=f(".w-reload-data-tips").closest(".w-confirm-reload-dialog"),n=t.find(".w-reload-data-tips").attr("data-name"),r="rules"===n,o=function(t,n){return t?void(r?(e.reloadRules(t),e.triggerRulesChange("reload")):(e.reloadValues(t),e.triggerValuesChange("reload"))):void S.showSystemError(n)};r?(D.rules.list(o),k.trigger("reloadRulesRecycleBin")):(D.values.list(o),k.trigger("reloadValuesRecycleBin"))},showReloadRules:function(){if("rules"===this.state.name&&this.rulesChanged){this.rulesChanged=!1;var e=this.state.rules.hasChanged();this.showReloadDialog("The rules has been modified.
Do you want to reload it.",e)}},showReloadValues:function(){if("values"===this.state.name&&this.valuesChanged){this.valuesChanged=!1;var e=this.state.values.hasChanged();this.showReloadDialog("The values has been modified.
Do you want to reload it.",e)}},componentDidUpdate:function(){this.showReloadRules(),this.showReloadValues()},showReloadDialog:function(e,t){var n=this.refs.confirmReload;n.show(),t&&(e+='

Note: There are unsaved changes.

'),f(".w-reload-data-tips").html(e).attr("data-name",this.state.name)},componentDidMount:function(){function e(e){if(e=e&&e.trim()){var t=e.indexOf("://")+3;if(e=-1!=t?e.substring(t):e,0===e.indexOf("{"))return t=e.lastIndexOf("}"),t>1?e.substring(1,t):null}}var t=this,n=new M(".w-copy-text");n.on("error",function(e){Y.alert("Copy failed.")}),n=new M(".w-copy-text-with-tips"),n.on("error",function(e){z.error("Copy failed.")}),n.on("success",function(e){z.success("Copied clipboard.")});var r=function(e){e.preventDefault()};k.on("enableRecord",function(){t.enableRecord()}),k.on("showJsonViewDialog",function(e,n){t.refs.jsonDialog.show(n)}),k.on("rulesChanged",function(){t.rulesChanged=!0,t.showReloadRules()}),k.on("switchTreeView",function(){t.toggleTreeView()}),k.on("updateGlobal",function(){t.setState({})}),k.on("valuesChanged",function(){t.valuesChanged=!0,t.showReloadValues()}),k.on("disableAllPlugins",t.disableAllPlugins),k.on("disableAllRules",t.disableAllRules),k.on("activeRules",function(){var e=D.rulesModal;e.exists(D.activeRulesName)&&(t.setRulesActive(D.activeRulesName,e),t.setState({}))}),k.on("activeValues",function(){var e=D.valuesModal;e.exists(D.activeValuesName)&&(t.setValuesActive(D.activeValuesName,e),t.setState({}))});var i;k.on("openEditor",function(e,n){try{if(i&&"function"==typeof i.setValue)return window.getTextFromWhistle_=null,t.refs.editorWin.show(),i.setValue(n);window._initWhistleTextEditor_=function(e){i=e,i.setValue(n)},t.refs.editorWin.show("editor.html")}catch(r){}}),k.on("addNewRulesFile",function(e,n){var r=n.filename,o=t.state.rules.add(r,n.data);t.setRulesActive(r),t.setState({activeRules:o}),t.triggerRulesChange("create")}),k.on("addNewValuesFile",function(e,n){var r=n.filename,o=t.state.values.add(r,n.data);t.setValuesActive(r),t.setState({activeValues:o}),t.triggerValuesChange("create")}),k.on("recoverRules",function(e,n){var r=t.state.rules,o=n.filename,i=function(e){e&&D.rules.add({name:o,value:n.data,recycleFilename:n.name},function(e,i){if(e&&0===e.ec){var a=r.add(o,n.data);t.setRulesActive(o),t.setState({activeRules:a}),t.triggerRulesChange("create"),k.trigger("rulesRecycleList",e),k.trigger("focusRulesList")}else S.showSystemError(i)})};return r.exists(o)?void Y.confirm("The name `"+o+"` already exists, whether to overwrite it?",i):i(!0)}),k.on("recoverValues",function(e,n){var r=t.state.values,o=n.filename,i=function(e){e&&D.values.add({name:o,value:n.data,recycleFilename:n.name},function(e,i){if(e&&0===e.ec){var a=r.add(o,n.data);t.setValuesActive(o),t.setState({activeValues:a}),t.triggerValuesChange("create"),k.trigger("valuesRecycleList",e)}else S.showSystemError(i)})};return r.exists(o)?void Y.confirm("The name `"+o+"` already exists, whether to overwrite it?",i):i(!0)}),f(document).on("dragleave",r).on("dragenter",r).on("dragover",r).on("drop",function(e){e.preventDefault();var n=e.originalEvent.dataTransfer.files,r=n&&n[0];if(r){if(f(".w-files-dialog.in").length)return k.trigger("uploadFile",r);var o,i=t.state.name,a=f(e.target);if("network"===i){if(a.closest(".w-frames-composer").length)return;if(/\.log$/i.test(r.name))return r.size>Z?Y.alert("The file size cannot exceed 2m."):void S.readFileAsText(r,function(e){e=S.parseLogs(e),e&&(null!==D.uploadLogs&&(D.uploadLogs=e),k.trigger("showLog"),k.trigger("uploadLogs",{logs:e}))});o=new FormData,o.append("importSessions",n[0]),t.uploadSessionsForm(o)}a.closest(".w-divider-left").length&&("rules"===i?(o=new FormData,o.append("rules",n[0]),t.rulesForm=o,t.refs.confirmImportRules.show()):"values"===i&&(o=new FormData,o.append("values",n[0]),t.valuesForm=o,t.refs.confirmImportValues.show()))}}).on("keydown",function(e){(e.metaKey||e.ctrlKey)&&82===e.keyCode&&e.preventDefault()});var a=function(e){var n=e.target;"A"==n.nodeName&&f(n).parent().hasClass("w-list-data")&&("rules"==t.state.name?t.removeRules():t.removeValues()),e.preventDefault()};f(window).on("hashchange",function(){var e=s(t.state);e&&-1==e.indexOf("rules")?-1!=e.indexOf("values")?t.showValues():-1!=e.indexOf("plugins")?t.showPlugins():t.showNetwork():t.showRules()}).on("keyup",function(e){if(27==e.keyCode){t.setMenuOptionsState();var n=f(".modal");"function"==typeof n.modal&&n.modal("hide")}}).on("keydown",function(e){if(46==e.keyCode&&a(e),!e.ctrlKey&&!e.metaKey)return void(112===e.keyCode?(e.preventDefault(),window.open("https://avwo.github.io/whistle/webui/"+t.state.name+".html")):116===e.keyCode&&e.preventDefault());77===e.keyCode?(t.toggleLeftMenu(),e.preventDefault()):66===e.keyCode&&(t.toggleTreeView(),e.preventDefault(),k.trigger("toggleTreeViewByAccessKey"));var n="network"===t.state.name;n&&88==e.keyCode&&(S.isFocusEditor()||f(e.target).closest(".w-frames-list").length||t.clear()),68==e.keyCode&&a(e);var r=t.state.network;if(n&&83===e.keyCode){if(e.preventDefault(),f(".modal.in").length)return void(f(A.findDOMNode(t.refs.chooseFileType)).is(":visible")&&t.exportBySave());var o=e.target.nodeName;if("INPUT"===o||"TEXTAREA"===o)return;var i=r.hasSelected();return void(i&&(f(A.findDOMNode(t.refs.chooseFileType)).modal("show"),setTimeout(function(){A.findDOMNode(t.refs.sessionsName).focus()},500)))}n&&73===e.keyCode&&(t.importSessions(e),e.preventDefault())});var c=function(){var e=t.state.name;return"rules"===e||"values"===e};f(document.body).on("mouseenter",$,function(t){if(c()&&(t.ctrlKey||t.metaKey)){var n=f(this);(n.hasClass("cm-js-http-url")||n.hasClass("cm-string")||n.hasClass("cm-js-at")||e(n.text()))&&n.addClass("w-is-link")}}).on("mouseleave",$,function(e){f(this).removeClass("w-is-link")}).on("mousedown",$,function(n){if(c()&&(n.ctrlKey||n.metaKey)){var r=f(this),o=r.text();if(r.hasClass("cm-js-at"))return void(te.test(o)&&window.open((RegExp.$1||"http:")+RegExp.$2));if(r.hasClass("cm-string"))return void(ee.test(o)&&window.open((RegExp.$1||"http:")+RegExp.$2));if(r.hasClass("cm-js-http-url"))return/^https?:\/\//i.test(o)||(o="http:"+("/"===o[0]?"":"//")+o),void window.open(o);var i=e(o);return i?void t.showAndActiveValues({name:i}):void 0}}),"network"==t.state.name&&t.startLoadData(),D.on("settings",function(e){var n=t.state,r=e.server,o=r.account&&r.account.url;if(n.interceptHttpsConnects!==e.interceptHttpsConnects||n.enableHttp2!==e.enableHttp2||n.disabledAllRules!==e.disabledAllRules||n.allowMultipleChoice!==e.allowMultipleChoice||n.disabledAllPlugins!==e.disabledAllPlugins||n.backRulesFirst!==e.backRulesFirst||n.multiEnv!=r.multiEnv||n.ndp!=r.ndp||n.ndr!=r.ndr||n.drb!=r.drb||n.drm!=r.drm){n.interceptHttpsConnects=e.interceptHttpsConnects,n.enableHttp2=e.enableHttp2,n.disabledAllRules=e.disabledAllRules,n.allowMultipleChoice=e.allowMultipleChoice,n.backRulesFirst=e.backRulesFirst,n.disabledAllPlugins=e.disabledAllPlugins,n.multiEnv=r.multiEnv,n.ndp=r.ndp,n.ndr=r.ndr,n.drb=r.drb,n.drm=r.drm,L.setPlugins(n);var i=oe;return i[3].checked=!n.disabledAllRules,i[4].checked=!n.disabledAllPlugins,t.setState({accountUrl:o}),void t.refs.contextMenu.update()}n.accountUrl!==o&&t.setState({accountUrl:o})}),D.on("rules",function(e){var n=t.state.rules,r=e.list;e.defaultRulesIsDisabled||-1!==r.indexOf("Default")||r.unshift("Default");var o=n.getSelectedNames();l(o,r)||(t.reselectRules(e,!0),t.setState({}))}),D.on("serverInfo",function(e){t.serverInfo=e}),k.on("executeComposer",function(){t.autoRefresh&&t.autoRefresh()});var u=function(e){if(Array.isArray(e))return e;if(e&&!e.selected)return[e]};k.on("updateUI",function(){t.setState({})}),k.on("replaySessions",function(e,n,r){var o=t.state.network,i=u(n)||o.getSelectedList(),a=i&&i.length;return r&&1===a?(t.replayList=i,t.refs.setReplayCount.show(),void setTimeout(function(){var e=A.findDOMNode(t.refs.replayCount);e.select(),e.focus()},300)):void t.replay(e,i)}),k.on("importSessions",t.importSessions),k.on("filterSessions",t.showSettings),k.on("exportSessions",function(e,n){t.exportData(e,u(n))}),k.on("abortRequest",function(e,n){t.abort(u(n))}),k.on("uploadSessions",function(e,n){var r=u(n&&n.curItem),o=n&&n.upload;if("function"==typeof o){if(!r){var i=t.state.network;r=i.getSelectedList(),r&&r.length&&(r=f.extend(!0,[],r))}r&&o(r)}}),k.on("removeIt",function(e,n){var r=t.state.network;n&&r&&(r.remove(n),t.setState({}))}),k.on("removeOthers",function(e,n){var r=t.state.network;n&&r&&(n.selected?r.removeUnselectedItems():r.removeOthers(n),t.setState({}))}),k.on("clearAll",t.clear),k.on("removeSelected",function(){var e=t.state.network;e&&(e.removeSelectedItems(),t.setState({}))}),k.on("removeUnselected",function(){var e=t.state.network;e&&(e.removeUnselectedItems(),t.setState({}))}),k.on("removeUnmarked",function(){var e=t.state.network;e&&(e.removeUnmarkedItems(),t.setState({}))}),k.on("saveRules",function(e,n){if(n.changed||!n.selected){var r=t.state.rules.getChangedGroupList(n);r.forEach(t.selectRules)}else t.unselectRules(n)}),k.on("saveValues",function(e,n){var r=t.state.values.getChangedGroupList(n);r.forEach(t.saveValues)}),k.on("renameRules",function(e,n){t.showEditRules(n)}),k.on("renameValues",function(e,n){t.showEditValues(n)}),k.on("deleteRules",function(e,n){setTimeout(function(){t.removeRules(n)},0)}),k.on("deleteValues",function(e,n){setTimeout(function(){t.removeValues(n)},0)}),k.on("createRules",t.showCreateRules),k.on("createValues",t.showCreateValues),k.on("exportRules",t.exportData),k.on("exportValues",t.exportData),k.on("importRules",t.importRules),k.on("importValues",t.importValues),k.on("uploadRules",function(e,n){var r=o(n);r.append("replaceAll","1"),t._uploadRules(r,!0)}),k.on("uploadValues",function(e,n){var r=o(n,"values");r.append("replaceAll","1"),t._uploadValues(r,!0)});var d,p,g=document.hidden;f(document).on("visibilitychange",function(){clearTimeout(d);var e="network"===t.state.name;return document.hidden||!e?void(e&&g!==document.hidden&&(g=!0,p=t.scrollerAtBottom&&t.scrollerAtBottom())):(g=!1,void(d=setTimeout(function(){var e=p||t.scrollerAtBottom&&t.scrollerAtBottom();p=!1,t.setState({},function(){e&&t.autoRefresh()})},100)))}),setTimeout(function(){D.checkUpdate(function(e){e&&e.showUpdate&&t.setState({version:e.version,latestVersion:e.latestVersion},function(){f(A.findDOMNode(t.refs.showUpdateTipsDialog)).modal("show")})})},1e4),D.getLogIdList=this.getLogIdListFromRules,D.importAnySessions=t.importAnySessions,D.on("plugins",function(e){var n=t.createPluginsOptions(e.plugins),r=t.state.pluginsOptions,o=t.state.disabledPlugins,i=t.state.disabledAllPlugins,a=e.disabledPlugins;if(i==e.disabledAllPlugins&&n.length==r.length){for(var s,l=0,c=n.length;c>l;l++){var u=n[l],d=r[l];if(u.name!=d.name||u.latest!==d.latest||u.mtime!=d.mtime||o[u.name]!=a[u.name]||u.hideLongProtocol!=d.hideLongProtocol||u.hideShortProtocol!=d.hideShortProtocol||u.path!=d.path){s=!0;break}}if(!s)return}var p=t.state.plugins;p&&e.plugins&&Object.keys(e.plugins).forEach(function(t){var n=p[t];if(n){var r=e.plugins[t];r.selectedRulesHistory=n.selectedRulesHistory,r.selectedValuesHistory=n.selectedValuesHistory}});var g={plugins:e.plugins,disabledPlugins:e.disabledPlugins,pluginsOptions:n,disabledAllPlugins:e.disabledAllPlugins};L.setPlugins(g),t.setState(g)});try{var h=window.parent.onWhistleReady;"function"==typeof h&&h({url:location.href,pageId:D.getPageId(),compose:D.compose,importSessions:t.importAnySessions,importHarSessions:t.importHarSessions,clearSessions:t.clear,selectIndex:function(e){k.trigger("selectedIndex",e)}})}catch(m){}},shouldComponentUpdate:function(e,t){var n=this.state.name;return"network"===n&&t.name!==n&&(this._isAtBottom=this.scrollerAtBottom&&this.scrollerAtBottom()),!0},importAnySessions:function(e){e&&(Array.isArray(e)?D.addNetworkList(e):this.importHarSessions(e))},donotShowAgain:function(){D.donotShowAgain()},hideUpdateTipsDialog:function(){f(A.findDOMNode(this.refs.showUpdateTipsDialog)).modal("hide")},getAllRulesText:function(){var e=" "+this.getAllRulesValue();return e.replace(/#[^\r\n]*[\r\n]/g,"\n")},getLogIdListFromRules:function(){var e=this.getAllRulesText();if(e=e.match(/\slog:\/\/(?:\{[^\s]{1,36}\}|[^/\\{}()<>\s]{1,36})\s/g)){var t={};e=e.map(function(e){return e=S.removeProtocol(e.trim()),"{"===e[0]&&(e=e.slice(1,-1)),e}).filter(function(e){return e?t[e]?!1:(t[e]=1,!0):!1})}return e},getWeinreFromRules:function(){var e=this.state.values,t=this.getAllRulesText();if(t=t.match(/(?:^|\s)weinre:\/\/[^\s#]+(?:$|\s)/gm)){var n={};t=t.map(function(t){t=S.removeProtocol(t.trim());var n=u(t);if(n!==!1)return n;var r=c(t);return r!==!1?(r=e.get(r),r&&r.value):t}).filter(function(e){return e?n[e]?!1:(n[e]=1,!0):!1})}return t},getValuesFromRules:function(){var e=" "+this.getAllRulesValue();return(e=e.match(/\s(?:[\w-]+:\/\/)?\{[^\s#]+\}/g))&&(e=e.map(function(e){return c(S.removeProtocol(e.trim()))}).filter(function(e){return!!e})),e},getAllRulesValue:function(){var e=[],t=[],n=[],r=this.state.rules;return r.list.forEach(function(o){var i=r.get(o),a=i.value||"";i.active?t.push(a):i.selected?n.push(a):e.push(a)}),r=this.state.values,r.list.forEach(function(t){/\.rules$/.test(t)&&e.push(r.get(t).value)}),t.concat(n).concat(e).join("\r\n")},preventBlur:function(e){"INPUT"!=e.target.nodeName&&e.preventDefault()},startLoadData:function(){function e(o,a){o=o||r.state.network,clearTimeout(i),i=null,"network"==r.state.name&&(a=a||n(),o.update(a)&&a&&(i=setTimeout(e,3e3)),document.hidden||r.setState({},function(){a&&t()}))}function t(e){(e||!r.state.network.isTreeView)&&(s.scrollTop=1e7)}function n(){var e=a.find(".ReactVirtualized__Grid__innerScrollContainer")[0];return e?s.scrollTop+s.offsetHeight+5>e.offsetHeight:!0}var r=this;if(r._updateNetwork)return void r._updateNetwork();var o,i,a=f(".w-req-data-list .ReactVirtualized__Grid:first").scroll(function(){var t=r.state.network;o&&clearTimeout(o),o=null,n()&&(o=setTimeout(function(){e(t,!0)},1e3))}),s=a[0];this.container=a,D.on("data",e),f(document).on("dblclick",".w-network-menu-list",function(e){f(e.target).hasClass("w-network-menu-list")&&(s.scrollTop<1?t(!0):s.scrollTop=0)}),r._updateNetwork=e,r.autoRefresh=t,r.scrollerAtBottom=n},showPlugins:function(e){"plugins"!=this.state.name?(this.setMenuOptionsState(),this.hidePluginsOptions()):e&&!this.state.showLeftMenu&&this.showPluginsOptions(),this.setState({hasPlugins:!0,name:"plugins"}),S.changePageName("plugins")},handleAction:function(e){if("top"===e)return void(this.container[0].scrollTop=0);if("bottom"===e)return this.autoRefresh(!0);if("pause"===e)return k.trigger("changeRecordState",e),D.pauseNetworkRecord();var t="refresh"===e;return t?k.trigger("changeRecordState"):k.trigger("changeRecordState","stop"),D.stopNetworkRecord(!t),t?this.autoRefresh():void 0},showNetwork:function(e){var t=this;return"network"==t.state.name?void(e&&!t.state.showLeftMenu&&t.showNetworkOptions()):(t.setMenuOptionsState(),t.setState({hasNetwork:!0,name:"network"},function(){t.startLoadData(),t._isAtBottom&&(t._isAtBottom=!1,t.autoRefresh&&t.autoRefresh())}),void S.changePageName("network"))},handleNetwork:function(e,t){var n=this.state.network;"removeAll"==e.id?this.clear():"removeSelected"==e.id?n.removeSelectedItems():"removeUnselected"==e.id?n.removeUnselectedItems():"exportWhistleFile"==e.id?this.exportSessions("whistle"):"exportSazFile"==e.id?this.exportSessions("Fiddler"):"exportHarFile"==e.id?this.exportSessions("har"):"importSessions"==e.id?this.importSessions(t):"toggleView"===e.id&&this.toggleTreeView(),this.hideNetworkOptions()},importData:function(e){switch(this.state.name){case"network":this.importSessions(e);break;case"rules":this.importRules(e);break;case"values":this.importValues(e)}},exportData:function(e,t){switch(this.state.name){case"network":var n=this.state.network,r=Array.isArray(t)||n.hasSelected();if(this.currentFoucsItem=t,r){f(A.findDOMNode(this.refs.chooseFileType)).modal("show");var o=this;setTimeout(function(){A.findDOMNode(o.refs.sessionsName).focus()},500)}else z.info("Please select the sessions first.");break;case"rules":this.showAndActiveRules({id:"exportRules"});break;case"values":this.showAndActiveValues({id:"exportValues"})}},importSessions:function(e,t){var n=this,r=e&&e.shiftKey||t&&t.shiftKey;return r?(n.refs.importRemoteSessions.show(),void setTimeout(function(){var e=A.findDOMNode(n.refs.sessionsRemoteUrl);e.focus(),e.select()},500)):void A.findDOMNode(n.refs.importSessions).click()},importSessionsFromUrl:function(e,t){if(e){var n=this;n.setState({pendingSessions:!0}),D.importRemote({url:e},a(function(e,r){n.setState({pendingSessions:!1}),e||(t&&n.refs.importRemoteSessions.hide(),n.importAnySessions(r))}))}},importRemoteSessions:function(e){if(!e||"click"===e.type||13===e.keyCode){var t=this,n=A.findDOMNode(t.refs.sessionsRemoteUrl),r=i(n.value);t.importSessionsFromUrl(r,!0)}},importRules:function(e,t){var n=this,r=e&&e.shiftKey||t&&t.shiftKey;return r?(n.refs.importRemoteRules.show(),void setTimeout(function(){var e=A.findDOMNode(n.refs.rulesRemoteUrl);e.focus(),e.select()},500)):void A.findDOMNode(n.refs.importRules).click()},importRemoteRules:function(e){if(!e||"click"===e.type||13===e.keyCode){var t=this,n=A.findDOMNode(t.refs.rulesRemoteUrl),r=i(n.value);r&&(t.setState({pendingRules:!0}),D.importRemote({url:r},a(function(e,n){t.setState({pendingRules:!1}),e||(t.refs.importRemoteRules.hide(),n&&(t.rulesForm=o(n),t.refs.confirmImportRules.show()))})))}},importValues:function(e,t){var n=this,r=e&&e.shiftKey||t&&t.shiftKey;return r?(n.refs.importRemoteValues.show(),void setTimeout(function(){var e=A.findDOMNode(n.refs.valuesRemoteUrl);e.focus(),e.select()},500)):void A.findDOMNode(n.refs.importValues).click()},importRemoteValues:function(e){if(!e||"click"===e.type||13===e.keyCode){var t=this,n=A.findDOMNode(t.refs.valuesRemoteUrl),r=i(n.value);r&&(t.setState({pendingValues:!0}),D.importRemote({url:r},a(function(e,n){t.setState({pendingValues:!1}),e||(t.refs.importRemoteValues.hide(),n&&(t.valuesForm=o(n,"values"),t.refs.confirmImportValues.show()))})))}},_uploadRules:function(e,t){var n=this;D.upload.importRules(e,function(e,r){e?0===e.ec?(n.reloadRules(e),t&&z.success("Successful synchronization Rules.")):Y.alert(e.em):S.showSystemError(r)})},_uploadValues:function(e,t){var n=this;D.upload.importValues(e,function(e,r){e||S.showSystemError(r),0===e.ec?(n.reloadValues(e),t&&z.success("Successful synchronization Values.")):Y.alert(e.em)})},uploadRules:function(e){var t=this.rulesForm;if(this.rulesForm=null,t){var n=t.get("rules");if(!n||!/\.(txt|json)$/i.test(n.name))return Y.alert("Only supports .txt or .json file.");if(n.size>K)return Y.alert("The file size cannot exceed 6m.");f(e.target).hasClass("btn-danger")&&t.append("replaceAll","1"),this._uploadRules(t),A.findDOMNode(this.refs.importRules).value=""}},uploadValues:function(e){var t=this.valuesForm;if(this.valuesForm=null,t){var n=t.get("values");if(!n||!/\.(txt|json)$/i.test(n.name))return Y.alert("Only supports .txt or .json file.");if(n.size>K)return Y.alert("The file size cannot exceed 6m.");f(e.target).hasClass("btn-danger")&&t.append("replaceAll","1"),this._uploadValues(t),A.findDOMNode(this.refs.importValues).value=""}},uploadRulesForm:function(){this.rulesForm=new FormData(A.findDOMNode(this.refs.importRulesForm)),this.refs.confirmImportRules.show()},uploadValuesForm:function(){this.valuesForm=new FormData(A.findDOMNode(this.refs.importValuesForm)),this.refs.confirmImportValues.show()},showAndActiveRules:function(e,t){if("rules"===this.state.name)switch(e.id){case"exportRules":this.refs.selectRulesDialog.show();break;case"importRules":this.importRules(t)}else this.setRulesActive(e.name),this.showRules();this.hideRulesOptions()},showRules:function(e){"rules"!=this.state.name?(this.setMenuOptionsState(),this.hideRulesOptions()):e&&!this.state.showLeftMenu&&this.showRulesOptions(e),this.setState({hasRules:!0,name:"rules"}),S.changePageName("rules")},showAndActiveValues:function(e,t){var n=this;if("values"===n.state.name&&e.id)switch(e.id){case"exportValues":n.refs.selectValuesDialog.show();break;case"importValues":this.importValues(t)}else{var r=n.state.values,o=e.name;r.exists(o)?n.setValuesActive(o):D.values.add({name:o},function(e,t){if(e&&0===e.ec){var i=r.add(o);n.setValuesActive(o),n.setState({activeValues:i}),k.trigger("focusValuesList")}else S.showSystemError(t)}),this.showValues()}n.hideValuesOptions()},addValue:function(){},showValues:function(e){"values"!=this.state.name?(this.setMenuOptionsState(),this.hideValuesOptions()):e&&!this.state.showLeftMenu&&this.showValuesOptions(e),this.setState({hasValues:!0,name:"values"}),S.changePageName("values")},showNetworkOptions:function(){"network"==this.state.name&&this.setState({showNetworkOptions:!0})},hideNetworkOptions:function(){this.setState({showRemoveOptions:!1,showAbortOptions:!1,showNetworkOptions:!1})},showRemoveOptions:function(){this.setState({showRemoveOptions:!0})},showAbortOptions:function(){var e=this.state.network,t=e.getSelectedList();le[0].disabled=!t||!t.filter(S.canAbort).length,this.setState({showAbortOptions:!0})},showCreateOptions:function(){this.setState({showCreateOptions:!0})},hideCreateOptions:function(){this.setState({showCreateOptions:!1})},hideRemoveOptions:function(){this.setState({showRemoveOptions:!1})},hideAbortOptions:function(){this.setState({ -showAbortOptions:!1})},showHelpOptions:function(){this.setState({showHelpOptions:!0})},hideHelpOptions:function(){this.setState({showHelpOptions:!1})},showHasNewVersion:function(e){this.setState({hasNewVersion:e})},showRulesOptions:function(e){var t,n=this,r=n.state.rules,o=r.data,i=r.list;if("rules"===n.state.name){var a=i.length;ie[0].disabled=2>a,ie[1].disabled=1>a,t=ie}else t=[],i.forEach(function(e){t.push(o[e])});n.setState({rulesOptions:t,showRulesOptions:!0})},hideRulesOptions:function(){this.setState({showRulesOptions:!1})},showValuesOptions:function(e){var t,n=this,r=this.state.values.list;if("values"===n.state.name){var o=r.length;ae[0].disabled=2>o,ae[1].disabled=1>o,t=ae}else{t=[];var i=n.getValuesFromRules()||[];i=S.unique(r.concat(i));var a=[];i.forEach(function(e){var n=-1!=r.indexOf(e),o={name:e,icon:n?"edit":"plus"};n?t.push(o):a.push(o)}),t=a.concat(t)}n.setState({valuesOptions:t,showValuesOptions:!0})},hideValuesOptions:function(){this.setState({showValuesOptions:!1})},showAndActivePlugins:function(e){this.hidePluginsOptions(),this.showPlugins(),this.showPluginTab(e.name)},showPluginTab:function(e){var t="Home",n=this.state.tabs||[];if(e&&e!=t)for(var r=0,o=n.length;o>r;r++)if(n[r].name==e){t=e,e=null;break}var i=e&&this.state.plugins[e+":"];if(i){if(n.length>=_)return Y.alert("At most "+_+" tabs can be opened at the same time."),this.showPlugins();if(t=e,i.pluginHomepage&&!i.openInPlugins)return window.open(i.pluginHomepage);n.push({name:e,url:i.pluginHomepage||"plugin."+e+"/"})}this.setState({active:t,tabs:n}),this.updatePluginTabInfo(n,t)},updatePluginTabInfo:function(e,t){e=e.map(function(e){return e.name}),j.set("activePluginTabList",JSON.stringify(e)),t&&j.set("activePluginTabName",t)},activePluginTab:function(e){this.showPluginTab(f(e.target).attr("data-name"))},closePluginTab:function(e){for(var t=f(e.target).attr("data-name"),n=this.state.tabs||[],r=0,o=n.length;o>r;r++)if(n[r].name==t){n.splice(r,1);var i=this.state.active;if(i==t){var a=n[r]||n[r-1];this.state.active=a?a.name:null}return this.setState({tabs:n}),void this.updatePluginTabInfo(n)}},showPluginsOptions:function(e){this.setState({showPluginsOptions:!0})},hidePluginsOptions:function(){this.setState({showPluginsOptions:!1})},showWeinreOptionsQuick:function(e){var t=this.getWeinreFromRules();return t&&t.length?void f(e.target).closest("div").addClass("w-menu-wrapper-show"):void this.showAnonymousWeinre()},showWeinreOptions:function(e){var t=this,n=t.state.weinreOptions=t.getWeinreFromRules()||[];t.state.weinreOptions=S.unique(n).map(function(e){return{name:e,icon:"console"}}),t.setState({showWeinreOptions:!0})},hideWeinreOptions:function(){this.setState({showWeinreOptions:!1})},setMenuOptionsState:function(e,t){var n={showCreateRules:!1,showCreateValues:!1,showEditRules:!1,showEditValues:!1,showCreateOptions:!1};e&&(n[e]=!0),this.setState(n,t)},hideRulesInput:function(){this.setState({showCreateRules:!1})},hideValuesInput:function(){this.setState({showCreateValues:!1})},hideRenameRuleInput:function(){this.setState({showEditRules:!1})},hideRenameValueInput:function(){this.setState({showEditValues:!1})},showCreateRules:function(e,t){var n=A.findDOMNode(this.refs.createRulesInput);this._curFocusRulesItem=t,this.setState({showCreateRules:!0},function(){n.focus()})},showCreateValues:function(e,t){var n=A.findDOMNode(this.refs.createValuesInput);this._curFocusValuesItem=t,this.setState({showCreateValues:!0},function(){n.focus()})},showHttpsSettingsDialog:function(){f(A.findDOMNode(this.refs.rootCADialog)).modal("show")},showAccountDialog:function(){this.refs.accountDialog.show(this.state.accountUrl)},interceptHttpsConnects:function(e){var t=this,n=e.target.checked;D.interceptHttpsConnects({interceptHttpsConnects:n?1:0},function(e,r){e&&0===e.ec?t.state.interceptHttpsConnects=n:S.showSystemError(r),t.setState({})})},enableHttp2:function(e){if(!D.supportH2){var t=this;return void Y.confirm("The current version of Node.js cannot support HTTP/2.\nPlease upgrade to the latest LTS version.",function(e){e&&window.open("https://nodejs.org/"),t.setState({})})}var n=e.target.checked;D.enableHttp2({enableHttp2:n?1:0},function(e,r){e&&0===e.ec?t.state.enableHttp2=n:S.showSystemError(r),t.setState({})})},createRules:function(e){if(13==e.keyCode||"click"==e.type){var t=this,n=A.findDOMNode(t.refs.createRulesInput),r=n.value.trim();if(!r)return void z.error("The name cannot be empty.");var o,i=t.state.rules,a=e&&e.target.getAttribute("data-type");if("group"===a&&(o=!0,r="\r"+r),i.exists(r))return void z.error("The name '"+r+"' already exists.");var s="top"===a?1:"",l=t._curFocusRulesItem,c={name:r,addToTop:s};l&&(c.groupName=l.name),D.rules.add(c,function(e,a){if(e&&0===e.ec){var l=i[s?"unshift":"add"](r);n.value="",n.blur(),i.moveToGroup(r,c.groupName,s),!o&&t.setRulesActive(r),c.groupName&&k.trigger("expandRulesGroup",c.groupName),t.setState(o?{}:{activeRules:l},function(){o&&k.trigger("scrollRulesBottom")}),t.triggerRulesChange("create")}else S.showSystemError(a)})}},createValues:function(e){if(13==e.keyCode||"click"==e.type){var t=this,n=A.findDOMNode(t.refs.createValuesInput),r=n.value.trim();if(!r)return void z.error("The name cannot be empty.");if(/\s/.test(r))return void z.error("The name cannot contain spaces.");if(/#/.test(r))return void z.error("The name cannot contain #.");var o,i=t.state.values,a=e&&e.target.getAttribute("data-type");if("group"===a&&(o=!0,r="\r"+r),i.exists(r))return void z.error("The name '"+r+"' already exists.");var s=t._curFocusValuesItem,l={name:r};s&&(l.groupName=s.name),D.values.add(l,function(e,a){if(e&&0===e.ec){var s=i.add(r);n.value="",n.blur(),i.moveToGroup(r,l.groupName),!o&&t.setValuesActive(r),l.groupName&&k.trigger("expandValuesGroup",l.groupName),t.setState(o?{}:{activeValues:s},function(){o&&k.trigger("scrollValuesBottom")}),t.triggerValuesChange("create")}else S.showSystemError(a)})}},showEditRules:function(e){this.currentFocusRules=e;var t=this.state.rules,n=e||t.getActive();if(n&&!n.isDefault){var r=A.findDOMNode(this.refs.editRulesInput);r.value=n.name,this.setState({showEditRules:!0,selectedRule:n},function(){r.select(),r.focus()})}},showEditValuesByDBClick:function(e){!e.changed&&this.showEditValues()},showEditValues:function(e){this.currentFocusValues=e;var t=this.state.values,n=e||t.getActive();if(n&&!n.isDefault){var r=A.findDOMNode(this.refs.editValuesInput);r.value=n.name,this.setState({showEditValues:!0,selectedValue:n},function(){r.select(),r.focus()})}},editRules:function(e){if(13==e.keyCode||"click"==e.type){var t=this,n=t.state.rules,r=this.currentFocusRules||n.getActive();if(r){var o=A.findDOMNode(t.refs.editRulesInput),i=S.isGroup(r.name),a=(i?"\r":"")+o.value.trim();if(!a)return void z.error("The name cannot be empty.");if(n.exists(a))return void z.error("The name '"+a+"' already exists.");var s=r.name;D.rules.rename({name:s,newName:a},function(e,r){e&&0===e.ec?(n.rename(s,a),o.value="",o.blur(),!i&&t.setRulesActive(a),k.trigger("rulesNameChanged",[s,a]),t.setState({activeRules:n.getActive()}),t.triggerRulesChange("rename")):S.showSystemError(r)})}}},editValues:function(e){if(13==e.keyCode||"click"==e.type){var t=this,n=t.state.values,o=this.currentFocusValues||n.getActive();if(o){var i=A.findDOMNode(t.refs.editValuesInput),a=S.isGroup(o.name),s=(a?"\r":"")+i.value.trim();if(!s)return void z.error("The name cannot be empty.");if(n.exists(s))return void z.error("The name '"+s+"' already exists.");var l=o.name;D.values.rename({name:l,newName:s},function(e,c){e&&0===e.ec?(n.rename(l,s),i.value="",i.blur(),!a&&t.setValuesActive(s),k.trigger("valuesNameChanged",[l,s]),t.setState({activeValues:n.getActive()}),t.triggerValuesChange("rename"),r(o)):S.showSystemError(c)})}}},showAnonymousWeinre:function(){this.openWeinre()},showWeinre:function(e){this.openWeinre(e.name)},openWeinre:function(e){window.open("weinre/client/#"+(e||"anonymous")),this.setState({showWeinreOptions:!1})},onClickRulesOption:function(e){e.selected?this.unselectRules(e):this.selectRules(e)},selectRules:function(e){if(!S.isGroup(e.name)){var t=this;return D.rules[e.isDefault?"enableDefault":"select"](e,function(n,r){n&&0===n.ec?(t.reselectRules(n),t.state.rules.setChanged(e.name,!1),t.setState({}),t.triggerRulesChange("save"),t.state.disabledAllRules&&Y.confirm("Rules has been turn off, do you want to turn on it?",function(e){e&&D.rules.disableAllRules({disabledAllRules:0},function(e,n){e&&0===e.ec?(t.state.disabledAllRules=!1,t.setState({})):S.showSystemError(n)})})):S.showSystemError(r)}),!1}},selectRulesByOptions:function(e){var t=this.state.rules.data[f(e.target).attr("data-name")];this[e.target.checked?"selectRules":"unselectRules"](t)},unselectRules:function(e){var t=this;return D.rules[e.isDefault?"disableDefault":"unselect"](e,function(e,n){e&&0===e.ec?(t.reselectRules(e),t.setState({})):S.showSystemError(n)}),!1},reselectRules:function(e,t){var n=this;n.state.rules.clearAllSelected(),n.setSelected(n.state.rules,"Default",!e.defaultRulesIsDisabled,t),e.list.forEach(function(e){n.setSelected(n.state.rules,e,!0,t)})},saveValues:function(e){if(e.changed&&!S.isGroup(e.name)){var t=this;return D.values.add(e,function(n,o){n&&0===n.ec?(t.setSelected(t.state.values,e.name),t.triggerValuesChange("save"),r(e)):S.showSystemError(o)}),!1}},setSelected:function(e,t,n,r){e.setSelected(t,n)&&(r||e.setChanged(t,!1),this.setState({curSelectedName:t}))},replayCountChange:function(e){var t=e.target.value.replace(/^\s*0*|[^\d]+/,""),n=t.slice(0,3);n>q&&(n=q),this.setState({replayCount:n})},clickReplay:function(e){e.shiftKey?k.trigger("replaySessions",[null,e.shiftKey]):this.replay(e)},replay:function(e,t,n){var r=this.state.network;if(t=Array.isArray(t)?t:r.getSelectedList(),t&&t.length){this.enableRecord();var o,i=function(e,t){var n=e.req;D.compose2({repeatCount:t,useH2:e.useH2?1:"",url:e.url,headers:S.getOriginalReqHeaders(e),method:n.method,base64:n.base64})};if(n>1?i(t[0],Math.min(n,q)):(o={},t.slice(0,q).forEach(function(e){o[e.id]=1,i(e)})),r.isTreeView){var a=D.lastSelectedDataId;if(!a)return;if(!o)return k.trigger("replayTreeView",[a,n]);var s=a&&r.getTreeNode(a);if(s=s&&s.parent,!s)return;n=0,s.children.forEach(function(e){e=e.data,e&&o[e.id]&&++n}),k.trigger("replayTreeView",[a,n])}else this.autoRefresh&&this.autoRefresh()}},enableRecord:function(){this.refs.recordBtn.enable(),k.trigger("changeRecordState")},composer:function(){k.trigger("composer")},clear:function(){var e=this.state.network;this.setState({network:e.clear(),showRemoveOptions:!1})},removeRulesBatch:function(e){var t=this;D.rules.remove({list:e},function(n,r){if(n&&0===n.ec){var o,i=t.state.rules;e.forEach(function(e){var n=i.data[e]||"";n.active&&(o=i.getSibling(e),o&&t.setRulesActive(o.name)),i.remove(e)}),o&&k.trigger("expandRulesGroup",o.name),t.setState(o?{activeRules:o}:{}),t.triggerRulesChange("remove"),k.trigger("focusRulesList")}else S.showSystemError(r)}),this.refs.deleteRulesDialog.hide()},removeValuesBatch:function(e){var t=this;D.values.remove({list:e},function(n,r){if(n&&0===n.ec){var o,i=t.state.values;e.forEach(function(e){var n=i.data[e]||"";n.active&&(o=i.getSibling(e),o&&t.setValuesActive(o.name)),i.remove(e)}),o&&k.trigger("expandValuesGroup",o.name),t.setState(o?{activeValues:o}:{}),t.triggerValuesChange("remove"),k.trigger("focusValuesList")}else S.showSystemError(r)}),this.refs.deleteValuesDialog.hide()},removeRules:function(e){var t=this.state.rules,n=e||t.getActive();n&&!n.isDefault&&this.refs.deleteRulesDialog.show(n.name)},removeValues:function(e){var t=this.state.values,n=e||t.getActive();n&&!n.isDefault&&this.refs.deleteValuesDialog.show(n.name)},setRulesActive:function(e,t){t=t||this.state.rules,j.set("activeRules",e),t.setActive(e)},setValuesActive:function(e,t){t=t||this.state.values,j.set("activeValues",e),t.setActive(e)},showRulesSettings:function(){var e=this;f(A.findDOMNode(e.refs.rulesSettingsDialog)).modal("show"),D.rules.accountRules(function(t,n){t&&0===t.ec?e.setState({accountRules:t.rules}):S.showSystemError(n)})},showValuesSettings:function(){f(A.findDOMNode(this.refs.valuesSettingsDialog)).modal("show")},toggleLeftMenu:function(){var e=!this.state.showLeftMenu;this.setState({showLeftMenu:e}),j.set("showLeftMenu",e?1:"")},handleCreate:function(){"rules"==this.state.name?this.showCreateRules():this.showCreateValues()},saveRulesOrValues:function(){var e,t=this,n=t.state,r="rules"==n.name;r?(e=n.rules.getChangedList(),e.length&&(e.forEach(function(e){t.selectRules(e)}),t.setState({}))):(e=n.values.getChangedList(),e.length&&(e.forEach(function(e){t.saveValues(e)}),t.setState({})))},onClickMenu:function(e){var t=f(e.target).closest("a"),n=this,r=n.state,o="rules"==r.name;t.hasClass("w-edit-menu")?o?n.showEditRules():n.showEditValues():t.hasClass("w-delete-menu")?o?n.removeRules():n.removeValues():t.hasClass("w-save-menu")&&n.saveRulesOrValues()},showSettings:function(e){var t=this.state.name;return"rules"===t?void this.showRulesSettings():"values"===t?void this.showValuesSettings():void this.refs.networkSettings.showDialog()},activeRules:function(e){j.set("activeRules",e.name),this.setState({activeRules:e})},activeValues:function(e){j.set("activeValues",e.name),this.setState({activeValues:e})},onRulesThemeChange:function(e){var t=e.target.value;j.set("rulesTheme",t),this.setState({rulesTheme:t})},onValuesThemeChange:function(e){var t=e.target.value;j.set("valuesTheme",t),this.setState({valuesTheme:t})},onRulesFontSizeChange:function(e){var t=e.target.value;j.set("rulesFontSize",t),this.setState({rulesFontSize:t})},onValuesFontSizeChange:function(e){var t=e.target.value;j.set("valuesFontSize",t),this.setState({valuesFontSize:t})},onRulesLineNumberChange:function(e){var t=e.target.checked;j.set("showRulesLineNumbers",t),this.setState({showRulesLineNumbers:t})},onValuesLineNumberChange:function(e){var t=e.target.checked;j.set("showValuesLineNumbers",t),this.setState({showValuesLineNumbers:t})},showFoldGutter:function(e){var t=e.target.checked;j.set("foldGutter",t?"1":""),this.setState({foldGutter:t})},onRulesLineWrappingChange:function(e){var t=e.target.checked;j.set("autoRulesLineWrapping",t?1:""),this.setState({autoRulesLineWrapping:t})},onValuesLineWrappingChange:function(e){var t=e.target.checked;j.set("autoValuesLineWrapping",t?1:""),this.setState({autoValuesLineWrapping:t})},confirmDisableAllRules:function(e){var t=this,n=t.state;n.disabledAllRules?t.disableAllRules():Y.confirm("Are you sure to disable all rules",function(e){e&&t.disableAllRules()}),e&&e.preventDefault()},confirmDisableAllPlugins:function(e){var t=this,n=t.state;n.disabledAllPlugins?t.disableAllPlugins():Y.confirm("Are you sure to disable all plugins",function(e){e&&t.disableAllPlugins()}),e&&e.preventDefault()},disableAllRules:function(e,t){var n=this,r=n.state,o=!r.disabledAllRules;D.rules.disableAllRules({disabledAllRules:o?1:0},function(e,i){e&&0===e.ec?(r.disabledAllRules=o,n.setState({}),"function"==typeof t&&t(o)):S.showSystemError(i)}),e&&e.preventDefault()},disableAllPlugins:function(e,t){var n=this,r=n.state,o=!r.disabledAllPlugins;D.plugins.disableAllPlugins({disabledAllPlugins:o?1:0},function(e,i){e&&0===e.ec?(r.disabledAllPlugins=o,L.setPlugins(r),n.setState({}),"function"==typeof t&&t(o)):S.showSystemError(i)}),e&&e.preventDefault()},disablePlugin:function(e){var t=this,n=e.target;return t.state.ndp?z.warn("Not allowed disable plugins."):void D.plugins.disablePlugin({name:f(n).attr("data-name"),disabled:n.checked?0:1},function(e,n){e&&0===e.ec?(t.state.disabledPlugins=e.data,L.setPlugins(t.state),t.setState({})):S.showSystemError(n)})},abort:function(e){if(!Array.isArray(e)){var t=this.state.network;e=t.getSelectedList()}e&&(e=e.map(function(e){return S.canAbort(e)?e.id:void 0}),e.length&&D.abort({list:e.join()})),this.hideAbortOptions()},allowMultipleChoice:function(e){var t=this,n=e.target.checked;D.rules.allowMultipleChoice({allowMultipleChoice:n?1:0},function(e,r){e&&0===e.ec?t.setState({allowMultipleChoice:n}):S.showSystemError(r)})},enableBackRulesFirst:function(e){var t=this,n=e.target.checked;D.rules.enableBackRulesFirst({backRulesFirst:n?1:0},function(e,r){e&&0===e.ec?(t.setState({backRulesFirst:n}),D.backRulesFirst=n):S.showSystemError(r)})},reinstallAllPlugins:function(){k.trigger("updateAllPlugins","reinstallAllPlugins")},chooseFileType:function(e){var t=e.target.value;j.set("exportFileType",t),this.setState({exportFileType:t})},uploadSessions:function(){this.uploadSessionsForm(new FormData(A.findDOMNode(this.refs.importSessionsForm))),A.findDOMNode(this.refs.importSessions).value=""},importHarSessions:function(e){if(e&&"object"===("undefined"==typeof e?"undefined":p(e))){var t=e.log.entries,n=[];t.forEach(function(e){if(e){var t=e.whistleTimes||"",r=new Date(t.startTime||e.startedDateTime).getTime();if(!isNaN(r)){var o=e.request||{},i=e.response||{},a=S.parseHeadersFromHar(o.headers),s=S.parseHeadersFromHar(i.headers),l=e.clientIPAddress||"127.0.0.1",c=e.serverIPAddress||"",u=G.test(o.httpVersion||i.httpVersion),d=u?"2.0":"1.1",p=o.postData||"",g={method:o.method,ip:l,port:o.port,httpVersion:d,unzipSize:p.size,size:o.bodySize>0?o.bodySize:0,headers:a.headers,rawHeaderNames:a.rawHeaderNames,body:""},h=p.base64||p.text;h&&(p.base64?g.base64=h:g.body=h);var f=i.content,m={httpVersion:d,statusCode:i.statusCode||i.status,statusMessage:i.statusText,unzipSize:f.size,size:i.bodySize>0?i.bodySize:0,headers:s.headers,rawHeaderNames:s.rawHeaderNames,ip:c,port:i.port,body:""},A=i.content,M=A&&A.text;M&&(A.base64?m.base64=A.base64:"IMG"===S.getContentType(A.mimeType)||M.length%4===0&&/^[a-z\d+/]+={0,2}$/i.test(M)?m.base64=M:m.body=M);var w={useH2:u,startTime:r,frames:e.frames,url:o.url,realUrl:e.whistleRealUrl,req:g,res:m,fwdHost:e.whistleFwdHost,sniPlugin:e.whistleSniPlugin,rules:e.whistleRules||{},version:e.whistleVersion,nodeVersion:e.whistleNodeVersion};if(t&&t.startTime)w.dnsTime=t.dnsTime,w.requestTime=t.requestTime,w.responseTime=t.responseTime,w.endTime=t.endTime;else{var y=e.timings||{},b=Math.round(r+S.getTimeFromHar(e.time));r=Math.floor(r+S.getTimeFromHar(y.dns)),w.dnsTime=r,r=Math.floor(r+S.getTimeFromHar(y.connect)+S.getTimeFromHar(y.ssl)+S.getTimeFromHar(y.send)+S.getTimeFromHar(y.blocked)+S.getTimeFromHar(y.wait)),w.requestTime=r,r=Math.floor(r+S.getTimeFromHar(y.receive)),w.responseTime=r,w.endTime=Math.max(r,b)}n.push(w)}}}),D.addNetworkList(n)}},uploadSessionsForm:function(e){var t=e.get("importSessions");if(!t||!/\.(txt|json|saz|har)$/i.test(t.name))return Y.alert("Only supports .txt, .json, .saz or .har file.");if(t.size>J)return Y.alert("The file size cannot exceed 64m.");var n=/\.txt$/i.test(t.name);if(n||/\.har$/i.test(t.name)){var r=this;return void S.readFileAsText(t,function(e){try{e=JSON.parse(e),n?D.addNetworkList(e):r.importHarSessions(e)}catch(t){Y.alert("Unrecognized format.")}})}D.upload.importSessions(e,D.addNetworkList)},exportSessions:function(e,t){var n=this.state.network,r=this.currentFoucsItem;if(this.currentFoucsItem=null,r&&f(A.findDOMNode(this.refs.chooseFileType)).is(":visible")||(r=n.getSelectedList()),r&&r.length){var o=A.findDOMNode(this.refs.exportSessionsForm);A.findDOMNode(this.refs.exportFilename).value=t||"",A.findDOMNode(this.refs.exportFileType).value=e,"har"===e&&(r={log:{version:"1.2",creator:{name:"Whistle",version:this.state.version,comment:""},browser:{name:"Whistle",version:this.state.version},pages:[],entries:r.map(S.toHar),comment:""}}),A.findDOMNode(this.refs.sessions).value=JSON.stringify(r,null," "),o.submit()}},exportBySave:function(e){if(!e||"click"===e.type||13===e.keyCode){var t=A.findDOMNode(this.refs.sessionsName),n=t.value.trim();t.value="",this.exportSessions(this.state.exportFileType,n),f(A.findDOMNode(this.refs.chooseFileType)).modal("hide")}},replayRepeat:function(e){e&&"click"!==e.type&&13!==e.keyCode||(this.refs.setReplayCount.hide(),this.replay("",this.replayList,this.state.replayCount),k.trigger("focusNetworkList"))},showAboutDialog:function(e){f(e.target).closest(".w-menu-enable").length&&this.refs.aboutDialog.showAboutInfo()},showCustomCertsInfo:function(){var e=this;e.loadingCerts||(e.loadingCerts=!0,D.certs.all(function(t,n){return e.loadingCerts=!1,t?void e.refs.certsInfoDialog.show(t.certs,t.dir):void S.showSystemError(n)}))},onContextMenu:function(e){var t=0,n=oe;if(n[2].hide&&++t,n[3].hide&&++t,n[4].hide&&++t,3>t){var r=S.getMenuPosition(e,110,100-30*t),o=this.state;r.list=n,n[2].checked=!!o.network.isTreeView,n[3].checked=!o.disabledAllRules,n[4].checked=!o.disabledAllPlugins;var i=f(e.target);n[0].hide=!0,n[1].hide=!0,i.closest(".w-network-menu").length?n[0].hide=!1:i.closest(".w-save-menu").length&&(n[1].hide=!1,i.closest(".w-rules-menu").length?n[1].disabled=!o.rules.hasChanged():n[1].disabled=!o.values.hasChanged()),this.refs.contextMenu.show(r)}e.preventDefault()},onClickContextMenu:function(e){var t=this,n=t.state,r=oe;switch(e){case"Tree View":r[2].checked=!n.network.isTreeView,t.toggleTreeView();break;case"Rules":t.disableAllRules(null,function(e){r[3].checked=!e,t.setState({})});break;case"Plugins":t.disableAllPlugins(null,function(e){r[4].checked=!e,t.setState({})});break;case"Clear":return void t.clear();case"Save":return void t.saveRulesOrValues()}this.refs.contextMenu.show({})},forceShowLeftMenu:function(){var e=this;clearTimeout(e.hideTimer),clearTimeout(e.showTimer),e.showTimer=setTimeout(function(){e.setState({forceShowLeftMenu:!0})},200)},selectCAType:function(e){var t=e.target.value;"cer"!==t&&"pem"!==t&&(t="crt"),this.setState({caType:t}),j.set("caType",t)},forceHideLeftMenu:function(){var e=this;clearTimeout(e.hideTimer),clearTimeout(e.showTimer),e.hideTimer=setTimeout(function(){e.setState({forceShowLeftMenu:!1})},500)},updateMenuView:function(e){var t=e.networkOptions[e.networkOptions.length-1];return e.network.isTreeView?(t.icon="globe",t.name="Show List View"):(t.icon="tree-conifer",t.name="Show Tree View"),e},toggleTreeView:function(){var e=this,t=e.state.network;t.setTreeView(!t.isTreeView),e.updateMenuView(e.state),e.setState({},function(){t.isTreeView||e.autoRefresh&&e.autoRefresh()})},toggleTreeViewByIcon:function(){"network"==this.getTabName()&&this.toggleTreeView()},getTabName:function(){var e=this.state,t=e.rulesMode,n=e.pluginsMode,r=e.name;return e.networkMode?r="network":e.rulesOnlyMode?r="values"===r?"values":"rules":t&&n?r="plugins":t?r="network"===r?"rules":r:n&&(r="plugins"!==r?"network":r),r||"network"},render:function(){var e=this.state,t=e.networkMode,n=e.rulesMode,r=e.rulesOnlyMode,o=e.pluginsMode,i=e.multiEnv,a=this.getTabName(),s="network"==a,l="rules"==a,c="values"==a,u="plugins"==a,p=!0,h=!0,f=e.rulesTheme||"cobalt",A=e.valuesTheme||"cobalt",M=e.rulesFontSize||"14px",y=e.valuesFontSize||"14px",S=e.showRulesLineNumbers||!1,L=e.showValuesLineNumbers||!1,k=e.autoRulesLineWrapping,j=e.autoValuesLineWrapping,z=e.rulesOptions,Y=e.pluginsOptions,G={},W=e.showNetworkOptions,_=e.showRulesOptions,J=e.showValuesOptions,K=e.showPluginsOptions,Z=e.showWeinreOptions,$=e.showHelpOptions,ee=e.network,te=ee.isTreeView,re=te?"tree-conifer":"globe";z[0].name===X&&z.forEach(function(t,n){t.icon=n&&e.multiEnv?"edit":"checkbox",t.selected||(G[t.name]=1)});var ie,ae;if(l){ae=e.rules.data;for(ie in ae)if(ae[ie].active){p=h=ae[ie].isDefault;break}}else if(c){ae=e.values.data;for(ie in ae)if(ae[ie].active){p=h=!1;break}}ee.rulesModal=e.rules,e.rules.editorTheme={theme:f,fontSize:M,lineNumbers:S};var ce=e.networkOptions,ue=ee.hasUnselected();ee.hasSelected()?(ce.forEach(function(e){e.disabled=!1,"removeUnselected"===e.id&&(e.disabled=!ue)}),se.forEach(function(e){e.disabled=!1,"removeUnselected"===e.id&&(e.disabled=!ue)})):(ce.forEach(function(e){-1!==ne.indexOf(e.id)?e.disabled=!0:"removeUnselected"===e.id&&(e.disabled=!ue)}),ce[0].disabled=!ue,se.forEach(function(e){-1!==ne.indexOf(e.id)?e.disabled=!0:"removeUnselected"===e.id&&(e.disabled=!ue)}));var de,pe,ge=e.pendingSessions,he=e.pendingRules,fe=e.pendingValues,me=e.accountRules,Ae=e.accountUrl,Me=g&&!e.forceShowLeftMenu,we=o&&n,ye=(t||e.showLeftMenu)&&!we,be=e.disabledAllPlugins,ve=e.disabledAllRules;ye&&g&&(de=this.forceShowLeftMenu,pe=this.forceHideLeftMenu),oe[2].hide=n,oe[3].hide=o,oe[4].hide=r;var Te=e.caType||"crt",xe="img/qrcode.png",Ne="cgi-bin/rootca",Ce="http://rootca.pro/";return"crt"!==Te&&(xe="img/qrcode-"+Te+".png",Ne+="?type="+Te,Ce+=Te),D.hideMockMenu=o||t,m.createElement("div",{className:"main orient-vertical-box"+(ye?" w-show-left-menu":"")},m.createElement("div",{className:"w-menu w-"+a+"-menu-list"},m.createElement("a",{onClick:this.toggleLeftMenu,draggable:"false",className:"w-show-left-menu-btn",onMouseEnter:de,onMouseLeave:pe,style:{display:t||we?"none":void 0},title:"Dock to "+(ye?"top":"left")+" (Ctrl[Command] + M)"},m.createElement("span",{className:"glyphicon glyphicon-chevron-"+(ye?Me?"down":"up":"left")})),m.createElement("div",{style:{display:n?"none":void 0},onMouseEnter:this.showNetworkOptions,onMouseLeave:this.hideNetworkOptions,className:"w-nav-menu w-menu-wrapper"+(W?" w-menu-wrapper-show":"")},m.createElement("a",{onClick:this.showNetwork,onDoubleClick:this.toggleTreeView,className:"w-network-menu"+("network"==a?" w-menu-selected":""),title:"Double click to show"+(te?" List View":" Tree View"),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-"+re}),"Network"),m.createElement(x,{ref:"networkMenuItem",options:e.networkOptions,className:"w-network-menu-item",onClickOption:this.handleNetwork})),m.createElement("div",{style:{display:o?"none":void 0},onMouseEnter:this.showRulesOptions,onMouseLeave:this.hideRulesOptions,className:"w-nav-menu w-menu-wrapper"+(_?" w-menu-wrapper-show":"")+(l?" w-menu-auto":"")},m.createElement("a",{onClick:this.showRules,className:"w-rules-menu"+("rules"==a?" w-menu-selected":""),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-list"+(ve?" w-disabled":"")}),"Rules"),m.createElement(x,{ref:"rulesMenuItem",name:"rules"==a?null:"Open",options:z,checkedOptions:G,disabled:ve,className:"w-rules-menu-item",onClick:this.showRules,onClickOption:this.showAndActiveRules,onChange:this.selectRulesByOptions})),m.createElement("div",{style:{display:o?"none":void 0},onMouseEnter:this.showValuesOptions,onMouseLeave:this.hideValuesOptions,className:"w-nav-menu w-menu-wrapper"+(J?" w-menu-wrapper-show":"")+(c?" w-menu-auto":"")},m.createElement("a",{onClick:this.showValues,className:"w-values-menu"+("values"==a?" w-menu-selected":""),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-folder-close"}),"Values"),m.createElement(x,{ref:"valuesMenuItem",name:"values"==a?null:"Open",options:e.valuesOptions,className:"w-values-menu-item",onClick:this.showValues,onClickOption:this.showAndActiveValues})),m.createElement("div",{style:{display:r||we?"none":void 0},ref:"pluginsMenu",onMouseEnter:this.showPluginsOptions,onMouseLeave:this.hidePluginsOptions,className:"w-nav-menu w-menu-wrapper"+(K?" w-menu-wrapper-show":"")},m.createElement("a",{onClick:this.showPlugins,className:"w-plugins-menu"+("plugins"==a?" w-menu-selected":""),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-list-alt"+(be?" w-disabled":"")}),"Plugins"),m.createElement(x,{ref:"pluginsMenuItem",name:"plugins"==a?null:"Open",options:Y,checkedOptions:e.disabledPlugins,disabled:be,className:"w-plugins-menu-item",onClick:this.showPlugins,onChange:this.disablePlugin,onClickOption:this.showAndActivePlugins})),!e.ndr&&m.createElement("a",{onClick:this.confirmDisableAllRules,className:"w-enable-rules-menu",title:ve?"Enable all rules":"Disable all rules",style:{display:l?"":"none",color:ve?"#f66":void 0},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-"+(ve?"play-circle":"off")}),ve?"ON":"OFF"),!e.ndp&&m.createElement("a",{onClick:this.confirmDisableAllPlugins,className:"w-enable-plugin-menu",title:be?"Enable all plugins":"Disable all plugins",style:{display:u?"":"none",color:be?"#f66":void 0},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-"+(be?"play-circle":"off")}),be?"ON":"OFF"),m.createElement(R,{hide:!u}),m.createElement("a",{onClick:this.reinstallAllPlugins,className:"w-plugins-menu"+(u?"":" hide"),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-download-alt"}),"ReinstallAll"),m.createElement(N,{ref:"recordBtn",hide:!s,onClick:this.handleAction}),m.createElement("a",{onClick:this.importData,className:"w-import-menu",style:{display:u?"none":""},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-import"}),"Import"),m.createElement("a",{onClick:this.exportData,className:"w-export-menu",style:{display:u?"none":""},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-export"}),"Export"),m.createElement("div",{onMouseEnter:this.showRemoveOptions,onMouseLeave:this.hideRemoveOptions,style:{display:s?"":"none"},className:"w-menu-wrapper w-remove-menu-list w-menu-auto"+(e.showRemoveOptions?" w-menu-wrapper-show":"")},m.createElement("a",{onClick:this.clear,className:"w-remove-menu",title:"Ctrl[Command] + X",draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-remove"}),"Clear"),m.createElement(x,{options:se,className:"w-remove-menu-item",onClickOption:this.handleNetwork})),m.createElement("a",{onClick:this.onClickMenu,className:"w-save-menu",style:{display:s||u?"none":""},draggable:"false",title:"Ctrl[Command] + S"},m.createElement("span",{className:"glyphicon glyphicon-save-file"}),"Save"),m.createElement("a",{className:"w-create-menu",style:{display:s||u?"none":""},draggable:"false",onClick:this.handleCreate},m.createElement("span",{className:"glyphicon glyphicon-plus"}),"Create"),m.createElement("a",{onClick:this.onClickMenu,className:"w-edit-menu"+(p?" w-disabled":""),style:{display:s||u?"none":""},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-edit"}),"Rename"),m.createElement("div",{onMouseEnter:this.showAbortOptions,onMouseLeave:this.hideAbortOptions,style:{display:s?"":"none"},className:"w-menu-wrapper w-abort-menu-list w-menu-auto"+(e.showAbortOptions?" w-menu-wrapper-show":"")},m.createElement("a",{onClick:this.clickReplay,className:"w-replay-menu",draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-repeat"}),"Replay"),m.createElement(x,{options:le,className:"w-remove-menu-item",onClickOption:this.abort})),m.createElement("a",{onClick:this.composer,className:"w-composer-menu",style:{display:s?"":"none"},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-send"}),"Compose"),m.createElement("a",{onClick:this.onClickMenu,className:"w-delete-menu"+(h?" w-disabled":""),style:{display:s||u?"none":""},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-trash"}),"Delete"),m.createElement(Q,{onClick:this.showSettings,disabledRules:l&&ve,isNetwork:s,hide:u}),m.createElement("div",{onMouseEnter:this.showWeinreOptions,onMouseLeave:this.hideWeinreOptions,className:"w-menu-wrapper"+(Z?" w-menu-wrapper-show":"")},m.createElement("a",{onClick:this.showWeinreOptionsQuick,onDoubleClick:this.showAnonymousWeinre,className:"w-weinre-menu",draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-console"}),"Weinre"),m.createElement(x,{ref:"weinreMenuItem",name:"anonymous",options:e.weinreOptions,className:"w-weinre-menu-item",onClick:this.showAnonymousWeinre,onClickOption:this.showWeinre})),m.createElement("a",{onClick:this.showHttpsSettingsDialog,className:"w-https-menu",draggable:"false",style:{color:D.hasInvalidCerts?"red":void 0}},m.createElement("span",{className:"glyphicon glyphicon-"+(e.interceptHttpsConnects?"ok":"lock")}),"HTTPS"),m.createElement("div",{onMouseEnter:this.showHelpOptions,onMouseLeave:this.hideHelpOptions,className:"w-menu-wrapper"+($?" w-menu-wrapper-show":"")},m.createElement("a",{className:"w-help-menu"+(e.hasNewVersion?" w-menu-enable":""),onClick:this.showAboutDialog,title:e.hasNewVersion?"There is a new version of whistle":void 0, -href:e.hasNewVersion?void 0:"https://github.com/avwo/whistle#whistle",target:e.hasNewVersion?void 0:"_blank"},e.hasNewVersion?m.createElement("i",{className:"w-new-version-icon"}):null,m.createElement("span",{className:"glyphicon glyphicon-question-sign"}),"Help"),m.createElement(x,{ref:"helpMenuItem",options:e.helpOptions,name:m.createElement(v,{ref:"aboutDialog",onClick:this.hideHelpOptions,onCheckUpdate:this.showHasNewVersion}),className:"w-help-menu-item"})),m.createElement("a",{onClick:this.showAccountDialog,className:"w-account-menu",draggable:"false",style:{display:Ae?null:"none"}},m.createElement("span",{className:"glyphicon glyphicon-user"}),"Account"),m.createElement(T,{name:a}),m.createElement("div",{onMouseDown:this.preventBlur,style:{display:e.showCreateRules?"block":"none"},className:"shadow w-input-menu-item w-create-rules-input"},m.createElement("input",{ref:"createRulesInput",onKeyDown:this.createRules,onBlur:this.hideRulesInput,type:"text",maxLength:"64",placeholder:"Input the name"}),m.createElement("button",{type:"button",onClick:this.createRules,className:"btn btn-primary"},"+Rule"),m.createElement("button",{type:"button",onClick:this.createRules,"data-type":"top",className:"btn btn-default"},"+Top"),m.createElement("button",{type:"button",onClick:this.createRules,"data-type":"group",className:"btn btn-default"},"+Group")),m.createElement("div",{onMouseDown:this.preventBlur,style:{display:e.showCreateValues?"block":"none"},className:"shadow w-input-menu-item w-create-values-input"},m.createElement("input",{ref:"createValuesInput",onKeyDown:this.createValues,onBlur:this.hideValuesInput,type:"text",maxLength:"64",placeholder:"Input the name"}),m.createElement("button",{type:"button",onClick:this.createValues,className:"btn btn-primary"},"+Key"),m.createElement("button",{type:"button",onClick:this.createValues,"data-type":"group",className:"btn btn-default"},"+Group")),m.createElement("div",{onMouseDown:this.preventBlur,style:{display:e.showEditRules?"block":"none"},className:"shadow w-input-menu-item w-edit-rules-input"},m.createElement("input",{ref:"editRulesInput",onKeyDown:this.editRules,onBlur:this.hideRenameRuleInput,type:"text",maxLength:"64"}),m.createElement("button",{type:"button",onClick:this.editRules,className:"btn btn-primary"},"OK")),m.createElement("div",{onMouseDown:this.preventBlur,style:{display:e.showEditValues?"block":"none"},className:"shadow w-input-menu-item w-edit-values-input"},m.createElement("input",{ref:"editValuesInput",onKeyDown:this.editValues,onBlur:this.hideRenameValueInput,type:"text",maxLength:"64"}),m.createElement("button",{type:"button",onClick:this.editValues,className:"btn btn-primary"},"OK"))),m.createElement("div",{className:"w-container box fill"},m.createElement(O,{onClick:this.onClickContextMenu,ref:"contextMenu"}),m.createElement("div",{onContextMenu:this.onContextMenu,onDoubleClick:this.onContextMenu,className:"w-left-menu"+(de?" w-hover-left-menu":""),style:{display:t||Me?"none":void 0},onMouseEnter:de,onMouseLeave:pe},m.createElement("a",{onClick:this.showNetwork,className:"w-network-menu"+("network"==a?" w-menu-selected":""),style:{display:n?"none":void 0},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-"+re}),m.createElement("i",{className:"w-left-menu-name"},"Network")),m.createElement("a",{onClick:this.showRules,className:"w-save-menu w-rules-menu"+("rules"==a?" w-menu-selected":""),style:{display:o?"none":void 0},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-list"+(ve?" w-disabled":"")}),m.createElement("i",{className:"w-left-menu-name"},"Rules"),m.createElement("i",{className:"w-menu-changed",style:{display:e.rules.hasChanged()?void 0:"none"}},"*")),m.createElement("a",{onClick:this.showValues,className:"w-save-menu w-values-menu"+("values"==a?" w-menu-selected":""),style:{display:o?"none":void 0},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-folder-close"}),m.createElement("i",{className:"w-left-menu-name"},"Values"),m.createElement("i",{className:"w-menu-changed",style:{display:e.values.hasChanged()?void 0:"none"}},"*")),m.createElement("a",{onClick:this.showPlugins,className:"w-plugins-menu"+("plugins"==a?" w-menu-selected":""),style:{display:r||we?"none":void 0},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-list-alt"+(be?" w-disabled":"")}),m.createElement("i",{className:"w-left-menu-name"},"Plugins"))),e.hasRules?m.createElement(w,{ref:"rules",disabled:ve,theme:f,lineWrapping:k,fontSize:M,lineNumbers:S,onSelect:this.selectRules,onUnselect:this.unselectRules,onActive:this.activeRules,modal:e.rules,hide:"rules"==a?!1:!0,name:"rules"}):void 0,e.hasValues?m.createElement(w,{theme:A,onDoubleClick:this.showEditValuesByDBClick,fontSize:y,lineWrapping:j,lineNumbers:L,onSelect:this.saveValues,onActive:this.activeValues,modal:e.values,hide:"values"==a?!1:!0,className:"w-values-list",foldGutter:e.foldGutter}):void 0,e.hasNetwork?m.createElement(b,{ref:"network",hide:"rules"===a||"values"===a||"plugins"===a,modal:ee}):void 0,e.hasPlugins?m.createElement(E,d({},e,{onOpen:this.activePluginTab,onClose:this.closePluginTab,onActive:this.activePluginTab,onChange:this.disablePlugin,ref:"plugins",hide:"plugins"==a?!1:!0})):void 0),m.createElement("div",{ref:"rulesSettingsDialog",className:"modal fade w-rules-settings-dialog"},m.createElement("div",{className:"modal-dialog"},m.createElement("div",{className:"modal-content"},m.createElement("div",{className:"modal-body"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},m.createElement("span",{"aria-hidden":"true"},"×")),m.createElement(C,{theme:f,fontSize:M,lineNumbers:S,lineWrapping:k,onLineWrappingChange:this.onRulesLineWrappingChange,onThemeChange:this.onRulesThemeChange,onFontSizeChange:this.onRulesFontSizeChange,onLineNumberChange:this.onRulesLineNumberChange}),!e.drb&&m.createElement("p",{className:"w-editor-settings-box"},m.createElement("label",null,m.createElement("input",{type:"checkbox",checked:e.backRulesFirst,onChange:this.enableBackRulesFirst})," ","Back rules first")),!e.drm&&m.createElement("p",{className:"w-editor-settings-box"},m.createElement("label",{style:{color:i?"#aaa":void 0}},m.createElement("input",{type:"checkbox",disabled:i,checked:!i&&e.allowMultipleChoice,onChange:this.allowMultipleChoice})," ","Use multiple rules")),me&&me.trim()?m.createElement("fieldset",{className:"w-fieldset"},m.createElement("legend",null,"Account Rules",m.createElement("span",{className:"glyphicon glyphicon-edit"})),m.createElement("pre",null,me)):null),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))))),m.createElement("div",{ref:"valuesSettingsDialog",className:"modal fade w-values-settings-dialog"},m.createElement("div",{className:"modal-dialog"},m.createElement("div",{className:"modal-content"},m.createElement("div",{className:"modal-body"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},m.createElement("span",{"aria-hidden":"true"},"×")),m.createElement(C,{theme:A,fontSize:y,lineNumbers:L,lineWrapping:j,onLineWrappingChange:this.onValuesLineWrappingChange,onThemeChange:this.onValuesThemeChange,onFontSizeChange:this.onValuesFontSizeChange,onLineNumberChange:this.onValuesLineNumberChange}),m.createElement("p",{className:"w-editor-settings-box"},m.createElement("label",null,m.createElement("input",{type:"checkbox",checked:e.foldGutter,onChange:this.showFoldGutter})," ","Show fold gutter"))),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))))),m.createElement(I,{ref:"networkSettings"}),m.createElement("div",{ref:"rootCADialog",className:"modal fade w-https-dialog"},m.createElement("div",{className:"modal-dialog"},m.createElement("div",{className:"modal-content"},m.createElement("div",{className:"modal-body"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},m.createElement("span",{"aria-hidden":"true"},"×")),m.createElement("div",null,m.createElement("a",{className:"w-help-menu",title:"Click here to learn how to install root ca",href:"https://avwo.github.io/whistle/webui/https.html",target:"_blank"},m.createElement("span",{className:"glyphicon glyphicon-question-sign"})),m.createElement("a",{className:"w-download-rootca",title:Ce,href:Ne,target:"downloadTargetFrame"},"Download RootCA"),m.createElement("select",{className:"w-root-ca-type",value:Te,onChange:this.selectCAType},m.createElement("option",{value:"crt"},"rootCA.crt"),m.createElement("option",{value:"cer"},"rootCA.cer"),m.createElement("option",{value:"pem"},"rootCA.pem"))),m.createElement("a",{title:Ce,href:Ne,target:"downloadTargetFrame"},m.createElement("img",{src:xe,width:"320"})),m.createElement("div",{className:"w-https-settings"},m.createElement("p",null,m.createElement("label",{title:i?"Use `pattern enable://capture` in rules to replace global configuration":void 0},m.createElement("input",{disabled:i,checked:e.interceptHttpsConnects,onChange:this.interceptHttpsConnects,type:"checkbox"})," ","Capture TUNNEL CONNECTS")),m.createElement("p",null,m.createElement("label",null,m.createElement("input",{checked:D.supportH2&&e.enableHttp2,onChange:this.enableHttp2,type:"checkbox"})," ","Enable HTTP/2")),m.createElement("a",{draggable:"false",style:{color:D.hasInvalidCerts?"red":void 0},onClick:this.showCustomCertsInfo},"View all custom certificates"),m.createElement(H,{ref:"certsInfoDialog"}))),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))))),m.createElement("div",{ref:"chooseFileType",className:"modal fade w-choose-filte-type"},m.createElement("div",{className:"modal-dialog"},m.createElement("div",{className:"modal-content"},m.createElement("div",{className:"modal-body"},m.createElement("label",{className:"w-choose-filte-type-label"},"Save as:",m.createElement("input",{ref:"sessionsName",onKeyDown:this.exportBySave,placeholder:"Input the filename",className:"form-control",maxLength:"64"}),m.createElement("select",{ref:"fileType",className:"form-control",value:e.exportFileType,onChange:this.chooseFileType},m.createElement("option",{value:"whistle"},"*.txt"),m.createElement("option",{value:"Fiddler"},"*.saz"),m.createElement("option",{value:"har"},"*.har"))),m.createElement("a",{type:"button",onKeyDown:this.exportBySave,tabIndex:"0",onMouseDown:this.preventBlur,className:"btn btn-primary",onClick:this.exportBySave},"Export"))))),m.createElement(F,{ref:"accountDialog"}),m.createElement(F,{ref:"editorWin",className:"w-editor-win"}),m.createElement(U,{ref:"setReplayCount",wstyle:"w-replay-count-dialog"},m.createElement("div",{className:"modal-body"},m.createElement("label",null,"Times:",m.createElement("input",{ref:"replayCount",placeholder:"<= "+q,onKeyDown:this.replayRepeat,onChange:this.replayCountChange,value:e.replayCount,className:"form-control",maxLength:"3"})),m.createElement("button",{type:"button",onKeyDown:this.replayRepeat,tabIndex:"0",onMouseDown:this.preventBlur,className:"btn btn-primary",disabled:!e.replayCount,onClick:this.replayRepeat},"Replay"))),m.createElement(U,{ref:"importRemoteRules",wstyle:"w-import-remote-dialog"},m.createElement("div",{className:"modal-body"},m.createElement("input",{readOnly:he,ref:"rulesRemoteUrl",maxLength:"2048",onKeyDown:this.importRemoteRules,placeholder:"Input the url",style:{"ime-mode":"disabled"}})),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-primary",disabled:he,onMouseDown:this.preventBlur,onClick:this.importRemoteRules},he?"Importing rules":"Import rules"),m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))),m.createElement(U,{ref:"importRemoteSessions",wstyle:"w-import-remote-dialog"},m.createElement("div",{className:"modal-body"},m.createElement("input",{readOnly:ge,ref:"sessionsRemoteUrl",maxLength:"2048",onKeyDown:this.importRemoteSessions,placeholder:"Input the url",style:{"ime-mode":"disabled"}})),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-primary",disabled:ge,onMouseDown:this.preventBlur,onClick:this.importRemoteSessions},ge?"Importing sessions":"Import sessions"),m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))),m.createElement(U,{ref:"importRemoteValues",wstyle:"w-import-remote-dialog"},m.createElement("div",{className:"modal-body"},m.createElement("input",{readOnly:fe,ref:"valuesRemoteUrl",maxLength:"2048",onKeyDown:this.importRemoteValues,placeholder:"Input the url",style:{"ime-mode":"disabled"}})),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-primary",disabled:fe,onMouseDown:this.preventBlur,onClick:this.importRemoteValues},fe?"Importing values":"Import values"),m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))),m.createElement("div",{ref:"showUpdateTipsDialog",className:"modal fade w-show-update-tips-dialog"},m.createElement("div",{className:"modal-dialog"},m.createElement("div",{className:"modal-content"},m.createElement("div",{className:"modal-body"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},m.createElement("span",{"aria-hidden":"true"},"×")),m.createElement("p",{className:"w-show-update-tips"},"whistle has important updates, it is recommended that you update to the latest version."),m.createElement("p",null,"Current version: ",e.version),m.createElement("p",null,"The latest stable version: ",e.latestVersion),m.createElement("p",null,"View change:"," ",m.createElement("a",{title:"Change log",href:"https://github.com/avwo/whistle/blob/master/CHANGELOG.md",target:"_blank"},"CHANGELOG.md"))),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-default",onClick:this.donotShowAgain,"data-dismiss":"modal"},"Don't show again"),m.createElement("a",{type:"button",className:"btn btn-primary",onClick:this.hideUpdateTipsDialog,href:"https://avwo.github.io/whistle/update.html",target:"_blank"},"Update now"))))),m.createElement(U,{ref:"confirmReload",wstyle:"w-confirm-reload-dialog"},m.createElement("div",{className:"modal-body w-confirm-reload"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal"},m.createElement("span",{"aria-hidden":"true"},"×")),m.createElement("div",{className:"w-reload-data-tips"})),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"No"),m.createElement("button",{type:"button",className:"btn btn-primary",onClick:this.reloadData,"data-dismiss":"modal"},"Yes"))),m.createElement(U,{ref:"confirmImportRules",wstyle:"w-confirm-import-dialog"},m.createElement("div",{className:"modal-body w-confirm-import"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal"},m.createElement("span",{"aria-hidden":"true"},"×")),"Whether to replace the existing rules?"),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-danger",onClick:this.uploadRules,"data-dismiss":"modal"},"Replace"),m.createElement("button",{type:"button",className:"btn btn-primary",onClick:this.uploadRules,"data-dismiss":"modal"},"Reserve"))),m.createElement(U,{ref:"confirmImportValues",wstyle:"w-confirm-import-dialog"},m.createElement("div",{className:"modal-body w-confirm-import"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal"},m.createElement("span",{"aria-hidden":"true"},"×")),"Whether to replace the existing values?"),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-danger",onClick:this.uploadValues,"data-dismiss":"modal"},"Replace"),m.createElement("button",{type:"button",className:"btn btn-primary",onClick:this.uploadValues,"data-dismiss":"modal"},"Reserve"))),m.createElement(B,{ref:"deleteRulesDialog",tips:"Are you sure to delete all follow rules or group?",onConfirm:this.removeRulesBatch,name:"rules",isRules:"1",list:e.rules.list}),m.createElement(B,{ref:"deleteValuesDialog",tips:"Are you sure to delete all follow values or group?",onConfirm:this.removeValuesBatch,name:"values",list:e.values.list}),m.createElement(B,{ref:"selectRulesDialog",name:"rules",list:e.rules.list}),m.createElement(B,{ref:"selectValuesDialog",name:"values",list:e.values.list}),m.createElement("iframe",{name:"downloadTargetFrame",style:{display:"none"}}),m.createElement("form",{ref:"exportSessionsForm",action:"cgi-bin/sessions/export",style:{display:"none"},method:"post",target:"downloadTargetFrame"},m.createElement("input",{ref:"exportFilename",name:"exportFilename",type:"hidden"}),m.createElement("input",{ref:"exportFileType",name:"exportFileType",type:"hidden"}),m.createElement("input",{ref:"sessions",name:"sessions",type:"hidden"})),m.createElement("form",{ref:"importSessionsForm",encType:"multipart/form-data",style:{display:"none"}},m.createElement("input",{ref:"importSessions",onChange:this.uploadSessions,type:"file",name:"importSessions",accept:".txt,.json,.saz,.har"})),m.createElement("form",{ref:"importRulesForm",encType:"multipart/form-data",style:{display:"none"}},m.createElement("input",{ref:"importRules",onChange:this.uploadRulesForm,name:"rules",type:"file",accept:".txt,.json"})),m.createElement("form",{ref:"importValuesForm",encType:"multipart/form-data",style:{display:"none"}},m.createElement("input",{ref:"importValues",onChange:this.uploadValuesForm,name:"values",type:"file",accept:".txt,.json"})),m.createElement(V,{ref:"syncDialog"}),m.createElement(P,{ref:"jsonDialog"}),m.createElement("div",{id:"copyTextBtn",style:{display:"none"}}))}});D.getInitialData(function(e){A.render(m.createElement(ce,{modal:e}),document.getElementById("container"))})},function(e,t){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function r(e){var t=n(e),r=t[0],o=t[1];return 3*(r+o)/4-o}function o(e,t,n){return 3*(t+n)/4-n}function i(e){var t,r,i=n(e),a=i[0],s=i[1],l=new d(o(e,a,s)),c=0,p=s>0?a-4:a;for(r=0;p>r;r+=4)t=u[e.charCodeAt(r)]<<18|u[e.charCodeAt(r+1)]<<12|u[e.charCodeAt(r+2)]<<6|u[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===s&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===s&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l}function a(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function s(e,t,n){for(var r,o=[],i=t;n>i;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(a(r));return o.join("")}function l(e){for(var t,n=e.length,r=n%3,o=[],i=16383,a=0,l=n-r;l>a;a+=i)o.push(s(e,a,a+i>l?l:a+i));return 1===r?(t=e[n-1],o.push(c[t>>2]+c[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],o.push(c[t>>10]+c[t>>4&63]+c[t<<2&63]+"=")),o.join("")}t.byteLength=r,t.toByteArray=i,t.fromByteArray=l;for(var c=[],u=[],d="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g=0,h=p.length;h>g;++g)c[g]=p[g],u[p.charCodeAt(g)]=g;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},function(e,t,n){var r,o;(function(n){!function(t,n){e.exports=n(t)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof n?n:this,function(n){"use strict";n=n||{};var i,a=n.Base64,s="2.6.4",l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=function(e){for(var t={},n=0,r=e.length;r>n;n++)t[e.charAt(n)]=n;return t}(l),u=String.fromCharCode,d=function(e){if(e.length<2){var t=e.charCodeAt(0);return 128>t?e:2048>t?u(192|t>>>6)+u(128|63&t):u(224|t>>>12&15)+u(128|t>>>6&63)+u(128|63&t)}var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return u(240|t>>>18&7)+u(128|t>>>12&63)+u(128|t>>>6&63)+u(128|63&t)},p=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,g=function(e){return e.replace(p,d)},h=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0),r=[l.charAt(n>>>18),l.charAt(n>>>12&63),t>=2?"=":l.charAt(n>>>6&63),t>=1?"=":l.charAt(63&n)];return r.join("")},f=n.btoa&&"function"==typeof n.btoa?function(e){return n.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,h)},m=function(e){return f(g(String(e)))},A=function(e){return e.replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,"")},M=function(e,t){return t?A(m(e)):m(e)},w=function(e){return M(e,!0)};n.Uint8Array&&(i=function(e,t){for(var n="",r=0,o=e.length;o>r;r+=3){var i=e[r],a=e[r+1],s=e[r+2],c=i<<16|a<<8|s;n+=l.charAt(c>>>18)+l.charAt(c>>>12&63)+("undefined"!=typeof a?l.charAt(c>>>6&63):"=")+("undefined"!=typeof s?l.charAt(63&c):"=")}return t?A(n):n});var y,b=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return u((n>>>10)+55296)+u((1023&n)+56320);case 3:return u((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return u((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},T=function(e){return e.replace(b,v)},x=function(e){var t=e.length,n=t%4,r=(t>0?c[e.charAt(0)]<<18:0)|(t>1?c[e.charAt(1)]<<12:0)|(t>2?c[e.charAt(2)]<<6:0)|(t>3?c[e.charAt(3)]:0),o=[u(r>>>16),u(r>>>8&255),u(255&r)];return o.length-=[0,0,2,1][n],o.join("")},N=n.atob&&"function"==typeof n.atob?function(e){return n.atob(e)}:function(e){return e.replace(/\S{1,4}/g,x)},C=function(e){return N(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},I=function(e){return T(N(e))},E=function(e){return String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},D=function(e){return I(E(e))};n.Uint8Array&&(y=function(e){return Uint8Array.from(C(E(e)),function(e){return e.charCodeAt(0)})});var S=function(){var e=n.Base64;return n.Base64=a,e};if(n.Base64={VERSION:s,atob:C,btoa:f,fromBase64:D,toBase64:M,utob:g,encode:M,encodeURI:w,btou:T,decode:D,noConflict:S,fromUint8Array:i,toUint8Array:y},"function"==typeof Object.defineProperty){var L=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};n.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",L(function(){return D(this)})),Object.defineProperty(String.prototype,"toBase64",L(function(e){return M(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",L(function(){return M(this,!0)}))}}return n.Meteor&&(Base64=n.Base64),"undefined"!=typeof e&&e.exports?e.exports.Base64=n.Base64:(r=[],o=function(){return n.Base64}.apply(t,r),!(void 0!==o&&(e.exports=o))),{Base64:n.Base64}})}).call(t,function(){return this}())},function(e,t){"use strict";function n(e,t){t=t||0;for(var n=Math.min(e.length,r);n>t;t++){var o=e[t];if(!(9==o||10==o||13==o||o>=32&&127>=o)){++t;var i=e[t];if(o>=194&&223>=o){if(i>=128&&191>=i)continue;return!i}++t;var a=e[t];if(224==o){if(i>=160&&191>=i&&a>=128&&191>=a)continue;return!a}if(o>=225&&236>=o||238==o||239==o){if(i>=128&&191>=i&&a>=128&&191>=a)continue;return!a}if(237==o){if(i>=128&&159>=i&&a>=128&&191>=a)continue;return!a}++t;var s=e[t];if(240==o){if(i>=144&&191>=i&&a>=128&&191>=a&&s>=128&&191>=s)continue;return!s}if(o>=241&&243>=o){if(i>=128&&191>=i&&a>=128&&191>=a&&s>=128&&191>=s)continue;return!s}if(244==o){if(i>=128&&143>=i&&a>=128&&191>=a&&s>=128&&191>=s)continue;return!s}return!1}}return!0}var r=32768;e.exports=function(e){return n(e)?!0:0===e[0]&&n(e,5)}},function(e,t,n){var r=n(5);"string"==typeof r&&(r=[[e.id,r,""]]);n(7)(r,{});r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(6)(),t.push([e.id,".w-menu{height:30px;border-top:1px solid #fcfcfc;border-bottom:1px solid #ccc;background:#f1f3f4;padding-right:5pc;position:relative;z-index:1001;white-space:nowrap}.w-history-bar a,.w-menu a{text-decoration:none!important;color:#000;padding:0 5px;line-height:26px;height:26px;margin-right:5px;display:inline-block}.w-menu a{height:27px;line-height:28px;overflow:hidden}.w-detail .glyphicon,.w-menu .glyphicon{margin-right:3px}.w-menu .glyphicon-folder-close,.w-menu .glyphicon-folder-open{margin-right:6px}.w-menu .w-online{position:absolute;top:0;right:0}.w-left-menu a:hover,.w-left-menu a:hover .w-disabled,.w-menu .w-online,.w-menu a:hover{color:#337ab7}.w-menu .w-offline{color:#ccc!important;cursor:default}.w-frames-action .w-disabled,.w-history-bar .w-disabled,.w-menu .w-disabled{color:#aaa!important;cursor:not-allowed!important}.w-left-menu .w-disabled{color:#aaa}.w-menu .w-menu-enable .glyphicon-cog{color:#f66!important}.w-menu .w-new-version-icon{position:absolute;top:2px;left:17px;width:5px;height:5px;border-radius:5px;background:red}.w-menu .w-menu-wrapper{display:inline-block;position:relative;height:30px}.w-show-update-tips{font-weight:700}.w-input-menu-item{display:block;position:absolute;background:#fff;border:1px solid #ccc;border-radius:2px;z-index:101;top:30px;display:none;white-space:nowrap}.w-input-menu-item input{width:246px;height:2pc;border:1px solid #ccc;border-radius:0!important;border-radius:2px;padding:0 5px;vertical-align:middle}.w-input-menu-item .btn{height:2pc;padding:0 9pt;vertical-align:middle;border-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-left:1px;border-color:#ccc}.w-create-rules-input{left:310px}.w-create-values-input{left:300px}.w-edit-rules-input{left:382px}.w-edit-values-input{left:372px}.w-show-left-menu .w-create-rules-input{left:210px}.w-show-left-menu .w-create-values-input{left:200px}.w-show-left-menu .w-edit-rules-input{left:282px}.w-show-left-menu .w-edit-values-input{left:17pc}.w-menu-wrapper .w-menu-item{display:none!important}.w-menu-wrapper-show .w-menu-item{display:block!important}.w-values-list .glyphicon-ok{display:none!important}.w-values-list a{font-weight:400!important}.w-disabled .glyphicon-ok,.w-disabled .glyphicon-stop{color:#ccc!important}.w-rules-settings-dialog .modal-dialog{width:25pc}.w-values-settings-dialog .modal-dialog{width:300px}.w-show-update-tips-dialog .modal-dialog{width:21pc}.w-show-update-tips-dialog .modal-body p{margin-bottom:5px}.w-https-dialog .modal-dialog{width:340px}.w-https-help{margin-left:150px}.w-https-dialog .modal-dialog div{white-space:nowrap}.w-https-dialog a{display:inline-block}.w-download-rootca,.w-https-help{line-height:30px}.w-https-settings label{font-weight:400}.w-https-settings p{margin:10px 0}.w-is-link{cursor:pointer;text-decoration:underline}.w-choose-filte-type .modal-dialog{width:456px}.w-choose-filte-type-label{white-space:nowrap}.w-choose-filte-type-label .form-control{margin-left:10px;width:200px;display:inline-block;font-weight:400}.w-choose-filte-type-label select.form-control{margin:0 5px;width:5pc}.w-confirm-import-dialog .modal-dialog{width:20pc;font-weight:700}.w-account-menu{white-space:nowrap;max-width:75pt;max-width:calc(100% - 750pt);text-overflow:ellipsis;overflow:hidden}.w-show-left-menu .w-account-menu{max-width:220px;max-width:calc(100% - 900px)}.w-show-left-menu-btn{padding:0 15px!important;margin-right:0!important}.w-left-menu{background:#f1f3f4;border-left:1px solid #ccc;border-right:1px solid #ccc;display:none}.w-show-left-menu .w-left-menu{display:block;border-left:none}.w-show-left-menu .w-nav-menu{display:none}.w-left-menu a{display:block;position:relative;padding:10px 0 8px;width:47px;overflow:hidden;text-align:center;text-decoration:none!important;color:#000}.w-left-menu a span{margin-right:5px}.w-left-menu a .w-left-menu-name{display:block;font-style:normal;font-size:9pt;zoom:1;transform:scale(0.8,0.8);width:65px;margin-left:-10px;white-space:nowrap}.w-left-menu-tips{padding:6px 10px;display:none;left:47px;top:3px;position:absolute;z-index:1;border-radius:4px}.w-left-menu a:hover .w-left-menu-tips{display:block;color:#000;background-color:#f1f3f4;font-weight:700;border:1px solid #ccc}.w-left-menu a .w-left-menu-tips:hover,.w-menu .w-export-menu,.w-menu .w-import-menu,.w-menu .w-remove-menu-list{display:none}.w-show-left-menu .w-export-menu,.w-show-left-menu .w-import-menu,.w-show-left-menu .w-remove-menu-list{display:inline-block}.w-menu-changed{position:absolute;top:2px;left:5px;color:red}.w-replay-count-dialog .modal-content{width:236px!important;white-space:nowrap}.w-replay-count-dialog .modal-dialog{width:236px!important}.w-replay-count-dialog .modal-content label{width:auto}.w-replay-count-dialog input{display:inline-block;width:5pc;text-align:center;margin:0 10px}.w-import-remote-dialog .modal-content{width:525px}.w-import-remote-dialog input{width:500px;height:30px;line-height:30px;padding:5px;border:1px solid #ccc}.w-https-menu .glyphicon-lock{color:#9e9e26}.w-hover-left-menu{position:absolute;z-index:1;height:auto;border-bottom:1px solid #ccc;min-height:0}.w-menu .w-tree-view-active{color:#337ab7}.w-menu-selected{background-color:#ddd}.w-root-ca-type{width:75pt;float:right;margin:3px 15px 0 0;border:1px solid #ccc;border-radius:3px;height:24px;font-size:9pt;padding-left:8px}.w-fieldset pre{max-height:220px;overflow:auto;padding:10px}.w-fieldset{border:1px solid #ddd}.w-fieldset legend{font-size:9pt;padding:0 5px;border:none;width:auto;margin:0 10px;font-weight:700}.w-fieldset legend .glyphicon{margin-left:5px;cursor:pointer}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;tn;n++)if(-1===f.inArray(e[n],t))return!1;var o=t.length;if(r!==o)for(n=0;o>n;n++)if(-1===f.inArray(t[n],e))return!1;return!0}function c(e){if(0==e.indexOf("{")){var t=e.lastIndexOf("}");return t>1&&e.substring(1,t)}return!1}function u(e){if(0==e.indexOf("(")){var t=e.lastIndexOf(")");return-1!=t&&e.substring(1,t)||""}return!1}var d=Object.assign||function(e){for(var t=1;tn?1:-1)}).forEach(function(n){var r=e[n];t.push({name:n.slice(0,-1),icon:"checkbox",mtime:r.mtime,homepage:r.homepage,latest:r.latest,hideLongProtocol:r.hideLongProtocol,hideShortProtocol:r.hideShortProtocol,path:r.path,pluginVars:r.pluginVars})}),t},reloadRules:function(e){var t=this,n=j.get("activeRules",!0)||e.current,r=[],o={};r.push(_),o.Default={name:_,fixed:!0,value:e.defaultRules,selected:!e.defaultRulesIsDisabled,isDefault:!0,active:n===_},e.list.forEach(function(e){r.push(e.name),e=o[e.name]={name:e.name,value:e.data,selected:e.selected,active:n===e.name}}),t.state.rules.reset(r,o),t.setState({})},reloadValues:function(e){var t=this,n=j.get("activeValues",!0)||e.current,r=[],o={};e.list.forEach(function(e){r.push(e.name),o[e.name]={name:e.name,value:e.data,active:n===e.name}}),t.state.values.reset(r,o),t.setState({})},reloadData:function(){var e=this,t=f(".w-reload-data-tips").closest(".w-confirm-reload-dialog"),n=t.find(".w-reload-data-tips").attr("data-name"),r="rules"===n,o=function(t,n){return t?void(r?(e.reloadRules(t),e.triggerRulesChange("reload")):(e.reloadValues(t),e.triggerValuesChange("reload"))):void S.showSystemError(n)};r?(D.rules.list(o),k.trigger("reloadRulesRecycleBin")):(D.values.list(o),k.trigger("reloadValuesRecycleBin"))},showReloadRules:function(){if("rules"===this.state.name&&this.rulesChanged){this.rulesChanged=!1;var e=this.state.rules.hasChanged();this.showReloadDialog("The rules has been modified.
Do you want to reload it.",e)}},showReloadValues:function(){if("values"===this.state.name&&this.valuesChanged){this.valuesChanged=!1;var e=this.state.values.hasChanged();this.showReloadDialog("The values has been modified.
Do you want to reload it.",e)}},componentDidUpdate:function(){this.showReloadRules(),this.showReloadValues()},showReloadDialog:function(e,t){var n=this.refs.confirmReload;n.show(),t&&(e+='

Note: There are unsaved changes.

'),f(".w-reload-data-tips").html(e).attr("data-name",this.state.name)},showTab:function(){var e=s(this.state);e&&-1==e.indexOf("rules")?-1!=e.indexOf("values")?this.showValues():-1!=e.indexOf("plugins")?this.showPlugins():this.state.showAccount&&"account"===e?this.showAccount():this.showNetwork():this.showRules(),j.set("pageName",e||"")},componentDidMount:function(){function e(e){if(e=e&&e.trim()){var t=e.indexOf("://")+3;if(e=-1!=t?e.substring(t):e,0===e.indexOf("{"))return t=e.lastIndexOf("}"),t>1?e.substring(1,t):null}}var t=this,n=new M(".w-copy-text");n.on("error",function(e){G.alert("Copy failed.")}),n=new M(".w-copy-text-with-tips"),n.on("error",function(e){z.error("Copy failed.")}),n.on("success",function(e){z.success("Copied clipboard.")});var r=function(e){e.preventDefault()};k.on("enableRecord",function(){t.enableRecord()}),k.on("showJsonViewDialog",function(e,n){t.refs.jsonDialog.show(n)}),k.on("rulesChanged",function(){t.rulesChanged=!0,t.showReloadRules()}),k.on("switchTreeView",function(){t.toggleTreeView()}),k.on("updateGlobal",function(){t.setState({})}),k.on("valuesChanged",function(){t.valuesChanged=!0,t.showReloadValues()}),k.on("showNetwork",function(){t.showNetwork()}),k.on("showRules",function(){t.showRules()}),k.on("showValues",function(){t.showValues()}),k.on("showPlugins",function(){t.showPlugins()}),k.on("disableAllPlugins",t.disableAllPlugins),k.on("disableAllRules",t.disableAllRules),k.on("activeRules",function(){var e=D.rulesModal;e.exists(D.activeRulesName)&&(t.setRulesActive(D.activeRulesName,e),t.setState({}))}),k.on("activeValues",function(){var e=D.valuesModal;e.exists(D.activeValuesName)&&(t.setValuesActive(D.activeValuesName,e),t.setState({}))});var i;k.on("openEditor",function(e,n){try{if(i&&"function"==typeof i.setValue)return window.getTextFromWhistle_=null,t.refs.editorWin.show(),i.setValue(n);window._initWhistleTextEditor_=function(e){i=e,i.setValue(n)},t.refs.editorWin.show("editor.html")}catch(r){}});var a;k.on("updateUIThrottle",function(){a||(a=setTimeout(function(){a=null,t.setState({})},200))}),k.on("addNewRulesFile",function(e,n){var r=n.filename,o=t.state.rules.add(r,n.data);t.setRulesActive(r),t.setState({activeRules:o}),t.triggerRulesChange("create")}),k.on("addNewValuesFile",function(e,n){var r=n.filename,o=t.state.values.add(r,n.data);t.setValuesActive(r),t.setState({activeValues:o}),t.triggerValuesChange("create")}),k.on("recoverRules",function(e,n){var r=t.state.rules,o=n.filename,i=function(e){e&&D.rules.add({name:o,value:n.data,recycleFilename:n.name},function(e,i){if(e&&0===e.ec){var a=r.add(o,n.data);t.setRulesActive(o),t.setState({activeRules:a}),t.triggerRulesChange("create"),k.trigger("rulesRecycleList",e),k.trigger("focusRulesList")}else S.showSystemError(i)})};return r.exists(o)?void G.confirm("The name `"+o+"` already exists, whether to overwrite it?",i):i(!0)}),k.on("recoverValues",function(e,n){var r=t.state.values,o=n.filename,i=function(e){e&&D.values.add({name:o,value:n.data,recycleFilename:n.name},function(e,i){if(e&&0===e.ec){var a=r.add(o,n.data);t.setValuesActive(o),t.setState({activeValues:a}),t.triggerValuesChange("create"),k.trigger("valuesRecycleList",e)}else S.showSystemError(i)})};return r.exists(o)?void G.confirm("The name `"+o+"` already exists, whether to overwrite it?",i):i(!0)}),f(document).on("dragleave",r).on("dragenter",r).on("dragover",r).on("drop",function(e){e.preventDefault();var n=e.originalEvent.dataTransfer.files,r=n&&n[0];if(r){if(f(".w-files-dialog.in").length)return k.trigger("uploadFile",r);var o,i=t.state.name,a=f(e.target);if("network"===i){if(a.closest(".w-frames-composer").length)return;if(/\.log$/i.test(r.name))return r.size>q?G.alert("The file size cannot exceed 2m."):void S.readFileAsText(r,function(e){e=S.parseLogs(e),e&&(null!==D.uploadLogs&&(D.uploadLogs=e),k.trigger("showLog"),k.trigger("uploadLogs",{logs:e}))});o=new FormData,o.append("importSessions",n[0]),t.uploadSessionsForm(o)}a.closest(".w-divider-left").length&&("rules"===i?(o=new FormData,o.append("rules",n[0]),t.rulesForm=o,t.refs.confirmImportRules.show()):"values"===i&&(o=new FormData,o.append("values",n[0]),t.valuesForm=o,t.refs.confirmImportValues.show()))}}).on("keydown",function(e){(e.metaKey||e.ctrlKey)&&82===e.keyCode&&e.preventDefault()});var s=function(e){var n=e.target;"A"==n.nodeName&&f(n).parent().hasClass("w-list-data")&&("rules"==t.state.name?t.removeRules():t.removeValues()),e.preventDefault()};f(window).on("hashchange",t.showTab).on("keyup",function(e){if(27==e.keyCode){t.setMenuOptionsState();var n=f(".modal");"function"==typeof n.modal&&n.modal("hide")}}).on("keydown",function(e){if(46==e.keyCode&&s(e),!e.ctrlKey&&!e.metaKey)return void(112===e.keyCode?(e.preventDefault(),window.open("https://avwo.github.io/whistle/webui/"+t.state.name+".html")):116===e.keyCode&&e.preventDefault());77===e.keyCode?(t.toggleLeftMenu(),e.preventDefault()):66===e.keyCode&&(t.toggleTreeView(),e.preventDefault(),k.trigger("toggleTreeViewByAccessKey"));var n="network"===t.state.name;n&&88==e.keyCode&&(S.isFocusEditor()||f(e.target).closest(".w-frames-list").length||t.clear()),68==e.keyCode&&s(e);var r=t.state.network;if(n&&83===e.keyCode){if(e.preventDefault(),f(".modal.in").length)return void(f(A.findDOMNode(t.refs.chooseFileType)).is(":visible")&&t.exportBySave());var o=e.target.nodeName;if("INPUT"===o||"TEXTAREA"===o)return;var i=r.hasSelected();return void(i&&(f(A.findDOMNode(t.refs.chooseFileType)).modal("show"),setTimeout(function(){A.findDOMNode(t.refs.sessionsName).focus()},500)))}n&&73===e.keyCode&&(t.importSessions(e),e.preventDefault())});var c=function(){var e=t.state.name;return"rules"===e||"values"===e};f(document.body).on("mouseenter",ee,function(t){if(c()&&(t.ctrlKey||t.metaKey)){var n=f(this);(n.hasClass("cm-js-http-url")||n.hasClass("cm-string")||n.hasClass("cm-js-at")||e(n.text()))&&n.addClass("w-is-link")}}).on("mouseleave",ee,function(e){f(this).removeClass("w-is-link")}).on("mousedown",ee,function(n){if(c()&&(n.ctrlKey||n.metaKey)){var r=f(this),o=r.text();if(r.hasClass("cm-js-at"))return void(ne.test(o)&&window.open((RegExp.$1||"http:")+RegExp.$2));if(r.hasClass("cm-string"))return void(te.test(o)&&window.open((RegExp.$1||"http:")+RegExp.$2));if(r.hasClass("cm-js-http-url"))return/^https?:\/\//i.test(o)||(o="http:"+("/"===o[0]?"":"//")+o),void window.open(o);var i=e(o);return i?void t.showAndActiveValues({name:i}):void 0}}),"network"==t.state.name&&t.startLoadData(),D.on("settings",function(e){var n=t.state,r=e.server;if(n.interceptHttpsConnects!==e.interceptHttpsConnects||n.enableHttp2!==e.enableHttp2||n.disabledAllRules!==e.disabledAllRules||n.allowMultipleChoice!==e.allowMultipleChoice||n.disabledAllPlugins!==e.disabledAllPlugins||n.backRulesFirst!==e.backRulesFirst||n.multiEnv!=r.multiEnv||n.ndp!=r.ndp||n.ndr!=r.ndr||n.drb!=r.drb||n.drm!=r.drm){n.interceptHttpsConnects=e.interceptHttpsConnects,n.enableHttp2=e.enableHttp2,n.disabledAllRules=e.disabledAllRules,n.allowMultipleChoice=e.allowMultipleChoice,n.backRulesFirst=e.backRulesFirst,n.disabledAllPlugins=e.disabledAllPlugins,n.multiEnv=r.multiEnv,n.ndp=r.ndp,n.ndr=r.ndr,n.drb=r.drb,n.drm=r.drm,L.setPlugins(n);var o=se;return o[3].checked=!n.disabledAllRules,o[4].checked=!n.disabledAllPlugins,t.refs.contextMenu.update(),t.setState({})}}),D.on("rules",function(e){var n=t.state.rules,r=e.list;e.defaultRulesIsDisabled||-1!==r.indexOf("Default")||r.unshift("Default");var o=n.getSelectedNames();l(o,r)||(t.reselectRules(e,!0),t.setState({}))}),D.on("serverInfo",function(e){t.serverInfo=e}),k.on("executeComposer",function(){t.autoRefresh&&t.autoRefresh()});var u=function(e){if(Array.isArray(e))return e;if(e&&!e.selected)return[e]};k.on("updateUI",function(){t.setState({})}),k.on("replaySessions",function(e,n,r){var o=t.state.network,i=u(n)||o.getSelectedList(),a=i&&i.length;return r&&1===a?(t.replayList=i,t.refs.setReplayCount.show(),void setTimeout(function(){var e=A.findDOMNode(t.refs.replayCount);e.select(),e.focus()},300)):void t.replay(e,i)}),k.on("importSessions",t.importSessions),k.on("filterSessions",t.showSettings),k.on("exportSessions",function(e,n){t.exportData(e,u(n))}),k.on("abortRequest",function(e,n){t.abort(u(n))}),k.on("uploadSessions",function(e,n){var r=u(n&&n.curItem),o=n&&n.upload;if("function"==typeof o){if(!r){var i=t.state.network;r=i.getSelectedList(),r&&r.length&&(r=f.extend(!0,[],r))}r&&o(r)}}),k.on("removeIt",function(e,n){var r=t.state.network;n&&r&&(r.remove(n),t.setState({}))}),k.on("removeOthers",function(e,n){var r=t.state.network;n&&r&&(n.selected?r.removeUnselectedItems():r.removeOthers(n),t.setState({}))}),k.on("clearAll",t.clear),k.on("removeSelected",function(){var e=t.state.network;e&&(e.removeSelectedItems(),t.setState({}))}),k.on("removeUnselected",function(){var e=t.state.network;e&&(e.removeUnselectedItems(),t.setState({}))}),k.on("removeUnmarked",function(){var e=t.state.network;e&&(e.removeUnmarkedItems(),t.setState({}))}),k.on("saveRules",function(e,n){if(n.changed||!n.selected){var r=t.state.rules.getChangedGroupList(n);r.forEach(t.selectRules)}else t.unselectRules(n)}),k.on("saveValues",function(e,n){var r=t.state.values.getChangedGroupList(n);r.forEach(t.saveValues)}),k.on("renameRules",function(e,n){t.showEditRules(n)}),k.on("renameValues",function(e,n){t.showEditValues(n)}),k.on("deleteRules",function(e,n){setTimeout(function(){t.removeRules(n)},0)}),k.on("deleteValues",function(e,n){setTimeout(function(){t.removeValues(n)},0)}),k.on("createRules",t.showCreateRules),k.on("createValues",t.showCreateValues),k.on("exportRules",t.exportData),k.on("exportValues",t.exportData),k.on("importRules",t.importRules),k.on("importValues",t.importValues),k.on("uploadRules",function(e,n){var r=o(n);r.append("replaceAll","1"),t._uploadRules(r,!0)}),k.on("uploadValues",function(e,n){var r=o(n,"values");r.append("replaceAll","1"),t._uploadValues(r,!0)});var d,p,h=document.hidden;f(document).on("visibilitychange",function(){clearTimeout(d);var e="network"===t.state.name;return document.hidden||!e?void(e&&h!==document.hidden&&(h=!0,p=t.scrollerAtBottom&&t.scrollerAtBottom())):(h=!1,void(d=setTimeout(function(){var e=p||t.scrollerAtBottom&&t.scrollerAtBottom();p=!1,t.setState({},function(){e&&t.autoRefresh()})},100)))}),setTimeout(function(){D.checkUpdate(function(e){e&&e.showUpdate&&t.setState({version:e.version,latestVersion:e.latestVersion},function(){f(A.findDOMNode(t.refs.showUpdateTipsDialog)).modal("show")})})},1e4),D.getLogIdList=this.getLogIdListFromRules,D.importAnySessions=t.importAnySessions,D.on("plugins",function(e){var n=t.createPluginsOptions(e.plugins),r=t.state.pluginsOptions,o=t.state.disabledPlugins,i=t.state.disabledAllPlugins,a=e.disabledPlugins;if(i==e.disabledAllPlugins&&n.length==r.length){for(var s,l=0,c=n.length;c>l;l++){var u=n[l],d=r[l];if(u.name!=d.name||u.latest!==d.latest||u.mtime!=d.mtime||o[u.name]!=a[u.name]||u.hideLongProtocol!=d.hideLongProtocol||u.hideShortProtocol!=d.hideShortProtocol||u.path!=d.path){s=!0;break}}if(!s)return}var p=t.state.plugins;p&&e.plugins&&Object.keys(e.plugins).forEach(function(t){var n=p[t];if(n){var r=e.plugins[t];r.selectedRulesHistory=n.selectedRulesHistory,r.selectedValuesHistory=n.selectedValuesHistory}});var h={plugins:e.plugins,disabledPlugins:e.disabledPlugins,pluginsOptions:n,disabledAllPlugins:e.disabledAllPlugins};L.setPlugins(h),t.setState(h)});try{var g=window.parent.onWhistleReady;"function"==typeof g&&g({url:location.href,pageId:D.getPageId(),compose:D.compose,importSessions:t.importAnySessions,importHarSessions:t.importHarSessions,clearSessions:t.clear,selectIndex:function(e){k.trigger("selectedIndex",e)}})}catch(m){}},shouldComponentUpdate:function(e,t){var n=this.state.name;return"network"===n&&t.name!==n&&(this._isAtBottom=this.scrollerAtBottom&&this.scrollerAtBottom()),!0},importAnySessions:function(e){e&&(Array.isArray(e)?D.addNetworkList(e):this.importHarSessions(e))},donotShowAgain:function(){D.donotShowAgain()},hideUpdateTipsDialog:function(){f(A.findDOMNode(this.refs.showUpdateTipsDialog)).modal("hide")},getAllRulesText:function(){var e=" "+this.getAllRulesValue();return e.replace(/#[^\r\n]*[\r\n]/g,"\n")},getLogIdListFromRules:function(){var e=this.getAllRulesText();if(e=e.match(/\slog:\/\/(?:\{[^\s]{1,36}\}|[^/\\{}()<>\s]{1,36})\s/g)){var t={};e=e.map(function(e){return e=S.removeProtocol(e.trim()),"{"===e[0]&&(e=e.slice(1,-1)),e}).filter(function(e){return e?t[e]?!1:(t[e]=1,!0):!1})}return e},getWeinreFromRules:function(){var e=this.state.values,t=this.getAllRulesText();if(t=t.match(/(?:^|\s)weinre:\/\/[^\s#]+(?:$|\s)/gm)){var n={};t=t.map(function(t){t=S.removeProtocol(t.trim());var n=u(t);if(n!==!1)return n;var r=c(t);return r!==!1?(r=e.get(r),r&&r.value):t}).filter(function(e){return e?n[e]?!1:(n[e]=1,!0):!1})}return t},getValuesFromRules:function(){var e=" "+this.getAllRulesValue();return(e=e.match(/\s(?:[\w-]+:\/\/)?\{[^\s#]+\}/g))&&(e=e.map(function(e){return c(S.removeProtocol(e.trim()))}).filter(function(e){return!!e})),e},getAllRulesValue:function(){var e=[],t=[],n=[],r=this.state.rules;return r.list.forEach(function(o){var i=r.get(o),a=i.value||"";i.active?t.push(a):i.selected?n.push(a):e.push(a)}),r=this.state.values,r.list.forEach(function(t){/\.rules$/.test(t)&&e.push(r.get(t).value)}),t.concat(n).concat(e).join("\r\n")},preventBlur:function(e){"INPUT"!=e.target.nodeName&&e.preventDefault()},startLoadData:function(){function e(o,a){o=o||r.state.network,clearTimeout(i),i=null,"network"==r.state.name&&(a=a||n(),o.update(a)&&a&&(i=setTimeout(e,3e3)),document.hidden||r.setState({},function(){a&&t()}))}function t(e){(e||!r.state.network.isTreeView)&&(s.scrollTop=1e7)}function n(){var e=a.find(".ReactVirtualized__Grid__innerScrollContainer")[0];return e?s.scrollTop+s.offsetHeight+5>e.offsetHeight:!0}var r=this;if(r._updateNetwork)return void r._updateNetwork();var o,i,a=f(".w-req-data-list .ReactVirtualized__Grid:first").scroll(function(){var t=r.state.network;o&&clearTimeout(o),o=null,n()&&(o=setTimeout(function(){e(t,!0)},1e3))}),s=a[0];this.container=a,D.on("data",e),f(document).on("dblclick",".w-network-menu-list",function(e){f(e.target).hasClass("w-network-menu-list")&&(s.scrollTop<1?t(!0):s.scrollTop=0)}),r._updateNetwork=e,r.autoRefresh=t,r.scrollerAtBottom=n},showPlugins:function(e){"plugins"!=this.state.name?(this.setMenuOptionsState(),this.hidePluginsOptions()):e&&!this.state.showLeftMenu&&this.showPluginsOptions(),this.setState({hasPlugins:!0,name:"plugins"}),S.changePageName("plugins")},handleAction:function(e){if("top"===e)return void(this.container[0].scrollTop=0);if("bottom"===e)return this.autoRefresh(!0);if("pause"===e)return k.trigger("changeRecordState",e),D.pauseNetworkRecord();var t="refresh"===e;return t?k.trigger("changeRecordState"):k.trigger("changeRecordState","stop"),D.stopNetworkRecord(!t),t?this.autoRefresh():void 0},showNetwork:function(e){var t=this;return"network"==t.state.name?void(e&&!t.state.showLeftMenu&&t.showNetworkOptions()):(t.setMenuOptionsState(),t.setState({hasNetwork:!0,name:"network"},function(){t.startLoadData(),t._isAtBottom&&(t._isAtBottom=!1,t.autoRefresh&&t.autoRefresh())}),void S.changePageName("network"))},showAccount:function(){var e=this;"account"!=e.state.name&&(e.setState({name:"account",hasAccount:!0}),S.changePageName("account"))},signOut:function(){this.state.showAccount=!1,this.showTab()},handleNetwork:function(e,t){var n=this.state.network;"removeAll"==e.id?this.clear():"removeSelected"==e.id?n.removeSelectedItems():"removeUnselected"==e.id?n.removeUnselectedItems():"exportWhistleFile"==e.id?this.exportSessions("whistle"):"exportSazFile"==e.id?this.exportSessions("Fiddler"):"exportHarFile"==e.id?this.exportSessions("har"):"importSessions"==e.id?this.importSessions(t):"toggleView"===e.id&&this.toggleTreeView(),this.hideNetworkOptions()},importData:function(e){switch(this.state.name){case"network":this.importSessions(e);break;case"rules":this.importRules(e);break;case"values":this.importValues(e)}},exportData:function(e,t){switch(this.state.name){case"network":var n=this.state.network,r=Array.isArray(t)||n.hasSelected();if(this.currentFoucsItem=t,r){f(A.findDOMNode(this.refs.chooseFileType)).modal("show");var o=this;setTimeout(function(){A.findDOMNode(o.refs.sessionsName).focus()},500)}else z.info("Please select the sessions first.");break;case"rules":this.showAndActiveRules({id:"exportRules"});break;case"values":this.showAndActiveValues({id:"exportValues"})}},importSessions:function(e,t){var n=this,r=e&&e.shiftKey||t&&t.shiftKey;return r?(n.refs.importRemoteSessions.show(),void setTimeout(function(){var e=A.findDOMNode(n.refs.sessionsRemoteUrl);e.focus(),e.select()},500)):void A.findDOMNode(n.refs.importSessions).click()},importSessionsFromUrl:function(e,t){if(e){var n=this;n.setState({pendingSessions:!0}),D.importRemote({url:e},a(function(e,r){n.setState({pendingSessions:!1}),e||(t&&n.refs.importRemoteSessions.hide(),n.importAnySessions(r))}))}},importRemoteSessions:function(e){if(!e||"click"===e.type||13===e.keyCode){var t=this,n=A.findDOMNode(t.refs.sessionsRemoteUrl),r=i(n.value);t.importSessionsFromUrl(r,!0)}},importRules:function(e,t){var n=this,r=e&&e.shiftKey||t&&t.shiftKey;return r?(n.refs.importRemoteRules.show(),void setTimeout(function(){var e=A.findDOMNode(n.refs.rulesRemoteUrl);e.focus(),e.select()},500)):void A.findDOMNode(n.refs.importRules).click()},importRemoteRules:function(e){if(!e||"click"===e.type||13===e.keyCode){var t=this,n=A.findDOMNode(t.refs.rulesRemoteUrl),r=i(n.value);r&&(t.setState({pendingRules:!0}),D.importRemote({url:r},a(function(e,n){t.setState({pendingRules:!1}),e||(t.refs.importRemoteRules.hide(),n&&(t.rulesForm=o(n),t.refs.confirmImportRules.show()))})))}},importValues:function(e,t){var n=this,r=e&&e.shiftKey||t&&t.shiftKey;return r?(n.refs.importRemoteValues.show(),void setTimeout(function(){var e=A.findDOMNode(n.refs.valuesRemoteUrl);e.focus(),e.select()},500)):void A.findDOMNode(n.refs.importValues).click()},importRemoteValues:function(e){if(!e||"click"===e.type||13===e.keyCode){var t=this,n=A.findDOMNode(t.refs.valuesRemoteUrl),r=i(n.value);r&&(t.setState({pendingValues:!0}),D.importRemote({url:r},a(function(e,n){t.setState({pendingValues:!1}),e||(t.refs.importRemoteValues.hide(),n&&(t.valuesForm=o(n,"values"),t.refs.confirmImportValues.show()))})))}},_uploadRules:function(e,t){var n=this;D.upload.importRules(e,function(e,r){e?0===e.ec?(n.reloadRules(e),t&&z.success("Successful synchronization Rules.")):G.alert(e.em):S.showSystemError(r)})},_uploadValues:function(e,t){var n=this;D.upload.importValues(e,function(e,r){e||S.showSystemError(r),0===e.ec?(n.reloadValues(e),t&&z.success("Successful synchronization Values.")):G.alert(e.em)})},uploadRules:function(e){var t=this.rulesForm;if(this.rulesForm=null,t){var n=t.get("rules");if(!n||!/\.(txt|json)$/i.test(n.name))return G.alert("Only supports .txt or .json file.");if(n.size>Z)return G.alert("The file size cannot exceed 6m.");f(e.target).hasClass("btn-danger")&&t.append("replaceAll","1"),this._uploadRules(t),A.findDOMNode(this.refs.importRules).value=""}},uploadValues:function(e){var t=this.valuesForm;if(this.valuesForm=null,t){var n=t.get("values");if(!n||!/\.(txt|json)$/i.test(n.name))return G.alert("Only supports .txt or .json file.");if(n.size>Z)return G.alert("The file size cannot exceed 6m.");f(e.target).hasClass("btn-danger")&&t.append("replaceAll","1"),this._uploadValues(t),A.findDOMNode(this.refs.importValues).value=""}},uploadRulesForm:function(){this.rulesForm=new FormData(A.findDOMNode(this.refs.importRulesForm)),this.refs.confirmImportRules.show()},uploadValuesForm:function(){this.valuesForm=new FormData(A.findDOMNode(this.refs.importValuesForm)),this.refs.confirmImportValues.show()},showAndActiveRules:function(e,t){if("rules"===this.state.name)switch(e.id){case"exportRules":this.refs.selectRulesDialog.show();break;case"importRules":this.importRules(t)}else this.setRulesActive(e.name),this.showRules();this.hideRulesOptions()},showRules:function(e){"rules"!=this.state.name?(this.setMenuOptionsState(),this.hideRulesOptions()):e&&!this.state.showLeftMenu&&this.showRulesOptions(e),this.setState({hasRules:!0,name:"rules"}),S.changePageName("rules")},showAndActiveValues:function(e,t){var n=this;if("values"===n.state.name&&e.id)switch(e.id){case"exportValues":n.refs.selectValuesDialog.show();break;case"importValues":this.importValues(t)}else{var r=n.state.values,o=e.name;r.exists(o)?n.setValuesActive(o):D.values.add({name:o},function(e,t){if(e&&0===e.ec){var i=r.add(o);n.setValuesActive(o),n.setState({activeValues:i}),k.trigger("focusValuesList")}else S.showSystemError(t)}),this.showValues()}n.hideValuesOptions()},addValue:function(){},showValues:function(e){"values"!=this.state.name?(this.setMenuOptionsState(),this.hideValuesOptions()):e&&!this.state.showLeftMenu&&this.showValuesOptions(e), +this.setState({hasValues:!0,name:"values"}),S.changePageName("values")},showNetworkOptions:function(){"network"==this.state.name&&this.setState({showNetworkOptions:!0})},hideNetworkOptions:function(){this.setState({showRemoveOptions:!1,showAbortOptions:!1,showNetworkOptions:!1})},showRemoveOptions:function(){this.setState({showRemoveOptions:!0})},showAbortOptions:function(){var e=this.state.network,t=e.getSelectedList();de[0].disabled=!t||!t.filter(S.canAbort).length,this.setState({showAbortOptions:!0})},showCreateOptions:function(){this.setState({showCreateOptions:!0})},hideCreateOptions:function(){this.setState({showCreateOptions:!1})},hideRemoveOptions:function(){this.setState({showRemoveOptions:!1})},hideAbortOptions:function(){this.setState({showAbortOptions:!1})},showHelpOptions:function(){this.setState({showHelpOptions:!0})},hideHelpOptions:function(){this.setState({showHelpOptions:!1})},showHasNewVersion:function(e){this.setState({hasNewVersion:e})},showRulesOptions:function(e){var t,n=this,r=n.state.rules,o=r.data,i=r.list;if("rules"===n.state.name){var a=i.length;le[0].disabled=2>a,le[1].disabled=1>a,t=le}else t=[],i.forEach(function(e){t.push(o[e])});n.setState({rulesOptions:t,showRulesOptions:!0})},hideRulesOptions:function(){this.setState({showRulesOptions:!1})},showValuesOptions:function(e){var t,n=this,r=this.state.values.list;if("values"===n.state.name){var o=r.length;ce[0].disabled=2>o,ce[1].disabled=1>o,t=ce}else{t=[];var i=n.getValuesFromRules()||[];i=S.unique(r.concat(i));var a=[];i.forEach(function(e){var n=-1!=r.indexOf(e),o={name:e,icon:n?"edit":"plus"};n?t.push(o):a.push(o)}),t=a.concat(t)}n.setState({valuesOptions:t,showValuesOptions:!0})},hideValuesOptions:function(){this.setState({showValuesOptions:!1})},showAndActivePlugins:function(e){this.hidePluginsOptions(),this.showPlugins(),this.showPluginTab(e.name)},showPluginTab:function(e){var t="Home",n=this.state.tabs||[];if(e&&e!=t)for(var r=0,o=n.length;o>r;r++)if(n[r].name==e){t=e,e=null;break}var i=e&&this.state.plugins[e+":"];if(i){if(n.length>=J)return G.alert("At most "+J+" tabs can be opened at the same time."),this.showPlugins();if(t=e,i.pluginHomepage&&!i.openInPlugins)return window.open(i.pluginHomepage);n.push({name:e,url:i.pluginHomepage||"plugin."+e+"/"})}this.setState({active:t,tabs:n}),this.updatePluginTabInfo(n,t)},updatePluginTabInfo:function(e,t){e=e.map(function(e){return e.name}),j.set("activePluginTabList",JSON.stringify(e)),t&&j.set("activePluginTabName",t)},activePluginTab:function(e){this.showPluginTab(f(e.target).attr("data-name"))},closePluginTab:function(e){for(var t=f(e.target).attr("data-name"),n=this.state.tabs||[],r=0,o=n.length;o>r;r++)if(n[r].name==t){n.splice(r,1);var i=this.state.active;if(i==t){var a=n[r]||n[r-1];this.state.active=a?a.name:null}return this.setState({tabs:n}),void this.updatePluginTabInfo(n)}},showPluginsOptions:function(e){this.setState({showPluginsOptions:!0})},hidePluginsOptions:function(){this.setState({showPluginsOptions:!1})},showWeinreOptionsQuick:function(e){var t=this.getWeinreFromRules();return t&&t.length?void f(e.target).closest("div").addClass("w-menu-wrapper-show"):void this.showAnonymousWeinre()},showWeinreOptions:function(e){var t=this,n=t.state.weinreOptions=t.getWeinreFromRules()||[];t.state.weinreOptions=S.unique(n).map(function(e){return{name:e,icon:"console"}}),t.setState({showWeinreOptions:!0})},hideWeinreOptions:function(){this.setState({showWeinreOptions:!1})},setMenuOptionsState:function(e,t){var n={showCreateRules:!1,showCreateValues:!1,showEditRules:!1,showEditValues:!1,showCreateOptions:!1};e&&(n[e]=!0),this.setState(n,t)},hideRulesInput:function(){this.setState({showCreateRules:!1})},hideValuesInput:function(){this.setState({showCreateValues:!1})},hideRenameRuleInput:function(){this.setState({showEditRules:!1})},hideRenameValueInput:function(){this.setState({showEditValues:!1})},showCreateRules:function(e,t){var n=A.findDOMNode(this.refs.createRulesInput);this._curFocusRulesItem=t,this.setState({showCreateRules:!0},function(){n.focus()})},showCreateValues:function(e,t){var n=A.findDOMNode(this.refs.createValuesInput);this._curFocusValuesItem=t,this.setState({showCreateValues:!0},function(){n.focus()})},showHttpsSettingsDialog:function(){f(A.findDOMNode(this.refs.rootCADialog)).modal("show")},interceptHttpsConnects:function(e){var t=this,n=e.target.checked;D.interceptHttpsConnects({interceptHttpsConnects:n?1:0},function(e,r){e&&0===e.ec?t.state.interceptHttpsConnects=n:S.showSystemError(r),t.setState({})})},enableHttp2:function(e){if(!D.supportH2){var t=this;return void G.confirm("The current version of Node.js cannot support HTTP/2.\nPlease upgrade to the latest LTS version.",function(e){e&&window.open("https://nodejs.org/"),t.setState({})})}var n=e.target.checked;D.enableHttp2({enableHttp2:n?1:0},function(e,r){e&&0===e.ec?t.state.enableHttp2=n:S.showSystemError(r),t.setState({})})},createRules:function(e){if(13==e.keyCode||"click"==e.type){var t=this,n=A.findDOMNode(t.refs.createRulesInput),r=n.value.trim();if(!r)return void z.error("The name cannot be empty.");var o,i=t.state.rules,a=e&&e.target.getAttribute("data-type");if("group"===a&&(o=!0,r="\r"+r),i.exists(r))return void z.error("The name '"+r+"' already exists.");var s="top"===a?1:"",l=t._curFocusRulesItem,c={name:r,addToTop:s};l&&(c.groupName=l.name),D.rules.add(c,function(e,a){if(e&&0===e.ec){var l=i[s?"unshift":"add"](r);n.value="",n.blur(),i.moveToGroup(r,c.groupName,s),!o&&t.setRulesActive(r),c.groupName&&k.trigger("expandRulesGroup",c.groupName),t.setState(o?{}:{activeRules:l},function(){o&&k.trigger("scrollRulesBottom")}),t.triggerRulesChange("create")}else S.showSystemError(a)})}},createValues:function(e){if(13==e.keyCode||"click"==e.type){var t=this,n=A.findDOMNode(t.refs.createValuesInput),r=n.value.trim();if(!r)return void z.error("The name cannot be empty.");if(/\s/.test(r))return void z.error("The name cannot contain spaces.");if(/#/.test(r))return void z.error("The name cannot contain #.");var o,i=t.state.values,a=e&&e.target.getAttribute("data-type");if("group"===a&&(o=!0,r="\r"+r),i.exists(r))return void z.error("The name '"+r+"' already exists.");var s=t._curFocusValuesItem,l={name:r};s&&(l.groupName=s.name),D.values.add(l,function(e,a){if(e&&0===e.ec){var s=i.add(r);n.value="",n.blur(),i.moveToGroup(r,l.groupName),!o&&t.setValuesActive(r),l.groupName&&k.trigger("expandValuesGroup",l.groupName),t.setState(o?{}:{activeValues:s},function(){o&&k.trigger("scrollValuesBottom")}),t.triggerValuesChange("create")}else S.showSystemError(a)})}},showEditRules:function(e){this.currentFocusRules=e;var t=this.state.rules,n=e||t.getActive();if(n&&!n.isDefault){var r=A.findDOMNode(this.refs.editRulesInput);r.value=n.name,this.setState({showEditRules:!0,selectedRule:n},function(){r.select(),r.focus()})}},showEditValuesByDBClick:function(e){!e.changed&&this.showEditValues()},showEditValues:function(e){this.currentFocusValues=e;var t=this.state.values,n=e||t.getActive();if(n&&!n.isDefault){var r=A.findDOMNode(this.refs.editValuesInput);r.value=n.name,this.setState({showEditValues:!0,selectedValue:n},function(){r.select(),r.focus()})}},editRules:function(e){if(13==e.keyCode||"click"==e.type){var t=this,n=t.state.rules,r=this.currentFocusRules||n.getActive();if(r){var o=A.findDOMNode(t.refs.editRulesInput),i=S.isGroup(r.name),a=(i?"\r":"")+o.value.trim();if(!a)return void z.error("The name cannot be empty.");if(n.exists(a))return void z.error("The name '"+a+"' already exists.");var s=r.name;D.rules.rename({name:s,newName:a},function(e,r){e&&0===e.ec?(n.rename(s,a),o.value="",o.blur(),!i&&t.setRulesActive(a),k.trigger("rulesNameChanged",[s,a]),t.setState({activeRules:n.getActive()}),t.triggerRulesChange("rename")):S.showSystemError(r)})}}},editValues:function(e){if(13==e.keyCode||"click"==e.type){var t=this,n=t.state.values,o=this.currentFocusValues||n.getActive();if(o){var i=A.findDOMNode(t.refs.editValuesInput),a=S.isGroup(o.name),s=(a?"\r":"")+i.value.trim();if(!s)return void z.error("The name cannot be empty.");if(n.exists(s))return void z.error("The name '"+s+"' already exists.");var l=o.name;D.values.rename({name:l,newName:s},function(e,c){e&&0===e.ec?(n.rename(l,s),i.value="",i.blur(),!a&&t.setValuesActive(s),k.trigger("valuesNameChanged",[l,s]),t.setState({activeValues:n.getActive()}),t.triggerValuesChange("rename"),r(o)):S.showSystemError(c)})}}},showAnonymousWeinre:function(){this.openWeinre()},showWeinre:function(e){this.openWeinre(e.name)},openWeinre:function(e){window.open("weinre/client/#"+(e||"anonymous")),this.setState({showWeinreOptions:!1})},onClickRulesOption:function(e){e.selected?this.unselectRules(e):this.selectRules(e)},selectRules:function(e){if(!S.isGroup(e.name)){var t=this;return D.rules[e.isDefault?"enableDefault":"select"](e,function(n,r){n&&0===n.ec?(t.reselectRules(n),t.state.rules.setChanged(e.name,!1),t.setState({}),t.triggerRulesChange("save"),t.state.disabledAllRules&&G.confirm("Rules has been turn off, do you want to turn on it?",function(e){e&&D.rules.disableAllRules({disabledAllRules:0},function(e,n){e&&0===e.ec?(t.state.disabledAllRules=!1,t.setState({})):S.showSystemError(n)})})):S.showSystemError(r)}),!1}},selectRulesByOptions:function(e){var t=this.state.rules.data[f(e.target).attr("data-name")];this[e.target.checked?"selectRules":"unselectRules"](t)},unselectRules:function(e){var t=this;return D.rules[e.isDefault?"disableDefault":"unselect"](e,function(e,n){e&&0===e.ec?(t.reselectRules(e),t.setState({})):S.showSystemError(n)}),!1},reselectRules:function(e,t){var n=this;n.state.rules.clearAllSelected(),n.setSelected(n.state.rules,"Default",!e.defaultRulesIsDisabled,t),e.list.forEach(function(e){n.setSelected(n.state.rules,e,!0,t)})},saveValues:function(e){if(e.changed&&!S.isGroup(e.name)){var t=this;return D.values.add(e,function(n,o){n&&0===n.ec?(t.setSelected(t.state.values,e.name),t.triggerValuesChange("save"),r(e)):S.showSystemError(o)}),!1}},setSelected:function(e,t,n,r){e.setSelected(t,n)&&(r||e.setChanged(t,!1),this.setState({curSelectedName:t}))},replayCountChange:function(e){var t=e.target.value.replace(/^\s*0*|[^\d]+/,""),n=t.slice(0,3);n>$&&(n=$),this.setState({replayCount:n})},clickReplay:function(e){e.shiftKey?k.trigger("replaySessions",[null,e.shiftKey]):this.replay(e)},replay:function(e,t,n){var r=this.state.network;if(t=Array.isArray(t)?t:r.getSelectedList(),t&&t.length){this.enableRecord();var o,i=function(e,t){var n=e.req;D.compose2({repeatCount:t,useH2:e.useH2?1:"",url:e.url,headers:S.getOriginalReqHeaders(e),method:n.method,base64:n.base64})};if(n>1?i(t[0],Math.min(n,$)):(o={},t.slice(0,$).forEach(function(e){o[e.id]=1,i(e)})),r.isTreeView){var a=D.lastSelectedDataId;if(!a)return;if(!o)return k.trigger("replayTreeView",[a,n]);var s=a&&r.getTreeNode(a);if(s=s&&s.parent,!s)return;n=0,s.children.forEach(function(e){e=e.data,e&&o[e.id]&&++n}),k.trigger("replayTreeView",[a,n])}else this.autoRefresh&&this.autoRefresh()}},enableRecord:function(){this.refs.recordBtn.enable(),k.trigger("changeRecordState")},composer:function(){k.trigger("composer")},clear:function(){var e=this.state.network;this.setState({network:e.clear(),showRemoveOptions:!1})},removeRulesBatch:function(e){var t=this;D.rules.remove({list:e},function(n,r){if(n&&0===n.ec){var o,i=t.state.rules;e.forEach(function(e){var n=i.data[e]||"";n.active&&(o=i.getSibling(e),o&&t.setRulesActive(o.name)),i.remove(e)}),o&&k.trigger("expandRulesGroup",o.name),t.setState(o?{activeRules:o}:{}),t.triggerRulesChange("remove"),k.trigger("focusRulesList")}else S.showSystemError(r)}),this.refs.deleteRulesDialog.hide()},removeValuesBatch:function(e){var t=this;D.values.remove({list:e},function(n,r){if(n&&0===n.ec){var o,i=t.state.values;e.forEach(function(e){var n=i.data[e]||"";n.active&&(o=i.getSibling(e),o&&t.setValuesActive(o.name)),i.remove(e)}),o&&k.trigger("expandValuesGroup",o.name),t.setState(o?{activeValues:o}:{}),t.triggerValuesChange("remove"),k.trigger("focusValuesList")}else S.showSystemError(r)}),this.refs.deleteValuesDialog.hide()},removeRules:function(e){var t=this.state.rules,n=e||t.getActive();n&&!n.isDefault&&this.refs.deleteRulesDialog.show(n.name)},removeValues:function(e){var t=this.state.values,n=e||t.getActive();n&&!n.isDefault&&this.refs.deleteValuesDialog.show(n.name)},setRulesActive:function(e,t){t=t||this.state.rules,j.set("activeRules",e),t.setActive(e)},setValuesActive:function(e,t){t=t||this.state.values,j.set("activeValues",e),t.setActive(e)},showRulesSettings:function(){var e=this;f(A.findDOMNode(e.refs.rulesSettingsDialog)).modal("show"),D.rules.accountRules(function(t,n){t&&0===t.ec?e.setState({accountRules:t.rules}):S.showSystemError(n)})},showValuesSettings:function(){f(A.findDOMNode(this.refs.valuesSettingsDialog)).modal("show")},toggleLeftMenu:function(){var e=!this.state.showLeftMenu;this.setState({showLeftMenu:e}),j.set("showLeftMenu",e?1:""),k.trigger("editorResize")},handleCreate:function(){"rules"==this.state.name?this.showCreateRules():this.showCreateValues()},saveRulesOrValues:function(){var e,t=this,n=t.state,r="rules"==n.name;r?(e=n.rules.getChangedList(),e.length&&(e.forEach(function(e){t.selectRules(e)}),t.setState({}))):(e=n.values.getChangedList(),e.length&&(e.forEach(function(e){t.saveValues(e)}),t.setState({})))},onClickMenu:function(e){var t=f(e.target).closest("a"),n=this,r=n.state,o="rules"==r.name;t.hasClass("w-edit-menu")?o?n.showEditRules():n.showEditValues():t.hasClass("w-delete-menu")?o?n.removeRules():n.removeValues():t.hasClass("w-save-menu")&&n.saveRulesOrValues()},showSettings:function(e){var t=this.state.name;return"rules"===t?void this.showRulesSettings():"values"===t?void this.showValuesSettings():void this.refs.networkSettings.showDialog()},activeRules:function(e){j.set("activeRules",e.name),this.setState({activeRules:e})},activeValues:function(e){j.set("activeValues",e.name),this.setState({activeValues:e})},onRulesThemeChange:function(e){var t=e.target.value;j.set("rulesTheme",t),this.setState({rulesTheme:t})},onValuesThemeChange:function(e){var t=e.target.value;j.set("valuesTheme",t),this.setState({valuesTheme:t})},onRulesFontSizeChange:function(e){var t=e.target.value;j.set("rulesFontSize",t),this.setState({rulesFontSize:t})},onValuesFontSizeChange:function(e){var t=e.target.value;j.set("valuesFontSize",t),this.setState({valuesFontSize:t})},onRulesLineNumberChange:function(e){var t=e.target.checked;j.set("showRulesLineNumbers",t),this.setState({showRulesLineNumbers:t})},onValuesLineNumberChange:function(e){var t=e.target.checked;j.set("showValuesLineNumbers",t),this.setState({showValuesLineNumbers:t})},showFoldGutter:function(e){var t=e.target.checked;j.set("foldGutter",t?"1":""),this.setState({foldGutter:t})},onRulesLineWrappingChange:function(e){var t=e.target.checked;j.set("autoRulesLineWrapping",t?1:""),this.setState({autoRulesLineWrapping:t})},onValuesLineWrappingChange:function(e){var t=e.target.checked;j.set("autoValuesLineWrapping",t?1:""),this.setState({autoValuesLineWrapping:t})},confirmDisableAllRules:function(e){var t=this,n=t.state;n.disabledAllRules?t.disableAllRules():G.confirm("Are you sure to disable all rules",function(e){e&&t.disableAllRules()}),e&&e.preventDefault()},confirmDisableAllPlugins:function(e){var t=this,n=t.state;n.disabledAllPlugins?t.disableAllPlugins():G.confirm("Are you sure to disable all plugins",function(e){e&&t.disableAllPlugins()}),e&&e.preventDefault()},disableAllRules:function(e,t){var n=this,r=n.state,o=!r.disabledAllRules;D.rules.disableAllRules({disabledAllRules:o?1:0},function(e,i){e&&0===e.ec?(r.disabledAllRules=o,n.setState({}),"function"==typeof t&&t(o)):S.showSystemError(i)}),e&&e.preventDefault()},disableAllPlugins:function(e,t){var n=this,r=n.state,o=!r.disabledAllPlugins;D.plugins.disableAllPlugins({disabledAllPlugins:o?1:0},function(e,i){e&&0===e.ec?(r.disabledAllPlugins=o,L.setPlugins(r),n.setState({}),"function"==typeof t&&t(o)):S.showSystemError(i)}),e&&e.preventDefault()},disablePlugin:function(e){var t=this,n=e.target;return t.state.ndp?z.warn("Not allowed disable plugins."):void D.plugins.disablePlugin({name:f(n).attr("data-name"),disabled:n.checked?0:1},function(e,n){e&&0===e.ec?(t.state.disabledPlugins=e.data,L.setPlugins(t.state),t.setState({})):S.showSystemError(n)})},abort:function(e){if(!Array.isArray(e)){var t=this.state.network;e=t.getSelectedList()}e&&(e=e.map(function(e){return S.canAbort(e)?e.id:void 0}),e.length&&D.abort({list:e.join()})),this.hideAbortOptions()},allowMultipleChoice:function(e){var t=this,n=e.target.checked;D.rules.allowMultipleChoice({allowMultipleChoice:n?1:0},function(e,r){e&&0===e.ec?t.setState({allowMultipleChoice:n}):S.showSystemError(r)})},enableBackRulesFirst:function(e){var t=this,n=e.target.checked;D.rules.enableBackRulesFirst({backRulesFirst:n?1:0},function(e,r){e&&0===e.ec?(t.setState({backRulesFirst:n}),D.backRulesFirst=n):S.showSystemError(r)})},reinstallAllPlugins:function(){D.enablePluginMgr?k.trigger("installPlugins"):k.trigger("updateAllPlugins","reinstallAllPlugins")},chooseFileType:function(e){var t=e.target.value;j.set("exportFileType",t),this.setState({exportFileType:t})},uploadSessions:function(){this.uploadSessionsForm(new FormData(A.findDOMNode(this.refs.importSessionsForm))),A.findDOMNode(this.refs.importSessions).value=""},importHarSessions:function(e){if(e&&"object"===("undefined"==typeof e?"undefined":p(e))){var t=e.log.entries,n=[];t.forEach(function(e){if(e){var t=e.whistleTimes||"",r=new Date(t.startTime||e.startedDateTime).getTime();if(!isNaN(r)){var o=e.request||{},i=e.response||{},a=S.parseHeadersFromHar(o.headers),s=S.parseHeadersFromHar(i.headers),l=e.clientIPAddress||"127.0.0.1",c=e.serverIPAddress||"",u=W.test(o.httpVersion||i.httpVersion),d=u?"2.0":"1.1",p=o.postData||"",h={method:o.method,ip:l,port:o.port,httpVersion:d,unzipSize:p.size,size:o.bodySize>0?o.bodySize:0,headers:a.headers,rawHeaderNames:a.rawHeaderNames,body:""},g=p.base64||p.text;g&&(p.base64?h.base64=g:h.body=g);var f=i.content,m={httpVersion:d,statusCode:i.statusCode||i.status,statusMessage:i.statusText,unzipSize:f.size,size:i.bodySize>0?i.bodySize:0,headers:s.headers,rawHeaderNames:s.rawHeaderNames,ip:c,port:i.port,body:""},A=i.content,M=A&&A.text;M&&(A.base64?m.base64=A.base64:"IMG"===S.getContentType(A.mimeType)||M.length%4===0&&/^[a-z\d+/]+={0,2}$/i.test(M)?m.base64=M:m.body=M);var w={useH2:u,startTime:r,frames:e.frames,url:o.url,realUrl:e.whistleRealUrl,req:h,res:m,customData:e.whistleCustomData,fwdHost:e.whistleFwdHost,sniPlugin:e.whistleSniPlugin,rules:e.whistleRules||{},captureError:e.whistleCaptureError,isHttps:e.whistleIsHttps,reqError:e.whistleReqError,resError:e.whistleResError,version:e.whistleVersion,nodeVersion:e.whistleNodeVersion};if(t&&t.startTime)w.dnsTime=t.dnsTime,w.requestTime=t.requestTime,w.responseTime=t.responseTime,w.endTime=t.endTime;else{var y=e.timings||{},b=Math.round(r+S.getTimeFromHar(e.time));r=Math.floor(r+S.getTimeFromHar(y.dns)),w.dnsTime=r,r=Math.floor(r+S.getTimeFromHar(y.connect)+S.getTimeFromHar(y.ssl)+S.getTimeFromHar(y.send)+S.getTimeFromHar(y.blocked)+S.getTimeFromHar(y.wait)),w.requestTime=r,r=Math.floor(r+S.getTimeFromHar(y.receive)),w.responseTime=r,w.endTime=Math.max(r,b)}n.push(w)}}}),D.addNetworkList(n)}},uploadSessionsForm:function(e){var t=e.get("importSessions");if(!t||!/\.(txt|json|saz|har)$/i.test(t.name))return G.alert("Only supports .txt, .json, .saz or .har file.");if(t.size>K)return G.alert("The file size cannot exceed 64m.");var n=/\.txt$/i.test(t.name);if(n||/\.har$/i.test(t.name)){var r=this;return void S.readFileAsText(t,function(e){try{e=JSON.parse(e),n?D.addNetworkList(e):r.importHarSessions(e)}catch(t){G.alert("Unrecognized format.")}})}D.upload.importSessions(e,D.addNetworkList)},getExportSessions:function(){var e=this.state.network,t=this.currentFoucsItem;return this.currentFoucsItem=null,t&&f(A.findDOMNode(this.refs.chooseFileType)).is(":visible")||(t=e.getSelectedList()),t},exportSessions:function(e,t,n){if(n=n||this.getExportSessions(),n&&n.length){var r=A.findDOMNode(this.refs.exportSessionsForm);A.findDOMNode(this.refs.exportFilename).value=t||"",A.findDOMNode(this.refs.exportFileType).value=e,"har"===e&&(n={log:{version:"1.2",creator:{name:"Whistle",version:this.state.version,comment:""},browser:{name:"Whistle",version:this.state.version},pages:[],entries:n.map(S.toHar),comment:""}}),A.findDOMNode(this.refs.sessions).value=JSON.stringify(n,null," "),r.submit()}},exportBySave:function(e){if(!e||"click"===e.type||13===e.keyCode){var t=A.findDOMNode(this.refs.sessionsName),n=t.value.trim();t.value="",this.exportSessions(this.state.exportFileType,n),f(A.findDOMNode(this.refs.chooseFileType)).modal("hide")}},replayRepeat:function(e){e&&"click"!==e.type&&13!==e.keyCode||(this.refs.setReplayCount.hide(),this.replay("",this.replayList,this.state.replayCount),k.trigger("focusNetworkList"))},showAboutDialog:function(e){f(e.target).closest(".w-menu-enable").length&&this.refs.aboutDialog.showAboutInfo()},showCustomCertsInfo:function(){var e=this;e.loadingCerts||(e.loadingCerts=!0,D.certs.all(function(t,n){return e.loadingCerts=!1,t?void e.refs.certsInfoDialog.show(t.certs,t.dir):void S.showSystemError(n)}))},onContextMenu:function(e){var t=0,n=se;if(n[2].hide&&++t,n[3].hide&&++t,n[4].hide&&++t,3>t){var r=S.getMenuPosition(e,110,100-30*t),o=this.state;r.list=n,n[2].checked=!!o.network.isTreeView,n[3].checked=!o.disabledAllRules,n[4].checked=!o.disabledAllPlugins;var i=f(e.target);n[0].hide=!0,n[1].hide=!0,i.closest(".w-network-menu").length?n[0].hide=!1:i.closest(".w-save-menu").length&&(n[1].hide=!1,i.closest(".w-rules-menu").length?n[1].disabled=!o.rules.hasChanged():n[1].disabled=!o.values.hasChanged()),this.refs.contextMenu.show(r)}e.preventDefault()},onClickContextMenu:function(e){var t=this,n=t.state,r=se;switch(e){case"Tree View":r[2].checked=!n.network.isTreeView,t.toggleTreeView();break;case"Rules":t.disableAllRules(null,function(e){r[3].checked=!e,t.setState({})});break;case"Plugins":t.disableAllPlugins(null,function(e){r[4].checked=!e,t.setState({})});break;case"Clear":return void t.clear();case"Save":return void t.saveRulesOrValues()}this.refs.contextMenu.show({})},forceShowLeftMenu:function(){var e=this;clearTimeout(e.hideTimer),clearTimeout(e.showTimer),e.showTimer=setTimeout(function(){e.setState({forceShowLeftMenu:!0})},200)},selectCAType:function(e){var t=e.target.value;"cer"!==t&&"pem"!==t&&(t="crt"),this.setState({caType:t}),j.set("caType",t)},forceHideLeftMenu:function(){var e=this;clearTimeout(e.hideTimer),clearTimeout(e.showTimer),e.hideTimer=setTimeout(function(){e.setState({forceShowLeftMenu:!1})},500)},updateMenuView:function(e){var t=e.networkOptions[e.networkOptions.length-1];return e.network.isTreeView?(t.icon="globe",t.name="Show List View"):(t.icon="tree-conifer",t.name="Show Tree View"),e},toggleTreeView:function(){var e=this,t=e.state.network;t.setTreeView(!t.isTreeView),e.updateMenuView(e.state),e.setState({},function(){t.isTreeView||e.autoRefresh&&e.autoRefresh()})},toggleTreeViewByIcon:function(){"network"==this.getTabName()&&this.toggleTreeView()},getTabName:function(){var e=this.state,t=e.rulesMode,n=e.pluginsMode,r=e.name;return e.showAccount&&"account"===r?r:(e.networkMode?r="network":e.rulesOnlyMode?r="values"===r?"values":"rules":t&&n?r="plugins":t?r="network"===r?"rules":r:n&&(r="plugins"!==r?"network":r),r||"network")},render:function(){var e=this.state,t=e.networkMode,n=e.rulesMode,r=e.rulesOnlyMode,o=e.pluginsMode,i=e.multiEnv,a=this.getTabName(),s="account"==a,l="network"==a,c="rules"==a,u="values"==a,p="plugins"==a,g=c||u,f=g?null:oe,A=p||s?oe:null,M=s?null:oe,y=!0,S=!0,L=e.rulesTheme||"cobalt",k=e.valuesTheme||"cobalt",j=e.rulesFontSize||"14px",z=e.valuesFontSize||"14px",G=e.showRulesLineNumbers||!1,W=e.showValuesLineNumbers||!1,X=e.autoRulesLineWrapping,J=e.autoValuesLineWrapping,K=e.rulesOptions,Z=e.pluginsOptions,q={},ee=e.showNetworkOptions,te=e.showRulesOptions,ne=e.showValuesOptions,ie=e.showPluginsOptions,ae=e.showWeinreOptions,le=e.showHelpOptions,ce=e.network,pe=ce.isTreeView,he=pe?"tree-conifer":"globe";K[0].name===_&&K.forEach(function(t,n){t.icon=n&&e.multiEnv?"edit":"checkbox",t.selected||(q[t.name]=1)});var ge,fe;if(c){fe=e.rules.data;for(ge in fe)if(fe[ge].active){y=S=fe[ge].isDefault;break}}else if(u){fe=e.values.data;for(ge in fe)if(fe[ge].active){y=S=!1;break}}ce.rulesModal=e.rules,e.rules.editorTheme={theme:L,fontSize:j,lineNumbers:G};var me=e.networkOptions,Ae=ce.hasUnselected();ce.hasSelected()?(me.forEach(function(e){e.disabled=!1,"removeUnselected"===e.id&&(e.disabled=!Ae)}),ue.forEach(function(e){e.disabled=!1,"removeUnselected"===e.id&&(e.disabled=!Ae)})):(me.forEach(function(e){-1!==re.indexOf(e.id)?e.disabled=!0:"removeUnselected"===e.id&&(e.disabled=!Ae)}),me[0].disabled=!Ae,ue.forEach(function(e){-1!==re.indexOf(e.id)?e.disabled=!0:"removeUnselected"===e.id&&(e.disabled=!Ae)}));var Me,we,ye=e.pendingSessions,be=e.pendingRules,ve=e.pendingValues,Te=e.accountRules,xe=h&&!e.forceShowLeftMenu,Ne=o&&n,Ce=e.showAccount,Ie=(t&&!Ce||e.showLeftMenu)&&(!Ne||Ce),Ee=e.disabledAllPlugins,De=e.disabledAllRules,Se=r||Ne&&!Ce||t?oe:null;Ie&&h&&(Me=this.forceShowLeftMenu,we=this.forceHideLeftMenu),se[2].hide=n,se[3].hide=o,se[4].hide=r;var Le=e.caType||"crt",ke="img/qrcode.png",je="cgi-bin/rootca",Ue="http://rootca.pro/";"crt"!==Le&&(ke="img/qrcode-"+Le+".png",je+="?type="+Le,Ue+=Le);var Be=o||t,Qe=Be?oe:null;return D.hideMockMenu=Be,m.createElement("div",{className:"main orient-vertical-box"+(Ie?" w-show-left-menu":"")+(Ce?" w-show-account":"")+(g&&!r?" w-show-editor":"")+(c?" w-show-rules":"")+(r||n?" w-show-rules-mode":"")},m.createElement("div",{className:"w-menu w-"+a+"-menu-list"},m.createElement("a",{onClick:this.toggleLeftMenu,draggable:"false",className:"w-show-left-menu-btn",onMouseEnter:Me,onMouseLeave:we,style:Ce||!t&&!Ne?null:oe,title:"Dock to "+(Ie?"top":"left")+" (Ctrl[Command] + M)"},m.createElement("span",{className:"glyphicon glyphicon-chevron-"+(Ie?xe?"down":"up":"left")})),m.createElement("div",{style:{display:n?"none":void 0},onMouseEnter:this.showNetworkOptions,onMouseLeave:this.hideNetworkOptions,className:"w-nav-menu w-menu-wrapper"+(ee?" w-menu-wrapper-show":"")},m.createElement("a",{onClick:this.showNetwork,onDoubleClick:this.toggleTreeView,className:"w-network-menu"+(l?" w-menu-selected":""),title:"Double click to show"+(pe?" List View":" Tree View"),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-"+he}),"Network"),m.createElement(x,{ref:"networkMenuItem",options:e.networkOptions,className:"w-network-menu-item",onClickOption:this.handleNetwork})),m.createElement("div",{style:Qe,onMouseEnter:this.showRulesOptions,onMouseLeave:this.hideRulesOptions,className:"w-nav-menu w-menu-wrapper"+(te?" w-menu-wrapper-show":"")+(c?" w-menu-auto":"")},m.createElement("a",{onClick:this.showRules,className:"w-rules-menu"+(c?" w-menu-selected":""),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-list"+(De?" w-disabled":"")}),"Rules"),m.createElement(x,{ref:"rulesMenuItem",name:c?null:"Open",options:K,checkedOptions:q,disabled:De,className:"w-rules-menu-item",onClick:this.showRules,onClickOption:this.showAndActiveRules,onChange:this.selectRulesByOptions})),m.createElement("div",{style:Qe,onMouseEnter:this.showValuesOptions,onMouseLeave:this.hideValuesOptions,className:"w-nav-menu w-menu-wrapper"+(ne?" w-menu-wrapper-show":"")+(u?" w-menu-auto":"")},m.createElement("a",{onClick:this.showValues,className:"w-values-menu"+(u?" w-menu-selected":""),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-folder-close"}),"Values"),m.createElement(x,{ref:"valuesMenuItem",name:u?null:"Open",options:e.valuesOptions,className:"w-values-menu-item",onClick:this.showValues,onClickOption:this.showAndActiveValues})),m.createElement("div",{style:Se,ref:"pluginsMenu",onMouseEnter:this.showPluginsOptions,onMouseLeave:this.hidePluginsOptions,className:"w-nav-menu w-menu-wrapper"+(ie?" w-menu-wrapper-show":"")},m.createElement("a",{onClick:this.showPlugins,className:"w-plugins-menu"+(p?" w-menu-selected":""),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-list-alt"+(Ee?" w-disabled":"")}),"Plugins"),m.createElement(x,{ref:"pluginsMenuItem",name:p?null:"Open",options:Z,checkedOptions:e.disabledPlugins,disabled:Ee,className:"w-plugins-menu-item",onClick:this.showPlugins,onChange:this.disablePlugin,onClickOption:this.showAndActivePlugins})),m.createElement("a",{onClick:this.showAccount,className:"w-account-menu"+(s?" w-menu-selected":""),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-user"}),"Account"),!e.ndr&&m.createElement("a",{onClick:this.confirmDisableAllRules,className:"w-enable-rules-menu",title:De?"Enable all rules":"Disable all rules",style:{display:c?"":"none",color:De?"#f66":void 0},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-"+(De?"play-circle":"off")}),De?"ON":"OFF"),!e.ndp&&m.createElement("a",{onClick:this.confirmDisableAllPlugins,className:"w-enable-plugin-menu",title:Ee?"Enable all plugins":"Disable all plugins",style:{display:p?"":"none",color:Ee?"#f66":void 0},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-"+(Ee?"play-circle":"off")}),Ee?"ON":"OFF"),m.createElement(R,{hide:!p}),m.createElement("a",{onClick:this.reinstallAllPlugins,className:"w-plugins-menu"+(p?"":" hide"),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-download-alt"}),D.enablePluginMgr?"Install":"ReinstallAll"),m.createElement(N,{ref:"recordBtn",hide:!l,onClick:this.handleAction}),m.createElement("a",{onClick:this.importData,className:"w-import-menu",style:A,draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-import"}),"Import"),m.createElement("a",{onClick:this.exportData,className:"w-export-menu",style:A,draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-export"}),"Export"),m.createElement("div",{onMouseEnter:this.showRemoveOptions,onMouseLeave:this.hideRemoveOptions,style:{display:l?"":"none"},className:"w-menu-wrapper w-remove-menu-list w-menu-auto"+(e.showRemoveOptions?" w-menu-wrapper-show":"")},m.createElement("a",{onClick:this.clear,className:"w-remove-menu",title:"Ctrl[Command] + X",draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-remove"}),"Clear"),m.createElement(x,{options:ue,className:"w-remove-menu-item",onClickOption:this.handleNetwork})),m.createElement("a",{onClick:this.onClickMenu,className:"w-save-menu",style:f,draggable:"false",title:"Ctrl[Command] + S"},m.createElement("span",{className:"glyphicon glyphicon-save-file"}),"Save"),m.createElement("a",{className:"w-create-menu",style:f,draggable:"false",onClick:this.handleCreate},m.createElement("span",{className:"glyphicon glyphicon-plus"}),"Create"),m.createElement("a",{onClick:this.onClickMenu,className:"w-edit-menu"+(y?" w-disabled":""),style:f,draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-transfer"}),"Rename"),m.createElement("div",{onMouseEnter:this.showAbortOptions,onMouseLeave:this.hideAbortOptions,style:{display:l?"":"none"},className:"w-menu-wrapper w-abort-menu-list w-menu-auto"+(e.showAbortOptions?" w-menu-wrapper-show":"")},m.createElement("a",{onClick:this.clickReplay,className:"w-replay-menu",draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-repeat"}),"Replay"),m.createElement(x,{options:de,className:"w-remove-menu-item",onClickOption:this.abort})),m.createElement("a",{onClick:this.composer,className:"w-composer-menu",style:{display:l?"":"none"},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-send"}),"Edit"),m.createElement("a",{onClick:this.onClickMenu,className:"w-delete-menu"+(S?" w-disabled":""),style:f,draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-trash"}),"Delete"),m.createElement("a",{ +onClick:this.addWidget,className:"w-add-widget",style:M,draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-plus"}),"Widget"),m.createElement(Q,{onClick:this.showSettings,disabledRules:c&&De,isNetwork:l,hide:p}),m.createElement("div",{onMouseEnter:this.showWeinreOptions,onMouseLeave:this.hideWeinreOptions,className:"w-menu-wrapper"+(ae?" w-menu-wrapper-show":"")},m.createElement("a",{onClick:this.showFiles,className:"w-files-menu",style:Ce?null:oe,draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-file"}),"Files"),m.createElement("a",{onClick:this.showWeinreOptionsQuick,onDoubleClick:this.showAnonymousWeinre,className:"w-weinre-menu",draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-console"}),m.createElement("span",{className:"w-weinre-name"},"Weinre")),m.createElement(x,{ref:"weinreMenuItem",name:"anonymous",options:e.weinreOptions,className:"w-weinre-menu-item",onClick:this.showAnonymousWeinre,onClickOption:this.showWeinre})),m.createElement("a",{onClick:this.showHttpsSettingsDialog,className:"w-https-menu",draggable:"false",style:{color:D.hasInvalidCerts?"red":void 0}},m.createElement("span",{className:"glyphicon glyphicon-"+(e.interceptHttpsConnects?"ok":"lock")}),m.createElement("span",{className:"w-https-name"},"HTTPS")),m.createElement("div",{onMouseEnter:this.showHelpOptions,onMouseLeave:this.hideHelpOptions,className:"w-menu-wrapper"+(le?" w-menu-wrapper-show":"")},m.createElement("a",{className:"w-help-menu"+(e.hasNewVersion?" w-menu-enable":""),onClick:this.showAboutDialog,title:e.hasNewVersion?"There is a new version of whistle":void 0,href:e.hasNewVersion?void 0:"https://github.com/avwo/whistle#whistle",target:e.hasNewVersion?void 0:"_blank"},e.hasNewVersion?m.createElement("i",{className:"w-new-version-icon"}):null,m.createElement("span",{className:"glyphicon glyphicon-question-sign"}),m.createElement("span",{className:"w-help-name"},"Help")),m.createElement(x,{ref:"helpMenuItem",options:e.helpOptions,name:m.createElement(v,{ref:"aboutDialog",onClick:this.hideHelpOptions,onCheckUpdate:this.showHasNewVersion}),className:"w-help-menu-item"})),m.createElement(T,{name:a}),m.createElement("div",{onMouseDown:this.preventBlur,style:{display:e.showCreateRules?"block":"none"},className:"shadow w-input-menu-item w-create-rules-input"},m.createElement("input",{ref:"createRulesInput",onKeyDown:this.createRules,onBlur:this.hideRulesInput,type:"text",maxLength:"64",placeholder:"Input the name"}),m.createElement("button",{type:"button",onClick:this.createRules,className:"btn btn-primary"},"+Rule"),m.createElement("button",{type:"button",onClick:this.createRules,"data-type":"top",className:"btn btn-default"},"+Top"),m.createElement("button",{type:"button",onClick:this.createRules,"data-type":"group",className:"btn btn-default"},"+Group")),m.createElement("div",{onMouseDown:this.preventBlur,style:{display:e.showCreateValues?"block":"none"},className:"shadow w-input-menu-item w-create-values-input"},m.createElement("input",{ref:"createValuesInput",onKeyDown:this.createValues,onBlur:this.hideValuesInput,type:"text",maxLength:"64",placeholder:"Input the name"}),m.createElement("button",{type:"button",onClick:this.createValues,className:"btn btn-primary"},"+Key"),m.createElement("button",{type:"button",onClick:this.createValues,"data-type":"group",className:"btn btn-default"},"+Group")),m.createElement("div",{onMouseDown:this.preventBlur,style:{display:e.showEditRules?"block":"none"},className:"shadow w-input-menu-item w-edit-rules-input"},m.createElement("input",{ref:"editRulesInput",onKeyDown:this.editRules,onBlur:this.hideRenameRuleInput,type:"text",maxLength:"64"}),m.createElement("button",{type:"button",onClick:this.editRules,className:"btn btn-primary"},"OK")),m.createElement("div",{onMouseDown:this.preventBlur,style:{display:e.showEditValues?"block":"none"},className:"shadow w-input-menu-item w-edit-values-input"},m.createElement("input",{ref:"editValuesInput",onKeyDown:this.editValues,onBlur:this.hideRenameValueInput,type:"text",maxLength:"64"}),m.createElement("button",{type:"button",onClick:this.editValues,className:"btn btn-primary"},"OK"))),m.createElement("div",{className:"w-container box fill"},m.createElement(O,{onClick:this.onClickContextMenu,ref:"contextMenu"}),m.createElement("div",{onContextMenu:this.onContextMenu,onDoubleClick:this.onContextMenu,className:"w-left-menu"+(Me?" w-hover-left-menu":""),style:!Ce&&t||xe?oe:null,onMouseEnter:Me,onMouseLeave:we},m.createElement("a",{onClick:this.showNetwork,className:"w-network-menu"+(l?" w-menu-selected":""),style:{display:n?"none":void 0},draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-"+he}),m.createElement("i",{className:"w-left-menu-name"},"Network")),m.createElement("a",{onClick:this.showRules,className:"w-save-menu w-rules-menu"+(c?" w-menu-selected":""),style:Qe,draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-list"+(De?" w-disabled":"")}),m.createElement("i",{className:"w-left-menu-name"},"Rules"),m.createElement("i",{className:"w-menu-changed",style:{display:e.rules.hasChanged()?void 0:"none"}},"*")),m.createElement("a",{onClick:this.showValues,className:"w-save-menu w-values-menu"+(u?" w-menu-selected":""),style:Qe,draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-folder-close"}),m.createElement("i",{className:"w-left-menu-name"},"Values"),m.createElement("i",{className:"w-menu-changed",style:{display:e.values.hasChanged()?void 0:"none"}},"*")),m.createElement("a",{onClick:this.showPlugins,className:"w-plugins-menu"+(p?" w-menu-selected":""),style:Se,draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-list-alt"+(Ee?" w-disabled":"")}),m.createElement("i",{className:"w-left-menu-name"},"Plugins")),m.createElement("a",{onClick:this.showAccount,className:"w-account-menu"+(s?" w-menu-selected":""),draggable:"false"},m.createElement("span",{className:"glyphicon glyphicon-user"}),m.createElement("i",{className:"w-left-menu-name"},"Account"))),e.hasRules?m.createElement(w,{ref:"rules",disabled:De,theme:L,lineWrapping:X,fontSize:j,lineNumbers:G,onSelect:this.selectRules,onUnselect:this.unselectRules,onActive:this.activeRules,modal:e.rules,hide:!c,name:"rules"}):void 0,e.hasValues?m.createElement(w,{theme:k,onDoubleClick:this.showEditValuesByDBClick,fontSize:z,lineWrapping:J,lineNumbers:W,onSelect:this.saveValues,onActive:this.activeValues,modal:e.values,hide:!u,className:"w-values-list",foldGutter:e.foldGutter}):void 0,e.hasAccount?m.createElement(Y,{hide:!s}):void 0,e.hasNetwork?m.createElement(b,{ref:"network",hide:!l,modal:ce}):void 0,e.hasPlugins?m.createElement(E,d({},e,{onOpen:this.activePluginTab,onClose:this.closePluginTab,onActive:this.activePluginTab,onChange:this.disablePlugin,ref:"plugins",hide:!p})):void 0),m.createElement("div",{ref:"rulesSettingsDialog",className:"modal fade w-rules-settings-dialog"},m.createElement("div",{className:"modal-dialog"},m.createElement("div",{className:"modal-content"},m.createElement("div",{className:"modal-body"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},m.createElement("span",{"aria-hidden":"true"},"×")),m.createElement(C,{theme:L,fontSize:j,lineNumbers:G,lineWrapping:X,onLineWrappingChange:this.onRulesLineWrappingChange,onThemeChange:this.onRulesThemeChange,onFontSizeChange:this.onRulesFontSizeChange,onLineNumberChange:this.onRulesLineNumberChange}),!e.drb&&m.createElement("p",{className:"w-editor-settings-box"},m.createElement("label",null,m.createElement("input",{type:"checkbox",checked:e.backRulesFirst,onChange:this.enableBackRulesFirst})," ","Back rules first")),!e.drm&&m.createElement("p",{className:"w-editor-settings-box"},m.createElement("label",{style:{color:i?"#aaa":void 0}},m.createElement("input",{type:"checkbox",disabled:i,checked:!i&&e.allowMultipleChoice,onChange:this.allowMultipleChoice})," ","Use multiple rules")),Te&&Te.trim()?m.createElement("fieldset",{className:"w-fieldset"},m.createElement("legend",null,"Account Rules",m.createElement("span",{className:"glyphicon glyphicon-edit"})),m.createElement("pre",null,Te)):null),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))))),m.createElement("div",{ref:"valuesSettingsDialog",className:"modal fade w-values-settings-dialog"},m.createElement("div",{className:"modal-dialog"},m.createElement("div",{className:"modal-content"},m.createElement("div",{className:"modal-body"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},m.createElement("span",{"aria-hidden":"true"},"×")),m.createElement(C,{theme:k,fontSize:z,lineNumbers:W,lineWrapping:J,onLineWrappingChange:this.onValuesLineWrappingChange,onThemeChange:this.onValuesThemeChange,onFontSizeChange:this.onValuesFontSizeChange,onLineNumberChange:this.onValuesLineNumberChange}),m.createElement("p",{className:"w-editor-settings-box"},m.createElement("label",null,m.createElement("input",{type:"checkbox",checked:e.foldGutter,onChange:this.showFoldGutter})," ","Show fold gutter"))),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))))),m.createElement(I,{ref:"networkSettings"}),m.createElement("div",{ref:"rootCADialog",className:"modal fade w-https-dialog"},m.createElement("div",{className:"modal-dialog"},m.createElement("div",{className:"modal-content"},m.createElement("div",{className:"modal-body"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},m.createElement("span",{"aria-hidden":"true"},"×")),m.createElement("div",null,m.createElement("a",{className:"w-help-menu",title:"Click here to learn how to install root ca",href:"https://avwo.github.io/whistle/webui/https.html",target:"_blank"},m.createElement("span",{className:"glyphicon glyphicon-question-sign"})),m.createElement("a",{className:"w-download-rootca",title:Ue,href:je,target:"downloadTargetFrame"},"Download RootCA"),m.createElement("select",{className:"w-root-ca-type",value:Le,onChange:this.selectCAType},m.createElement("option",{value:"crt"},"rootCA.crt"),m.createElement("option",{value:"cer"},"rootCA.cer"),m.createElement("option",{value:"pem"},"rootCA.pem"))),m.createElement("a",{title:Ue,href:je,target:"downloadTargetFrame"},m.createElement("img",{src:ke,width:"320"})),m.createElement("div",{className:"w-https-settings"},m.createElement("p",null,m.createElement("label",{title:i?"Use `pattern enable://capture` in rules to replace global configuration":void 0},m.createElement("input",{disabled:i,checked:e.interceptHttpsConnects,onChange:this.interceptHttpsConnects,type:"checkbox"})," ","Capture TUNNEL CONNECTS")),m.createElement("p",null,m.createElement("label",null,m.createElement("input",{checked:D.supportH2&&e.enableHttp2,onChange:this.enableHttp2,type:"checkbox"})," ","Enable HTTP/2")),m.createElement("a",{draggable:"false",style:{color:D.hasInvalidCerts?"red":void 0},onClick:this.showCustomCertsInfo},"View all custom certificates"),m.createElement(H,{ref:"certsInfoDialog"}))),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))))),m.createElement("div",{ref:"chooseFileType",className:"modal fade w-choose-filte-type"},m.createElement("div",{className:"modal-dialog"},m.createElement("div",{className:"modal-content"},m.createElement("div",{className:"modal-body"},m.createElement("label",{className:"w-choose-filte-type-label"},"Save as:",m.createElement("input",{ref:"sessionsName",onKeyDown:this.exportBySave,placeholder:"Input the filename",className:"form-control",maxLength:"64"}),m.createElement("select",{ref:"fileType",className:"form-control",value:e.exportFileType,onChange:this.chooseFileType},m.createElement("option",{value:"whistle"},"*.txt"),m.createElement("option",{value:"Fiddler"},"*.saz"),m.createElement("option",{value:"har"},"*.har"))),m.createElement("a",{type:"button",onKeyDown:this.exportBySave,tabIndex:"0",onMouseDown:this.preventBlur,className:"btn btn-primary",onClick:this.exportBySave},"Export"))))),m.createElement(F,{ref:"editorWin",className:"w-editor-win"}),m.createElement(U,{ref:"setReplayCount",wstyle:"w-replay-count-dialog"},m.createElement("div",{className:"modal-body"},m.createElement("label",null,"Times:",m.createElement("input",{ref:"replayCount",placeholder:"<= "+$,onKeyDown:this.replayRepeat,onChange:this.replayCountChange,value:e.replayCount,className:"form-control",maxLength:"3"})),m.createElement("button",{type:"button",onKeyDown:this.replayRepeat,tabIndex:"0",onMouseDown:this.preventBlur,className:"btn btn-primary",disabled:!e.replayCount,onClick:this.replayRepeat},"Replay"))),m.createElement(U,{ref:"importRemoteRules",wstyle:"w-import-remote-dialog"},m.createElement("div",{className:"modal-body"},m.createElement("input",{readOnly:be,ref:"rulesRemoteUrl",maxLength:"2048",onKeyDown:this.importRemoteRules,placeholder:"Input the url",style:{"ime-mode":"disabled"}})),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-primary",disabled:be,onMouseDown:this.preventBlur,onClick:this.importRemoteRules},be?"Importing rules":"Import rules"),m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))),m.createElement(U,{ref:"importRemoteSessions",wstyle:"w-import-remote-dialog"},m.createElement("div",{className:"modal-body"},m.createElement("input",{readOnly:ye,ref:"sessionsRemoteUrl",maxLength:"2048",onKeyDown:this.importRemoteSessions,placeholder:"Input the url",style:{"ime-mode":"disabled"}})),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-primary",disabled:ye,onMouseDown:this.preventBlur,onClick:this.importRemoteSessions},ye?"Importing sessions":"Import sessions"),m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))),m.createElement(U,{ref:"importRemoteValues",wstyle:"w-import-remote-dialog"},m.createElement("div",{className:"modal-body"},m.createElement("input",{readOnly:ve,ref:"valuesRemoteUrl",maxLength:"2048",onKeyDown:this.importRemoteValues,placeholder:"Input the url",style:{"ime-mode":"disabled"}})),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-primary",disabled:ve,onMouseDown:this.preventBlur,onClick:this.importRemoteValues},ve?"Importing values":"Import values"),m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close"))),m.createElement("div",{ref:"showUpdateTipsDialog",className:"modal fade w-show-update-tips-dialog"},m.createElement("div",{className:"modal-dialog"},m.createElement("div",{className:"modal-content"},m.createElement("div",{className:"modal-body"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},m.createElement("span",{"aria-hidden":"true"},"×")),m.createElement("p",{className:"w-show-update-tips"},"whistle has important updates, it is recommended that you update to the latest version."),m.createElement("p",null,"Current version: ",e.version),m.createElement("p",null,"The latest stable version: ",e.latestVersion),m.createElement("p",null,"View change:"," ",m.createElement("a",{title:"Change log",href:"https://github.com/avwo/whistle/blob/master/CHANGELOG.md",target:"_blank"},"CHANGELOG.md"))),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-default",onClick:this.donotShowAgain,"data-dismiss":"modal"},"Don't show again"),m.createElement("a",{type:"button",className:"btn btn-primary",onClick:this.hideUpdateTipsDialog,href:"https://avwo.github.io/whistle/update.html",target:"_blank"},"View Update Guide"))))),m.createElement(U,{ref:"confirmReload",wstyle:"w-confirm-reload-dialog"},m.createElement("div",{className:"modal-body w-confirm-reload"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal"},m.createElement("span",{"aria-hidden":"true"},"×")),m.createElement("div",{className:"w-reload-data-tips"})),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},"No"),m.createElement("button",{type:"button",className:"btn btn-primary",onClick:this.reloadData,"data-dismiss":"modal"},"Yes"))),m.createElement(U,{ref:"confirmImportRules",wstyle:"w-confirm-import-dialog"},m.createElement("div",{className:"modal-body w-confirm-import"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal"},m.createElement("span",{"aria-hidden":"true"},"×")),"Whether to replace the existing rules?"),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-danger",onClick:this.uploadRules,"data-dismiss":"modal"},"Replace"),m.createElement("button",{type:"button",className:"btn btn-primary",onClick:this.uploadRules,"data-dismiss":"modal"},"Reserve"))),m.createElement(U,{ref:"confirmImportValues",wstyle:"w-confirm-import-dialog"},m.createElement("div",{className:"modal-body w-confirm-import"},m.createElement("button",{type:"button",className:"close","data-dismiss":"modal"},m.createElement("span",{"aria-hidden":"true"},"×")),"Whether to replace the existing values?"),m.createElement("div",{className:"modal-footer"},m.createElement("button",{type:"button",className:"btn btn-danger",onClick:this.uploadValues,"data-dismiss":"modal"},"Replace"),m.createElement("button",{type:"button",className:"btn btn-primary",onClick:this.uploadValues,"data-dismiss":"modal"},"Reserve"))),m.createElement(B,{ref:"deleteRulesDialog",tips:"Are you sure to delete all follow rules or group?",onConfirm:this.removeRulesBatch,name:"rules",isRules:"1",list:e.rules.list}),m.createElement(B,{ref:"deleteValuesDialog",tips:"Are you sure to delete all follow values or group?",onConfirm:this.removeValuesBatch,name:"values",list:e.values.list}),m.createElement(B,{ref:"selectRulesDialog",name:"rules",list:e.rules.list}),m.createElement(B,{ref:"selectValuesDialog",name:"values",list:e.values.list}),m.createElement("iframe",{name:"downloadTargetFrame",style:{display:"none"}}),m.createElement("form",{ref:"exportSessionsForm",action:"cgi-bin/sessions/export",style:{display:"none"},method:"post",target:"downloadTargetFrame"},m.createElement("input",{ref:"exportFilename",name:"exportFilename",type:"hidden"}),m.createElement("input",{ref:"exportFileType",name:"exportFileType",type:"hidden"}),m.createElement("input",{ref:"sessions",name:"sessions",type:"hidden"})),m.createElement("form",{ref:"importSessionsForm",encType:"multipart/form-data",style:{display:"none"}},m.createElement("input",{ref:"importSessions",onChange:this.uploadSessions,type:"file",name:"importSessions",accept:".txt,.json,.saz,.har"})),m.createElement("form",{ref:"importRulesForm",encType:"multipart/form-data",style:{display:"none"}},m.createElement("input",{ref:"importRules",onChange:this.uploadRulesForm,name:"rules",type:"file",accept:".txt,.json"})),m.createElement("form",{ref:"importValuesForm",encType:"multipart/form-data",style:{display:"none"}},m.createElement("input",{ref:"importValues",onChange:this.uploadValuesForm,name:"values",type:"file",accept:".txt,.json"})),m.createElement(V,{ref:"syncDialog"}),m.createElement(P,{ref:"jsonDialog"}),m.createElement("div",{id:"copyTextBtn",style:{display:"none"}}))}});D.getInitialData(function(e){A.render(m.createElement(pe,{modal:e}),document.getElementById("container"))})},function(e,t){"use strict";function n(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function r(e){var t=n(e),r=t[0],o=t[1];return 3*(r+o)/4-o}function o(e,t,n){return 3*(t+n)/4-n}function i(e){var t,r,i=n(e),a=i[0],s=i[1],l=new d(o(e,a,s)),c=0,p=s>0?a-4:a;for(r=0;p>r;r+=4)t=u[e.charCodeAt(r)]<<18|u[e.charCodeAt(r+1)]<<12|u[e.charCodeAt(r+2)]<<6|u[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;return 2===s&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,l[c++]=255&t),1===s&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t),l}function a(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function s(e,t,n){for(var r,o=[],i=t;n>i;i+=3)r=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(a(r));return o.join("")}function l(e){for(var t,n=e.length,r=n%3,o=[],i=16383,a=0,l=n-r;l>a;a+=i)o.push(s(e,a,a+i>l?l:a+i));return 1===r?(t=e[n-1],o.push(c[t>>2]+c[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],o.push(c[t>>10]+c[t>>4&63]+c[t<<2&63]+"=")),o.join("")}t.byteLength=r,t.toByteArray=i,t.fromByteArray=l;for(var c=[],u=[],d="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,g=p.length;g>h;++h)c[h]=p[h],u[p.charCodeAt(h)]=h;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},function(e,t,n){var r,o;(function(n){!function(t,n){e.exports=n(t)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof n?n:this,function(n){"use strict";n=n||{};var i,a=n.Base64,s="2.6.4",l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=function(e){for(var t={},n=0,r=e.length;r>n;n++)t[e.charAt(n)]=n;return t}(l),u=String.fromCharCode,d=function(e){if(e.length<2){var t=e.charCodeAt(0);return 128>t?e:2048>t?u(192|t>>>6)+u(128|63&t):u(224|t>>>12&15)+u(128|t>>>6&63)+u(128|63&t)}var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return u(240|t>>>18&7)+u(128|t>>>12&63)+u(128|t>>>6&63)+u(128|63&t)},p=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(e){return e.replace(p,d)},g=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0),r=[l.charAt(n>>>18),l.charAt(n>>>12&63),t>=2?"=":l.charAt(n>>>6&63),t>=1?"=":l.charAt(63&n)];return r.join("")},f=n.btoa&&"function"==typeof n.btoa?function(e){return n.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,g)},m=function(e){return f(h(String(e)))},A=function(e){return e.replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,"")},M=function(e,t){return t?A(m(e)):m(e)},w=function(e){return M(e,!0)};n.Uint8Array&&(i=function(e,t){for(var n="",r=0,o=e.length;o>r;r+=3){var i=e[r],a=e[r+1],s=e[r+2],c=i<<16|a<<8|s;n+=l.charAt(c>>>18)+l.charAt(c>>>12&63)+("undefined"!=typeof a?l.charAt(c>>>6&63):"=")+("undefined"!=typeof s?l.charAt(63&c):"=")}return t?A(n):n});var y,b=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return u((n>>>10)+55296)+u((1023&n)+56320);case 3:return u((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return u((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},T=function(e){return e.replace(b,v)},x=function(e){var t=e.length,n=t%4,r=(t>0?c[e.charAt(0)]<<18:0)|(t>1?c[e.charAt(1)]<<12:0)|(t>2?c[e.charAt(2)]<<6:0)|(t>3?c[e.charAt(3)]:0),o=[u(r>>>16),u(r>>>8&255),u(255&r)];return o.length-=[0,0,2,1][n],o.join("")},N=n.atob&&"function"==typeof n.atob?function(e){return n.atob(e)}:function(e){return e.replace(/\S{1,4}/g,x)},C=function(e){return N(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},I=function(e){return T(N(e))},E=function(e){return String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},D=function(e){return I(E(e))};n.Uint8Array&&(y=function(e){return Uint8Array.from(C(E(e)),function(e){return e.charCodeAt(0)})});var S=function(){var e=n.Base64;return n.Base64=a,e};if(n.Base64={VERSION:s,atob:C,btoa:f,fromBase64:D,toBase64:M,utob:h,encode:M,encodeURI:w,btou:T,decode:D,noConflict:S,fromUint8Array:i,toUint8Array:y},"function"==typeof Object.defineProperty){var L=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};n.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",L(function(){return D(this)})),Object.defineProperty(String.prototype,"toBase64",L(function(e){return M(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",L(function(){return M(this,!0)}))}}return n.Meteor&&(Base64=n.Base64),"undefined"!=typeof e&&e.exports?e.exports.Base64=n.Base64:(r=[],o=function(){return n.Base64}.apply(t,r),!(void 0!==o&&(e.exports=o))),{Base64:n.Base64}})}).call(t,function(){return this}())},function(e,t){"use strict";function n(e,t){t=t||0;for(var n=Math.min(e.length,r);n>t;t++){var o=e[t];if(!(9==o||10==o||13==o||o>=32&&127>=o)){++t;var i=e[t];if(o>=194&&223>=o){if(i>=128&&191>=i)continue;return!i}++t;var a=e[t];if(224==o){if(i>=160&&191>=i&&a>=128&&191>=a)continue;return!a}if(o>=225&&236>=o||238==o||239==o){if(i>=128&&191>=i&&a>=128&&191>=a)continue;return!a}if(237==o){if(i>=128&&159>=i&&a>=128&&191>=a)continue;return!a}++t;var s=e[t];if(240==o){if(i>=144&&191>=i&&a>=128&&191>=a&&s>=128&&191>=s)continue;return!s}if(o>=241&&243>=o){if(i>=128&&191>=i&&a>=128&&191>=a&&s>=128&&191>=s)continue;return!s}if(244==o){if(i>=128&&143>=i&&a>=128&&191>=a&&s>=128&&191>=s)continue;return!s}return!1}}return!0}var r=32768;e.exports=function(e){return n(e)?!0:0===e[0]&&n(e,5)}},function(e,t,n){var r=n(5);"string"==typeof r&&(r=[[e.id,r,""]]);n(7)(r,{});r.locals&&(e.exports=r.locals)},function(e,t,n){t=e.exports=n(6)(),t.push([e.id,".w-menu{height:30px;border-top:1px solid #fcfcfc;border-bottom:1px solid #ccc;background:#f1f3f4;padding-right:5pc;position:relative;z-index:1001;white-space:nowrap}.w-history-bar a,.w-menu a{text-decoration:none!important;color:#000;padding:0 5px;line-height:26px;height:26px;margin-right:5px;display:inline-block}.w-menu a{height:27px;line-height:28px;overflow:hidden}.w-detail .glyphicon,.w-menu .glyphicon{margin-right:3px}.w-menu .glyphicon-folder-close,.w-menu .glyphicon-folder-open{margin-right:6px}.w-menu .w-online{position:absolute;top:0;right:0}.w-left-menu a:hover,.w-left-menu a:hover .w-disabled,.w-menu .w-online,.w-menu a:hover{color:#337ab7}.w-menu .w-offline{color:#ccc!important;cursor:default}.w-frames-action .w-disabled,.w-history-bar .w-disabled,.w-menu .w-disabled{color:#aaa!important;cursor:not-allowed!important}.w-left-menu .w-disabled{color:#aaa}.w-menu .w-menu-enable .glyphicon-cog{color:#f66!important}.w-menu .w-new-version-icon{position:absolute;top:2px;left:17px;width:5px;height:5px;border-radius:5px;background:red}.w-menu .w-menu-wrapper{display:inline-block;position:relative;height:30px}.w-show-update-tips{font-weight:700}.w-input-menu-item{display:block;position:absolute;background:#fff;border:1px solid #ccc;border-radius:2px;z-index:101;top:30px;display:none;white-space:nowrap}.w-input-menu-item input{width:246px;height:2pc;border:1px solid #ccc;border-radius:0!important;border-radius:2px;padding:0 5px;vertical-align:middle}.w-input-menu-item .btn{height:2pc;padding:0 9pt;vertical-align:middle;border-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;margin-left:1px;border-color:#ccc}.w-create-rules-input{left:310px}.w-create-values-input{left:300px}.w-edit-rules-input{left:382px}.w-edit-values-input{left:372px}.w-show-left-menu .w-create-rules-input{left:210px}.w-show-left-menu .w-create-values-input{left:200px}.w-show-left-menu .w-edit-rules-input{left:282px}.w-show-left-menu .w-edit-values-input{left:17pc}.w-menu-wrapper .w-menu-item{display:none!important}.w-menu-wrapper-show .w-menu-item{display:block!important}.w-values-list .glyphicon-ok{display:none!important}.w-values-list a{font-weight:400!important}.w-disabled .glyphicon-ok,.w-disabled .glyphicon-stop{color:#ccc!important}.w-rules-settings-dialog .modal-dialog{width:25pc}.w-values-settings-dialog .modal-dialog{width:300px}.w-show-update-tips-dialog .modal-dialog{width:21pc}.w-show-update-tips-dialog .modal-body p{margin-bottom:5px}.w-https-dialog .modal-dialog{width:340px}.w-https-help{margin-left:150px}.w-https-dialog .modal-dialog div{white-space:nowrap}.w-https-dialog a{display:inline-block}.w-download-rootca,.w-https-help{line-height:30px}.w-https-settings label{font-weight:400}.w-https-settings p{margin:10px 0}.w-is-link{cursor:pointer;text-decoration:underline}.w-choose-filte-type .modal-dialog{width:456px}.w-choose-filte-type-label{white-space:nowrap}.w-choose-filte-type-label .form-control{margin-left:10px;width:200px;display:inline-block;font-weight:400}.w-choose-filte-type-label select.form-control{margin:0 5px;width:5pc}.w-confirm-import-dialog .modal-dialog{width:20pc;font-weight:700}.w-show-left-menu .w-menu .w-account-menu{display:none!important}.w-show-left-menu-btn{padding:0 15px!important;margin-right:0!important}.w-left-menu{background:#f1f3f4;border-left:1px solid #ccc;border-right:1px solid #ccc;display:none}.w-show-left-menu .w-left-menu{display:block;border-left:none}.w-show-left-menu .w-nav-menu{display:none}.w-left-menu a{display:block;position:relative;padding:10px 0 8px;width:47px;overflow:hidden;text-align:center;text-decoration:none!important;color:#000}.w-left-menu a span{margin-right:5px}.w-left-menu a .w-left-menu-name{display:block;font-style:normal;font-size:9pt;zoom:1;transform:scale(0.8,0.8);width:65px;margin-left:-10px;white-space:nowrap}.w-left-menu-tips{padding:6px 10px;display:none;left:47px;top:3px;position:absolute;z-index:1;border-radius:4px}.w-left-menu a:hover .w-left-menu-tips{display:block;color:#000;background-color:#f1f3f4;font-weight:700;border:1px solid #ccc}.w-left-menu a .w-left-menu-tips:hover,.w-menu .w-export-menu,.w-menu .w-import-menu,.w-menu .w-remove-menu-list{display:none}.w-show-left-menu .w-export-menu,.w-show-left-menu .w-import-menu,.w-show-left-menu .w-remove-menu-list{display:inline-block}.w-menu-changed{position:absolute;top:2px;left:5px;color:red}.w-replay-count-dialog .modal-content{width:236px!important;white-space:nowrap}.w-replay-count-dialog .modal-dialog{width:236px!important}.w-replay-count-dialog .modal-content label{width:auto}.w-replay-count-dialog input{display:inline-block;width:5pc;text-align:center;margin:0 10px}.w-import-remote-dialog .modal-content{width:525px}.w-import-remote-dialog input{width:500px;height:30px;line-height:30px;padding:5px;border:1px solid #ccc}.w-https-menu .glyphicon-lock{color:#9e9e26}.w-hover-left-menu{position:absolute;z-index:1;height:auto;border-bottom:1px solid #ccc;min-height:0}.w-menu .w-tree-view-active{color:#337ab7}.w-menu-selected{background-color:#ddd}.w-root-ca-type{width:75pt;float:right;margin:3px 15px 0 0;border:1px solid #ccc;border-radius:3px;height:24px;font-size:9pt;padding-left:8px}.w-fieldset pre{max-height:220px;overflow:auto;padding:10px}.w-fieldset{border:1px solid #ddd}.w-fieldset legend{font-size:9pt;padding:0 5px;border:none;width:auto;margin:0 10px;font-weight:700}.w-fieldset legend .glyphicon{margin-left:5px;cursor:pointer}@media screen and (max-width:1210px){.w-show-account.w-show-editor .w-help-name{display:none}}@media screen and (max-width:1190px){.w-show-account.w-show-rules .w-https-name{display:none}.w-show-account.w-show-rules-mode span.w-help-name,.w-show-account.w-show-rules-mode span.w-https-name,.w-show-account.w-show-rules-mode span.w-weinre-name{display:inline}}@media screen and (max-width:1160px){.w-show-account.w-show-editor .w-https-name,.w-show-account.w-show-editor span.w-help-name{display:none}}@media screen and (max-width:1130px){.w-show-account.w-show-rules .w-weinre-name{display:none}}@media screen and (max-width:1090px){.w-show-account.w-show-rules .w-help-menu,.w-show-account.w-show-rules .w-https-menu,.w-show-account.w-show-rules .w-weinre-menu{padding:0 3px}}.w-show-left-menu .w-help-name,.w-show-left-menu .w-https-name{display:inline!important}.w-account-menu{display:none!important}.w-show-account .w-account-menu{display:inline-block!important}",""]); +},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t0&&t-1 in e}function c(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function u(e,t,n){return ve(t)?Ce.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?Ce.grep(e,function(e){return e===t!==n}):"string"!=typeof t?Ce.grep(e,function(e){return fe.call(t,e)>-1!==n}):Ce.filter(t,e,n)}function d(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function p(e){var t={};return Ce.each(e.match(Re)||[],function(e,n){t[n]=!0}),t}function g(e){return e}function h(e){throw e}function f(e,t,n,r){var o;try{e&&ve(o=e.promise)?o.call(e).done(t).fail(n):e&&ve(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}function m(){ue.removeEventListener("DOMContentLoaded",m),n.removeEventListener("load",m),Ce.ready()}function A(e,t){return t.toUpperCase()}function M(e){return e.replace(Fe,"ms-").replace(Pe,A)}function w(){this.expando=Ce.expando+w.uid++}function y(e){return"true"===e?!0:"false"===e?!1:"null"===e?null:e===+e+""?+e:Xe.test(e)?JSON.parse(e):e}function b(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(_e,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n=y(n)}catch(o){}We.set(e,t,n)}else n=void 0;return n}function v(e,t,n,r){var o,i,a=20,s=r?function(){return r.cur()}:function(){return Ce.css(e,t,"")},l=s(),c=n&&n[3]||(Ce.cssNumber[t]?"":"px"),u=(Ce.cssNumber[t]||"px"!==c&&+l)&&Ke.exec(Ce.css(e,t));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;a--;)Ce.style(e,t,u+c),(1-i)*(1-(i=s()/l||.5))<=0&&(a=0),u/=i;u=2*u,Ce.style(e,t,u+c),n=n||[]}return n&&(u=+u||+l||0,o=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=o)),o}function T(e){var t,n=e.ownerDocument,r=e.nodeName,o=et[r];return o?o:(t=n.body.appendChild(n.createElement(r)),o=Ce.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),et[r]=o,o)}function x(e,t){for(var n,r,o=[],i=0,a=e.length;a>i;i++)r=e[i],r.style&&(n=r.style.display,t?("none"===n&&(o[i]=Ge.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&qe(r)&&(o[i]=T(r))):"none"!==n&&(o[i]="none",Ge.set(r,"display",n)));for(i=0;a>i;i++)null!=o[i]&&(e[i].style.display=o[i]);return e}function N(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&c(e,t)?Ce.merge([e],n):n}function C(e,t){for(var n=0,r=e.length;r>n;n++)Ge.set(e[n],"globalEval",!t||Ge.get(t[n],"globalEval"))}function I(e,t,n,r,o){for(var i,a,l,c,u,d,p=t.createDocumentFragment(),g=[],h=0,f=e.length;f>h;h++)if(i=e[h],i||0===i)if("object"===s(i))Ce.merge(g,i.nodeType?[i]:i);else if(it.test(i)){for(a=a||p.appendChild(t.createElement("div")),l=(nt.exec(i)||["",""])[1].toLowerCase(),c=ot[l]||ot._default,a.innerHTML=c[1]+Ce.htmlPrefilter(i)+c[2],d=c[0];d--;)a=a.lastChild;Ce.merge(g,a.childNodes),a=p.firstChild,a.textContent=""}else g.push(t.createTextNode(i));for(p.textContent="",h=0;i=g[h++];)if(r&&Ce.inArray(i,r)>-1)o&&o.push(i);else if(u=Ce.contains(i.ownerDocument,i),a=N(p.appendChild(i),"script"),u&&C(a),n)for(d=0;i=a[d++];)rt.test(i.type||"")&&n.push(i);return p}function E(){return!0}function D(){return!1}function S(){try{return ue.activeElement}catch(e){}}function L(e,t,n,r,o,i){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)L(e,s,n,r,t[s],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),o===!1)o=D;else if(!o)return e;return 1===i&&(a=o,o=function(e){return Ce().off(e),a.apply(this,arguments)},o.guid=a.guid||(a.guid=Ce.guid++)),e.each(function(){Ce.event.add(this,t,o,r,n)})}function k(e,t){return c(e,"table")&&c(11!==t.nodeType?t:t.firstChild,"tr")?Ce(e).children("tbody")[0]||e:e}function j(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function U(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function B(e,t){var n,r,o,i,a,s,l,c;if(1===t.nodeType){if(Ge.hasData(e)&&(i=Ge.access(e),a=Ge.set(t,i),c=i.events)){delete a.handle,a.events={};for(o in c)for(n=0,r=c[o].length;r>n;n++)Ce.event.add(t,o,c[o][n])}We.hasData(e)&&(s=We.access(e),l=Ce.extend({},s),We.set(t,l))}}function Q(e,t){var n=t.nodeName.toLowerCase();"input"===n&&tt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function z(e,t,n,r){t=ge.apply([],t);var o,i,s,l,c,u,d=0,p=e.length,g=p-1,h=t[0],f=ve(h);if(f||p>1&&"string"==typeof h&&!be.checkClone&&pt.test(h))return e.each(function(o){var i=e.eq(o);f&&(t[0]=h.call(this,o,i.html())),z(i,t,n,r)});if(p&&(o=I(t,e[0].ownerDocument,!1,e,r),i=o.firstChild,1===o.childNodes.length&&(o=i),i||r)){for(s=Ce.map(N(o,"script"),j),l=s.length;p>d;d++)c=o,d!==g&&(c=Ce.clone(c,!0,!0),l&&Ce.merge(s,N(c,"script"))),n.call(e[d],c,d);if(l)for(u=s[s.length-1].ownerDocument,Ce.map(s,U),d=0;l>d;d++)c=s[d],rt.test(c.type||"")&&!Ge.access(c,"globalEval")&&Ce.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?Ce._evalUrl&&Ce._evalUrl(c.src):a(c.textContent.replace(gt,""),u,c))}return e}function R(e,t,n){for(var r,o=t?Ce.filter(t,e):e,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||Ce.cleanData(N(r)),r.parentNode&&(n&&Ce.contains(r.ownerDocument,r)&&C(N(r,"script")),r.parentNode.removeChild(r));return e}function O(e,t,n){var r,o,i,a,s=e.style;return n=n||ft(e),n&&(a=n.getPropertyValue(t)||n[t],""!==a||Ce.contains(e.ownerDocument,e)||(a=Ce.style(e,t)),!be.pixelBoxStyles()&&ht.test(a)&&mt.test(t)&&(r=s.width,o=s.minWidth,i=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=o,s.maxWidth=i)),void 0!==a?a+"":a}function H(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function V(e){if(e in vt)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=bt.length;n--;)if(e=bt[n]+t,e in vt)return e}function F(e){var t=Ce.cssProps[e];return t||(t=Ce.cssProps[e]=V(e)||e),t}function P(e,t,n){var r=Ke.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Y(e,t,n,r,o,i){var a="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;4>a;a+=2)"margin"===n&&(l+=Ce.css(e,n+Ze[a],!0,o)),r?("content"===n&&(l-=Ce.css(e,"padding"+Ze[a],!0,o)),"margin"!==n&&(l-=Ce.css(e,"border"+Ze[a]+"Width",!0,o))):(l+=Ce.css(e,"padding"+Ze[a],!0,o),"padding"!==n?l+=Ce.css(e,"border"+Ze[a]+"Width",!0,o):s+=Ce.css(e,"border"+Ze[a]+"Width",!0,o));return!r&&i>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-l-s-.5))),l}function G(e,t,n){var r=ft(e),o=O(e,t,r),i="border-box"===Ce.css(e,"boxSizing",!1,r),a=i;if(ht.test(o)){if(!n)return o;o="auto"}return a=a&&(be.boxSizingReliable()||o===e.style[t]),("auto"===o||!parseFloat(o)&&"inline"===Ce.css(e,"display",!1,r))&&(o=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),o=parseFloat(o)||0,o+Y(e,t,n||(i?"border":"content"),a,r,o)+"px"}function W(e,t,n,r,o){return new W.prototype.init(e,t,n,r,o)}function X(){xt&&(ue.hidden===!1&&n.requestAnimationFrame?n.requestAnimationFrame(X):n.setTimeout(X,Ce.fx.interval),Ce.fx.tick())}function _(){return n.setTimeout(function(){Tt=void 0}),Tt=Date.now()}function J(e,t){var n,r=0,o={height:e};for(t=t?1:0;4>r;r+=2-t)n=Ze[r],o["margin"+n]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function K(e,t,n){for(var r,o=($.tweeners[t]||[]).concat($.tweeners["*"]),i=0,a=o.length;a>i;i++)if(r=o[i].call(n,t,e))return r}function Z(e,t,n){var r,o,i,a,s,l,c,u,d="width"in t||"height"in t,p=this,g={},h=e.style,f=e.nodeType&&qe(e),m=Ge.get(e,"fxshow");n.queue||(a=Ce._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,Ce.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(o=t[r],Nt.test(o)){if(delete t[r],i=i||"toggle"===o,o===(f?"hide":"show")){if("show"!==o||!m||void 0===m[r])continue;f=!0}g[r]=m&&m[r]||Ce.style(e,r)}if(l=!Ce.isEmptyObject(t),l||!Ce.isEmptyObject(g)){d&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],c=m&&m.display,null==c&&(c=Ge.get(e,"display")),u=Ce.css(e,"display"),"none"===u&&(c?u=c:(x([e],!0),c=e.style.display||c,u=Ce.css(e,"display"),x([e]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===Ce.css(e,"float")&&(l||(p.done(function(){h.display=c}),null==c&&(u=h.display,c="none"===u?"":u)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),l=!1;for(r in g)l||(m?"hidden"in m&&(f=m.hidden):m=Ge.access(e,"fxshow",{display:c}),i&&(m.hidden=!f),f&&x([e],!0),p.done(function(){f||x([e]),Ge.remove(e,"fxshow");for(r in g)Ce.style(e,r,g[r])})),l=K(f?m[r]:0,r,p),r in m||(m[r]=l.start,f&&(l.end=l.start,l.start=0))}}function q(e,t){var n,r,o,i,a;for(n in e)if(r=M(n),o=t[r],i=e[n],Array.isArray(i)&&(o=i[1],i=e[n]=i[0]),n!==r&&(e[r]=i,delete e[n]),a=Ce.cssHooks[r],a&&"expand"in a){i=a.expand(i),delete e[r];for(n in i)n in e||(e[n]=i[n],t[n]=o)}else t[r]=o}function $(e,t,n){var r,o,i=0,a=$.prefilters.length,s=Ce.Deferred().always(function(){delete l.elem}),l=function(){if(o)return!1;for(var t=Tt||_(),n=Math.max(0,c.startTime+c.duration-t),r=n/c.duration||0,i=1-r,a=0,l=c.tweens.length;l>a;a++)c.tweens[a].run(i);return s.notifyWith(e,[c,i,n]),1>i&&l?n:(l||s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:Ce.extend({},t),opts:Ce.extend(!0,{specialEasing:{},easing:Ce.easing._default},n),originalProperties:t,originalOptions:n,startTime:Tt||_(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Ce.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){var n=0,r=t?c.tweens.length:0;if(o)return this;for(o=!0;r>n;n++)c.tweens[n].run(1);return t?(s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c,t])):s.rejectWith(e,[c,t]),this}}),u=c.props;for(q(u,c.opts.specialEasing);a>i;i++)if(r=$.prefilters[i].call(c,e,u,c.opts))return ve(r.stop)&&(Ce._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return Ce.map(u,K,c),ve(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),Ce.fx.timer(Ce.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}function ee(e){var t=e.match(Re)||[];return t.join(" ")}function te(e){return e.getAttribute&&e.getAttribute("class")||""}function ne(e){return Array.isArray(e)?e:"string"==typeof e?e.match(Re)||[]:[]}function re(e,t,n,r){var o;if(Array.isArray(t))Ce.each(t,function(t,o){n||zt.test(e)?r(e,o):re(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)});else if(n||"object"!==s(t))r(e,t);else for(o in t)re(e+"["+o+"]",t[o],n,r)}function oe(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,i=t.toLowerCase().match(Re)||[];if(ve(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function ie(e,t,n,r){function o(s){var l;return i[s]=!0,Ce.each(e[s]||[],function(e,s){var c=s(t,n,r);return"string"!=typeof c||a||i[c]?a?!(l=c):void 0:(t.dataTypes.unshift(c),o(c),!1)}),l}var i={},a=e===Jt;return o(t.dataTypes[0])||!i["*"]&&o("*")}function ae(e,t){var n,r,o=Ce.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&Ce.extend(!0,e,r),e}function se(e,t,n){for(var r,o,i,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){l.unshift(o);break}if(l[0]in n)i=l[0];else{for(o in n){if(!l[0]||e.converters[o+" "+l[0]]){i=o;break}a||(a=o)}i=i||a}return i?(i!==l[0]&&l.unshift(i),n[i]):void 0}function le(e,t,n,r){var o,i,a,s,l,c={},u=e.dataTypes.slice();if(u[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(i=u.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=i,i=u.shift())if("*"===i)i=l;else if("*"!==l&&l!==i){if(a=c[l+" "+i]||c["* "+i],!a)for(o in c)if(s=o.split(" "),s[1]===i&&(a=c[l+" "+s[0]]||c["* "+s[0]])){a===!0?a=c[o]:c[o]!==!0&&(i=s[0],u.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(d){return{state:"parsererror",error:a?d:"No conversion from "+l+" to "+i}}}return{state:"success",data:t}}var ce=[],ue=n.document,de=Object.getPrototypeOf,pe=ce.slice,ge=ce.concat,he=ce.push,fe=ce.indexOf,me={},Ae=me.toString,Me=me.hasOwnProperty,we=Me.toString,ye=we.call(Object),be={},ve=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},Te=function(e){return null!=e&&e===e.window},xe={type:!0,src:!0,noModule:!0},Ne="3.3.1",Ce=function(e,t){return new Ce.fn.init(e,t)},Ie=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;Ce.fn=Ce.prototype={jquery:Ne,constructor:Ce,length:0,toArray:function(){return pe.call(this)},get:function(e){return null==e?pe.call(this):0>e?this[e+this.length]:this[e]},pushStack:function(e){var t=Ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return Ce.each(this,e)},map:function(e){return this.pushStack(Ce.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(pe.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:he,sort:ce.sort,splice:ce.splice},Ce.extend=Ce.fn.extend=function(){var e,t,n,r,o,i,a=arguments[0]||{},s=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[s]||{},s++),"object"==typeof a||ve(a)||(a={}),s===l&&(a=this,s--);l>s;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],r=e[t],a!==r&&(c&&r&&(Ce.isPlainObject(r)||(o=Array.isArray(r)))?(o?(o=!1,i=n&&Array.isArray(n)?n:[]):i=n&&Ce.isPlainObject(n)?n:{},a[t]=Ce.extend(c,i,r)):void 0!==r&&(a[t]=r));return a},Ce.extend({expando:"jQuery"+(Ne+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return e&&"[object Object]"===Ae.call(e)?(t=de(e))?(n=Me.call(t,"constructor")&&t.constructor,"function"==typeof n&&we.call(n)===ye):!0:!1},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){a(e)},each:function(e,t){var n,r=0;if(l(e))for(n=e.length;n>r&&t.call(e[r],r,e[r])!==!1;r++);else for(r in e)if(t.call(e[r],r,e[r])===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(Ie,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(l(Object(e))?Ce.merge(n,"string"==typeof e?[e]:e):he.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:fe.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,o=e.length;n>r;r++)e[o++]=t[r];return e.length=o,e},grep:function(e,t,n){for(var r,o=[],i=0,a=e.length,s=!n;a>i;i++)r=!t(e[i],i),r!==s&&o.push(e[i]);return o},map:function(e,t,n){var r,o,i=0,a=[];if(l(e))for(r=e.length;r>i;i++)o=t(e[i],i,n),null!=o&&a.push(o);else for(i in e)o=t(e[i],i,n),null!=o&&a.push(o);return ge.apply([],a)},guid:1,support:be}),"function"==typeof Symbol&&(Ce.fn[Symbol.iterator]=ce[Symbol.iterator]),Ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){me["[object "+t+"]"]=t.toLowerCase()});var Ee=/*! +!function(t,n){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,i){"use strict";function a(e,t,n){t=t||ue;var r,o=t.createElement("script");if(o.text=e,n)for(r in xe)n[r]&&(o[r]=n[r]);t.head.appendChild(o).parentNode.removeChild(o)}function s(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?me[Ae.call(e)]||"object":typeof e}function l(e){var t=!!e&&"length"in e&&e.length,n=s(e);return ve(e)||Te(e)?!1:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function c(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function u(e,t,n){return ve(t)?Ce.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?Ce.grep(e,function(e){return e===t!==n}):"string"!=typeof t?Ce.grep(e,function(e){return fe.call(t,e)>-1!==n}):Ce.filter(t,e,n)}function d(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function p(e){var t={};return Ce.each(e.match(Re)||[],function(e,n){t[n]=!0}),t}function h(e){return e}function g(e){throw e}function f(e,t,n,r){var o;try{e&&ve(o=e.promise)?o.call(e).done(t).fail(n):e&&ve(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}function m(){ue.removeEventListener("DOMContentLoaded",m),n.removeEventListener("load",m),Ce.ready()}function A(e,t){return t.toUpperCase()}function M(e){return e.replace(Fe,"ms-").replace(Pe,A)}function w(){this.expando=Ce.expando+w.uid++}function y(e){return"true"===e?!0:"false"===e?!1:"null"===e?null:e===+e+""?+e:Xe.test(e)?JSON.parse(e):e}function b(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(_e,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n=y(n)}catch(o){}We.set(e,t,n)}else n=void 0;return n}function v(e,t,n,r){var o,i,a=20,s=r?function(){return r.cur()}:function(){return Ce.css(e,t,"")},l=s(),c=n&&n[3]||(Ce.cssNumber[t]?"":"px"),u=(Ce.cssNumber[t]||"px"!==c&&+l)&&Ke.exec(Ce.css(e,t));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;a--;)Ce.style(e,t,u+c),(1-i)*(1-(i=s()/l||.5))<=0&&(a=0),u/=i;u=2*u,Ce.style(e,t,u+c),n=n||[]}return n&&(u=+u||+l||0,o=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=u,r.end=o)),o}function T(e){var t,n=e.ownerDocument,r=e.nodeName,o=et[r];return o?o:(t=n.body.appendChild(n.createElement(r)),o=Ce.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),et[r]=o,o)}function x(e,t){for(var n,r,o=[],i=0,a=e.length;a>i;i++)r=e[i],r.style&&(n=r.style.display,t?("none"===n&&(o[i]=Ge.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&qe(r)&&(o[i]=T(r))):"none"!==n&&(o[i]="none",Ge.set(r,"display",n)));for(i=0;a>i;i++)null!=o[i]&&(e[i].style.display=o[i]);return e}function N(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&c(e,t)?Ce.merge([e],n):n}function C(e,t){for(var n=0,r=e.length;r>n;n++)Ge.set(e[n],"globalEval",!t||Ge.get(t[n],"globalEval"))}function I(e,t,n,r,o){for(var i,a,l,c,u,d,p=t.createDocumentFragment(),h=[],g=0,f=e.length;f>g;g++)if(i=e[g],i||0===i)if("object"===s(i))Ce.merge(h,i.nodeType?[i]:i);else if(it.test(i)){for(a=a||p.appendChild(t.createElement("div")),l=(nt.exec(i)||["",""])[1].toLowerCase(),c=ot[l]||ot._default,a.innerHTML=c[1]+Ce.htmlPrefilter(i)+c[2],d=c[0];d--;)a=a.lastChild;Ce.merge(h,a.childNodes),a=p.firstChild,a.textContent=""}else h.push(t.createTextNode(i));for(p.textContent="",g=0;i=h[g++];)if(r&&Ce.inArray(i,r)>-1)o&&o.push(i);else if(u=Ce.contains(i.ownerDocument,i),a=N(p.appendChild(i),"script"),u&&C(a),n)for(d=0;i=a[d++];)rt.test(i.type||"")&&n.push(i);return p}function E(){return!0}function D(){return!1}function S(){try{return ue.activeElement}catch(e){}}function L(e,t,n,r,o,i){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)L(e,s,n,r,t[s],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),o===!1)o=D;else if(!o)return e;return 1===i&&(a=o,o=function(e){return Ce().off(e),a.apply(this,arguments)},o.guid=a.guid||(a.guid=Ce.guid++)),e.each(function(){Ce.event.add(this,t,o,r,n)})}function k(e,t){return c(e,"table")&&c(11!==t.nodeType?t:t.firstChild,"tr")?Ce(e).children("tbody")[0]||e:e}function j(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function U(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function B(e,t){var n,r,o,i,a,s,l,c;if(1===t.nodeType){if(Ge.hasData(e)&&(i=Ge.access(e),a=Ge.set(t,i),c=i.events)){delete a.handle,a.events={};for(o in c)for(n=0,r=c[o].length;r>n;n++)Ce.event.add(t,o,c[o][n])}We.hasData(e)&&(s=We.access(e),l=Ce.extend({},s),We.set(t,l))}}function Q(e,t){var n=t.nodeName.toLowerCase();"input"===n&&tt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function z(e,t,n,r){t=he.apply([],t);var o,i,s,l,c,u,d=0,p=e.length,h=p-1,g=t[0],f=ve(g);if(f||p>1&&"string"==typeof g&&!be.checkClone&&pt.test(g))return e.each(function(o){var i=e.eq(o);f&&(t[0]=g.call(this,o,i.html())),z(i,t,n,r)});if(p&&(o=I(t,e[0].ownerDocument,!1,e,r),i=o.firstChild,1===o.childNodes.length&&(o=i),i||r)){for(s=Ce.map(N(o,"script"),j),l=s.length;p>d;d++)c=o,d!==h&&(c=Ce.clone(c,!0,!0),l&&Ce.merge(s,N(c,"script"))),n.call(e[d],c,d);if(l)for(u=s[s.length-1].ownerDocument,Ce.map(s,U),d=0;l>d;d++)c=s[d],rt.test(c.type||"")&&!Ge.access(c,"globalEval")&&Ce.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?Ce._evalUrl&&Ce._evalUrl(c.src):a(c.textContent.replace(ht,""),u,c))}return e}function R(e,t,n){for(var r,o=t?Ce.filter(t,e):e,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||Ce.cleanData(N(r)),r.parentNode&&(n&&Ce.contains(r.ownerDocument,r)&&C(N(r,"script")),r.parentNode.removeChild(r));return e}function O(e,t,n){var r,o,i,a,s=e.style;return n=n||ft(e),n&&(a=n.getPropertyValue(t)||n[t],""!==a||Ce.contains(e.ownerDocument,e)||(a=Ce.style(e,t)),!be.pixelBoxStyles()&>.test(a)&&mt.test(t)&&(r=s.width,o=s.minWidth,i=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=o,s.maxWidth=i)),void 0!==a?a+"":a}function H(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function V(e){if(e in vt)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=bt.length;n--;)if(e=bt[n]+t,e in vt)return e}function F(e){var t=Ce.cssProps[e];return t||(t=Ce.cssProps[e]=V(e)||e),t}function P(e,t,n){var r=Ke.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Y(e,t,n,r,o,i){var a="width"===t?1:0,s=0,l=0;if(n===(r?"border":"content"))return 0;for(;4>a;a+=2)"margin"===n&&(l+=Ce.css(e,n+Ze[a],!0,o)),r?("content"===n&&(l-=Ce.css(e,"padding"+Ze[a],!0,o)),"margin"!==n&&(l-=Ce.css(e,"border"+Ze[a]+"Width",!0,o))):(l+=Ce.css(e,"padding"+Ze[a],!0,o),"padding"!==n?l+=Ce.css(e,"border"+Ze[a]+"Width",!0,o):s+=Ce.css(e,"border"+Ze[a]+"Width",!0,o));return!r&&i>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-l-s-.5))),l}function G(e,t,n){var r=ft(e),o=O(e,t,r),i="border-box"===Ce.css(e,"boxSizing",!1,r),a=i;if(gt.test(o)){if(!n)return o;o="auto"}return a=a&&(be.boxSizingReliable()||o===e.style[t]),("auto"===o||!parseFloat(o)&&"inline"===Ce.css(e,"display",!1,r))&&(o=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),o=parseFloat(o)||0,o+Y(e,t,n||(i?"border":"content"),a,r,o)+"px"}function W(e,t,n,r,o){return new W.prototype.init(e,t,n,r,o)}function X(){xt&&(ue.hidden===!1&&n.requestAnimationFrame?n.requestAnimationFrame(X):n.setTimeout(X,Ce.fx.interval),Ce.fx.tick())}function _(){return n.setTimeout(function(){Tt=void 0}),Tt=Date.now()}function J(e,t){var n,r=0,o={height:e};for(t=t?1:0;4>r;r+=2-t)n=Ze[r],o["margin"+n]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function K(e,t,n){for(var r,o=($.tweeners[t]||[]).concat($.tweeners["*"]),i=0,a=o.length;a>i;i++)if(r=o[i].call(n,t,e))return r}function Z(e,t,n){var r,o,i,a,s,l,c,u,d="width"in t||"height"in t,p=this,h={},g=e.style,f=e.nodeType&&qe(e),m=Ge.get(e,"fxshow");n.queue||(a=Ce._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,Ce.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(o=t[r],Nt.test(o)){if(delete t[r],i=i||"toggle"===o,o===(f?"hide":"show")){if("show"!==o||!m||void 0===m[r])continue;f=!0}h[r]=m&&m[r]||Ce.style(e,r)}if(l=!Ce.isEmptyObject(t),l||!Ce.isEmptyObject(h)){d&&1===e.nodeType&&(n.overflow=[g.overflow,g.overflowX,g.overflowY],c=m&&m.display,null==c&&(c=Ge.get(e,"display")),u=Ce.css(e,"display"),"none"===u&&(c?u=c:(x([e],!0),c=e.style.display||c,u=Ce.css(e,"display"),x([e]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===Ce.css(e,"float")&&(l||(p.done(function(){g.display=c}),null==c&&(u=g.display,c="none"===u?"":u)),g.display="inline-block")),n.overflow&&(g.overflow="hidden",p.always(function(){g.overflow=n.overflow[0],g.overflowX=n.overflow[1],g.overflowY=n.overflow[2]})),l=!1;for(r in h)l||(m?"hidden"in m&&(f=m.hidden):m=Ge.access(e,"fxshow",{display:c}),i&&(m.hidden=!f),f&&x([e],!0),p.done(function(){f||x([e]),Ge.remove(e,"fxshow");for(r in h)Ce.style(e,r,h[r])})),l=K(f?m[r]:0,r,p),r in m||(m[r]=l.start,f&&(l.end=l.start,l.start=0))}}function q(e,t){var n,r,o,i,a;for(n in e)if(r=M(n),o=t[r],i=e[n],Array.isArray(i)&&(o=i[1],i=e[n]=i[0]),n!==r&&(e[r]=i,delete e[n]),a=Ce.cssHooks[r],a&&"expand"in a){i=a.expand(i),delete e[r];for(n in i)n in e||(e[n]=i[n],t[n]=o)}else t[r]=o}function $(e,t,n){var r,o,i=0,a=$.prefilters.length,s=Ce.Deferred().always(function(){delete l.elem}),l=function(){if(o)return!1;for(var t=Tt||_(),n=Math.max(0,c.startTime+c.duration-t),r=n/c.duration||0,i=1-r,a=0,l=c.tweens.length;l>a;a++)c.tweens[a].run(i);return s.notifyWith(e,[c,i,n]),1>i&&l?n:(l||s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:Ce.extend({},t),opts:Ce.extend(!0,{specialEasing:{},easing:Ce.easing._default},n),originalProperties:t,originalOptions:n,startTime:Tt||_(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Ce.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){var n=0,r=t?c.tweens.length:0;if(o)return this;for(o=!0;r>n;n++)c.tweens[n].run(1);return t?(s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c,t])):s.rejectWith(e,[c,t]),this}}),u=c.props;for(q(u,c.opts.specialEasing);a>i;i++)if(r=$.prefilters[i].call(c,e,u,c.opts))return ve(r.stop)&&(Ce._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return Ce.map(u,K,c),ve(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),Ce.fx.timer(Ce.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}function ee(e){var t=e.match(Re)||[];return t.join(" ")}function te(e){return e.getAttribute&&e.getAttribute("class")||""}function ne(e){return Array.isArray(e)?e:"string"==typeof e?e.match(Re)||[]:[]}function re(e,t,n,r){var o;if(Array.isArray(t))Ce.each(t,function(t,o){n||zt.test(e)?r(e,o):re(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)});else if(n||"object"!==s(t))r(e,t);else for(o in t)re(e+"["+o+"]",t[o],n,r)}function oe(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,i=t.toLowerCase().match(Re)||[];if(ve(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function ie(e,t,n,r){function o(s){var l;return i[s]=!0,Ce.each(e[s]||[],function(e,s){var c=s(t,n,r);return"string"!=typeof c||a||i[c]?a?!(l=c):void 0:(t.dataTypes.unshift(c),o(c),!1)}),l}var i={},a=e===Jt;return o(t.dataTypes[0])||!i["*"]&&o("*")}function ae(e,t){var n,r,o=Ce.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&Ce.extend(!0,e,r),e}function se(e,t,n){for(var r,o,i,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){l.unshift(o);break}if(l[0]in n)i=l[0];else{for(o in n){if(!l[0]||e.converters[o+" "+l[0]]){i=o;break}a||(a=o)}i=i||a}return i?(i!==l[0]&&l.unshift(i),n[i]):void 0}function le(e,t,n,r){var o,i,a,s,l,c={},u=e.dataTypes.slice();if(u[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(i=u.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=i,i=u.shift())if("*"===i)i=l;else if("*"!==l&&l!==i){if(a=c[l+" "+i]||c["* "+i],!a)for(o in c)if(s=o.split(" "),s[1]===i&&(a=c[l+" "+s[0]]||c["* "+s[0]])){a===!0?a=c[o]:c[o]!==!0&&(i=s[0],u.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(d){return{state:"parsererror",error:a?d:"No conversion from "+l+" to "+i}}}return{state:"success",data:t}}var ce=[],ue=n.document,de=Object.getPrototypeOf,pe=ce.slice,he=ce.concat,ge=ce.push,fe=ce.indexOf,me={},Ae=me.toString,Me=me.hasOwnProperty,we=Me.toString,ye=we.call(Object),be={},ve=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},Te=function(e){return null!=e&&e===e.window},xe={type:!0,src:!0,noModule:!0},Ne="3.3.1",Ce=function(e,t){return new Ce.fn.init(e,t)},Ie=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;Ce.fn=Ce.prototype={jquery:Ne,constructor:Ce,length:0,toArray:function(){return pe.call(this)},get:function(e){return null==e?pe.call(this):0>e?this[e+this.length]:this[e]},pushStack:function(e){var t=Ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return Ce.each(this,e)},map:function(e){return this.pushStack(Ce.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(pe.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:ge,sort:ce.sort,splice:ce.splice},Ce.extend=Ce.fn.extend=function(){var e,t,n,r,o,i,a=arguments[0]||{},s=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[s]||{},s++),"object"==typeof a||ve(a)||(a={}),s===l&&(a=this,s--);l>s;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],r=e[t],a!==r&&(c&&r&&(Ce.isPlainObject(r)||(o=Array.isArray(r)))?(o?(o=!1,i=n&&Array.isArray(n)?n:[]):i=n&&Ce.isPlainObject(n)?n:{},a[t]=Ce.extend(c,i,r)):void 0!==r&&(a[t]=r));return a},Ce.extend({expando:"jQuery"+(Ne+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return e&&"[object Object]"===Ae.call(e)?(t=de(e))?(n=Me.call(t,"constructor")&&t.constructor,"function"==typeof n&&we.call(n)===ye):!0:!1},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){a(e)},each:function(e,t){var n,r=0;if(l(e))for(n=e.length;n>r&&t.call(e[r],r,e[r])!==!1;r++);else for(r in e)if(t.call(e[r],r,e[r])===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(Ie,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(l(Object(e))?Ce.merge(n,"string"==typeof e?[e]:e):ge.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:fe.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,o=e.length;n>r;r++)e[o++]=t[r];return e.length=o,e},grep:function(e,t,n){for(var r,o=[],i=0,a=e.length,s=!n;a>i;i++)r=!t(e[i],i),r!==s&&o.push(e[i]);return o},map:function(e,t,n){var r,o,i=0,a=[];if(l(e))for(r=e.length;r>i;i++)o=t(e[i],i,n),null!=o&&a.push(o);else for(i in e)o=t(e[i],i,n),null!=o&&a.push(o);return he.apply([],a)},guid:1,support:be}),"function"==typeof Symbol&&(Ce.fn[Symbol.iterator]=ce[Symbol.iterator]),Ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){me["[object "+t+"]"]=t.toLowerCase()});var Ee=/*! * Sizzle CSS Selector Engine v2.3.3 * https://sizzlejs.com/ * @@ -24,14 +24,14 @@ e.appendChild(document.createTextNode(n))}}function u(e,t){var n=t.css,r=(t.medi * * Date: 2016-08-08 */ -function(e){function t(e,t,n,r){var o,i,a,s,l,c,u,p=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!r&&((t?t.ownerDocument||t:V)!==j&&k(t),t=t||j,B)){if(11!==h&&(l=Ae.exec(e)))if(o=l[1]){if(9===h){if(!(a=t.getElementById(o)))return n;if(a.id===o)return n.push(a),n}else if(p&&(a=p.getElementById(o))&&O(t,a)&&a.id===o)return n.push(a),n}else{if(l[2])return q.apply(n,t.getElementsByTagName(e)),n;if((o=l[3])&&v.getElementsByClassName&&t.getElementsByClassName)return q.apply(n,t.getElementsByClassName(o)),n}if(v.qsa&&!W[e+" "]&&(!Q||!Q.test(e))){if(1!==h)p=t,u=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(be,ve):t.setAttribute("id",s=H),c=C(e),i=c.length;i--;)c[i]="#"+s+" "+g(c[i]);u=c.join(","),p=Me.test(e)&&d(t.parentNode)||t}if(u)try{return q.apply(n,p.querySelectorAll(u)),n}catch(f){}finally{s===H&&t.removeAttribute("id")}}}return E(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>T.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[H]=!0,e}function o(e){var t=j.createElement("fieldset");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function i(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return function(t){return"form"in t?t.parentNode&&t.disabled===!1?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&xe(t)===e:t.disabled===e:"label"in t?t.disabled===e:!1}}function u(e){return r(function(t){return t=+t,r(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function d(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function p(){}function g(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,o=t.next,i=o||r,a=n&&"parentNode"===i,s=P++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,o);return!1}:function(t,n,l){var c,u,d,p=[F,s];if(l){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(d=t[H]||(t[H]={}),u=d[t.uniqueID]||(d[t.uniqueID]={}),o&&o===t.nodeName.toLowerCase())t=t[r]||t;else{if((c=u[i])&&c[0]===F&&c[1]===s)return p[2]=c[2];if(u[i]=p,p[2]=e(t,n,l))return!0}return!1}}function f(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var o=0,i=n.length;i>o;o++)t(e,n[o],r);return r}function A(e,t,n,r,o){for(var i,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(i=e[s])&&(!n||n(i,r,o))&&(a.push(i),c&&t.push(s));return a}function M(e,t,n,o,i,a){return o&&!o[H]&&(o=M(o)),i&&!i[H]&&(i=M(i,a)),r(function(r,a,s,l){var c,u,d,p=[],g=[],h=a.length,f=r||m(t||"*",s.nodeType?[s]:s,[]),M=!e||!r&&t?f:A(f,p,e,s,l),w=n?i||(r?e:h||o)?[]:a:M;if(n&&n(M,w,s,l),o)for(c=A(w,g),o(c,[],s,l),u=c.length;u--;)(d=c[u])&&(w[g[u]]=!(M[g[u]]=d));if(r){if(i||e){if(i){for(c=[],u=w.length;u--;)(d=w[u])&&c.push(M[u]=d);i(null,w=[],c,l)}for(u=w.length;u--;)(d=w[u])&&(c=i?ee(r,d):p[u])>-1&&(r[c]=!(a[c]=d))}}else w=A(w===a?w.splice(h,w.length):w),i?i(null,a,w,l):q.apply(a,w)})}function w(e){for(var t,n,r,o=e.length,i=T.relative[e[0].type],a=i||T.relative[" "],s=i?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return ee(t,e)>-1},a,!0),u=[function(e,n,r){var o=!i&&(r||n!==D)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,o}];o>s;s++)if(n=T.relative[e[s].type])u=[h(f(u),n)];else{if(n=T.filter[e[s].type].apply(null,e[s].matches),n[H]){for(r=++s;o>r&&!T.relative[e[r].type];r++);return M(s>1&&f(u),s>1&&g(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&w(e.slice(s,r)),o>r&&w(e=e.slice(r)),o>r&&g(e))}u.push(n)}return f(u)}function y(e,n){var o=n.length>0,i=e.length>0,a=function(r,a,s,l,c){var u,d,p,g=0,h="0",f=r&&[],m=[],M=D,w=r||i&&T.find.TAG("*",c),y=F+=null==M?1:Math.random()||.1,b=w.length;for(c&&(D=a===j||a||c);h!==b&&null!=(u=w[h]);h++){if(i&&u){for(d=0,a||u.ownerDocument===j||(k(u),s=!B);p=e[d++];)if(p(u,a||j,s)){l.push(u);break}c&&(F=y)}o&&((u=!p&&u)&&g--,r&&f.push(u))}if(g+=h,o&&h!==g){for(d=0;p=n[d++];)p(f,m,a,s);if(r){if(g>0)for(;h--;)f[h]||m[h]||(m[h]=K.call(l));m=A(m)}q.apply(l,m),c&&!r&&m.length>0&&g+n.length>1&&t.uniqueSort(l)}return c&&(F=y,D=M),f};return o?r(a):a}var b,v,T,x,N,C,I,E,D,S,L,k,j,U,B,Q,z,R,O,H="sizzle"+1*new Date,V=e.document,F=0,P=0,Y=n(),G=n(),W=n(),X=function(e,t){return e===t&&(L=!0),0},_={}.hasOwnProperty,J=[],K=J.pop,Z=J.push,q=J.push,$=J.slice,ee=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\x00-\\xa0])+",oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+re+"))|)"+ne+"*\\]",ie=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",ae=new RegExp(ne+"+","g"),se=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),le=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),ue=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),de=new RegExp(ie),pe=new RegExp("^"+re+"$"),ge={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ie),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,fe=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,Ae=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Me=/[+~]/,we=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),ye=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},be=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ve=function(e,t){return t?"\x00"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},Te=function(){k()},xe=h(function(e){return e.disabled===!0&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{q.apply(J=$.call(V.childNodes),V.childNodes),J[V.childNodes.length].nodeType}catch(Ne){q={apply:J.length?function(e,t){Z.apply(e,$.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}v=t.support={},N=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},k=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:V;return r!==j&&9===r.nodeType&&r.documentElement?(j=r,U=j.documentElement,B=!N(j),V!==j&&(n=j.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),v.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),v.getElementsByTagName=o(function(e){return e.appendChild(j.createComment("")),!e.getElementsByTagName("*").length}),v.getElementsByClassName=me.test(j.getElementsByClassName),v.getById=o(function(e){return U.appendChild(e).id=H,!j.getElementsByName||!j.getElementsByName(H).length}),v.getById?(T.filter.ID=function(e){var t=e.replace(we,ye);return function(e){return e.getAttribute("id")===t}},T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&B){var n=t.getElementById(e);return n?[n]:[]}}):(T.filter.ID=function(e){var t=e.replace(we,ye);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&B){var n,r,o,i=t.getElementById(e);if(i){if(n=i.getAttributeNode("id"),n&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if(n=i.getAttributeNode("id"),n&&n.value===e)return[i]}return[]}}),T.find.TAG=v.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):v.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},T.find.CLASS=v.getElementsByClassName&&function(e,t){return"undefined"!=typeof t.getElementsByClassName&&B?t.getElementsByClassName(e):void 0},z=[],Q=[],(v.qsa=me.test(j.querySelectorAll))&&(o(function(e){U.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&Q.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||Q.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+H+"-]").length||Q.push("~="),e.querySelectorAll(":checked").length||Q.push(":checked"),e.querySelectorAll("a#"+H+"+*").length||Q.push(".#.+[+~]")}),o(function(e){e.innerHTML="";var t=j.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&Q.push("name"+ne+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&Q.push(":enabled",":disabled"),U.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&Q.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),Q.push(",.*:")})),(v.matchesSelector=me.test(R=U.matches||U.webkitMatchesSelector||U.mozMatchesSelector||U.oMatchesSelector||U.msMatchesSelector))&&o(function(e){v.disconnectedMatch=R.call(e,"*"),R.call(e,"[s!='']:x"),z.push("!=",ie)}),Q=Q.length&&new RegExp(Q.join("|")),z=z.length&&new RegExp(z.join("|")),t=me.test(U.compareDocumentPosition),O=t||me.test(U.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},X=t?function(e,t){if(e===t)return L=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!v.sortDetached&&t.compareDocumentPosition(e)===n?e===j||e.ownerDocument===V&&O(V,e)?-1:t===j||t.ownerDocument===V&&O(V,t)?1:S?ee(S,e)-ee(S,t):0:4&n?-1:1)}:function(e,t){if(e===t)return L=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,s=[e],l=[t];if(!o||!i)return e===j?-1:t===j?1:o?-1:i?1:S?ee(S,e)-ee(S,t):0;if(o===i)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;s[r]===l[r];)r++;return r?a(s[r],l[r]):s[r]===V?-1:l[r]===V?1:0},j):j},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==j&&k(e),n=n.replace(ue,"='$1']"),v.matchesSelector&&B&&!W[n+" "]&&(!z||!z.test(n))&&(!Q||!Q.test(n)))try{var r=R.call(e,n);if(r||v.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(o){}return t(n,j,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==j&&k(e),O(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==j&&k(e);var n=T.attrHandle[t.toLowerCase()],r=n&&_.call(T.attrHandle,t.toLowerCase())?n(e,t,!B):void 0;return void 0!==r?r:v.attributes||!B?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(be,ve)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,o=0;if(L=!v.detectDuplicates,S=!v.sortStable&&e.slice(0),e.sort(X),L){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return S=null,e},x=t.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=x(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=x(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:ge,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(we,ye),e[3]=(e[3]||e[4]||e[5]||"").replace(we,ye),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ge.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=C(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(we,ye).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Y[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&Y(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(o){var i=t.attr(o,e);return null==i?"!="===n:n?(i+="","="===n?i===r:"!="===n?i!==r:"^="===n?r&&0===i.indexOf(r):"*="===n?r&&i.indexOf(r)>-1:"$="===n?r&&i.slice(-r.length)===r:"~="===n?(" "+i.replace(ae," ")+" ").indexOf(r)>-1:"|="===n?i===r||i.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,p,g,h,f=i!==a?"nextSibling":"previousSibling",m=t.parentNode,A=s&&t.nodeName.toLowerCase(),M=!l&&!s,w=!1;if(m){if(i){for(;f;){for(p=t;p=p[f];)if(s?p.nodeName.toLowerCase()===A:1===p.nodeType)return!1;h=f="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&M){for(p=m,d=p[H]||(p[H]={}),u=d[p.uniqueID]||(d[p.uniqueID]={}),c=u[e]||[],g=c[0]===F&&c[1],w=g&&c[2],p=g&&m.childNodes[g];p=++g&&p&&p[f]||(w=g=0)||h.pop();)if(1===p.nodeType&&++w&&p===t){u[e]=[F,g,w];break}}else if(M&&(p=t,d=p[H]||(p[H]={}),u=d[p.uniqueID]||(d[p.uniqueID]={}),c=u[e]||[],g=c[0]===F&&c[1],w=g),w===!1)for(;(p=++g&&p&&p[f]||(w=g=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==A:1!==p.nodeType)||!++w||(M&&(d=p[H]||(p[H]={}),u=d[p.uniqueID]||(d[p.uniqueID]={}),u[e]=[F,w]),p!==t)););return w-=o,w===r||w%r===0&&w/r>=0}}},PSEUDO:function(e,n){var o,i=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return i[H]?i(n):i.length>1?(o=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,o=i(e,n),a=o.length;a--;)r=ee(e,o[a]),e[r]=!(t[r]=o[a])}):function(e){return i(e,0,o)}):i}},pseudos:{not:r(function(e){var t=[],n=[],o=I(e.replace(se,"$1"));return o[H]?r(function(e,t,n,r){for(var i,a=o(e,null,r,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))}):function(e,r,i){return t[0]=e,o(t,null,i,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(we,ye),function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),lang:r(function(e){return pe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(we,ye).toLowerCase(),function(t){var n;do if(n=B?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===U},focus:function(e){return e===j.activeElement&&(!j.hasFocus||j.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:c(!1),disabled:c(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return fe.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[0>n?n+t:n]}),even:u(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:u(function(e,t,n){for(var r=0>n?n+t:n;++r2&&"ID"===(a=i[0]).type&&9===t.nodeType&&B&&T.relative[i[1].type]){if(t=(T.find.ID(a.matches[0].replace(we,ye),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=ge.needsContext.test(e)?0:i.length;o--&&(a=i[o],!T.relative[s=a.type]);)if((l=T.find[s])&&(r=l(a.matches[0].replace(we,ye),Me.test(i[0].type)&&d(t.parentNode)||t))){if(i.splice(o,1),e=r.length&&g(i),!e)return q.apply(n,r),n;break}}return(c||I(e,u))(r,t,!B,n,!t||Me.test(e)&&d(t.parentNode)||t),n},v.sortStable=H.split("").sort(X).join("")===H,v.detectDuplicates=!!L,k(),v.sortDetached=o(function(e){return 1&e.compareDocumentPosition(j.createElement("fieldset"))}),o(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||i("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),v.attributes&&o(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||i("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||i(te,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(n);Ce.find=Ee,Ce.expr=Ee.selectors,Ce.expr[":"]=Ce.expr.pseudos,Ce.uniqueSort=Ce.unique=Ee.uniqueSort,Ce.text=Ee.getText,Ce.isXMLDoc=Ee.isXML,Ce.contains=Ee.contains,Ce.escapeSelector=Ee.escape;var De=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&Ce(e).is(n))break;r.push(e)}return r},Se=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Le=Ce.expr.match.needsContext,ke=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;Ce.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?Ce.find.matchesSelector(r,e)?[r]:[]:Ce.find.matches(e,Ce.grep(t,function(e){return 1===e.nodeType}))},Ce.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(Ce(e).filter(function(){for(t=0;r>t;t++)if(Ce.contains(o[t],this))return!0}));for(n=this.pushStack([]),t=0;r>t;t++)Ce.find(e,o[t],n);return r>1?Ce.uniqueSort(n):n},filter:function(e){return this.pushStack(u(this,e||[],!1))},not:function(e){return this.pushStack(u(this,e||[],!0))},is:function(e){return!!u(this,"string"==typeof e&&Le.test(e)?Ce(e):e||[],!1).length}});var je,Ue=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,Be=Ce.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||je,"string"==typeof e){if(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Ue.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof Ce?t[0]:t,Ce.merge(this,Ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:ue,!0)),ke.test(r[1])&&Ce.isPlainObject(t))for(r in t)ve(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return o=ue.getElementById(r[2]),o&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):ve(e)?void 0!==n.ready?n.ready(e):e(Ce):Ce.makeArray(e,this)};Be.prototype=Ce.fn,je=Ce(ue);var Qe=/^(?:parents|prev(?:Until|All))/,ze={children:!0,contents:!0,next:!0,prev:!0};Ce.fn.extend({has:function(e){var t=Ce(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(Ce.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,o=this.length,i=[],a="string"!=typeof e&&Ce(e);if(!Le.test(e))for(;o>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&Ce.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?Ce.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?fe.call(Ce(e),this[0]):fe.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(Ce.uniqueSort(Ce.merge(this.get(),Ce(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Ce.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return De(e,"parentNode")},parentsUntil:function(e,t,n){return De(e,"parentNode",n)},next:function(e){return d(e,"nextSibling")},prev:function(e){return d(e,"previousSibling")},nextAll:function(e){return De(e,"nextSibling")},prevAll:function(e){return De(e,"previousSibling")},nextUntil:function(e,t,n){return De(e,"nextSibling",n)},prevUntil:function(e,t,n){return De(e,"previousSibling",n)},siblings:function(e){return Se((e.parentNode||{}).firstChild,e)},children:function(e){return Se(e.firstChild)},contents:function(e){return c(e,"iframe")?e.contentDocument:(c(e,"template")&&(e=e.content||e),Ce.merge([],e.childNodes))}},function(e,t){Ce.fn[e]=function(n,r){var o=Ce.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=Ce.filter(r,o)),this.length>1&&(ze[e]||Ce.uniqueSort(o),Qe.test(e)&&o.reverse()),this.pushStack(o)}});var Re=/[^\x20\t\r\n\f]+/g;Ce.Callbacks=function(e){e="string"==typeof e?p(e):Ce.extend({},e);var t,n,r,o,i=[],a=[],l=-1,c=function(){for(o=o||e.once,r=t=!0;a.length;l=-1)for(n=a.shift();++l-1;)i.splice(n,1),l>=n&&l--}),this},has:function(e){return e?Ce.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||t||(i=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||c()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},Ce.extend({Deferred:function(e){var t=[["notify","progress",Ce.Callbacks("memory"),Ce.Callbacks("memory"),2],["resolve","done",Ce.Callbacks("once memory"),Ce.Callbacks("once memory"),0,"resolved"],["reject","fail",Ce.Callbacks("once memory"),Ce.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return i.done(arguments).fail(arguments),this},"catch":function(e){return o.then(null,e)},pipe:function(){var e=arguments;return Ce.Deferred(function(n){Ce.each(t,function(t,r){var o=ve(e[r[4]])&&e[r[4]];i[r[1]](function(){var e=o&&o.apply(this,arguments);e&&ve(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(e,r,o){function i(e,t,r,o){return function(){var s=this,l=arguments,c=function(){var n,c;if(!(a>e)){if(n=r.apply(s,l),n===t.promise())throw new TypeError("Thenable self-resolution");c=n&&("object"==typeof n||"function"==typeof n)&&n.then,ve(c)?o?c.call(n,i(a,t,g,o),i(a,t,h,o)):(a++,c.call(n,i(a,t,g,o),i(a,t,h,o),i(a,t,g,t.notifyWith))):(r!==g&&(s=void 0,l=[n]),(o||t.resolveWith)(s,l))}},u=o?c:function(){try{c()}catch(n){Ce.Deferred.exceptionHook&&Ce.Deferred.exceptionHook(n,u.stackTrace),e+1>=a&&(r!==h&&(s=void 0,l=[n]),t.rejectWith(s,l))}};e?u():(Ce.Deferred.getStackHook&&(u.stackTrace=Ce.Deferred.getStackHook()),n.setTimeout(u))}}var a=0;return Ce.Deferred(function(n){t[0][3].add(i(0,n,ve(o)?o:g,n.notifyWith)),t[1][3].add(i(0,n,ve(e)?e:g)),t[2][3].add(i(0,n,ve(r)?r:h))}).promise()},promise:function(e){return null!=e?Ce.extend(e,o):o}},i={};return Ce.each(t,function(e,n){var a=n[2],s=n[5];o[n[1]]=a.add,s&&a.add(function(){r=s},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(n[3].fire),i[n[0]]=function(){return i[n[0]+"With"](this===i?void 0:this,arguments),this},i[n[0]+"With"]=a.fireWith}),o.promise(i),e&&e.call(i,i),i},when:function(e){var t=arguments.length,n=t,r=Array(n),o=pe.call(arguments),i=Ce.Deferred(),a=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?pe.call(arguments):n,--t||i.resolveWith(r,o)}};if(1>=t&&(f(e,i.done(a(n)).resolve,i.reject,!t),"pending"===i.state()||ve(o[n]&&o[n].then)))return i.then();for(;n--;)f(o[n],a(n),i.reject);return i.promise()}});var Oe=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;Ce.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&Oe.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},Ce.readyException=function(e){n.setTimeout(function(){throw e})};var He=Ce.Deferred();Ce.fn.ready=function(e){return He.then(e)["catch"](function(e){Ce.readyException(e)}),this},Ce.extend({isReady:!1,readyWait:1,ready:function(e){(e===!0?--Ce.readyWait:Ce.isReady)||(Ce.isReady=!0,e!==!0&&--Ce.readyWait>0||He.resolveWith(ue,[Ce]))}}),Ce.ready.then=He.then,"complete"===ue.readyState||"loading"!==ue.readyState&&!ue.documentElement.doScroll?n.setTimeout(Ce.ready):(ue.addEventListener("DOMContentLoaded",m),n.addEventListener("load",m));var Ve=function(e,t,n,r,o,i,a){var l=0,c=e.length,u=null==n;if("object"===s(n)){o=!0;for(l in n)Ve(e,t,l,n[l],!0,i,a)}else if(void 0!==r&&(o=!0,ve(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(Ce(e),n)})),t))for(;c>l;l++)t(e[l],n,a?r:r.call(e[l],l,t(e[l],n)));return o?e:u?t.call(e):c?t(e[0],n):i},Fe=/^-ms-/,Pe=/-([a-z])/g,Ye=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};w.uid=1,w.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Ye(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,o=this.cache(e);if("string"==typeof t)o[M(t)]=n;else for(r in t)o[M(r)]=t[r];return o},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][M(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){Array.isArray(t)?t=t.map(M):(t=M(t),t=t in r?[t]:t.match(Re)||[]),n=t.length;for(;n--;)delete r[t[n]]}(void 0===t||Ce.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!Ce.isEmptyObject(t)}};var Ge=new w,We=new w,Xe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/[A-Z]/g;Ce.extend({hasData:function(e){return We.hasData(e)||Ge.hasData(e)},data:function(e,t,n){return We.access(e,t,n)},removeData:function(e,t){We.remove(e,t)},_data:function(e,t,n){return Ge.access(e,t,n)},_removeData:function(e,t){Ge.remove(e,t)}}),Ce.fn.extend({data:function(e,t){var n,r,o,i=this[0],a=i&&i.attributes;if(void 0===e){if(this.length&&(o=We.get(i),1===i.nodeType&&!Ge.get(i,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=M(r.slice(5)),b(i,r,o[r])));Ge.set(i,"hasDataAttrs",!0)}return o}return"object"==typeof e?this.each(function(){We.set(this,e)}):Ve(this,function(t){var n;if(i&&void 0===t){if(n=We.get(i,e),void 0!==n)return n;if(n=b(i,e),void 0!==n)return n}else this.each(function(){We.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){We.remove(this,e)})}}),Ce.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=Ge.get(e,t),n&&(!r||Array.isArray(n)?r=Ge.access(e,t,Ce.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=Ce.queue(e,t),r=n.length,o=n.shift(),i=Ce._queueHooks(e,t),a=function(){Ce.dequeue(e,t)};"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,a,i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Ge.get(e,n)||Ge.access(e,n,{empty:Ce.Callbacks("once memory").add(function(){Ge.remove(e,[t+"queue",n])})})}}),Ce.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,rt=/^$|^module$|\/(?:java|ecma)script/i,ot={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ot.optgroup=ot.option,ot.tbody=ot.tfoot=ot.colgroup=ot.caption=ot.thead,ot.th=ot.td;var it=/<|&#?\w+;/;!function(){var e=ue.createDocumentFragment(),t=e.appendChild(ue.createElement("div")),n=ue.createElement("input"); -n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),be.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",be.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var at=ue.documentElement,st=/^key/,lt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ct=/^([^.]*)(?:\.(.+)|)/;Ce.event={global:{},add:function(e,t,n,r,o){var i,a,s,l,c,u,d,p,g,h,f,m=Ge.get(e);if(m)for(n.handler&&(i=n,n=i.handler,o=i.selector),o&&Ce.find.matchesSelector(at,o),n.guid||(n.guid=Ce.guid++),(l=m.events)||(l=m.events={}),(a=m.handle)||(a=m.handle=function(t){return"undefined"!=typeof Ce&&Ce.event.triggered!==t.type?Ce.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Re)||[""],c=t.length;c--;)s=ct.exec(t[c])||[],g=f=s[1],h=(s[2]||"").split(".").sort(),g&&(d=Ce.event.special[g]||{},g=(o?d.delegateType:d.bindType)||g,d=Ce.event.special[g]||{},u=Ce.extend({type:g,origType:f,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&Ce.expr.match.needsContext.test(o),namespace:h.join(".")},i),(p=l[g])||(p=l[g]=[],p.delegateCount=0,d.setup&&d.setup.call(e,r,h,a)!==!1||e.addEventListener&&e.addEventListener(g,a)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,u):p.push(u),Ce.event.global[g]=!0)},remove:function(e,t,n,r,o){var i,a,s,l,c,u,d,p,g,h,f,m=Ge.hasData(e)&&Ge.get(e);if(m&&(l=m.events)){for(t=(t||"").match(Re)||[""],c=t.length;c--;)if(s=ct.exec(t[c])||[],g=f=s[1],h=(s[2]||"").split(".").sort(),g){for(d=Ce.event.special[g]||{},g=(r?d.delegateType:d.bindType)||g,p=l[g]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=p.length;i--;)u=p[i],!o&&f!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(p.splice(i,1),u.selector&&p.delegateCount--,d.remove&&d.remove.call(e,u));a&&!p.length&&(d.teardown&&d.teardown.call(e,h,m.handle)!==!1||Ce.removeEvent(e,g,m.handle),delete l[g])}else for(g in l)Ce.event.remove(e,g+t[c],n,r,!0);Ce.isEmptyObject(l)&&Ge.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,i,a,s=Ce.event.fix(e),l=new Array(arguments.length),c=(Ge.get(this,"events")||{})[s.type]||[],u=Ce.event.special[s.type]||{};for(l[0]=s,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||c.disabled!==!0)){for(i=[],a={},n=0;l>n;n++)r=t[n],o=r.selector+" ",void 0===a[o]&&(a[o]=r.needsContext?Ce(o,this).index(c)>-1:Ce.find(o,this,null,[c]).length),a[o]&&i.push(r);i.length&&s.push({elem:c,handlers:i})}return c=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,dt=/\s*$/g;Ce.extend({htmlPrefilter:function(e){return e.replace(ut,"<$1>")},clone:function(e,t,n){var r,o,i,a,s=e.cloneNode(!0),l=Ce.contains(e.ownerDocument,e);if(!(be.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Ce.isXMLDoc(e)))for(a=N(s),i=N(e),r=0,o=i.length;o>r;r++)Q(i[r],a[r]);if(t)if(n)for(i=i||N(e),a=a||N(s),r=0,o=i.length;o>r;r++)B(i[r],a[r]);else B(e,s);return a=N(s,"script"),a.length>0&&C(a,!l&&N(e,"script")),s},cleanData:function(e){for(var t,n,r,o=Ce.event.special,i=0;void 0!==(n=e[i]);i++)if(Ye(n)){if(t=n[Ge.expando]){if(t.events)for(r in t.events)o[r]?Ce.event.remove(n,r):Ce.removeEvent(n,r,t.handle);n[Ge.expando]=void 0}n[We.expando]&&(n[We.expando]=void 0)}}}),Ce.fn.extend({detach:function(e){return R(this,e,!0)},remove:function(e){return R(this,e)},text:function(e){return Ve(this,function(e){return void 0===e?Ce.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return z(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=k(this,e);t.appendChild(e)}})},prepend:function(){return z(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=k(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return z(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return z(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(Ce.cleanData(N(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Ce.clone(this,e,t)})},html:function(e){return Ve(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!dt.test(e)&&!ot[(nt.exec(e)||["",""])[1].toLowerCase()]){e=Ce.htmlPrefilter(e);try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(Ce.cleanData(N(t,!1)),t.innerHTML=e);t=0}catch(o){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return z(this,arguments,function(t){var n=this.parentNode;Ce.inArray(this,e)<0&&(Ce.cleanData(N(this)),n&&n.replaceChild(t,this))},e)}}),Ce.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Ce.fn[e]=function(e){for(var n,r=[],o=Ce(e),i=o.length-1,a=0;i>=a;a++)n=a===i?this:this.clone(!0),Ce(o[a])[t](n),he.apply(r,n.get());return this.pushStack(r)}});var ht=new RegExp("^("+Je+")(?!px)[a-z%]+$","i"),ft=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=n),t.getComputedStyle(e)},mt=new RegExp(Ze.join("|"),"i");!function(){function e(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",at.appendChild(l).appendChild(c);var e=n.getComputedStyle(c);r="1%"!==e.top,s=12===t(e.marginLeft),c.style.right="60%",a=36===t(e.right),o=36===t(e.width),c.style.position="absolute",i=36===c.offsetWidth||"absolute",at.removeChild(l),c=null}}function t(e){return Math.round(parseFloat(e))}var r,o,i,a,s,l=ue.createElement("div"),c=ue.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",be.clearCloneStyle="content-box"===c.style.backgroundClip,Ce.extend(be,{boxSizingReliable:function(){return e(),o},pixelBoxStyles:function(){return e(),a},pixelPosition:function(){return e(),r},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i}}))}();var At=/^(none|table(?!-c[ea]).+)/,Mt=/^--/,wt={position:"absolute",visibility:"hidden",display:"block"},yt={letterSpacing:"0",fontWeight:"400"},bt=["Webkit","Moz","ms"],vt=ue.createElement("div").style;Ce.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=O(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i,a,s=M(t),l=Mt.test(t),c=e.style;return l||(t=F(s)),a=Ce.cssHooks[t]||Ce.cssHooks[s],void 0===n?a&&"get"in a&&void 0!==(o=a.get(e,!1,r))?o:c[t]:(i=typeof n,"string"===i&&(o=Ke.exec(n))&&o[1]&&(n=v(e,t,o),i="number"),null!=n&&n===n&&("number"===i&&(n+=o&&o[3]||(Ce.cssNumber[s]?"":"px")),be.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?c.setProperty(t,n):c[t]=n)),void 0)}},css:function(e,t,n,r){var o,i,a,s=M(t),l=Mt.test(t);return l||(t=F(s)),a=Ce.cssHooks[t]||Ce.cssHooks[s],a&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=O(e,t,r)),"normal"===o&&t in yt&&(o=yt[t]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),Ce.each(["height","width"],function(e,t){Ce.cssHooks[t]={get:function(e,n,r){return n?!At.test(Ce.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?G(e,t,r):$e(e,wt,function(){return G(e,t,r)}):void 0},set:function(e,n,r){var o,i=ft(e),a="border-box"===Ce.css(e,"boxSizing",!1,i),s=r&&Y(e,t,r,a,i);return a&&be.scrollboxSize()===i.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-Y(e,t,"border",!1,i)-.5)),s&&(o=Ke.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=Ce.css(e,t)),P(e,n,s)}}}),Ce.cssHooks.marginLeft=H(be.reliableMarginLeft,function(e,t){return t?(parseFloat(O(e,"marginLeft"))||e.getBoundingClientRect().left-$e(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px":void 0}),Ce.each({margin:"",padding:"",border:"Width"},function(e,t){Ce.cssHooks[e+t]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];4>r;r++)o[e+Ze[r]+t]=i[r]||i[r-2]||i[0];return o}},"margin"!==e&&(Ce.cssHooks[e+t].set=P)}),Ce.fn.extend({css:function(e,t){return Ve(this,function(e,t,n){var r,o,i={},a=0;if(Array.isArray(t)){for(r=ft(e),o=t.length;o>a;a++)i[t[a]]=Ce.css(e,t[a],!1,r);return i}return void 0!==n?Ce.style(e,t,n):Ce.css(e,t)},e,t,arguments.length>1)}}),Ce.Tween=W,W.prototype={constructor:W,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||Ce.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(Ce.cssNumber[n]?"":"px")},cur:function(){var e=W.propHooks[this.prop];return e&&e.get?e.get(this):W.propHooks._default.get(this)},run:function(e){var t,n=W.propHooks[this.prop];return this.options.duration?this.pos=t=Ce.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):W.propHooks._default.set(this),this}},W.prototype.init.prototype=W.prototype,W.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=Ce.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){Ce.fx.step[e.prop]?Ce.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[Ce.cssProps[e.prop]]&&!Ce.cssHooks[e.prop]?e.elem[e.prop]=e.now:Ce.style(e.elem,e.prop,e.now+e.unit)}}},W.propHooks.scrollTop=W.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Ce.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},Ce.fx=W.prototype.init,Ce.fx.step={};var Tt,xt,Nt=/^(?:toggle|show|hide)$/,Ct=/queueHooks$/;Ce.Animation=Ce.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return v(n.elem,e,Ke.exec(t),n),n}]},tweener:function(e,t){ve(e)?(t=e,e=["*"]):e=e.match(Re);for(var n,r=0,o=e.length;o>r;r++)n=e[r],$.tweeners[n]=$.tweeners[n]||[],$.tweeners[n].unshift(t)},prefilters:[Z],prefilter:function(e,t){t?$.prefilters.unshift(e):$.prefilters.push(e)}}),Ce.speed=function(e,t,n){var r=e&&"object"==typeof e?Ce.extend({},e):{complete:n||!n&&t||ve(e)&&e,duration:e,easing:n&&t||t&&!ve(t)&&t};return Ce.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in Ce.fx.speeds?r.duration=Ce.fx.speeds[r.duration]:r.duration=Ce.fx.speeds._default),(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){ve(r.old)&&r.old.call(this),r.queue&&Ce.dequeue(this,r.queue)},r},Ce.fn.extend({fadeTo:function(e,t,n,r){return this.filter(qe).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var o=Ce.isEmptyObject(e),i=Ce.speed(t,n,r),a=function(){var t=$(this,Ce.extend({},e),i);(o||Ge.get(this,"finish"))&&t.stop(!0)};return a.finish=a,o||i.queue===!1?this.each(a):this.queue(i.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",i=Ce.timers,a=Ge.get(this);if(o)a[o]&&a[o].stop&&r(a[o]);else for(o in a)a[o]&&a[o].stop&&Ct.test(o)&&r(a[o]);for(o=i.length;o--;)i[o].elem!==this||null!=e&&i[o].queue!==e||(i[o].anim.stop(n),t=!1,i.splice(o,1));(t||!n)&&Ce.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=Ge.get(this),r=n[e+"queue"],o=n[e+"queueHooks"],i=Ce.timers,a=r?r.length:0;for(n.finish=!0,Ce.queue(this,e,[]),o&&o.stop&&o.stop.call(this,!0),t=i.length;t--;)i[t].elem===this&&i[t].queue===e&&(i[t].anim.stop(!0),i.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),Ce.each(["toggle","show","hide"],function(e,t){var n=Ce.fn[t];Ce.fn[t]=function(e,r,o){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(J(t,!0),e,r,o)}}),Ce.each({slideDown:J("show"),slideUp:J("hide"),slideToggle:J("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Ce.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Ce.timers=[],Ce.fx.tick=function(){var e,t=0,n=Ce.timers;for(Tt=Date.now();t1)},removeAttr:function(e){return this.each(function(){Ce.removeAttr(this,e)})}}),Ce.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return"undefined"==typeof e.getAttribute?Ce.prop(e,t,n):(1===i&&Ce.isXMLDoc(e)||(o=Ce.attrHooks[t.toLowerCase()]||(Ce.expr.match.bool.test(t)?It:void 0)),void 0!==n?null===n?void Ce.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:(r=Ce.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!be.radioValue&&"radio"===t&&c(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(Re);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),It={set:function(e,t,n){return t===!1?Ce.removeAttr(e,n):e.setAttribute(n,n),n}},Ce.each(Ce.expr.match.bool.source.match(/\w+/g),function(e,t){var n=Et[t]||Ce.find.attr;Et[t]=function(e,t,r){var o,i,a=t.toLowerCase();return r||(i=Et[a],Et[a]=o,o=null!=n(e,t,r)?a:null,Et[a]=i),o}});var Dt=/^(?:input|select|textarea|button)$/i,St=/^(?:a|area)$/i;Ce.fn.extend({prop:function(e,t){return Ve(this,Ce.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[Ce.propFix[e]||e]})}}),Ce.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&Ce.isXMLDoc(e)||(t=Ce.propFix[t]||t,o=Ce.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=Ce.find.attr(e,"tabindex");return t?parseInt(t,10):Dt.test(e.nodeName)||St.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),be.optSelected||(Ce.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),Ce.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){Ce.propFix[this.toLowerCase()]=this}),Ce.fn.extend({addClass:function(e){var t,n,r,o,i,a,s,l=0;if(ve(e))return this.each(function(t){Ce(this).addClass(e.call(this,t,te(this)))});if(t=ne(e),t.length)for(;n=this[l++];)if(o=te(n),r=1===n.nodeType&&" "+ee(o)+" "){for(a=0;i=t[a++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");s=ee(r),o!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,o,i,a,s,l=0;if(ve(e))return this.each(function(t){Ce(this).removeClass(e.call(this,t,te(this)))});if(!arguments.length)return this.attr("class","");if(t=ne(e),t.length)for(;n=this[l++];)if(o=te(n),r=1===n.nodeType&&" "+ee(o)+" "){for(a=0;i=t[a++];)for(;r.indexOf(" "+i+" ")>-1;)r=r.replace(" "+i+" "," ");s=ee(r),o!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):ve(e)?this.each(function(n){Ce(this).toggleClass(e.call(this,n,te(this),t),t)}):this.each(function(){var t,o,i,a;if(r)for(o=0,i=Ce(this),a=ne(e);t=a[o++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else(void 0===e||"boolean"===n)&&(t=te(this),t&&Ge.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Ge.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+ee(te(n))+" ").indexOf(t)>-1)return!0;return!1}});var Lt=/\r/g;Ce.fn.extend({val:function(e){var t,n,r,o=this[0];{if(arguments.length)return r=ve(e),this.each(function(n){var o;1===this.nodeType&&(o=r?e.call(this,n,Ce(this).val()):e,null==o?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=Ce.map(o,function(e){return null==e?"":e+""})),t=Ce.valHooks[this.type]||Ce.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))});if(o)return t=Ce.valHooks[o.type]||Ce.valHooks[o.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:(n=o.value,"string"==typeof n?n.replace(Lt,""):null==n?"":n)}}}),Ce.extend({valHooks:{option:{get:function(e){var t=Ce.find.attr(e,"value");return null!=t?t:ee(Ce.text(e))}},select:{get:function(e){var t,n,r,o=e.options,i=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?i+1:o.length;for(r=0>i?l:a?i:0;l>r;r++)if(n=o[r],(n.selected||r===i)&&!n.disabled&&(!n.parentNode.disabled||!c(n.parentNode,"optgroup"))){if(t=Ce(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,o=e.options,i=Ce.makeArray(t),a=o.length;a--;)r=o[a],(r.selected=Ce.inArray(Ce.valHooks.option.get(r),i)>-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),Ce.each(["radio","checkbox"],function(){Ce.valHooks[this]={set:function(e,t){return Array.isArray(t)?e.checked=Ce.inArray(Ce(e).val(),t)>-1:void 0}},be.checkOn||(Ce.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),be.focusin="onfocusin"in n;var kt=/^(?:focusinfocus|focusoutblur)$/,jt=function(e){e.stopPropagation()};Ce.extend(Ce.event,{trigger:function(e,t,r,o){var i,a,s,l,c,u,d,p,g=[r||ue],h=Me.call(e,"type")?e.type:e,f=Me.call(e,"namespace")?e.namespace.split("."):[];if(a=p=s=r=r||ue,3!==r.nodeType&&8!==r.nodeType&&!kt.test(h+Ce.event.triggered)&&(h.indexOf(".")>-1&&(f=h.split("."),h=f.shift(),f.sort()),c=h.indexOf(":")<0&&"on"+h,e=e[Ce.expando]?e:new Ce.Event(h,"object"==typeof e&&e),e.isTrigger=o?2:3,e.namespace=f.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:Ce.makeArray(t,[e]),d=Ce.event.special[h]||{},o||!d.trigger||d.trigger.apply(r,t)!==!1)){if(!o&&!d.noBubble&&!Te(r)){for(l=d.delegateType||h,kt.test(l+h)||(a=a.parentNode);a;a=a.parentNode)g.push(a),s=a;s===(r.ownerDocument||ue)&&g.push(s.defaultView||s.parentWindow||n)}for(i=0;(a=g[i++])&&!e.isPropagationStopped();)p=a,e.type=i>1?l:d.bindType||h,u=(Ge.get(a,"events")||{})[e.type]&&Ge.get(a,"handle"),u&&u.apply(a,t),u=c&&a[c],u&&u.apply&&Ye(a)&&(e.result=u.apply(a,t),e.result===!1&&e.preventDefault());return e.type=h,o||e.isDefaultPrevented()||d._default&&d._default.apply(g.pop(),t)!==!1||!Ye(r)||c&&ve(r[h])&&!Te(r)&&(s=r[c],s&&(r[c]=null),Ce.event.triggered=h,e.isPropagationStopped()&&p.addEventListener(h,jt),r[h](),e.isPropagationStopped()&&p.removeEventListener(h,jt),Ce.event.triggered=void 0,s&&(r[c]=s)),e.result}},simulate:function(e,t,n){var r=Ce.extend(new Ce.Event,n,{type:e,isSimulated:!0});Ce.event.trigger(r,null,t)}}),Ce.fn.extend({trigger:function(e,t){return this.each(function(){Ce.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?Ce.event.trigger(e,t,n,!0):void 0}}),be.focusin||Ce.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){Ce.event.simulate(t,e.target,Ce.event.fix(e))};Ce.event.special[t]={setup:function(){var r=this.ownerDocument||this,o=Ge.access(r,t);o||r.addEventListener(e,n,!0),Ge.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this,o=Ge.access(r,t)-1;o?Ge.access(r,t,o):(r.removeEventListener(e,n,!0),Ge.remove(r,t))}}});var Ut=n.location,Bt=Date.now(),Qt=/\?/;Ce.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(r){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&Ce.error("Invalid XML: "+e),t};var zt=/\[\]$/,Rt=/\r?\n/g,Ot=/^(?:submit|button|image|reset|file)$/i,Ht=/^(?:input|select|textarea|keygen)/i;Ce.param=function(e,t){var n,r=[],o=function(e,t){var n=ve(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!Ce.isPlainObject(e))Ce.each(e,function(){o(this.name,this.value)});else for(n in e)re(n,e[n],t,o);return r.join("&")},Ce.fn.extend({serialize:function(){return Ce.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=Ce.prop(this,"elements");return e?Ce.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!Ce(this).is(":disabled")&&Ht.test(this.nodeName)&&!Ot.test(e)&&(this.checked||!tt.test(e))}).map(function(e,t){var n=Ce(this).val();return null==n?null:Array.isArray(n)?Ce.map(n,function(e){return{name:t.name,value:e.replace(Rt,"\r\n")}}):{name:t.name,value:n.replace(Rt,"\r\n")}}).get()}});var Vt=/%20/g,Ft=/#.*$/,Pt=/([?&])_=[^&]*/,Yt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Gt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Wt=/^(?:GET|HEAD)$/,Xt=/^\/\//,_t={},Jt={},Kt="*/".concat("*"),Zt=ue.createElement("a");Zt.href=Ut.href,Ce.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ut.href,type:"GET",isLocal:Gt.test(Ut.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":Ce.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ae(ae(e,Ce.ajaxSettings),t):ae(Ce.ajaxSettings,e)},ajaxPrefilter:oe(_t),ajaxTransport:oe(Jt),ajax:function(e,t){function r(e,t,r,s){var c,p,g,y,b,v=t;u||(u=!0,l&&n.clearTimeout(l),o=void 0,a=s||"",T.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(y=se(h,T,r)),y=le(h,y,T,c),c?(h.ifModified&&(b=T.getResponseHeader("Last-Modified"),b&&(Ce.lastModified[i]=b),b=T.getResponseHeader("etag"),b&&(Ce.etag[i]=b)),204===e||"HEAD"===h.type?v="nocontent":304===e?v="notmodified":(v=y.state,p=y.data,g=y.error,c=!g)):(g=v,(e||!v)&&(v="error",0>e&&(e=0))),T.status=e,T.statusText=(t||v)+"",c?A.resolveWith(f,[p,v,T]):A.rejectWith(f,[T,v,g]),T.statusCode(w),w=void 0,d&&m.trigger(c?"ajaxSuccess":"ajaxError",[T,h,c?p:g]),M.fireWith(f,[T,v]),d&&(m.trigger("ajaxComplete",[T,h]),--Ce.active||Ce.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var o,i,a,s,l,c,u,d,p,g,h=Ce.ajaxSetup({},t),f=h.context||h,m=h.context&&(f.nodeType||f.jquery)?Ce(f):Ce.event,A=Ce.Deferred(),M=Ce.Callbacks("once memory"),w=h.statusCode||{},y={},b={},v="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(u){if(!s)for(s={};t=Yt.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return u?a:null},setRequestHeader:function(e,t){return null==u&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,y[e]=t),this},overrideMimeType:function(e){return null==u&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||v;return o&&o.abort(t),r(0,t),this}};if(A.promise(T),h.url=((e||h.url||Ut.href)+"").replace(Xt,Ut.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(Re)||[""],null==h.crossDomain){c=ue.createElement("a");try{c.href=h.url,c.href=c.href,h.crossDomain=Zt.protocol+"//"+Zt.host!=c.protocol+"//"+c.host}catch(x){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=Ce.param(h.data,h.traditional)),ie(_t,h,t,T),u)return T;d=Ce.event&&h.global,d&&0===Ce.active++&&Ce.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Wt.test(h.type),i=h.url.replace(Ft,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Vt,"+")):(g=h.url.slice(i.length),h.data&&(h.processData||"string"==typeof h.data)&&(i+=(Qt.test(i)?"&":"?")+h.data,delete h.data),h.cache===!1&&(i=i.replace(Pt,"$1"),g=(Qt.test(i)?"&":"?")+"_="+Bt++ +g),h.url=i+g),h.ifModified&&(Ce.lastModified[i]&&T.setRequestHeader("If-Modified-Since",Ce.lastModified[i]),Ce.etag[i]&&T.setRequestHeader("If-None-Match",Ce.etag[i])),(h.data&&h.hasContent&&h.contentType!==!1||t.contentType)&&T.setRequestHeader("Content-Type",h.contentType),T.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Kt+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)T.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(h.beforeSend.call(f,T,h)===!1||u))return T.abort();if(v="abort",M.add(h.complete),T.done(h.success),T.fail(h.error),o=ie(Jt,h,t,T)){if(T.readyState=1,d&&m.trigger("ajaxSend",[T,h]),u)return T;h.async&&h.timeout>0&&(l=n.setTimeout(function(){T.abort("timeout")},h.timeout));try{u=!1,o.send(y,r)}catch(x){if(u)throw x;r(-1,x)}}else r(-1,"No Transport");return T},getJSON:function(e,t,n){return Ce.get(e,t,n,"json")},getScript:function(e,t){return Ce.get(e,void 0,t,"script")}}),Ce.each(["get","post"],function(e,t){Ce[t]=function(e,n,r,o){return ve(n)&&(o=o||r,r=n,n=void 0),Ce.ajax(Ce.extend({url:e,type:t,dataType:o,data:n,success:r},Ce.isPlainObject(e)&&e))}}),Ce._evalUrl=function(e){return Ce.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},Ce.fn.extend({wrapAll:function(e){var t;return this[0]&&(ve(e)&&(e=e.call(this[0])),t=Ce(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return ve(e)?this.each(function(t){Ce(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Ce(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ve(e);return this.each(function(n){Ce(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){Ce(this).replaceWith(this.childNodes)}),this}}),Ce.expr.pseudos.hidden=function(e){return!Ce.expr.pseudos.visible(e)},Ce.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},Ce.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var qt={0:200,1223:204},$t=Ce.ajaxSettings.xhr();be.cors=!!$t&&"withCredentials"in $t,be.ajax=$t=!!$t,Ce.ajaxTransport(function(e){ -var t,r;return be.cors||$t&&!e.crossDomain?{send:function(o,i){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)s.setRequestHeader(a,o[a]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?i(0,"error"):i(s.status,s.statusText):i(qt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(l){if(t)throw l}},abort:function(){t&&t()}}:void 0}),Ce.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),Ce.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return Ce.globalEval(e),e}}}),Ce.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),Ce.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,o){t=Ce("